Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Tcl by dime ( 15 years ago )
# Server ip address/hostname
set rhost "xxxx"
# Server port
set rport "xxxx"
# Rcon password
set rconpass "xxxx"
set challenge [challengercon $rhost $rport]
bind pub o|o @challenge rconchallenge
proc rconchallenge {nickname ident handle channel argument } {
global rhost rport challenge rcon_listen_port
set challenge [challengercon $rhost $rport]
putserv "PRIVMSG $channel :Challenge gautas"
}
proc myrcon {mycmd} {
global rhost rport rconpass challenge rcon_listen_port
set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]
if {[regexp {Bad challenge.} $response all] || [regexp {No challenge
for your address.} $response all]} {
set challenge [challengercon $rhost $rport]
set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]
}
return $response
}
bind pub -|- .say rconsay
proc rconsay {nickname ident handle channel argument } {
global rhost rport rconpass challenge rcon_listen_port
if {$argument == ""} {
putserv "PRIVMSG $channel :Naudojimas: .say textas"
} elseif {![isop $nickname $channel]} {
putserv "privmsg $channel :Norint pasinaudoti sia komanda, reikia tureti @"
} else {
set response [myrcon "amx_irc $nickname: $argument"]
putserv "PRIVMSG $channel :[IRC] $nickname: $argument"
}
}
bind rcon - * rconmsg
proc rconmsg {msg} {
set kan "#gamesnet-chat"
global rhost rport my-ip rcon_listen_port
regexp {log L [^ ]+ - [0-9]{2}:[0-9]{2}:[0-9]{2}: (.+)} $msg orig msg
# putlog "wtf $msg"
if {[regexp {"(.+)" say "(.+)"(.*)} $msg all nk1 txt dead]} {
regexp {(.+?)<} $nk1 x nikas
regsub -all "(.+?)<(.+?)<STEAM_(.+?)>" $nk1 "" nk1
regsub -all "<TERRORIST>" $nk1 "?034<T>" nk1
regsub -all "<CT>" $nk1 "?0312<CT>" nk1
if {[string compare $dead " (dead)"] == 0} {
puthelp "privmsg $kan :$nk1 *DEAD* $nikas?03: $txt"
} else {
puthelp "privmsg $kan :$nk1 $nikas?03: $txt"
}
} elseif {[regexp {"(.+)" say_team "(.+)"(.*)} $msg all nk1 txt dead]} {
regexp {(.+?)<} $nk1 x nikas
regsub -all "(.+?)<(.+?)<STEAM_(.+?)>" $nk1 "" nk1
regsub -all "<TERRORIST>" $nk1 "?034<T>" nk1
regsub -all "<CT>" $nk1 "?0312<CT>" nk1
if {[string compare $dead " (dead)"] == 0} {
puthelp "privmsg $kan :$nk1 *DEAD* $nikas (team)?03: $txt"
} else {
puthelp "privmsg $kan :$nk1 $nikas (team)?03: $txt"
}
} elseif {[regexp {"(.+)" triggered "amx_chat"(.+)} $msg all nk1 txt]} {
regexp {(.+?)<} $nk1 x nikas
regexp {"(.+?)"} $txt x textas
puthelp "privmsg $kan :?033<ADMINS> $nikas?03: $textas"
}
if {[regexp {"(.+)" triggered "amx_.say"(.+)} $msg all nk1 txt]} {
regexp {(.+?)<} $nk1 x nikas
regexp {"(.+?)"} $txt x textas
puthelp "privmsg $kan :?0314<@SAY> $nikas?03: $textas"
}
}
proc rconexec {nickname ident handle channel argument } {
global rhost rport rconpass challenge
if {$argument == ""} {
putserv "PRIVMSG $channel :Naudojimas: !rcon komanda"
} else {
set response [myrcon $argument]
putserv "PRIVMSG $channel :$response"
}
return 1
}
bind pub o|o !rcon rconexec
bind pub -|- !pub sinfo
bind pub -|- .pub sinfo
bind pub -|- !public sinfo
bind pub -|- .public sinfo
proc sinfo {nick uhost hand chan args} {
global rhost rport challenge rconpass
set challenge [challengercon $rhost $rport]
set spalva "?033,1"
set status [rcon $rhost $rport $challenge "$rconpass" status]
#putlog "cia $status"
regsub -all -- { +} $status " " status
regsub -all -- {# } $status "#" status
foreach line [split $status "n"] {
if {[regexp -nocase -- {hostname: (.*?)$} $line garb hostname]} { continue }
if {[regexp -nocase -- {tcp/ip : (.*?)$} $line grab ipas]} { continue }
if {[regexp -nocase -- {map : (.*?) at.*$} $line garb map]} { continue }
if {[regexp -nocase -- {players : (.*?) active ((.*?) max)$} $line garb pl max]} { continue }
}
if {$pl > 19} { set spalva ?034,1 }
if {$pl < 19} { set spalva ?033,1 }
#putlog "$hostname $ipas $map $pl $max"
puthelp "privmsg $chan :?030,1Public Serveris: ?037,1(?030,1 $hostname - $ipas ?037,1)?030,1, ?emelapis: ?037,1$map?030,1, ?aidejai:$spalva $pl?030,1 /?037,1 $max?030,1.?03"
}
Revise this Paste