• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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
 
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
 
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:
  • 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".
 
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.
Back
Top