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!
digitalbleh
Voice
Posts: 4 Joined: Wed Jul 06, 2011 4:02 am
Location: Sydney
Post
by digitalbleh » Mon Apr 26, 2021 5:49 am
Hi,
Just want a simple script to send a msg to a person every 80 minutes.
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Mon Apr 26, 2021 9:48 am
Seems kind of rude to spam the same message to aPerson every 80 minutes, but here it is:)
Code: Select all
proc timedMsgProc {} {
puthelp "PRIVMSG aPerson :send this msg to aPerson every 80 minutes"
timer 80 [list timedMsgProc]
}
if {![info exists timedMsgRunning]} {
set timedMsgRunning 1
timer 10 [list timedMsgProc]
}
caesar
Mint Rubber
Posts: 3776 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Apr 26, 2021 10:48 am
If anyone is willing to test a cron job like
20 */1 * * * (meaning at 20 minutes past the hour) let me know if works.
Code: Select all
bind cron - {20 */1 * * *} send:message
proc send:message {min hour day month week} {
puthelp "PRIVMSG user :This is the once every 80 minutes message"
}
Once the game is over, the king and the pawn go back in the same box.
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Mon Apr 26, 2021 11:37 am
Caesar: That seems a lot more like a 60 minute timer, at 20 after every hour.
CrazyCat
Revered One
Posts: 1277 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Mon Apr 26, 2021 12:25 pm
*/1 or * are the same.
When using */x, it means it will run when * % x (modulo) equals 0.
Examples:
*/5 * * * * will act every time the minutes are 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
13 */7 * * * will act at 7h13, 14h13 and 21h13
digitalbleh
Voice
Posts: 4 Joined: Wed Jul 06, 2011 4:02 am
Location: Sydney
Post
by digitalbleh » Mon Apr 26, 2021 3:28 pm
Thanks SpiKe^^
Thank you caesar
I will test both scripts, im worried tho if i need to change the time to + or - 80mins i wont know how to change 20 */1. Id assume if its 90mins it would be 30 */1 ?
CrazyCat
Revered One
Posts: 1277 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Mon Apr 26, 2021 5:59 pm
digitalbleh wrote: I will test both scripts, im worried tho if i need to change the time to + or - 80mins i wont know how to change 20 */1. Id assume if its 90mins it would be 30 */1 ?
No.
20 */1 will send the message every hour, when minutes are 0, 20 and 40.
The code from SpiKe^^ seems more relevant
caesar
Mint Rubber
Posts: 3776 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Apr 27, 2021 2:22 am
Ah, right, i had a feeling a single cron job wouldn't do the job and it actually makes sense.
Once the game is over, the king and the pawn go back in the same box.
CrazyCat
Revered One
Posts: 1277 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Tue Apr 27, 2021 11:52 am
Thanks, I didn't know this package exists.
Might solve a lot of problematics
simo
Revered One
Posts: 1100 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sat May 08, 2021 3:50 pm
anyway to have this as pub command ?
also anyway to display all running crons ? with the method heartbroken used
willyw
Revered One
Posts: 1202 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Sat May 08, 2021 7:49 pm
simo wrote: ...
also anyway to display all running crons ?
...
From within the partyline, this is what I do:
.tcl binds cron
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
simo
Revered One
Posts: 1100 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sat May 08, 2021 7:56 pm
i tried that as well willyw but the method heartbroken is using doesnt show in the list on PL when using: .tcl binds cron
caesar
Mint Rubber
Posts: 3776 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun May 09, 2021 3:34 am
That's because it doesn't come from eggdrop's commands, but from tcllib, meaning it doesn't have an implementation to see them.
Once the game is over, the king and the pawn go back in the same box.
CrazyCat
Revered One
Posts: 1277 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Fri May 28, 2021 5:53 am
A friend of mine remembers me that the (u)timer can have a
count parameter (
https://github.com/eggheads/eggdrop/blo ... mand-count )
if count equals 0, it will never end
Code: Select all
.tcl timer 80 {putserv "PRIVMSG nick :hey!"} 0
Btw, I think I prefer using the cron package which allows to name the process and adds more flexibility.