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.

Autojoiner after 5 seconds! [Help]

Help for those learning Tcl or writing their own scripts.
Post Reply
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Autojoiner after 5 seconds! [Help]

Post by Branden »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

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?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

utimer 5 [list putquick "SAJOIN #main [stripcodes bcruag $User]"]
Post Reply