mIRC Home    About    Download    Register    News    Help

Print Thread
#205622 27/10/08 03:58 AM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
How do I do an automatic lottery drawing everyday at such and such time? I have the entire lottery script all written, I just need to script something up that will actually do the daily drawing. How do I perform such a task without needing an event to trigger (such as on TEXT)?

Last edited by Joe_Dean; 27/10/08 03:58 AM.
Joe_Dean #205623 27/10/08 04:09 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Simple, use a timer.

Eg:
Code:
on me:*:join:#:{
  $+(.timerdraw.,$network,.,$chan) 00:00 1 1 draw $chan
}
alias -l draw {
  unset %draw
  while $numtok(%draw,32) < 6 {
    set %draw $addtok(%draw,$r(1,49),32)
  }
  .msg $1 Daily 6/49 Drawing numbers are %draw
  $+(.timerdraw.,$network,.,$1) 00:00 1 1 draw $1
}


I've seen your coding before, and you seem to be good enough to be able to understand what I've done here.

RusselB #205625 27/10/08 06:00 AM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
Yep, but, is there an alternative? My bot is connected to my network 24/7, hence using on JOIN wouldn't really be helpful. The point here is to make the system automated -- making the bot leave and rejoin isn't automation. smirk

Joe_Dean #205627 27/10/08 06:25 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I could re-write the code so that it uses the ON START event, rather than the ON JOIN event, but in case you didn't realize it, the way my code is designed, the bot would only have to part and join once, which could be done via the /hop command, to minimize the amount of time the bot actually isn't in the channel. With the /hop command, you're looking at milliseconds to part and re-join the channel.


Link Copied to Clipboard