mIRC Home    About    Download    Register    News    Help

Print Thread
Timing script #217310 08/01/10 12:55 AM
Joined: Apr 2006
Posts: 43
D
Dave4989 Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Basically what Im trying to do is when <text> is displayed in <#Chan> a timer will be activated and begin to countdown for 5 mins, Once this 5 mins is over a page will be sent to <user>.

Re: Timing script [Re: Dave4989] #217311 08/01/10 01:07 AM
Joined: Jan 2010
Posts: 11
E
extremity Offline
Pikka bird
Offline
Pikka bird
E
Joined: Jan 2010
Posts: 11
Do you want anyone to be able to use it?

Will it be the same <user> every time, or will you select the user?

Can you give an example of use in a room?

Re: Timing script [Re: extremity] #217312 08/01/10 02:19 AM
Joined: Apr 2006
Posts: 43
D
Dave4989 Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Originally Posted By: extremity
Do you want anyone to be able to use it?

Will it be the same <user> every time, or will you select the user?

Can you give an example of use in a room?





Ok if user "OnOeS" says "Dave4989: !weap" in channel #n00bless-aow" I want a timer to countdown 5 minutes. When this is over user "dave4989" would say /msg #Batcave You just used the !weap command, Please wait 5 minutes.

Also if "OnOeS" says "Dave4989 has joined the game" in channel #n00bless-aow another 5 minute timer would countdown when its finish it would /msg #Batcave 5 minute countdown started.

I was thinking of a way to alert me of how much time is left on the countdown, If "OnOeS" says "Dave4989: !c4" in channel #n00bless-aow it would /msg #Batcave <time> is remaining on the <first> and <second> (Those being each of the commands).




I originally was thinking something like...

on 1:TEXT:*Dave4989: !weap*:#n00bless-aow:{
if ($nick == OnOeS)
/timer5 1 300 msg #batcave You just used the !weap command, Please wait 5 minutes.
}



Last edited by Dave4989; 08/01/10 02:44 AM.
Re: Timing script [Re: Dave4989] #217322 08/01/10 08:12 AM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yeah the : in your wildcard match there would give you an error.

Code:
on *:text:*:#:{

;checks if nick is correct & your nick is in the first word. 
if ($nick = OnOeS) && ($me isin $1) {

;checks timer to not reset timer until 5 min is up.
if (!%onoes) {
;sets variable so you wont keep resetting it.
;as long as variable exists it wont reset the timer and send a message.
set -u300 %onoes $true

;!weap
if ($2 = !weap) timeronoes 1 300 msg #batcave You just used the !weap command, Please wait 5 minutes.

;has join the channel
elseif ($2-3 = has joined) timeronoes_join 1 300 msg #Batcave 5 minute countdown started.
}

;check timer duration status
if ($2 = !c4) msg # Join timer: $calc($timer(onoes_join).secs / 60) minute(s). Weap timer: $calc($timer(onoes).secs / 60) minute(s).
  }
}


I wrote this in this edit box, untested but a basic approach to your request.

This will only answer one person, you didn't sepcify more. If it is supposed to answer more nicks you would make a list, then check if nick is in the list.

Re: Timing script [Re: Dave4989] #217324 08/01/10 08:26 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
on 1:TEXT:*Dave4989: !weap*:#n00bless-aow:{

should change to this to be working:
Code:
on 1:TEXT:$(*Dave4989 $+ $chr(58) !weap*):#n00bless-aow:{

Re: Timing script [Re: Tomao] #217341 08/01/10 11:08 PM
Joined: Apr 2006
Posts: 43
D
Dave4989 Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Script is tweaking abit..

Ok if the following words !weap, !char, or !veh are said in the 2nd word ($2) in channel #n00bless-aow by user OnOeS I want it to start a 5 minute countdown. When this is up it will send a message to #batcave saying XXX

Now if !c4 is said in the second word and the first is Dave4989: I want it to display "Time remaining on !weap: <x> !veh: <x> !char: <x>


THis look good????

I get this..

"<~Dave4989> Char: 2.783333 minute(s). Veh: 2.716667 minute(s). Weap: 2.616667 minute(s)." How would I remove the extra numbers. I just want 2.7
Code:
on 1:TEXT:*:#n00bless-aow:{
  if ($nick = OnOeS) && ($me isin $1) {
    if (!%onoes) {
      if ($2 = !char) timerC 1 300 msg #batcave You can now use the !char command.
      if ($2 = !veh) timerV 1 300 msg #batcave You can now use the !veh command.
      if ($2 = !weap) timerW 1 300 msg #batcave You can now use the !weap command.
    }
    if ($2 = !c4) msg #Batcave Char: $calc($timer(c).secs / 60) minute(s). Veh: $calc($timer(v).secs / 60) minute(s). Weap: $calc($timer(w).secs / 60) minute(s).
  }
}

Last edited by Dave4989; 08/01/10 11:49 PM.
Re: Timing script [Re: Dave4989] #217344 09/01/10 12:09 AM
Joined: Jul 2006
Posts: 3,728
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,728
Quote:
How would I remove the extra numbers. I just want 2.7
$round(2.666666,1) is 2.7, type /help $round for more information


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net