mIRC Home    About    Download    Register    News    Help

Print Thread
Trigger script when only the keyword is said? #241326 08/04/13 10:16 AM
Joined: Apr 2013
Posts: 9
F
Felanbird Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Apr 2013
Posts: 9
Is there anyway to make a script trigger when only the keyword is said?

I know there is on 1:TEXT: but it causes the script to trigger even if the keyword is said amongst a bunch of words. i.e(msg: example example KEYWORD example) which would still cause the script to work.

Any ideas? ^_^

Re: Trigger script when only the keyword is said? [Re: Felanbird] #241327 08/04/13 10:21 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You use isin.
Code:
on *:text:*:#: {
  ; This will watch for the word in all channel messages.
  if (word isin $1-) { echo -a $nick used the word }
}
on *:text:*:?: {
  ; This will watch for the word in all private messages.
  if (word isin $1-) { echo -a $nick used the word: $1- }
}

This goes in to your remote. ALT + R in mirc.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Trigger script when only the keyword is said? [Re: sparta] #241328 08/04/13 10:57 AM
Joined: Apr 2013
Posts: 9
F
Felanbird Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Apr 2013
Posts: 9
Ty for your response ^_^ but I realize I worded my question incorrectly.

I meant to ask for a script that would only trigger when ONLY text is said, versus mentioned amongst any message frown

Re: Trigger script when only the keyword is said? [Re: Felanbird] #241329 08/04/13 11:01 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Don't use any wildcards in the matchtext section of the event.

on *:TEXT:hello:#chan:
This matches only when "hello" is said

on *:TEXT*hello*:#chan:
This matches when "hello" is anywhere in the line.

Re: Trigger script when only the keyword is said? [Re: 5618] #241330 08/04/13 11:05 AM
Joined: Apr 2013
Posts: 9
F
Felanbird Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Apr 2013
Posts: 9
Oh that makes perfect sense, thank you grin

Re: Trigger script when only the keyword is said? [Re: sparta] #241464 24/04/13 11:26 PM
Joined: Apr 2013
Posts: 4
J
juk3 Offline
Self-satisified door
Offline
Self-satisified door
J
Joined: Apr 2013
Posts: 4
noob here - can i get this to work for multiple keywords in a sentence?

example - can you gear check my monk?

i would like (gear & check) together to trigger the script. also if possible the words together (gearcheck).

sometimes people put a space and sometimes they dont so i would like the script to recognize it and trigger for both ways. BUT i dont want it to trigger if gear is used alone or if check is used alone. sorry for the overload i have been searching all day.

Re: Trigger script when only the keyword is said? [Re: juk3] #241465 25/04/13 12:20 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just use wildcards...

*gear*check*

That will trigger as long as both are used and gear comes before check.


Invision Support
#Invision on irc.irchighway.net
Re: Trigger script when only the keyword is said? [Re: Riamus2] #241466 25/04/13 01:30 AM
Joined: Apr 2013
Posts: 4
J
juk3 Offline
Self-satisified door
Offline
Self-satisified door
J
Joined: Apr 2013
Posts: 4
ok so my script looks like this

Code:
on *:TEXT:*:#: {
  if (*gear*check* isin $1-) { msg $chan JUK3 will gear check the shit outta you $nick post your battle.net armory or diablo progress link }
}


but its not working also when regular non op users type gearcheck its not triggering the script btw did i mention i was a noob?

Re: Trigger script when only the keyword is said? [Re: juk3] #241467 25/04/13 01:34 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Put it in the trigger...

Code:
on *:text:*gear*check*:#:{


If you really want to use it in an IF statement, then use iswm instead of isin. You use iswm if you're using wildcards.


Invision Support
#Invision on irc.irchighway.net