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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
swasteris
Voice
Posts: 5 Joined: Thu Aug 24, 2006 12:51 pm
Post
by swasteris » Thu Aug 24, 2006 1:01 pm
bind time - * time:test; proc time:test {1} {if {[expr $m % 2]} {putserv "privmsg #eGc :test1"} {putserv "privmsg #eGc :test2"}}
how make that script work with eggdrop!
that script me don't working whit eggdrop.. help plz (sry ban English
)
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Thu Aug 24, 2006 1:44 pm
You hav'nt specified the value of $m...
Also, your proc does not take proper number of variables to be used with a time-binding
Finally, please put code inside code-blocks..
Code: Select all
bind time - * time:test
proc time:test {minute hour day month year} {
#setting m to 1 for demonstration
set m 1
if {[expr $m % 2]} {
puthelp "PRIVMSG #eGc :test1"
} {
puthelp "PRIVMSG #eGc :test2"
}
}
Of course, you'll have to set m to something useful, unless you're using it as a global variable (then you'll have to "global m" it first however)
NML_375
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Aug 24, 2006 10:39 pm
there's a little catch here: this won't work and will bail out with Tcl error on minute values of 08 and 09 as these aren't valid octal numbers
you can use [scan] to extract proper numerical values from [bind time] proc arguments
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
swasteris
Voice
Posts: 5 Joined: Thu Aug 24, 2006 12:51 pm
Post
by swasteris » Fri Aug 25, 2006 3:55 am
something is ban working because in channel eggdrop bot write test1. so what wrong with that script?
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Fri Aug 25, 2006 6:10 am
Yes... and as I stated, you'll have to do something useful with $m in the first place... I only set it to 1 for demonstation purposes...
This example assumes you wish to test wether the minute is even or not (as suggested by demond, and with his scan-fix)
Code: Select all
bind time - * time:test
proc time:test {minute hour day month year} {
if {[expr [scan $minute "%d"] % 2]} {
puthelp "PRIVMSG #eGc :test1"
} {
puthelp "PRIVMSG #eGc :test2"
}
}
NML_375
swasteris
Voice
Posts: 5 Joined: Thu Aug 24, 2006 12:51 pm
Post
by swasteris » Fri Aug 25, 2006 7:09 am
okey now it's work perfect