mIRC Home    About    Download    Register    News    Help

Print Thread
Command Triggered only XX seconds or Minutes #255356 12/10/15 10:34 PM
Joined: Oct 2015
Posts: 6
J
jackpotirc Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
I tried to search but I just think I'm not using the right vocabulary for what I'm trying to do. So I want a message that is triggered on a certain phrase or word which I already can do but I want to add to it so it can only be triggered every so many seconds.


This is what I currently have but would also like for it to be only triggered say every 1800 seconds

on *:text:*triggermessage*:#: { .timermsg 1 $r(20,300) /msg $chan replymessaget }

Thanks in advance

Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255364 14/10/15 05:39 PM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Code:
on *:text:*triggermessage*:#: { if (!%delay) { set -u1800 %delay 1 | .timermsg 1 $r(20,300) /msg $chan replymessaget } | }


-uN switch unsets the variable after N seconds smile

Re: Command Triggered only XX seconds or Minutes [Re: OrFeAsGr] #255368 15/10/15 09:59 AM
Joined: Oct 2015
Posts: 6
J
jackpotirc Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
Thank you very much for the reply. The next thing I am trying to add to a few of the text commands is to ignore a specific users. I have one bot that tells me what commands do what and it triggers the commands them selfs as well.

Thanks Again

Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255369 15/10/15 12:01 PM
Joined: Oct 2014
Posts: 35
M
MattiSony Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Oct 2014
Posts: 35
Code:
on *:text:*triggermessage*:#: { 
  if $nick = USER { return }
  if (!%delay) { 
    set -u1800 %delay 1 | .timermsg 1 $r(20,300) /msg $chan replymessaget 
  } 
}



Matti
Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255371 15/10/15 03:44 PM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Either what Matti suggested or to use a list of nicks, you can modify it to this.
Code:
on *:text:*triggermessage*:#: { 
  if ($istok(%blist,$nick,32)) { return }
  if (!%delay) { 
    set -u1800 %delay 1 | .timermsg 1 $r(20,300) /msg $chan replymessaget 
  } 
}

And put the nicks you dont want to respond to in %blist smile

Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255412 21/10/15 09:31 AM
Joined: Oct 2015
Posts: 6
J
jackpotirc Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
thanks guys they work great appreciate it!

Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255442 24/10/15 06:17 AM
Joined: Oct 2015
Posts: 6
J
jackpotirc Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
Sorry for the continuous replies to adding more variables to these commands.

Is there a way to add onto a text command to only be allowed to trigger at certain times of the day.

Example 4pm-5pm power hour and during this time additional triggers are available to use.

Thanks again

Last edited by jackpotirc; 24/10/15 06:18 AM.
Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255444 24/10/15 11:00 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You can set this in a number of ways. Either to check if $time is within your limit or activate a timer that will set a variable on at a certain time and unset it at a certain time etc.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Command Triggered only XX seconds or Minutes [Re: Nillen] #255455 25/10/15 06:50 AM
Joined: Oct 2015
Posts: 6
J
jackpotirc Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
Prefer a specified time frame. example: 4pm to 5pm the trigger is available and the rest of the time if a user tries it it wont activate.

Re: Command Triggered only XX seconds or Minutes [Re: jackpotirc] #255456 25/10/15 05:05 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Here's what you do, on connect, start a timer that activates at 4pm, that timer should set a variable active and start another timer that activates at 5pm, unsetting the variable.

/help on connect
/help timers

Then when that is done you just check in your text events if the variable is active or not.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net