Find this:
# set main channel here
set mainchan "#123"
# set help channel here
set helpchan "#help"
in the below, and edit to reflect your actual channel names.
Edit only those two things.
Then load the script, and test it.
(If you need help with loading scripts, see:
http://www.egghelp.org/enhance.htm#tclscripts )
I tested, and compared to your request, it seemed to do what you asked.
Code: Select all
### begin configuration ####
# set main channel here
set mainchan "#123"
# set help channel here
set helpchan "#help"
# set time window here ( in seconds )
# this is the amount of time that a user has, after sending !helpme, to then reply to the /msg sent to user by the bot
set timewindow "45"
# set repy window time here ( in seconds )
# this is the amount of time that a helper has in which to send !helper <nick>
set replywindow "120"
#### end configuration ###
### script starts here
bind pub - "!helpme" do:helpme
bind msgm - * do:prob
bind pub - "!helper" do:helpchanreply
set nick2help "0"
set replytime "0"
proc do:helpme {nick uhost handle chan text} {
global nick2help timewindow mainchan replywindow replytime helpchan
if {![botonchan $helpchan]} {
putserv "privmsg $chan : Sorry, help function is temporarily Off"
return 0
}
if {"$chan"=="$mainchan"} {
putserv "privmsg $nick :Please describe your problem, in a single line:"
set nick2help $nick
set replytime $replywindow
utimer $timewindow [list set nick2help 0]
utimer $replywindow [list set replytime 0]
}
}
proc do:prob {nick uhost handle text} {
global nick2help helpchan mainchan
if {![botonchan $helpchan]} {
putserv "privmsg $nick :Sorry, help function is temporarily Off"
return 0
}
if {"$nick"=="$nick2help"} {
putserv "privmsg $helpchan :$nick has the following problem: $text "
putserv "privmsg $helpchan : If you want to help $nick write !Helper $nick"
putserv "privmsg $nick :Your text describing your problem has been sent"
putserv "privmsg $nick :Please stand by a few minutes. If help is available now, you will be notified shortly."
return 0
} else {
putserv "privmsg $nick :To enable a short window of time for you to send help requests via /msg to the bot, you must first send !helpme in $mainchan "
}
}
proc do:helpchanreply {nick uhost handle chan text} {
global helpchan mainchan nick2help replytime
if {![botonchan $mainchan]} {
putserv "privmsg $chan :Sorry, bot is not in $mainchan"
return
}
if {"$replytime"=="0"} {
putserv "privmsg $chan :Sorry, no one has recently asked for help"
return
}
if {"$chan"=="$helpchan"} {
putserv "privmsg $chan :notifying $text"
putserv "privmsg $mainchan :$nick will help in seconds"
}
}