Code: Select all
variable gameREQUEST "0"
variable gameIP ""
variable gamePW ""
variable gameMAP ""
variable gameADMIN ""
variable gameHANDLE ""
bind pub - !needsub needsub_request
proc needsub_request {nick host handle channel text} {
set channel [string tolower $channel]
set subchan "#tugax.sub"
if {$subchan != $channel} {
return
}
if {[scan $text "%d.%d.%d.%d:%d %s %s" IP1 IP2 IP3 IP4 PORT PASSWORD MAP] == 7} {
set IP "$IP1.$IP2.$IP3.$IP4"
tugax_notc $nick "Your request is being forwarded."
} else {
tugax_notc $nick "Please state your request in the following layout: \002!needsub IP:PORT PASSWORD MAP\002"
return
}
global gameREQUEST gameIP gamePW gameHANDLE gamePW gameADMIN gameMAP
set gameREQUEST "1"
set gameIP "$IP:$PORT"
set gameADMIN $nick
set gameHANDLE $handle
set gamePW $PASSWORD
set gameMAP $MAP
tugax_amsg "An substitute player is needed for the game Counter Strike 1.6 ( Game ip: \"\002$IP:$PORT\002\" , Game map: \"\002$MAP\002\" ) on #tugax , if you'r interested in playing join \002#tugax\002 and type \002!sub\002"
}
bind pub - !sub sub_request
proc sub_request {nick host handle channel text} {
global gameREQUEST
set channel [string tolower $channel]
set mainchan "#tugax"
if {$mainchan != $channel} {
return
}
if {$gameREQUEST == "0"} {
tugax_notc $nick "There is no open game logged."
return
}
global gameIP gamePW gameADMIN
tugax_say $channel "Thanks for playing on #tugax, your IP:PORT is \"\002$gameIP\002\" and your password is \"\002$gamePW\002\" . Your admin is \"\002$gameADMIN\002\""
set gameREQUEST 0
}
bind pub - !delsub delsub_request
proc delsub_request {nick host handle channel text} {
global gameHANDLE
if {![isop $nick $channel] && $handle != $gameHANDLE} {
tugax_notc $nick "You can only delete your own request."
return
}
global gameREQUEST
set gameREQUEST 0
}
bind time - "?0 * * *" timed_request
bind time - "?5 * * *" timed_request
proc timed_request {a b c d e} {
global gameREQUEST
if {$gameREQUEST == "0"} {
#tugax_amsg "advertisement"
return
}
global gameIP gamePW gameMAP
tugax_amsg "An substitute player is needed for the game Counter Strike 1.6 ( Game ip: \"\002$gameIP\002\" , Game map: \"\002$gameMAP\002\" ) on #tugax , if you'r interested in playing join \002#tugax\002 and type \002!sub\002"
}
#http://forum.egghelp.org/viewtopic.php?t=14249
proc tugax_amsg text {
foreach c [channels] {
if {[botonchan $c]} {
putserv "PRIVMSG $c :$text"
}
}
}
proc tugax_say {channel text} {
putserv "PRIVMSG $channel :$text"
}
proc tugax_notc {nick text} {
putserv "NOTICE $nick :$text"
}