mIRC Homepage
Posted By: Dave4989 Timing script - 08/01/10 12:55 AM
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>.
Posted By: extremity Re: Timing script - 08/01/10 01:07 AM
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?
Posted By: Dave4989 Re: Timing script - 08/01/10 02:19 AM
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.
}


Posted By: DJ_Sol Re: Timing script - 08/01/10 08:12 AM
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.
Posted By: Tomao Re: Timing script - 08/01/10 08:26 AM
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:{
Posted By: Dave4989 Re: Timing script - 08/01/10 11:08 PM
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).
  }
}
Posted By: Wims Re: Timing script - 09/01/10 12:09 AM
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
© mIRC Discussion Forums