egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

replace bind time with utimer?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ricktee76
Voice


Joined: 12 Jul 2016
Posts: 11

PostPosted: Tue Nov 15, 2016 3:43 pm    Post subject: replace bind time with utimer? Reply with quote

I've been running a highly modified domsen Shoutcast script but one thing i cant figure out is the bind time, currently it checks the stream is online every minute and updates the title etc into the chat.

the current bind time:
Code:
bind time - "* * * * *" isonline

which checks every minute.

Code:
proc isonline { nick uhost hand chan arg } {
global etc etc etc
global more more more

// isonline code here

}


i have tried

    set newtimer [utimer 20 {isonline nick uhost hand chan arg}]
    utimer 20 [list isonline]
    utimer 20 {isonline nick uhost hand chan arg}

the isonline process needs to be run every 20 seconds.

Do i need to add the globals to the utimer?

All help appreciated
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Nov 16, 2016 2:16 am    Post subject: Reply with quote

The "arguments" in a bind time are <minute> <hour> <day> <month> <year> not 'nick uhost hand chan arg'.

Anyway, give this a try:
Code:

proc checkOnline args {
   # execute the proc you want
   isonline 1 2 3 4 5

   # self maintain
   utimer 20 [list checkOnline]
}

# start the 20 seconds "infinite" loop
utimer 20 [list checkOnline]

And to adapt this to your code:
Code:

proc isonline { nick uhost hand chan arg } {
   global etc etc etc
   global more more more

   // isonline code here

   # self maintain
   utimer 20 [list isonline 1 2 3 4 5]
}

# initiate the loop
utimer 20 [list isonline 1 2 3 4 5]

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
ricktee76
Voice


Joined: 12 Jul 2016
Posts: 11

PostPosted: Wed Nov 16, 2016 6:13 pm    Post subject: Reply with quote

thanks again caesar your reply was helpful once again, i have now got it working as i wanted by adding.

Much appreciated.
Code:
 if {[info exists isonline]} {
  utimer xx [list isonline $nick $uhost $hand $chan $arg]
  }
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber