| View previous topic :: View next topic |
| Author |
Message |
isis123 Voice
Joined: 01 Sep 2005 Posts: 13
|
Posted: Thu Sep 01, 2005 12:21 pm Post subject: HEllo, Auto-Answer |
|
|
| Hello, IŽd like to have an autoanswer script, which automatically respons on opening a query. What do I have to type? Thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Sep 01, 2005 12:24 pm Post subject: |
|
|
| Code: | set response {
"bla"
"yeah, bla bla"
"exetra.. bla"
}
bind msgm - * response
proc response {nick uhost hand arg} {
puthelp "privmsg $nick :[lindex $::response [rand [llength $::response]]]"
} |
This will respond with a random line from $response whenver someone sends a message to the bot. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
isis123 Voice
Joined: 01 Sep 2005 Posts: 13
|
Posted: Thu Sep 01, 2005 12:44 pm Post subject: |
|
|
thanks, very helpful. Another question just bothers me, I made an advertisement script, but the bot only posts in the first set channel, not in all.
| Code: | set adchannel "#omfgnaps #jonathan"
set adtime 1
set adtext {
{
":: IAC :: Du suchst oder hast Accounts? :: Von WoW bis Steam? :: Von GW bis ESL? :: Bei uns bist du richtig! :: IAC ::"
}
{
":: IAC :: "
}
}
if {![string match "*go*" [timers]]} { timer $adtime go }
proc go {} {
global adchannel adtime adtext
set text [lindex $adtext [rand [llength $adtext]]]
foreach line $text {
putserv "PRIVMSG $adchannel :$line"
}
if {![string match "*go*" [timers]]} { timer $adtime go }
}
|
So in this case, it only posts in the first channel #omfgnaps, Whats wrong? thanks.[code] |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Sep 01, 2005 1:15 pm Post subject: |
|
|
| you don't have a loop by channels, which is curious, since you had that loop yesterday when you asked for timer help, and for some reason you have removed it |
|
| Back to top |
|
 |
isis123 Voice
Joined: 01 Sep 2005 Posts: 13
|
Posted: Thu Sep 01, 2005 2:09 pm Post subject: |
|
|
| demond wrote: | | you don't have a loop by channels, which is curious, since you had that loop yesterday when you asked for timer help, and for some reason you have removed it |
How do i fix that? Thanks |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Sep 01, 2005 2:24 pm Post subject: |
|
|
| just go back to your original code from yesterday |
|
| Back to top |
|
 |
|