mIRC Home    About    Download    Register    News    Help

Print Thread
Seems simple #167615 27/12/06 05:17 PM
Joined: Nov 2006
Posts: 9
L
Lucan Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Nov 2006
Posts: 9
But what do i know? :P

im not too good at this whole scripting thing, but this is the idea that i have:

the input would be something like: "!track <Variable 1> <Time in hours> <Variable 2, if none then $nick>"

then after the time has expired, the bot would msg $chan, something like: "<Variable 1> on <Variable 2> has expired."

is that doable?


Nooblets Unite :P
Re: Seems simple [Re: Lucan] #167616 27/12/06 05:56 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:text:!track*:#:{
  if !$2 || !$3 {
    .notice $nick Usage: !track <item> <time in hours> [item 2]
    .notice $nick [item 2] is optional
  }
  else .timer 1 $calc($3 * 3600) .msg $chan $2 on $iif($4,$4,$nick) has expired
}


Re: Seems simple [Re: RusselB] #167626 27/12/06 11:42 PM
Joined: Nov 2006
Posts: 9
L
Lucan Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Nov 2006
Posts: 9
great. That works like a charm. thanks. just another small (i hope) thing that i overlooked, if it is hard to implement, don't worry about it. But is there a way to make the "time in hours" so that when they enter a whole number (lets say they never put in a decimal point) it counts that number of "o'clocks" instead of hours from entering? (So if they enter 3 at 6:30, it will notify at 9:00, not 9:30)


Nooblets Unite :P
Re: Seems simple [Re: Lucan] #167628 28/12/06 01:04 AM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
replace the timer line with something like:

Code:
.timer $+($calc($asctime(HH) + $3),:00) 1 1 .msg $chan $2 on $iif($4,$4,$nick) has expired


That executes the timer at the time specified by taking the current hour ($asctime(HH) - 24hr format), adding the number of hours, and appending the :00. I think that's what you wanted.


Sais
Re: Seems simple [Re: Sais] #167662 28/12/06 02:25 PM
Joined: Nov 2006
Posts: 9
L
Lucan Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Nov 2006
Posts: 9
awesome. That was just what i was looking for. thank you


Nooblets Unite :P