Picking up Integers from String

Somatic

You can change this now in User CP.
Reaction score
84
Any one can kindly explain to me how does the trigger picks up the needed integer from the string entered, and process it out? I have a trigger here but it does not work. Its key word is "-shells" and "-shells XX" to trigger, and when it entered "-shells XX" the "X" are integer which cannot exceed 20, or below 1. Plus its suppose to feed it into the integer for usage in other spells.
Please see what is wrong here. Thanks. :)
Code:
Shells Control
    Events
        Player - Player 1 (Red) types a chat message containing -shells as A substring
        Player - Player 2 (Blue) types a chat message containing -shells as A substring
        Player - Player 3 (Teal) types a chat message containing -shells as A substring
        Player - Player 4 (Purple) types a chat message containing -shells as A substring
        Player - Player 5 (Yellow) types a chat message containing -shells as A substring
        Player - Player 6 (Orange) types a chat message containing -shells as A substring
        Player - Player 7 (Green) types a chat message containing -shells as A substring
        Player - Player 9 (Gray) types a chat message containing -shells as A substring
        Player - Player 8 (Pink) types a chat message containing -shells as A substring
        Player - Player 10 (Light Blue) types a chat message containing -shells as A substring
        Player - Player 11 (Dark Green) types a chat message containing -shells as A substring
        Player - Player 12 (Brown) types a chat message containing -shells as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Integer((Substring((Entered chat string), 9, 9)))) Not equal to 0
                (Integer((Entered chat string))) Equal to 9
            Then - Actions
                Set Shells[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 9, 9))))
                Game - Display to (Player group((Triggering player))) for 4.00 seconds the text: (Shells Per Barrage Set To :  + (String(Shells[(Player number of (Triggering player))])))
            Else - Actions
                Game - Display to (Player group((Triggering player))) for 4.00 seconds the text: (Shells Per Barrage Set To :  + (String(Shells[(Player number of (Triggering player))])))

Thanks
 
S

SquirrelyCat

Guest
grabbing an integer from a string? That sounds like conversions....i only know how to do conversions in JASS, (S2I for string to integer i guess)

But i've seen it and used it in GUI too, but it took me a while to find it, i hate scrollin' through GUI not finding what i need >=(

Hmmm, i think those are substrings...which you have....hmm....i've tried substrings before ....i thought i had it! But it turns out i suck at substrings :S
 

Somatic

You can change this now in User CP.
Reaction score
84
Its ok, i found out the problem
Code:
(Integer((Entered chat string))) Equal to 9

Should be
Code:
((Length of (Entered chat string)) Equal to 9) or ((Length of (Entered chat string)) Equal to 10)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top