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.

a crontab script request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

a crontab script request

Post by Football »

I`m using pisg stats and using a crontab that updates the stats at 00:00 every day, I was wondering if someone could write a script that I will run at 00:01 that will announce on a room called #football that the stats were updated and write the link to the stats; www.EPLonline.co.uk/chanstats/football.html I hope thats possible and if not what should I do instead?

Help please.
Idling at #Football, Quakenet.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

just change the bind time to what you want ;)

currently every 1min if you leave it, but i cant tell you everything :P

Code: Select all

set the_chan "#football"

bind time -|- "* * * * *" football

proc football {min hour day month year} { 
   putlog "football timer active"
   puthelp "PRIVMSG $the_chan :STATS UPDATE: www.EPLonline.co.uk/chanstats/football.html"  
}

putlog "football_stats loaded!"
hope this helps... :)
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

So should I load that script? or just put it in the eggs directory an add a crontab to run it at 00 01 ?
Idling at #Football, Quakenet.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

just change the time bind to suit

Code: Select all

"* * * * *"
and add the line

Code: Select all

source wherever/watever.tcl
and rehash yr bot ;)
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

set the_chan "#EPL"

bind time -|- "*00 01 * * *" EPL

proc football {min hour day month year} {
putlog "football timer active"
puthelp "PRIVMSG $the_chan :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html"
}

putlog "football_stats loaded!"


thats the script

and on eggdrop.conf;

source scripts/statsupdate.tcl

that'll work right?
Idling at #Football, Quakenet.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

Code: Select all

proc football
needs changing to...


Code: Select all

proc EPL
but yeah should do.....
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

that script doesn't seem to work. try it.
Idling at #Football, Quakenet.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

You've got a problem with variable context: you define the_chan in a global context, yet try to read it as a local variable within EPL..
Either use the global command to link the two, or use full namepath addressing when reading the variable ($::the_chan instead of $the_chan).

A third option would be to skip the variable alltogether, and hardcode the channelname into the proc.
NML_375
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

You've got a problem with variable context: you define the_chan in a global context, yet try to read it as a local variable within EPL..
Either use the global command to link the two, or use full namepath addressing when reading the variable ($::the_chan instead of $the_chan).

A third option would be to skip the variable alltogether, and hardcode the channelname into the proc.
So how should the script look?
Idling at #Football, Quakenet.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Code: Select all

set the_chan "#EPL"

bind time - "00 01 *" EPL

proc EPL {min hour day month year} {
  putlog "football timer active"
  puthelp "PRIVMSG $::the_chan :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html"
}
Or

Code: Select all

bind time - "00 01 *" EPL

proc EPL {min hour day month year} {
  putlog "football timer active"
  puthelp "PRIVMSG #EPL :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html"
}
NML_375
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Code:
set the_chan "#EPL"

bind time - "00 01 *" EPL

proc EPL {min hour day month year} {
putlog "football timer active"
puthelp "PRIVMSG $::the_chan :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html"
}

Or
Code:
bind time - "00 01 *" EPL

proc EPL {min hour day month year} {
putlog "football timer active"
puthelp "PRIVMSG #EPL :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html"
}
Hey nml375,

Thanks for the reply.

Have you tested those scripts?

I`ve tried them, they don't seem to work either.
Idling at #Football, Quakenet.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

You've got a problem with variable context: you define the_chan in a global context, yet try to read it as a local variable within EPL..
Either use the global command to link the two, or use full namepath addressing when reading the variable ($::the_chan instead of $the_chan).

A third option would be to skip the variable alltogether, and hardcode the channelname into the proc.
oops forgot about the :: for variables :P

Code: Select all

set the_chan "#fr3ddy" 

bind pub - -footie EPL

bind time - "* * * * *" EPL 

proc EPL {min hour day month year} { 
putlog "football timer active" 
puthelp "PRIVMSG $::the_chan :STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html" 
} 
i added a -footie trigger for testing and set the timer for every minuite after working fine here.....

on the channel announces on -footie and every one min

Code: Select all

[10:26am] <doggo> -footie
[10:27am] <fr3ddy> STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html
[10:27am] <fr3ddy> STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html
[10:28am] <fr3ddy> STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html
[10:29am] <fr3ddy> STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html
[10:30am] <fr3ddy> STATS UPDATED: www.EPLonline.co.uk/chanstats/stats.html
and on the partyline

Code: Select all

[10:26am] <fr3ddy> [10:28] football timer active
[10:27am] <fr3ddy> [10:29] football timer active
[10:28am] <fr3ddy> [10:30] football timer active
[10:29am] <fr3ddy> [10:31] football timer active
[10:30am] <fr3ddy> [10:32] football timer active
and wouldnt the time bind be

Code: Select all

"01 00 * * *"


for 00:01 ?
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

But does it work for you with the bind time?

I mean set it to a certain time and see if that works, so far it hasn't worked for me.
Idling at #Football, Quakenet.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Doggo, you're quite right. Must've read the request as 1am :oops:

Football, do you get any error messages logged? Given the issue with the malformed mask, did you get any output at 1am instead (notice, errors, or other)?
NML_375
g
game_over
Voice
Posts: 29
Joined: Thu Apr 26, 2007 7:22 am

Post by game_over »

Code: Select all

set ::the_chan "#fr3ddy"
Post Reply