2 values in a substring

BEeeH-

New Member
Reaction score
2
Hey i'm a bit noob in making triggers, and i need some help!

This is a trigger of my Sheep Tag map.
Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
      • Player - Player 2 (Blue) types a chat message containing -gold as A substring
      • Player - Player 3 (Teal) types a chat message containing -gold as A substring
      • Player - Player 4 (Purple) types a chat message containing -gold as A substring
      • Player - Player 5 (Yellow) types a chat message containing -gold as A substring
      • Player - Player 6 (Orange) types a chat message containing -gold as A substring
      • Player - Player 7 (Green) types a chat message containing -gold as A substring
      • Player - Player 8 (Pink) types a chat message containing -gold as A substring
      • Player - Player 9 (Gray) types a chat message containing -gold as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -gold as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -gold as A substring
      • Player - Player 12 (Brown) types a chat message containing -gold as A substring
    • Conditions
      • (Triggering player) Equal to GameController
      • (Substring((Entered chat string), 1, 5)) Equal to -gold
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string)))))) Greater than 10000000
        • Then - Actions
          • Set TempInt1 = 10000000
        • Else - Actions
          • Set TempInt1 = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to TempInt1


Atm, everyone will get gold as you see. But i want to make a trigger which gives a different amount of gold to the sheeps and the wolves.
I want it to work like this "-gold X Y" , X = the gold amount for sheeps, Y = for wolves.
But i dunno how to make it work...:thdown: please help:D
 

ThranDeuL

New Member
Reaction score
1
That's nearly impossible seeing as if you can divide sub strings you can have an infinite amount of them and not just 2.

Why just not make 2 triggers, one for the sheep, one for the wolves?
 

eXirrah

New Member
Reaction score
51
You need to split the string into words like this:

Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
      • -------- Add all the players --------
    • Conditions
    • Actions
      • -------- Nullify the variables --------
      • Set iWords_Count = 0
      • For each (Integer A) from 0 to 9, do (Actions)
        • Loop - Actions
          • Set asWords[(Integer A)] = <Empty String>
      • -------- Loop through the string and split it into words --------
      • For each (Integer A) from 6 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • -------- I save the substring to a variable to save some processing time --------
          • Set sTempString = (Substring((Entered chat string), (Integer A), (Integer A)))
          • -------- This is actually sTempString Equal to <Space> --------
          • -------- Space marks the split --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • sTempString Equal to
            • Then - Actions
              • -------- Safety stuff --------
              • -------- You need the first 2 words, but I count to the third just in case --------
              • -------- All the stuff after the third word will be put into a single array element --------
              • -------- (array overflow safety) --------
              • -------- At the point when the script reaches the 3rd words I would exit the loop --------
              • -------- but I can't find exitloop action in GUI --------
              • -------- The second condition checks for double spaces and treats them as single --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • iWords_Count Less than 3
                      • asWords[iWords_Count] Not equal to <Empty String>
                • Then - Actions
                  • Set iWords_Count = (iWords_Count + 1)
                • Else - Actions
            • Else - Actions
              • Set asWords[iWords_Count] = (asWords[iWords_Count] + sTempString)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • asWords[0] Not equal to <Empty String>
        • Then - Actions
          • Game - Display to (All players) the text: (The first word is + asWords[0])
        • Else - Actions
          • -------- If there is no first word ... there should not be second ... no need to go on --------
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • asWords[1] Not equal to <Empty String>
        • Then - Actions
          • Game - Display to (All players) the text: (The second word is + asWords[1])
        • Else - Actions


Variables:
sTempString - string
iWordsCount - integer
asWords - string array with at least 3 elements

When you delete the comments it gets shorter :)
 

BEeeH-

New Member
Reaction score
2
Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
    • and all the other players
      • Conditions
        • (Triggering player) Equal to GameController
        • (Substring((Entered chat string), 1, 5)) Equal to -gold
      • Actions
        • Set TempInt1 = 0
        • For each (Integer A) from 0 to 9, do (Actions)
          • Loop - Actions
            • Set asWords[TempInt1] = <Empty String>
        • For each (Integer A) from 6 to (Length of (Entered chat string)), do (Actions)
          • Loop - Actions
            • Set sTempString = (Substring((Entered chat string), (Integer A), (Integer A)))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • sTempString Equal to
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • And - All (Conditions) are true
                      • Conditions
                        • TempInt1 Less than 3
                        • asWords[TempInt1] Not equal to <Empty String>
                  • Then - Actions
                    • Set TempInt1 = (TempInt1 + 1)
                  • Else - Actions
              • Else - Actions
                • Set asWords[TempInt1] = (asWords[TempInt1] + sTempString)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • asWords[0] Equal to <Empty String>
          • Then - Actions
            • Game - Display to (All players) the text: (The first word is + asWords[0])
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • asWords[1] Equal to <Empty String>
          • Then - Actions
            • Game - Display to (All players) the text: (The second word is + asWords[1])
          • Else - Actions
    • but where do i put this now????? and i guess i gotta edit it
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string)))))) Greater than 10000000
        • Then - Actions
          • Set TempInt1 = 10000000
        • Else - Actions
          • Set TempInt1 = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to TempInt1
As i said in the trigger. What to do?? sry if im noob and bad english :p
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Code:
Player Init
    Events
        Map initialization
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Integer A) Greater than or equal to 8
                    Then - Actions
                        Player Group - Add (Player((Integer A))) to [COLOR="SeaGreen"]PlayergroupWolves[/COLOR]
                    Else - Actions
                        Player Group - Add (Player((Integer A))) to [COLOR="SeaGreen"]PlayergroupSheep[/COLOR]
                Trigger - Add to Command Gold <gen> the event (Player - (Player((Integer A))) types a chat message containing -gold as A substring)

Code:
Command Gold
    Events
    Conditions
    Actions
        Set [COLOR="SeaGreen"]intTemp [/COLOR]= 0
        For each (Integer A) from 7 to (Length of (Entered chat string)), do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Substring((Entered chat string), (Integer A), (Integer A))) Equal to  
                    Then - Actions
                        Set [COLOR="SeaGreen"]intTemp [/COLOR]= (Integer A)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [COLOR="SeaGreen"]intTemp [/COLOR]Greater than [COLOR="Red"]7[/COLOR]
            Then - Actions
                Set [COLOR="SeaGreen"]intGoldSheep [/COLOR]= (Integer((Substring((Entered chat string), 7, ([COLOR="SeaGreen"]intTemp [/COLOR][COLOR="Red"]- 1)[/COLOR]))))
                Set [COLOR="SeaGreen"]intGoldWolves [/COLOR]= (Integer((Substring((Entered chat string), ([COLOR="SeaGreen"]intTemp [/COLOR][COLOR="Red"]+ 1), [/COLOR](Length of (Entered chat string))))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        [COLOR="SeaGreen"]intGoldWolves [/COLOR]Greater than 999999
                    Then - Actions
                        Set [COLOR="SeaGreen"]intGoldWolves [/COLOR]= 999999
                    Else - Actions
                Player Group - Pick every player in [COLOR="SeaGreen"]PlayergroupWolves [/COLOR]and do (Actions)
                    Loop - Actions
                        Player - Set (Picked player) Current gold to [COLOR="SeaGreen"]intGoldWolves[/COLOR]
            Else - Actions
                Set [COLOR="SeaGreen"]intGoldSheep [/COLOR]= (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [COLOR="SeaGreen"]intGoldSheep [/COLOR]Greater than 999999
            Then - Actions
                Set [COLOR="SeaGreen"]intGoldSheep [/COLOR]= 999999
            Else - Actions
        Player Group - Pick every player in [COLOR="SeaGreen"]PlayergroupSheep [/COLOR]and do (Actions)
            Loop - Actions
                Player - Set (Picked player) Current gold to [COLOR="SeaGreen"]intGoldSheep[/COLOR]
Variables used:
intGoldSheep - Integer Type
intGoldWolves - Integer Type
intTemp - Integer
PlayerGroupSheep - Player Group Type
PlayerGroupWolves - Player Group Type

Edit: Few comments about those triggers you have there...
>>(Triggering player) Equal to GameController
This condition is not really needed, players types on the format "-gold xxxxx yyyyy", computers does not say that much, at least not on this format, now do they?
>> Loop where you set "asWords[int A] = empty string"
Not needed.
>>Set sTempString = (Substring((Entered chat string), (Integer A), (Integer A)))
Just more work, then you have to check if the sTempString == " ", a blank, instead of just checking the substring right away.

Else the rest is quite strange...

But, ... Want to manage this yourself or do you want me to upload this in a map so you can just copy paste the two triggers? :)
 

Icyculyr

I'm a Mac
Reaction score
68
Wow, it's been a long time since I've posted here.

You might not understand this but I'll post it anyway just in case you do.

Create a global variable in the variable editor called Player_Units, give it an array size of 11, and give it the type Unit. Also make the variables "WolfGold" and "SheepGold" both of type Integer (not arrays).

In whatever trigger you create the wolves and sheep for the players set Player_Units[PN] = the unit (I'd need to see the code to tell you it exactly)... PN being the Player Number for the player - 1 (I.E, 0 for Player 1, 2 for Player 3, etc.).

And then in your existing code you'd replace the player group with this:
Trigger:
  • Set SheepGold = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
    • Set WolfGold = SheepGold / 2
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ~Unit Type of Player_Units[Player Number of Picked player-1] Equal To &lt;Wolf&gt;
          • Then - Actions
            • Player - Set (Picked player) Current gold to WolfGold
          • Else - Actions
            • Player - Set (Picked player) Current gold to SheepGold
 

BEeeH-

New Member
Reaction score
2
(Triggering player) Equal to GameController
This condition is not really needed, players types on the format "-gold xxxxx yyyyy", computers does not say that much, at least not on this format, now do they?
what do u mean? I think this a very important condition because this is a 12 player game, and it would be fucked up if everyone could make the game commands. ^^ correct me if im wrong, i didnt really understand what you meant:p

But, ... Want to manage this yourself or do you want me to upload this in a map so you can just copy paste the two triggers? :)
nanana i will fix this:D
 

BEeeH-

New Member
Reaction score
2
Wow, it's been a long time since I've posted here.

You might not understand this but I'll post it anyway just in case you do.

Create a global variable in the variable editor called Player_Units, give it an array size of 11, and give it the type Unit. Also make the variables "WolfGold" and "SheepGold" both of type Integer (not arrays).

In whatever trigger you create the wolves and sheep for the players set Player_Units[PN] = the unit (I'd need to see the code to tell you it exactly)... PN being the Player Number for the player - 1 (I.E, 0 for Player 1, 2 for Player 3, etc.).

And then in your existing code you'd replace the player group with this:
Trigger:
  • Set SheepGold = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
    • Set WolfGold = SheepGold / 2
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ~Unit Type of Player_Units[Player Number of Picked player-1] Equal To &lt;Wolf&gt;
          • Then - Actions
            • Player - Set (Picked player) Current gold to WolfGold
          • Else - Actions
            • Player - Set (Picked player) Current gold to SheepGold

As i understand the wolves will get the half amount of gold as the sheeps get in this trigger, or?? :p sry for double post, i dunno how to quote 2 different peoples in the same post
 

Icyculyr

I'm a Mac
Reaction score
68
As i understand the wolves will get the half amount of gold as the sheeps get in this trigger, or?? :p sry for double post, i dunno how to quote 2 different peoples in the same post
Correct, just an example though; you can pick whatever ratio you want.
 

BEeeH-

New Member
Reaction score
2
yo guys! I've almost made it work :D but it is that the gold is given before the round is started... So if you were wolf the last round, and it's time for a new round, you will get the Y amount of gold, even if you get sheep..

(-gold X Y supposed to be sheepgold and wolfgold)
 

Icyculyr

I'm a Mac
Reaction score
68
yo guys! I've almost made it work :D but it is that the gold is given before the round is started... So if you were wolf the last round, and it's time for a new round, you will get the Y amount of gold, even if you get sheep..

(-gold X Y supposed to be sheepgold and wolfgold)
Could you post your function again so we can see the whole function with the new changes?
 

BEeeH-

New Member
Reaction score
2
Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
      • Player - Player 2 (Blue) types a chat message containing -gold as A substring
      • Player - Player 3 (Teal) types a chat message containing -gold as A substring
      • Player - Player 4 (Purple) types a chat message containing -gold as A substring
      • Player - Player 5 (Yellow) types a chat message containing -gold as A substring
      • Player - Player 6 (Orange) types a chat message containing -gold as A substring
      • Player - Player 7 (Green) types a chat message containing -gold as A substring
      • Player - Player 8 (Pink) types a chat message containing -gold as A substring
      • Player - Player 9 (Gray) types a chat message containing -gold as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -gold as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -gold as A substring
      • Player - Player 12 (Brown) types a chat message containing -gold as A substring
    • Conditions
      • (Triggering player) Equal to GameController
    • Actions
      • Set TempInt1 = 0
      • For each (Integer A) from 7 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
            • Then - Actions
              • Set TempInt1 = (Integer A)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt1 Greater than 7
        • Then - Actions
          • Set intGoldSheep = (Integer((Substring((Entered chat string), 7, (TempInt1 - 1)))))
          • Set intGoldWolves = (Integer((Substring((Entered chat string), (TempInt1 + 1), (Length of (Entered chat string))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • intGoldWolves Greater than 999999
            • Then - Actions
              • Set intGoldWolves = 999999
            • Else - Actions
          • Player Group - Pick every player in WolfPlayers and do (Actions)
            • Loop - Actions
              • Player - Set (Picked player) Current gold to intGoldWolves
        • Else - Actions
          • Set intGoldSheep = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • intGoldSheep Greater than 999999
        • Then - Actions
          • Set intGoldSheep = 999999
        • Else - Actions
      • Player Group - Pick every player in SheepPlayers and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to intGoldSheep
 

Icyculyr

I'm a Mac
Reaction score
68
There is quite a bit of code you have which I don't see the need for, however, when the new round starts and the sheep / wolves are created again you need to clear the SheepGroup and WolfGroup and add them back in so you have the right ones in the group.

Let me know how it goes for you.
 

Xan_Kriegor

I can change this now in User CP.
Reaction score
12
Simple but I think efficient

I had an answer to this earlier, but I've been busy so I haven't been able write it out in GUI/at all before now. But anyway, here it is and I think it works for what you want.
Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
      • Player - Player 2 (Blue) types a chat message containing -gold as A substring
      • Player - Player 3 (Teal) types a chat message containing -gold as A substring
    • Conditions
      • (Triggering player) Equal to GameController
      • (Substring((Entered chat string), 1, 5)) Equal to -gold
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Substring((Entered chat string), 7, 13)))) Greater than 1000000
        • Then - Actions
          • Player Group - Pick every player in PlayerGroupSheep and do (Actions)
            • Loop - Actions
              • Player - Set (Picked player) Current gold to 1000000
        • Else - Actions
          • Set GoldIntSheep = (Integer((Substring((Entered chat string), 7, 13))))
          • Player Group - Pick every player in PlayerGroupSheep and do (Actions)
            • Loop - Actions
              • Player - Add GoldIntSheep to (Picked player) Current gold
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Substring((Entered chat string), 15, 21)))) Greater than 1000000
        • Then - Actions
          • Player Group - Pick every player in PlayerGroupWolf and do (Actions)
            • Loop - Actions
              • Player - Set (Picked player) Current gold to 1000000
        • Else - Actions
          • Set GoldIntWolf = (Integer((Substring((Entered chat string), 15, 21))))
          • Player Group - Pick every player in PlayerGroupWolf and do (Actions)
            • Loop - Actions
              • Player - Add GoldIntWolf to (Picked player) Current gold

As written, it'll add the integers to players' gold instead of set to, which I've seen in a few of your guys' triggers. It's fairly simple though, and does what you want. The first integer will add to sheep players' gold, and the second wolves'. The one problem with this trigger though, is that it'll bug some of your players. Due to the fact it's so simple, whenever inputting numbers for the command they have to be in the exact correct place. Even if your number you want to add doesn't fill up all 7 digits, the player will need to fill in with zeroes. For instance, if you want to add 500 gold to sheep and 50 to wolves, you'll need to type in "-gold 0000500 0000050" for it to work. If you don't care about that though, you're golden.
 

Danis[h]

New Member
Reaction score
19
That's nearly impossible seeing as if you can divide sub strings you can have an infinite amount of them and not just 2.

Why just not make 2 triggers, one for the sheep, one for the wolves?
You need what's called a delimiter. Something which can be recognized to separate the data inputs.

Takes 2 inputs of integer type, separated by a "," (comma)
Trigger:
  • gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -gold
    • Actions
      • Set i = 1
      • Set gcounter = 0
      • For each (Integer A) from 6 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • Set TmpString = (TmpString + (Substring((Entered chat string), (6 + i), (6 + i))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), (6 + i), (6 + i))) Equal to ,
            • Then - Actions
              • Set gold[gcounter] = (Integer(TmpString))
              • Set TmpString = &lt;Empty String&gt;
              • Set gcounter = 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • i Equal to (Length of (Substring((Entered chat string), 7, (Length of (Entered chat string)))))
            • Then - Actions
              • Set gold[gcounter] = (Integer(TmpString))
              • Set TmpString = &lt;Empty String&gt;
            • Else - Actions
          • Set i = (i + 1)
      • Game - Display to (All players) the text: (Gold 1: + (String(gold[0])))
      • Game - Display to (All players) the text: (Gold 2: + (String(gold[1])))


What it does:
The loop runs through the number of times of the length of the string from the actual number inputs.

Variables used:
integers: i, gcounter, gold[array]
Strings: TmpString

How it works:
The loop runs through the first if statement adding each character one by one to the temporary string, once the loop finds the character "," (comma) it converts the string to an integer value saving it to gold[0]
It adds 1 increment to gcounter, which will make it assign the value to gold[1] next time around.

The second if-statement assigns the value of TmpString again once i (which counts the number of loops) is equal to the string length, meaning when the loop has finished.

Usage:
The function can accept two number values separated by "," (comma). simply type -gold x,y where x and y are number values without decimal.

limitations:
If you put in any character other than numbers after "-gold " the method will break. You can give more inputs than 2 but there will be little point as the following inputs would overwrite gold[1]. This means it will only ever handle 2 inputs, even though it wont break from getting more than this, as long as the format of the input isn't broken.

implementation:
To give gold, replace the game message actions at the bottom of the trigger with the unit group actions, sheep and wolves respectively for gold[0] and gold[1]
You can modify the trigger to accept other limitations, just add if conditions as appropriate. :)

as opposed to the poster above me, you do not need to fill in zeroes for blank spots using this method.
 

BEeeH-

New Member
Reaction score
2
yo guys! As i said before, i've almost made it work, but it do still remain one problemo.
And the problemo is that the trigger gives the gold before the round is started. Which makes the old sheepplayers and wolfplayers get the X and Y gold. For example if youve been wolf the last round, and youre now going to get sheep. Then you will still get the Y amount of gold, because you got the gold before youve been assigned to the new team.

The wolf and sheepplayers gets assigned to their teams when the gamecontrolled writes -start.

So i made a new trigger with a variable that i though would fix the problemo, but it didnt..
Trigger:
  • Round Started
    • Events
      • Time - Elapsed game time is 0.05 seconds
    • Conditions
      • VariableGold Equal to y
    • Actions
      • Player Group - Pick every player in SheepPlayers and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to intGoldSheep
      • Player Group - Pick every player in WolfPlayers and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to intGoldWolves
      • Set VariableGold = n


And this is how the gold trigger looks like now.
Trigger:
  • Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
    • player 2 3 4...
      • Conditions
        • (Triggering player) Equal to GameController
      • Actions
        • Set VariableGold = y
        • Set TempInt1 = 0
        • For each (Integer A) from 7 to (Length of (Entered chat string)), do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
              • Then - Actions
                • Set TempInt1 = (Integer A)
              • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempInt1 Greater than 7
          • Then - Actions
            • Set intGoldSheep = (Integer((Substring((Entered chat string), 7, (TempInt1 - 1)))))
            • Set intGoldWolves = (Integer((Substring((Entered chat string), (TempInt1 + 1), (Length of (Entered chat string))))))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • intGoldWolves Greater than 999999
              • Then - Actions
                • Set intGoldWolves = 999999
              • Else - Actions
          • Else - Actions
            • Set intGoldSheep = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • intGoldSheep Greater than 999999
          • Then - Actions
            • Set intGoldSheep = 999999
          • Else - Actions


Help! :p
 
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