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.

bind timer script dont work in many channels

Old posts that have not been replied to for several years.
Locked
s
sever
Voice
Posts: 9
Joined: Sat Mar 27, 2004 8:04 pm

bind timer script dont work in many channels

Post by sever »

hi, i have a problem.

that is my script
set msgchans "#sever #sauger"
set msgtext "test"

bind time - "00 * * * *" msgmode
bind time - "05 * * * *" msgmode
bind time - "10 * * * *" msgmode
bind time - "15 * * * *" msgmode
bind time - "20 * * * *" msgmode
bind time - "25 * * * *" msgmode
bind time - "30 * * * *" msgmode
bind time - "35 * * * *" msgmode
bind time - "40 * * * *" msgmode
bind time - "45 * * * *" msgmode
bind time - "50 * * * *" msgmode
bind time - "55 * * * *" msgmode

proc msgmode {min hour day month year} {
global msgtext
putserv "PRIVMSG $msgchans :$::msgtext"
}
i need the script in more than one channels.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Re: bind timer script dont work in many channels

Post by strikelight »

sever wrote:hi, i have a problem.

that is my script
set msgchans "#sever #sauger"
set msgtext "test"

bind time - "00 * * * *" msgmode
bind time - "05 * * * *" msgmode
bind time - "10 * * * *" msgmode
bind time - "15 * * * *" msgmode
bind time - "20 * * * *" msgmode
bind time - "25 * * * *" msgmode
bind time - "30 * * * *" msgmode
bind time - "35 * * * *" msgmode
bind time - "40 * * * *" msgmode
bind time - "45 * * * *" msgmode
bind time - "50 * * * *" msgmode
bind time - "55 * * * *" msgmode

proc msgmode {min hour day month year} {
global msgtext
putserv "PRIVMSG $msgchans :$::msgtext"
}
i need the script in more than one channels.
This is because the IRC protocol does not work how you want it to...

Some IRCD's allow targets seperated by commas....
ie

Code: Select all

set msgchans "#chan1,#chan2"
But to be safer from flood exemptions, and ircd's that don't support targets seperated by commas, you will need to walk through a list (ie. loop)....

Code: Select all

foreach chan [split $msgchans] {
  putserv "PRIVMSG $chan :$::msgtext"
}
s
sever
Voice
Posts: 9
Joined: Sat Mar 27, 2004 8:04 pm

Post by sever »

putlog "Script loaded: test"

set msgchans "#sever,#sauger"
set msgtext "test"

bind time - "00 * * * *" msgmode
bind time - "05 * * * *" msgmode
bind time - "10 * * * *" msgmode
bind time - "15 * * * *" msgmode
bind time - "20 * * * *" msgmode
bind time - "25 * * * *" msgmode
bind time - "30 * * * *" msgmode
bind time - "35 * * * *" msgmode
bind time - "40 * * * *" msgmode
bind time - "45 * * * *" msgmode
bind time - "50 * * * *" msgmode
bind time - "55 * * * *" msgmode

proc msgmode {min hour day month year} {
global msgtext
foreach chan [split $msgchans] {
putserv "PRIVMSG $chan :$::msgtext"
}
}
doesnt work! :(

Tcl error [msgmode]: can't read "msgchans": no such variable
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

You've global'd the wrong variable... you would have been getting that error in the previous code you posted as well.

Also, I didn't say use both the "comma" method and the "loop" method... I said the "loop" method is better and safer than the "comma" method.
s
sever
Voice
Posts: 9
Joined: Sat Mar 27, 2004 8:04 pm

Post by sever »

set msgchans "#sever #sauger"
set msgtext "test"

bind time - "00 * * * *" msgmode
bind time - "05 * * * *" msgmode
bind time - "10 * * * *" msgmode
bind time - "15 * * * *" msgmode
bind time - "20 * * * *" msgmode
bind time - "25 * * * *" msgmode
bind time - "30 * * * *" msgmode
bind time - "35 * * * *" msgmode
bind time - "40 * * * *" msgmode
bind time - "45 * * * *" msgmode
bind time - "50 * * * *" msgmode
bind time - "55 * * * *" msgmode

proc msgmode {min hour day month year} {
global msgtext msgchans
foreach chan [split $msgchans] {
putserv "PRIVMSG $chan :$::msgtext"
}
}
work :)

thx 4 help.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind time - "00 * * * *" msgmode 
bind time - "?5 * * * *" msgmode
Once the game is over, the king and the pawn go back in the same box.
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

caesar wrote:

Code: Select all

bind time - "00 * * * *" msgmode 
bind time - "?5 * * * *" msgmode

Code: Select all

bind time - "?0 * * * *" msgmode 
bind time - "?5 * * * *" msgmode
8)
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups.. :P forgot to place an "?" there :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

dollar wrote:
caesar wrote:

Code: Select all

bind time - "00 * * * *" msgmode 
bind time - "?5 * * * *" msgmode

Code: Select all

bind time - "?0 * * * *" msgmode 
bind time - "?5 * * * *" msgmode
8)

Code: Select all

bind time - "?0*" msgmode 
bind time - "?5*" msgmode
Locked