mIRC Home    About    Download    Register    News    Help

Print Thread
#169316 21/01/07 03:37 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
I want to make a script called lotto:

Code:
      set %lotto $rand(1,100) {
        if (%lotto == 1) { /msg $chan CONGRADULATIONS $nick You are now an op for a day! | /mode #avatarrp +o $nick }
        if (%lotto == 2) { /msg $chan CONGRADULATIONS $nick You are now an op for a day! | /mode #avatarrp +o $nick }
        if (%lotto == 3) { /msg $chan CONGRADULATIONS $nick You are now a halfop for a day! | /mode #avatarrp +h $nick }
        if (%lotto == 4) { /msg $chan CONGRADULATIONS $nick You are now a halfop for a day! | /mode #avatarrp +h $nick }
        if (%lotto == 5) { /msg $chan CONGRADULATIONS $nick You are now a halfop for a day! | /mode #avatarrp +h $nick }
        if (%lotto == 6) { /msg $chan CONGRADULATIONS $nick You are now a halfop for a day! | /mode #avatarrp +h $nick }
        if (%lotto == 49) { /msg $chan CONGRADULATIONS $nick You win the GRAND PRIZE and are now an ADMINISTRATOR for a day! /mode #avatarrp +a $nick }
        else /msg $chan SORRY $nick...better luck next time :) | set %lottoplay %lottoplay $nick
      }
    } 
  }


Don't worry about the first part....but the problem is I want to reset it once a day AUTOMATICALLY, at a specific time.

How do I do that?

And also on day...and stuff like that
Thanks

THE_ADZ #169318 21/01/07 03:47 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/help /timer
Code:
; Insert into your script somewhere (on START perhaps)
; Just change 15:00 to the time you want (24h time)
.timer 15:00 0 1 resetstats

alias resetstats {
  do all of your commands here.
  If it's only one command, you can just put it on the
  timer line instead of in an alias.
}


Invision Support
#Invision on irc.irchighway.net
Riamus2 #169321 21/01/07 04:22 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
it won't work....

THE_ADZ #169323 21/01/07 04:39 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
I did
Code:
.timer 11:30 0 1 resetstats
alias resetstats {
  set %lottoplay NONE
}

And it did nothing....

THE_ADZ #169325 21/01/07 04:52 PM
Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
Quote:
unset %lottoplay


you must unset what you have set


learn learn learn
learn3r #169328 21/01/07 05:51 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
hmmm....still no

THE_ADZ #169329 21/01/07 05:53 PM
Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
Quote:
set %lotto $rand(1,100) {


May I ask why did you unset %lottotplay if you setted %lotto

Code:
on *:start:{
  .timer 11:30 0 1 resetstats
}
alias resetstats {
  unset %lotto
}

Last edited by learn3r; 21/01/07 05:55 PM.

learn learn learn
learn3r #169330 21/01/07 06:01 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
%lotto is the lotto number %lottoplay is people who played.

THE_ADZ #169331 21/01/07 06:03 PM
Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
Code:
on *:start:{
  .timer 11:30 0 1 resetstats
}
alias resetstats {
  unset %lottoplay
}


learn learn learn
THE_ADZ #169337 21/01/07 06:42 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Remember that if you're using the on START event, you need to close and reopen mIRC for the event to trigger. And because it's a timer, it will continue from then on (every day at that time), but you'll have to restart first.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #169339 21/01/07 06:50 PM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
hmmm...alright I will try that


Link Copied to Clipboard