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.
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Mon Jan 16, 2006 1:20 pm
I have this script:
Code: Select all
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 10 [putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
It is about the last sentence, that utimer.
Sometimes it works (it IMMEDIATELY send it to operserv, not 10 seconds), and sometime it doesn't work at all.
Can anyone explain what I am doing wrong here?
Thanks in advance,
T-Xorcist
nANDu
Voice
Posts: 15 Joined: Sun May 22, 2005 1:05 am
Post
by nANDu » Mon Jan 16, 2006 2:13 pm
Code: Select all
utimer 10 [list putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Jan 16, 2006 2:19 pm
Code: Select all
utimer 10 {putquick "PRIVMSG OperServ :mode $chan +o $botnick"}
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Mon Jan 16, 2006 2:25 pm
nANDu wrote: Code: Select all
utimer 10 [list putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
This 1 works fine. What is the difference with yours demond?
What is the "official" way?
And can I build an IF function into a timer?
Is that possible?
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Jan 16, 2006 2:29 pm
no difference, they are equivalent, I was a bit late on "Submit" button
put your if logic in a proc, run that proc by timer
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Mon Jan 16, 2006 9:49 pm
How do I do this exacly :$
I have this:
Code: Select all
utimer 4 [list check:ops $chan $nick]
and tried this:
And it MUST go to this procedure:
Code: Select all
proc check:ops {nick host hand text} {
if {([isop $nick $chan])} {
putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
} else {
putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
channel remove $chan
}
}
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Jan 16, 2006 10:05 pm
you MUST pass to [utimer] all the arguments your proc needs:
Code: Select all
proc foo {x y z} {
...
}
...
utimer $t [list foo $x $y $z]
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Mon Jan 16, 2006 10:11 pm
so:
Code: Select all
utimer 4 [list check:ops $nick $host $hand $text]
All of this?
I tried this one aswell:
Code: Select all
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 4 {
if {([isop $nick $chan])} {
putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
} else {
putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
channel remove $chan
}
}
But that doesn't seem to work
Anyone?
nANDu
Voice
Posts: 15 Joined: Sun May 22, 2005 1:05 am
Post
by nANDu » Tue Jan 17, 2006 5:47 pm
Pls read what demond posted again
Code: Select all
proc check:ops {nick host hand text} {
if {([isop $nick $chan])} {
......
......
}
}
Code: Select all
....
....
putquick "NOTICE $nick :You invited me to join \002$chan\002. Joining..."
putquick "PRIVMSG #bots :Joining \002$chan\002 - Invited in by \002$nick\002"
channel add $chan
utimer 4 [list check:ops $nick $host $hand $text]
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Tue Jan 17, 2006 6:12 pm
As you can read, I allready tried this, but it doesn't work...
I get these two lines in my error log:
Code: Select all
[23:10] Tcl error in script for 'timer2':
[23:10] extra characters after close-quote
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Jan 17, 2006 7:42 pm
T-Xorcist wrote: How do I do this exacly :$
I have this:
Code: Select all
utimer 4 [list check:ops $chan $nick]
and tried this:
And it MUST go to this procedure:
Code: Select all
proc check:ops {nick host hand text} {
if {([isop $nick $chan])} {
putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
} else {
putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
channel remove $chan
}
}
Use
Code: Select all
utimer 4 [list check:ops $chan $nick]
and
Code: Select all
proc check:ops {chan nick} {
global botnick
if {([isop $nick $chan])} {
putquick "PRIVMSG OperServ :mode $chan +o $botnick"
} else {
putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
channel remove $chan
}
}
T-Xorcist
Halfop
Posts: 47 Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:
Post
by T-Xorcist » Tue Jan 17, 2006 9:55 pm
Well Sir_Fz, it goes to that procedure... thanks for that.
Only.. It allways say that I haven't got @ in the channel, and then parts.
Do you have any idea of what I am doing wrong? I guess the code is ok?
if I do this:
Code: Select all
} else {
putquick "PRIVMSG $chan :Nick = $nick"
putquick "PRIVMSG $chan :Chan = $chan"
putquick "PRIVMSG $chan :Leaving channel... (Requester doesn't have ops) \002#bots\002"
channel remove $chan
}
It does give me the right nickname and channel.