I have been working on this for awhile now and have come into abit of a snag and can't figure out why this isn't working. I am sure it is easy to fix but I am not sure.
Anyway, I am just using the simplest way I could think of, two triggers, Save and Load. I just +10 to a variable and +20 to the other and -10 from the first part of the substring and -20 from the second part of the substring, but for some strange reason it doesn't work out the way it should.
Here is the code:
Save
Load
Thanks and +rep if I can remember how...
Anyway, I am just using the simplest way I could think of, two triggers, Save and Load. I just +10 to a variable and +20 to the other and -10 from the first part of the substring and -20 from the second part of the substring, but for some strange reason it doesn't work out the way it should.
Here is the code:
Save
Code:
Save
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current lumber) Greater than 0
Then - Actions
Set SaveHonor = ((((Triggering player) Current lumber) + 20) + 0)
Else - Actions
Do nothing
Set SaveRank = ((Rank[(Player number of (Triggering player))] + 10) + 0)
Cinematic - Clear the screen of text messages for (Player group((Triggering player)))
Game - Display to (Player group((Triggering player))) for 120.00 seconds the text: (|cffffcc00Code: |r + ((String(SaveRank)) + (- + (String(SaveHonor)))))
Load
Code:
Load
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current lumber) Greater than 0
Then - Actions
Set Honor[(Player number of (Triggering player))] = (((Integer((Substring((Entered chat string), 12, (Length of (Entered chat string)))))) - 20) - 0)
Player - Set (Triggering player) Current lumber to Rank[(Player number of (Triggering player))]
Else - Actions
Do nothing
Set Rank[(Player number of (Triggering player))] = (((Integer((Substring((Entered chat string), 7, 10)))) - 10) - 0)
Player - Set (Triggering player) Current lumber to Honor[(Player number of (Triggering player))]
Cinematic - Clear the screen of text messages for (Player group((Triggering player)))
Game - Display to (Player group((Triggering player))) for 15.00 seconds the text: (|cffffcc00Announcement: |r + Your code has been accepted.)