mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2015
Posts: 6
J
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

Joined: Feb 2015
Posts: 243
O
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

Joined: Oct 2015
Posts: 6
J
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

Joined: Oct 2014
Posts: 35
M
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
Joined: Feb 2015
Posts: 243
O
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

Joined: Oct 2015
Posts: 6
J
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2015
Posts: 6
thanks guys they work great appreciate it!

Joined: Oct 2015
Posts: 6
J
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.
Joined: Dec 2013
Posts: 779
N
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
Joined: Oct 2015
Posts: 6
J
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.

Joined: Dec 2013
Posts: 779
N
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

Link Copied to Clipboard