This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Sat Sep 27, 2008 11:22 pm
I would like my bot to sajoin a user after they connect to the network, but wait 5 seconds before it does it.
Code: Select all
bind pubm - "*CONNECT*" CONNECT
proc CONNECT { nick host hand chan text } {
set User [lindex [split $text] 3]
if {$chan == "#4ct1v1ty"} {
utimer 5 "putquick SAJOIN #main $User"
} else {
return
}
}
Everything is right, except I can't figure out how to make the timer work correctly.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sun Sep 28, 2008 9:29 am
putquick only expects one argument, you are currently supplying three...
Try the code below instead, as it uses proper list structures to create the commandline used with utimer...
Code: Select all
bind pubm - "*CONNECT*" CONNECT
proc CONNECT { nick host hand chan text } {
set User [lindex [split $text] 3]
if {$chan == "#4ct1v1ty"} {
utimer 5 [list putquick "SAJOIN #main $User"]
} else {
return
}
}
NML_375
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Sun Sep 28, 2008 10:32 am
Okay, I have a new problem.
The $User is underlined, and I don't know how to remove the underline in the variable. How can I remove it?
speechles
Revered One
Posts: 1398 Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)
Post
by speechles » Sun Sep 28, 2008 10:58 am
Code: Select all
utimer 5 [list putquick "SAJOIN #main [stripcodes bcruag $User]"]