You mean to say, one one channel a user say will request !help, then on the other room it will say publicly which user requested help on that channel?Bot will be in 2 rooms people will request !help in one room and other room it would say to the chan person needs help in channel ops would type !online or !offline Bot would reply to them online message or offline.
Code: Select all
set room1 "#channel1"
set room2 "#channel2"
bind pub - !help help:proc
bind pub - !offline offline:proc
bind pub - !online online:proc
proc help:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room1] && ![info exists $nick_to_help]} {
putserv "PRIVMSG $room2 :\002NOTE\002: \002$nick\002 need's help in \002$room1\002. (Message: \002[lrange $text 0 end]\002)"
set nick_to_help $nick
}
}
proc online:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room2] && [isop $nick $room2] && [info exists $nick_to_help]} {
putserv "PRIVMSG $room1 :\002$nick_to_help\002, please be *patient*. An \002op\002 will be with you in just a \002minute\002."
unset nick_to_help $nick
}
}
proc offline:proc {nick uhost hand chan text} {
global room1 room2 nick_to_help
if {[string equal -nocase $chan $room2] && [isop $nick $room2] && [info exists $nick_to_help]} {
putserv "PRIVMSG $room1 :\002$nick_to_help\002, please try back again *later*. There are \002no ops\002 currently to assist you at the \002moment\002."
unset nick_to_help $nick
}
}