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.

Welcome message delay [solved]

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Welcome message delay [solved]

Post by Cr4sh »

I have these line:

Code: Select all

proc onjoin {nick host hand chan} {
	global botnick
	if {$botnick == $nick} {
	} else {
		if {[validuser $nick] == 1} {
			if {[passwdok "$hand" ""] == "1"} {
				putlog "$nick ($hand) Does Not Have A Password Set.  /msg $nick."
				putserv "privmsg $nick :You Don't Have A Password Set On Me.  Please One Set One Now By Typing: /msg $botnick pass <PASSWORD>"
			}
		}
		putserv "privmsg $chan : <message>"
	}
}
I want to delay (about 15 sec.) the welcome message...
Please, how i must to modify for to do this? :oops:
Last edited by Cr4sh on Sun Jun 04, 2006 6:16 pm, edited 1 time in total.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

this tip is only for adding the delay:
replace

Code: Select all

putserv "privmsg $chan : <message>"

with

Code: Select all

utimer 15 putserv "privmsg $chan : <message>"
(or

Code: Select all

utimer 15 { putserv "privmsg $chan : <message>" }
if you get errors on this part)
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Post by Cr4sh »

Thx man! :wink:
The last thing...
I want that only if the user remain on the channel, the bot give to him the welcome...
Something like this:

if ($1 ison #channel) {utimer 15 putserv "privmsg $chan : <message>"}



...i've tried to modify with utimer 15 putserv "privmsg $chan : <message>"...i read "Tcl error [onjoin]: wrong # args: should be "utimer seconds command""

with...utimer 15 { putserv "privmsg $chan : <message>" }...i read "Tcl error in script for 'timer356':" :cry:
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Code: Select all

utimer 15 [list putserv "PRIVMSG $chan :<message>"]
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Post by Cr4sh »

This works good, thx :wink:
Now remain only one problem...
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Maybe something like this?

Code: Select all

utimer 15 [list if [list [onchan $nick $chan]] [list putserv "PRIVMSG $chan :<message>"]]
Edit: I corrceted the script
Last edited by De Kus on Fri Jun 02, 2006 10:27 am, edited 1 time in total.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Post by Cr4sh »

Probably, but i read...Tcl error [onjoin]: wrong # args: should be "utimer seconds command"... :(
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Post by Cr4sh »

Nobody else have an idea?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

utimer 15 [list msgchan $nick $chan]
and add this proc to the script:

Code: Select all

proc msgchan {nick chan} {
 if {[onchan $nick $chan]} {
  puthelp "privmsg $chan :<message>"
 }
}
User avatar
Cr4sh
Halfop
Posts: 63
Joined: Sat Jan 14, 2006 5:16 pm
Contact:

Post by Cr4sh »

YOU ARE GREAT!!!
Works perfectly, thx. :wink:
Post Reply