| 08-29-2004, 04:53 AM | #1 |
I am making a save code and I am trying to color code it based on whether its a number or a letter. However when I try to do the trigger, it not only doesn't work but it stops everything past it on the trigger from working as well! Could one of you troubleshoot it, or better yet come up with a better solution? It would be a great help, I have tried everything. Btw I KNOW it is either this trigger or a messed up variable, since when I disabled that particular action and set the showing to OutPutCode3 it works fine (just not color coded). Variables = TempC [26 arrays], one for every letter of the alphabet, which I had defined earlier. Outputcode3 [length of 64] this is the save code after encryption, it isn't arrayed at all Outputcode4, this is the save code after color coding, again its just a string variable TempInt, this is just a regular int variable (starts at either 0 or 1, im pretty sure it should be 0 but ive tried both and neither work) Code:
For each [Integer A] from 1 to 64, do [Actions]
Loop- Actions
Set TempInt = 0 (also tried setting to 1)
For each [Integer B] from 1 to 26, do [Actions]
If [All Conditions are True] then do [Then actions] else do [Else Actions]
If - Conditions
[Substring(OutPutCode3, (Integer A), (Integer A))) Equal to TempC[Integer B]]
Then - Actions
Set OutPutCode4 = [OutPutCode4 + (|cffffcc00 + ((Substring(OutPutCode3, (Integer A), (Integer A))) + |r)))
Else - Actions
Set TempInt = (TempInt + 1)
If [All Conditions are True] then do [Then actions] else do [Else Actions]
If - Conditions
TempInt Equal to 26
Then - Actions
Set OutPutCode4 = [OutPutCode4 + (Substring(OutPutCode3, (Integer A), (Integer A))))
Else - ActionsAnybody see anything wrong with this? because I sure don't. If you have a different way to do this, by all means post it because im at a stump here (spent the last 3 hours combing over it and finding nothing) |
| 08-29-2004, 05:46 AM | #2 |
hmm, well the first part looks right up until the else, i would say ur problem is in here: Code:
Set TempInt = (TempInt + 1)
If [All Conditions are True] then do [Then actions] else do [Else Actions]
If - Conditions
TempInt Equal to 26
Then - Actions
Set OutPutCode4 = [OutPutCode4 + (Substring(OutPutCode3, (Integer A), (Integer A))))
Else - ActionsWhats this 4? Code:
If - Conditions
TempInt Equal to 26
Then - Actionsright now i think whenever it sees a number in the code, it would just add temint + 1, and it would only color that text when it hits 26. Remove that condition and it should work. but i may b wrong, its ezer 2 look at a trigger u made rather then 1 some1 else made. |
| 08-29-2004, 02:11 PM | #3 |
The point of temp int is to make sure that it doesn't add the letter every single time. what it does in the second loop is that it goes through the secondary loop 26 times, checking if the symbol in question is equal to the letters in temp c. if I didn't have a condition to stop it from adding it every time it loops, it would add it 25-26 (depending if it was a letter or number) times to the string for every single symbol in the loop, so I would end up with a code that is around 500 characters long. Basically the point of temp it is that if it isn't that particular number then it would add one to the integer.... and I think I just figured out my problem (i forgot to reset the tempint after every loop) ^_^ . lol strange how revelations can come to you like that. EDIT: *sigh* although im sure it contributed to the fixing it didn't work... |
| 08-29-2004, 04:00 PM | #4 |
hmm, well this is how i would do the trigger: Code:
set string = abcdefghijklmnopqrstuvwxyz0123456789 for each integer a from 1-string length of CHARACTERLength(this is integer of how many arrays are in side character) for each integer b from 1-26 if character[integer a] = string(integer b, integer b) set finalcode = finalcode + |cffffcc00 + string(integer b, integer b) + |r else for each integer b from 27-36 if character[integer a] = string(integer b, integer b) set finalcode = finalcode + |cff00ccff + string(integer b, integer b) + |r That way it just checks to c if each slot and compares it to a string containing every number and letter, then if it = that letter then it would just put that onto the code. try that. and for testing purposes, make it do game display text message each time it adds something onto it 2 c what exactally its adding on and when. |
