mIRC Home    About    Download    Register    News    Help

Print Thread
J
jackpotirc
jackpotirc
J
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: 241
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 241
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

J
jackpotirc
jackpotirc
J
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

M
MattiSony
MattiSony
M
Code:
on *:text:*triggermessage*:#: { 
  if $nick = USER { return }
  if (!%delay) { 
    set -u1800 %delay 1 | .timermsg 1 $r(20,300) /msg $chan replymessaget 
  } 
}


Joined: Feb 2015
Posts: 241
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 241
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

J
jackpotirc
jackpotirc
J
thanks guys they work great appreciate it!

J
jackpotirc
jackpotirc
J
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: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

J
jackpotirc
jackpotirc
J
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: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.


Link Copied to Clipboard