mIRC Home    About    Download    Register    News    Help

Print Thread
Keywords with On Text #156322 15/08/06 03:35 AM
Joined: Aug 2006
Posts: 27
Z
Zaephyr Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Aug 2006
Posts: 27
I'm trying to set up some keywords with an on text script and I'm confused as to how to do it.

I've looked on the mIrc help and seen how to use the * with it, but I'm having some troubles. Here are two examples of the keywords I'd like to use.

1. nisstyre assume nadu
2. nisstyre assume tower nadu

How would I place those words with * so when someone used all three or four it would run the command.
I'm trying to write the trigger so that when the three words of the first are in a line it will run the script, but if the word tower is there as well (really tower nadu is one word,) then it should run the other script.

Re: Keywords with On Text #156323 15/08/06 03:44 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
on *:TEXT:nisstyre assume *:#: {
  var %assume = $3-
  if (%assume == nadu) { /msg $chan Nadu Script }
  else if (%assume == tower nadu) { /msg $chan Tower Nadu Script }
  ;else if (%assume == ...) { /msg $chan <some command> }
}


-KingTomato
Re: Keywords with On Text #156324 15/08/06 04:18 AM
Joined: Aug 2006
Posts: 27
Z
Zaephyr Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Aug 2006
Posts: 27
Is there a way to make the order of the keywords unnecessary? Like nisstyre, assume nadu or assume nadu, nisstyre or just having the three words together in one line like nisstyre, come here and assume nadu, just so long as those three words are together in one line it would trigger, unless it said tower nadu then it would trigger the second version.

Re: Keywords with On Text #156325 15/08/06 04:21 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
An alternative
Code:
 on *:text:nisstyre assume*:#:{
if nadu isin $3- {
.msg $chan $3- Script
}
}
 

Re: Keywords with On Text #156326 15/08/06 08:51 AM
Joined: Jul 2004
Posts: 21
X
xhine Offline
Ameglian cow
Offline
Ameglian cow
X
Joined: Jul 2004
Posts: 21
Code:
on *:TEXT:*nisstyre*:#:{
  if ((assume isin $1-) && (nadu isin $1-)) {
    if (tower isin $1-) { second part.. }
    else { first part.. }
  }
}

Re: Keywords with On Text #156327 16/08/06 05:43 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Quote:
I'm trying to set up some keywords with an on text script and I'm confused as to how to do it.


You just had a post not too long ago with the same exact TOPIC, asking for the exact SAME thing. Which can be located here:

http://forums.mirc.com/s...true#Post163575

Seriously, I'm at a loss as to how else we can help you. You appear to be incapable of learning mIRC Script. Either that or you just don't want to.

As for your question, it's time for you to look up how to do "if then else" statements.

Code:
on *:text:botsname *:{
  if ($2 == give) { describe $chan gives $3- }
  elseif ($2-4 == throw ball at) { describe $chan hurls a ball of fiery wrath at $5 }
  elseif ($2-3 == dance with) { describe $chan dances with $4 }
  elseif ($2 == dance) { describe $chan dances in the channel }
  elseif ($2-3 == bend over) { describe $chan glares at $nick for even suggesting... }
  elseif ($2 == assume) { describe $chan assumes $3- }
}