HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Save/Load code debugging help

11-23-2004, 04:51 AM#1
aots_assasin
Ok i can't figure it out but i think its not getting the length of the player name. i do plan to open source once i am done.
Code:
encode
    Events
        Player - Player 1 (Red) types a chat message containing -save as An exact match
    Conditions
    Actions
        -------- Player comparison method Modify to support more then player 1 --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 1 (Red)
            Then - Actions
                Set Loader = Player Group - Player 1 (Red)
            Else - Actions
        -------- End player comparison method --------
        Set encryptmethod = (Random integer number between 1 and 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                encryptmethod Equal to 1
            Then - Actions
                -------- One method of getting 2 letters from a name --------
                Set Namelength = (Integer((Name of (Triggering player))))
                Game - Display to Loader for 30.00 seconds the text: (String(Namelength))
                Set letter1 = (Namelength mod 5)
                Set letter1 = ((Namelength - letter1) / 5)
                Game - Display to Loader for 30.00 seconds the text: (String(letter1))
                Set letter2 = (Namelength mod 2)
                Set letter2 = ((Namelength - letter1) / 2)
                Game - Display to Loader for 30.00 seconds the text: (String(letter2))
                Set letterstring = (Substring((Name of (Triggering player)), letter1, letter1))
                Game - Display to Loader for 30.00 seconds the text: letterstring
                For each (Integer B) from 0 to Validcharacter, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                letterstring Equal to Rot[(Integer B)]
                            Then - Actions
                                Set letter1 = (Integer B)
                                Game - Display to Loader the text: Error with letter 1
                            Else - Actions
                                Do nothing
                Set letterstring = (Substring((Name of (Triggering player)), letter2, letter2))
                For each (Integer B) from 1 to Validcharacter, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                letterstring Equal to Rot[(Integer B)]
                            Then - Actions
                                Set letter2 = (Integer B)
                                Game - Display to Loader the text: Error with letter 2
                            Else - Actions
                                Do nothing
                -------- String decoder for this method --------
                Set Realletter1 = rotletterarray[letter1]
                Set Realletter2 = rotletterarray[letter2]
                Set letter1 = (Namelength mod 5)
                Set letter1 = ((Namelength - letter1) / 5)
                Set letter2 = (Namelength mod 2)
                Set letter2 = ((Namelength - letter1) / 2)
                For each (Integer B) from 1 to 13, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (String(letter1)) Equal to HexCode[(Integer B)]
                            Then - Actions
                                Set letterposition1 = HexCode[(Integer B)]
                            Else - Actions
                                Do nothing
                For each (Integer B) from 1 to 13, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (String(letter2)) Equal to HexCode[(Integer B)]
                            Then - Actions
                                Set letterposition2 = HexCode[(Integer B)]
                            Else - Actions
                                Do nothing
                -------- Produces --------
                Set Finalstring = ((Realletter1 + (String(encryptmethod))) + Realletter2)
                Set Finalstring = ((letterposition1 + Finalstring) + letterposition2)
            Else - Actions
        Game - Display to Loader the text: (Your code is  + Finalstring)

its losely based on ROT-13 encoding
11-23-2004, 10:12 AM#2
Guest
Quote:
Originally Posted by aots_assasin
Ok i can't figure it out but i think its not getting the length of the player name. i do plan to open source once i am done.
Code:
encode
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Conditions
Actions
-------- Player comparison method Modify to support more then player 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to Player 1 (Red)
Then - Actions
Set Loader = Player Group - Player 1 (Red)
Else - Actions
-------- End player comparison method --------
Set encryptmethod = (Random integer number between 1 and 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
encryptmethod Equal to 1
Then - Actions
-------- One method of getting 2 letters from a name --------
[color=red]Set Namelength = (Integer((Name of (Triggering player))))[/color]
Game - Display to Loader for 30.00 seconds the text: (String(Namelength))
Set letter1 = (Namelength mod 5)
Set letter1 = ((Namelength - letter1) / 5)
Game - Display to Loader for 30.00 seconds the text: (String(letter1))
Set letter2 = (Namelength mod 2)
Set letter2 = ((Namelength - letter1) / 2)

I haven't read more. You should use "Set Namelenght = (Lenght of (Name of (Triggering player)))".

Salutions®
11-23-2004, 03:09 PM#3
aots_assasin
ooops thanks.