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.

timer repeat

Old posts that have not been replied to for several years.
Locked
l
loze

Post by loze »

what wrong with this?

Code: Select all

utimer 1 onair

proc onair {} {
        utimer 1 pub:onair
        utimer 10 onair
}
Anyone with any different solution if this not work??

P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

nothing particularily wrong with it per se. though i wouldnt go making utimers like that without checking that a utimer isnt already running for it first (ie, every time you rehash that script, you're gonna duplicate the timer). also, i suspect you're calling pub:onair with too few arguments
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Code: Select all


if {![info exists mytimer]} {
  set mytimer [utimer 1 onair]
}

proc onair ...
That will keep your timer from being executed multiple times on .rehash (the problem Petersen pointed out).
l
loze

Post by loze »

i suspect you're calling pub:onair with too few arguments
What do you mean with that? Do I need more in the { and } tags after proc onair.. ??

<font size=-1>[ This Message was edited by: loze on 2002-05-22 01:59 ]</font>
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

no, you defined proc pub:onair as something like proc pub:onair {nick uhost hand chan arg} {...
thus if you try and call it like you just did, its gonna error cos you're not passing 5 variables to it like you defined.
l
loze

Post by loze »

My pub:onair look like this:

Code: Select all

proc pub:onair {nick uhand handle chan input} {
        global onairdj onairlat
        set sock [socket ...
I have 5 variabals in it. And it not updates.. Its only work when im use !on

Code: Select all

bind pub -|- !on pub:onair
I and svahn can't find the error.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

proc onair {} {
utimer 1 pub:onair
utimer 10 onair
}
Delete the line that says "utimer 1 pub:onair"
l
loze

Post by loze »

Why? I did change the timer "thing" to..

Code: Select all

bind pub -|- !onair pub:onairdisplay

if {![info exists mytimer]} {
        set mytimer [utimer 1 onair]
}

proc onair {nick uhand handle chan input} {
        global onairdj onairlat
        utimer 10 onair
...
whats wrong with this one? :wink: It fills like I never will fix it.
l
loze

Post by loze »

I wonder if maybe utimer doesnt work in v1.6.10? No one of my timers doesnt work. Just a thought..
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

as i keep saying, you're calling the proc with too few arguments. all you're gonna get is something like TCL error in script for 'timer2222': no value given for parameter "nick" to "onair"
s
svahn
Voice
Posts: 19
Joined: Sun May 19, 2002 8:00 pm
Location: Sweden
Contact:

Post by svahn »

Code: Select all

proc onair {} {
        utimer 10 onair
        global onairdj onairlat
Something like that.
l
loze

Post by loze »

thank you all for the help.. :wink:
Its works with svahn's ide
Locked