| View previous topic :: View next topic |
| Author |
Message |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Mon Jan 16, 2006 1:20 pm Post subject: utimer problem? |
|
|
I have this script:
| Code: | 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 _________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
nANDu Voice
Joined: 22 May 2005 Posts: 15
|
Posted: Mon Jan 16, 2006 2:13 pm Post subject: |
|
|
| Code: |
utimer 10 [list putquick "PRIVMSG OperServ :mode $chan +o $botnick"]
|
|
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Jan 16, 2006 2:19 pm Post subject: |
|
|
| Code: |
utimer 10 {putquick "PRIVMSG OperServ :mode $chan +o $botnick"}
|
_________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Mon Jan 16, 2006 2:25 pm Post subject: |
|
|
| nANDu wrote: | | Code: |
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? _________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Jan 16, 2006 2:29 pm Post subject: |
|
|
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 [code] tag when posting logs, code |
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Mon Jan 16, 2006 9:49 pm Post subject: |
|
|
How do I do this exacly :$
I have this:
| Code: | | utimer 4 [list check:ops $chan $nick] |
and tried this:
| Code: | | utimer 4 [list check:ops] |
And it MUST go to this procedure:
| Code: | 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
}
} |
_________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Jan 16, 2006 10:05 pm Post subject: |
|
|
you MUST pass to [utimer] all the arguments your proc needs:
| Code: |
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 [code] tag when posting logs, code |
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Mon Jan 16, 2006 10:11 pm Post subject: |
|
|
so:
| Code: | | utimer 4 [list check:ops $nick $host $hand $text] |
All of this?
I tried this one aswell:
| Code: | 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? _________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
nANDu Voice
Joined: 22 May 2005 Posts: 15
|
Posted: Tue Jan 17, 2006 5:47 pm Post subject: |
|
|
Pls read what demond posted again
| Code: |
proc check:ops {nick host hand text} {
if {([isop $nick $chan])} {
......
......
}
}
|
| Code: |
....
....
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]
|
|
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Tue Jan 17, 2006 6:12 pm Post subject: |
|
|
As you can read, I allready tried this, but it doesn't work...
I get these two lines in my error log:
| Code: | [23:10] Tcl error in script for 'timer2':
[23:10] extra characters after close-quote |
_________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Jan 17, 2006 7:42 pm Post subject: |
|
|
| T-Xorcist wrote: | How do I do this exacly :$
I have this:
| Code: | | utimer 4 [list check:ops $chan $nick] |
and tried this:
| Code: | | utimer 4 [list check:ops] |
And it MUST go to this procedure:
| Code: | 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: | | utimer 4 [list check:ops $chan $nick] |
and
| Code: | 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
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Tue Jan 17, 2006 9:55 pm Post subject: |
|
|
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: | } 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. _________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
|