mIRC Homepage
Posted By: Zaephyr Keywords with On Text - 15/08/06 03:35 AM
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.
Posted By: KingTomato Re: Keywords with On Text - 15/08/06 03:44 AM
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> }
}
Posted By: Zaephyr Re: Keywords with On Text - 15/08/06 04:18 AM
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.
Posted By: RusselB Re: Keywords with On Text - 15/08/06 04:21 AM
An alternative
Code:
 on *:text:nisstyre assume*:#:{
if nadu isin $3- {
.msg $chan $3- Script
}
}
 
Posted By: xhine Re: Keywords with On Text - 15/08/06 08:51 AM
Code:
on *:TEXT:*nisstyre*:#:{
  if ((assume isin $1-) && (nadu isin $1-)) {
    if (tower isin $1-) { second part.. }
    else { first part.. }
  }
}
Posted By: Rand Re: Keywords with On Text - 16/08/06 05:43 AM
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:

https://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- }
}
© mIRC Discussion Forums