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.
Old posts that have not been replied to for several years.
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Thu Jan 02, 2003 8:59 am
Code: Select all
proc pubnotice {} {
global chanl network notice
set active "1"
while {$active != 1} {
putlog "Notice Applied to $chanl(main)"
timer 1 [putserv "Notice $chanl(main) :$notice(public)]
}
}
Well this is the bit of code i having problems with. Doesnt seem to be running at all from what i can tell. Any ideas on how i can get it working. Thankfully, no TCL errors, so bot still running with it
tainted
Master
Posts: 239 Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:
Post
by tainted » Thu Jan 02, 2003 9:06 am
Its been one of those really really long nights for me, but I would have to say its not working because you are setting the var to 1, then having the script compare it to 1. If it is NOT 1, then it continues.. So, it just returns.
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Thu Jan 02, 2003 9:11 am
does it need to be triggered by something, or will it just run if the script is running as it is. I havent got the procedure linked to anything.
chanded the != to == and it isnt producing anything
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Thu Jan 02, 2003 9:36 am
figged out i was missing out a " as well
still nothing tho
If i remove it from the procedure, it crashes the bot when it runs on bootup
Papillon
Owner
Posts: 724 Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no
Post
by Papillon » Thu Jan 02, 2003 6:25 pm
Code: Select all
bind time - * pubnotice
proc pubnotice {min hour day moth year} {
global chanl network notice
putlog "Notice Applied to $chanl(main)"
putserv "Notice $chanl(main) :$notice(public)"
}
this sends a notice to $chanl(main) every min...
Elen sila lúmenn' omentielvo
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Thu Jan 02, 2003 6:38 pm
any chance of increasing it to 15 mins?
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Thu Jan 02, 2003 9:23 pm
make the line after the global line the following
This works, by dividing the current mins by 15. If there is a remainder in the division, then don't operate.
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Thu Jan 02, 2003 9:52 pm
thank you, give it a try. Wish me luck on the move
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Thu Jan 02, 2003 11:06 pm
ppslim wrote: make the line after the global line the following
This works, by dividing the current mins by 15. If there is a remainder in the division, then don't operate.
I believe ppslim meant:
But the expr isn't really needed, if you wanted to, you could save space by just using: (atleast in tcl7.6 and above)
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Fri Jan 03, 2003 6:05 am
#Ill give it a go, at the moment, i getting
[04:08:00] <Natsuki-Chan> [04:08] Tcl error [time:pubnotice]: expected integer but got "08" (looks like invalid octal number)
[04:09:00] <Natsuki-Chan> [04:09] Tcl error [time:pubnotice]: expected integer but got "09" (looks like invalid octal number)
those
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Fri Jan 03, 2003 7:09 am
[11:08:00] <Natsuki-Chan> [11:08] Tcl error [time:pubnotice]: can't use invalid octal number as operand of "%"
[11:09:00] <Natsuki-Chan> [11:09] Tcl error [time:pubnotice]: can't use invalid octal number as operand of "%"
now getting these
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Fri Jan 03, 2003 7:09 am
Never post when you are very tired. I forgot about thboth of these.
99% of the time, I am on a system, where I can make small tests using tclsh.
Change $min in the if statement to
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Fri Jan 03, 2003 7:12 am
ok, changed, ill see how it goes
Weirdo
Master
Posts: 265 Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England
Post
by Weirdo » Fri Jan 03, 2003 8:12 am
[12:00:00] <Natsuki-Chan> [12:00] Tcl error [time:pubnotice]: syntax error in expression " ^ 3": unexpected operator ^
[12:03:00] <Natsuki-Chan> [12:03] Tcl error [time:pubnotice]: can't read "nick": no such variable << I fixed this one
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Fri Jan 03, 2003 11:30 am
Stupid old me.
Go back to the plain $min version.
The string trim, is removing both 00's when the hour strikes.
Code: Select all
if {![string index $min 0]} { set min [string index $min 1] }
Use this line, before it checks the reaminder.