• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] How do you make it so if two different words are said in a chat message

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
Let's say someone says "look at girl".

How do I make it so a trigger detects if someone said something that contains both "look" and "girl"

so that "look girl" and "look at girl" would both work it is possible?


I can't seem to get it to work even when I just want one phrase to be the activator of the trigger. I always have to write the specific message in game.

Like if "gordon freeman is cool" is typed nothing happens. when the activator is "gordon" I have to type "gordon" for it to work

please help
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Must be like this:
Player - Player 1 (Red) types a chat message containing (look) as A substring

And make a condition inside actions like: If entered substring is look at girl then: actions!
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
lol, no
  • Girl
  • Events
    • Player - Player 1 (Red) types a chat message containing look as A substring
  • Conditions
    • (Substring((Entered chat string), 1, 5)) Equal to look
  • Actions
    • Game - Display to (All players) the text: (Substring((Entered chat string), 6, 13))
Look at girl
the activation word is look, the rest is at girl
so the one which will be displayed is at girl (6,13)
count all letter and space
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
lol, no
  • Girl
  • Events
    • Player - Player 1 (Red) types a chat message containing look as A substring
  • Conditions
    • (Substring((Entered chat string), 1, 5)) Equal to look
  • Actions
    • Game - Display to (All players) the text: (Substring((Entered chat string), 6, 13))
Look at girl
the activation word is look, the rest is at girl
so the one which will be displayed is at girl (6,13)
count all letter and space

the white color... it burns smeagul's eyeballs

anyway, what the OP is looking for is a regex compiler which can't be done in GUI, probably not even JASS. The trigger quoted will work for the initial "look". if you want different lookats (girl, boy, dog, etc.) than you can do like

  • if (Substring((Entered chat string), 6, Length of (Entered Chat String)) is equal to "at girl" then
  • ... do stuff
  • else if (blah) is equal to "at boy" then
  • ... do stiff
(excuse my psuedogui syntax)
 
Example:

  • keywords
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing look as Ein Teil-String
      • Spieler - Spieler 1 (Rot) types a chat message containing girl as Ein Teil-String
    • Bedingungen
    • Aktionen
      • Set Player = (Triggering player)
      • Set Real = (Real + 1.00)
      • Wait 0.00 seconds
      • Set Real = (Real - 1.00)

  • execution
    • Ereignisse
      • Spiel - Real becomes Gleich 2.00
    • Bedingungen
    • Aktionen
      • Spiel - Display to (All players) for 30.00 seconds the text: (Name of Player)


Idk, maybe it will help you.
 
Last edited:
Level 12
Joined
Oct 16, 2010
Messages
680
  • Untitled Trigger 003
    • Events
      • Player - Player 1 (Red) types a chat message containing girl as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to look
    • Actions
this will work for "lookgirl" , "look girl" , "look that cvazy girl maaan" and anything that contains "girl" and starts with "look".
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
actually this is work just same, but you just need to change it
  • Girl
  • Events
    • Player - Player 1 (Red) types a chat message containing look as A substring
  • Conditions
    • (Substring((Entered chat string), 1, 5)) Equal to look
  • Actions
    • Game - Display to (All players) the text: (Substring((Entered chat string), 6, Length of (Entered Chat String))))
it will show the words after "look" and "look" as the activation words
 
Status
Not open for further replies.
Top