Working on save/load

Nestharus

o-o
Reaction score
84
Ok, so I'm working on a save/load code

Hopefully, this save/load code will be impossible or near impossible to crack : )

1:
It will different bases that it will choose randomly

2:
It will have different orders that it will convert everything, thus your gold will not always be in the same place. It could be anywhere in the code

3:
Color coding of course

4:
dashes

5:
Be able to save strings and Integers :)

6:
I might also put in a password system, heh... for more security you know, like load the code, then type in the password ^)^

I'll get back with you guys later and i might end up asking for help about it

: D
 

SFilip

Gone but not forgotten
Reaction score
634
Instead of messing with a password can't you simply make it depend on the person's nickname?
 

substance

New Member
Reaction score
34
Instead of messing with a password can't you simply make it depend on the person's nickname?

name spoofer?

Anyway, I guess if your goal is to be 'uncrackable' all of the extra stuff (password etc.) isnt bad. But its a bit excessive IMO =p
 

Nestharus

o-o
Reaction score
84
System Under Work:
Auto Pool Maxer
Let's say you have a sequence with 7 different characters in it. You want to make a nice pool of 49 (your max for the 7), but you don't want to type out all the different combinations. Well, I'm developing something that'll auto max for you. All you have to do is change a variable saves to how many pieces of information you are saving and it'll auto max it for ya : D
With this system, you can only save up to 90 pieces of different information.
What information is in this system is a storage group. You can have a storage group be the player's level, another one be the player's gold, another one be the player's lumber, and another one be all the player's items + their charges. You can group whatever you want together or split it all up. The more groups you have, the more security your code will have. This will not increase your code length. Maybe 1 character, maybe***

This can also be used with Alphabet bases

I'll post more specs when I get this up and running, but I'll tell you what, it's a little tricky, heh, especially keeping it 100% user friendly.

Ok, so I've been working heavily on it ^)^

What I ended up doing was looking at AceHart's system as its genius. I just modified some of the JASS to meet my own needs, but overall, the JASS is the same. I increased encryption for example.

Now, I decided to get rid of the password features, but here's what I got for 3 extra characters atm and 56 different combinations

#1:
Random Alphabet Base from a pool of 8 different alphabets. Each alphabet has 74 Characters

#2:
Random Sequencer so your code stores information at random points in the code. For example, sometimes the gold might be stored first, it might be stored last, it can be stored anywhere. I have a pool of 7
7*8 = 56, there's where I get my number of combos

#3:
Set Alphabet Base to encrypt the random sequencer and random alphabet base so people can't see it : P

After all of that, I encode the rest of the code with the random alphabet base
^)^

Ok, now the problem is the decryption's a bit screwy and I'm not sure what's going on. I'm going to fully learn how Acehart's system works with the math and on once I really get to looking at it, but it should work, heh ^)^

Now, the GUI parts from his system are still in GUI. I'll convert/optimize and coolify when I get the initial framework up. I'm not comfortable with JASS functions yet, so it takes me long in JASS than GUI atm. How I program right now is I make it in GUI, then I convert to JASS and coolify : D, lolz.

Ok, so the save works very well so from from what I see. Yea, I have a lot of global variables atm that could be local variables, but oh well, screw it, haha.

: P

I'm just trying to get it to work.
http://www.thehelper.net/forums/showthread.php?t=49392
that's the thread with Acehart's cool save/load system that I'm going to be heavily modding out ^)^
Ok, here's the background system:
JASS:

function SaveLoad_InitialSetup takes nothing returns nothing
    local integer i = 0
    local integer j = 0

    loop
        set udg_SaveLoad_Compress[i + 48] = j
        set udg_SaveLoad_Uncompress<i> = i + 48
        set j = j + 1
        set i = i + 1
        exitwhen i &gt;= 10
    endloop
    set i = 0
    loop
        set udg_SaveLoad_Compress[i + 97] = j
        set udg_SaveLoad_Compress[i + 65] = j + 26
        set udg_SaveLoad_Uncompress[i + 10] = i + 97
        set udg_SaveLoad_Uncompress[i + 26 + 10] = i + 65
        set j = j + 1
        set i = i + 1
        exitwhen i &gt;= 26
    endloop
endfunction

function SaveLoad_Id2CId takes integer n returns integer
    local integer i = n / (256 * 256 * 256)
    local integer r
    set n = n - i * (256 * 256 * 256)
    set r = udg_SaveLoad_Compress<i>
    set i = n / (256 * 256)
    set n = n - i * (256 * 256)
    set r = r * 64 + udg_SaveLoad_Compress<i>
    set i = n / 256
    set r = r * 64 + udg_SaveLoad_Compress<i>
    return r * 64 + udg_SaveLoad_Compress[n - i * 256]
endfunction

function SaveLoad_CId2Id takes integer n returns integer
    local integer i = n / (64 * 64 * 64)
    local integer r
    set n = n - i * (64 * 64 * 64)
    set r = udg_SaveLoad_Uncompress<i>
    set i = n / (64 * 64)
    set n = n - i * (64 * 64)
    set r = r * 256 + udg_SaveLoad_Uncompress<i>
    set i = n / 64
    set r = r * 256 + udg_SaveLoad_Uncompress<i>
    return r * 256 + udg_SaveLoad_Uncompress[n - i * 64]
endfunction

function SaveLoad_Unit2Integer takes unit u returns integer
    local integer i = 0
    local integer n = GetUnitTypeId(u)
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    loop
        set i = i + 1
        exitwhen i &gt; udg_SaveLoad_Heroes_LastIndex
        if udg_SaveLoad_Heroes<i> == n then
            return i
        endif
    endloop
    return SaveLoad_Id2CId(n)
endfunction
function SaveLoad_Integer2Unit takes integer i returns integer
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    if i &lt;= udg_SaveLoad_Heroes_LastIndex then
        return udg_SaveLoad_Heroes<i>
    endif
    return SaveLoad_CId2Id(i)
endfunction

function SaveLoad_Item2Integer takes item t returns integer
    local integer i = 0
    local integer n = GetItemTypeId(t)
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    loop
        set i = i + 1
        exitwhen i &gt; udg_SaveLoad_Items_LastIndex
        if udg_SaveLoad_Items<i> == n then
            return i
        endif
    endloop
    return SaveLoad_Id2CId(n)
endfunction
function SaveLoad_Integer2Item takes integer i returns integer
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    if i &lt;= udg_SaveLoad_Items_LastIndex then
        return udg_SaveLoad_Items<i>
    endif
    return SaveLoad_CId2Id(i)
endfunction

function SaveLoad_Ability2Integer takes integer a returns integer
    local integer i = 0
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    loop
        set i = i + 1
        exitwhen i &gt; udg_SaveLoad_Abilities_LastIndex
        if udg_SaveLoad_Abilities<i> == a then
            return i
        endif
    endloop
    return SaveLoad_Id2CId(a)
endfunction
function SaveLoad_Integer2Ability takes integer i returns integer
    if udg_SaveLoad_Initialized == false then
        set udg_SaveLoad_Initialized = true
        call SaveLoad_InitialSetup()
    endif
    if i &lt;= udg_SaveLoad_Abilities_LastIndex then
        return udg_SaveLoad_Abilities<i>
    endif
    return SaveLoad_CId2Id(i)
endfunction

function SaveLoad_Color takes string s returns string
    local integer i = StringLength(s)
    local string c
    local string r = &quot;&quot;

    loop
        set i = i - 1
        set c = SubString(s,i,i + 1)
        if c == &quot;0&quot; or c == &quot;1&quot; or c == &quot;2&quot; or c == &quot;3&quot; or c == &quot;4&quot; or c == &quot;5&quot; or c == &quot;6&quot; or c == &quot;7&quot; or c == &quot;8&quot; or c == &quot;9&quot; then
            set r = &quot;|cffffcc00&quot; + c + &quot;|r&quot; + r
        elseif c == &quot;-&quot; then
            set r = &quot;|cffdddddd-|r&quot; + r
        elseif c == &quot;a&quot; or c == &quot;b&quot; or c == &quot;c&quot; or c == &quot;d&quot; or c == &quot;e&quot; or c == &quot;f&quot; or c == &quot;g&quot; or c == &quot;h&quot; or c == &quot;i&quot; or c == &quot;j&quot; or c == &quot;k&quot; or c == &quot;l&quot; or c == &quot;m&quot; or c == &quot;n&quot; or c == &quot;o&quot; or c == &quot;p&quot; or c == &quot;q&quot; or c == &quot;r&quot; or c == &quot;s&quot; or c == &quot;t&quot; or c == &quot;u&quot; or c == &quot;v&quot; or c == &quot;w&quot; or c == &quot;x&quot; or c == &quot;y&quot; or c == &quot;z&quot; then
            set r = &quot;|CFF20C000&quot; + c + &quot;|r&quot; + r
        elseif c == &quot;@&quot; or c == &quot;#&quot; or c == &quot;$&quot; or c == &quot;%&quot; or c == &quot;&amp;&quot; or c == &quot;&lt;&quot; or c == &quot;&gt;&quot; or c == &quot;?&quot; or c == &quot;=&quot; or c == &quot;+&quot; or c == &quot;/&quot; or c == &quot;~&quot; then
            set r = &quot;|CFFFF0303&quot; + c + &quot;|r&quot; + r
        else
            set r = c + r
        endif
        exitwhen i &lt;= 0
    endloop
    return r
endfunction

function SaveLoad_EncodeChar takes string n returns integer
    local integer i = 0
    local string s1 = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
    local string s2 = &quot;abcdefghijklmnopqrstuvwxyz&quot;
    local string s3 = &quot;0123456789&quot;
    local string s4 = &quot;!@#$^&amp;*()_+={}[]|:;&#039;,&lt;&gt;.?~`/&quot;
    loop
        if SubString(s1,i,i + 1) == n then
            return i
        endif
        set i = i + 1
        exitwhen i &gt;= 26
    endloop
    loop
        if SubString(s2,i,i + 1) == n then
            return i
        endif
        set i = i + 1
        exitwhen i &gt;= 26
    endloop
    loop
        if SubString(s3,i,i + 1) == n then
            return i
        endif
        set i = i + 1
        exitwhen i &gt;= 10
    endloop
    loop
        if SubString(s4,i,i + 1) == n then
            return i
        endif
        set i = i + 1
        exitwhen i &gt;= 28
    endloop
    return 0
endfunction

function SaveLoad_EncodeVerify takes string buffer returns integer
    local integer i = 0
    local integer j = 0
    local string name = GetPlayerName(GetTriggerPlayer())
    if udg_SaveLoad_UsePlayername == true then
        loop
            set j = j + SaveLoad_EncodeChar(SubString(name,i,i + 1))
            set i = i + 1
            exitwhen i &gt;= StringLength(name)
        endloop
    endif
    set i = 0
    loop
        set j = j + SaveLoad_EncodeChar(SubString(buffer,i,i + 1))
        set i = i + 1
        exitwhen i &gt;= StringLength(buffer)
    endloop
    return j
endfunction

function SaveLoad_EncodeValues takes nothing returns string
    local integer i
    local integer j
    local integer k
    local integer l
    local integer m
    local integer CodeLength = StringLength(udg_Alphabet[udg_base])
    local integer array a
    local string buffer = &quot;&quot;
    local string c = &quot;&quot;
    local integer skip = 0
    local integer CONST = 1000000
    local string abc = &quot;0123456789&quot;
    set i = 0
    loop
        set i = i + 1
        exitwhen i &gt; udg_SaveCount
        set buffer = buffer + I2S(udg_Save<i>) + &quot;-&quot;
    endloop
    set buffer = buffer + I2S(SaveLoad_EncodeVerify(buffer))
    if udg_Save[1] == 0 then
        set buffer = &quot;-&quot; + buffer
    endif

    set i = 0
    loop
        set a<i> = 0
        set i = i + 1
        exitwhen i &gt;= 100
    endloop

    set m = 0
    set i = 0
    loop
        set j = 0
        loop
            set a[j] = a[j] * 11
            set j = j + 1
            exitwhen j &gt; m
        endloop

        set l = 0
        set c = SubString(buffer,i,i + 1)
        loop
            exitwhen SubString(abc,l,l + 1) == c
            set l = l + 1
            exitwhen l &gt; 9
        endloop
        set a[0] = a[0] + l

        set j = 0
        loop
            set k = a[j] / CONST
            set a[j] = a[j] - k * CONST
            set a[j + 1] = a[j + 1] + k
            set j = j + 1
            exitwhen j &gt; m
        endloop
        if k &gt; 0 then
            set m = m + 1
        endif
        set i = i + 1
        exitwhen i &gt;= StringLength(buffer)
    endloop

    set buffer = &quot;&quot;
    loop
        exitwhen m &lt; 0
        set j = m
        loop
            exitwhen j &lt;= 0
            set k = a[j] / CodeLength
            set a[j - 1] = a[j - 1] + (a[j] - k * CodeLength) * CONST
            set a[j] = k
            set j = j - 1
        endloop
        set k = a[j] / CodeLength
        set i = a[j] - k * CodeLength
        set buffer = buffer + SubString(udg_Alphabet[udg_base],i,i + 1)
        set a[j] = k
        if a[m] == 0 then
            set m = m - 1
        endif
    endloop

    set i = StringLength(buffer)
    set skip = 0
    set c = &quot;&quot;
    loop
        set i = i - 1
        set c = c + SubString(buffer,i,i + 1)
        set skip = skip + 1
        if skip == 4 and i &gt; 0 then
            set c = c + &quot;-&quot;
            set skip = 0
        endif
        exitwhen i &lt;= 0
    endloop
    return c
endfunction

function SaveLoad_DecodeValues takes string s returns boolean
    local integer i
    local integer j
    local integer k
    local integer l
    local integer SaveCode = 0
    local integer m
    local integer array a
    local string buffer = &quot;&quot;
    local integer CodeLength = StringLength(udg_Alphabet[udg_base])
    local integer skip = -1
    local integer CONST = 1000000
    local string abc = &quot;0123456789-&quot;
    local string c

    set i = 0
    loop
        set a<i> = 0
        set i = i + 1
        exitwhen i &gt;= 100
    endloop

    set m = 0

    set i = 0
    loop
        set j = 0
        loop
            set a[j] = a[j] * CodeLength
            set j = j + 1
            exitwhen j &gt; m
        endloop

        set skip = skip + 1
        if skip == 4 then
            set skip = 0
            set i = i + 1
        endif

        set l = CodeLength
        set c = SubString(s,i,i + 1)
        loop
            set l = l - 1
            exitwhen l &lt; 1
            exitwhen SubString(udg_Alphabet[udg_base],l,l + 1) == c
        endloop
        set a[0] = a[0] + l

        set j = 0
        loop
            set k = a[j] / CONST
            set a[j] = a[j] - k * CONST
            set a[j + 1] = a[j + 1] + k
            set j = j + 1
            exitwhen j &gt; m
        endloop
        if k &gt; 0 then
            set m = m + 1
        endif
        set i = i + 1
        exitwhen i &gt;= StringLength(s)
    endloop

    loop
        exitwhen m &lt; 0
        set j = m
        loop
            exitwhen j &lt;= 0
            set k = a[j] / 11
            set a[j - 1] = a[j - 1] + (a[j] - k * 11) * CONST
            set a[j] = k
            set j = j - 1
        endloop
        set k = a[j] / 11
        set i = a[j] - k * 11
        set buffer = SubString(abc,i,i + 1) + buffer
        set a[j] = k
        if a[m] == 0 then
            set m = m - 1
        endif
    endloop

    set i = 0
    set j = 0
    loop
        loop
            exitwhen i &gt;= StringLength(buffer)
            exitwhen i &gt; 0 and SubString(buffer,i,i + 1) == &quot;-&quot; and SubString(buffer,i - 1,i) != &quot;-&quot;
            set i = i + 1
        endloop
        if i &lt; StringLength(buffer) then
            set k = i
        endif
        set SaveCode = SaveCode + 1
        set udg_Save[SaveCode] = S2I(SubString(buffer,j,i))
        set j = i + 1
        set i = i + 1
        exitwhen i &gt;= StringLength(buffer)
    endloop

    set j = SaveLoad_EncodeVerify(SubString(buffer,0,k))
    set udg_SaveCount = SaveCode - 1
    if j == udg_Save[SaveCode] then
        return true
    else
        return false
    endif
endfunction

function SaveLoad_Encode takes nothing returns string
    if udg_SaveLoad_CaseSensitive == false then
        set udg_Alphabet[udg_base] = StringCase(udg_Alphabet[udg_base],true)
    endif
    return SaveLoad_Color(SaveLoad_EncodeValues())
endfunction

function SaveLoad_Decode takes string s returns boolean
    if udg_SaveLoad_CaseSensitive == false then
        set udg_Alphabet[udg_base] = StringCase(udg_Alphabet[udg_base],true)
        set s = StringCase(s,true)
    endif
    if SaveLoad_DecodeValues(s) then
        call DisplayTextToPlayer(GetTriggerPlayer(),0,0,&quot;Decoding sucessful&quot;)
        return true
    endif
    call DisplayTextToPlayer(GetTriggerPlayer(),0,0,&quot;Decoding failed&quot;)
    return false
endfunction
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


That's your encoding, compressions, decoding, and so forth. It also sets up an encryption process and color codes the code. As you can see, so far I've only changed around the color coding and encryption process ^)^

Ok, next, this is GUI so heh

Map Setup
Code:
Events
    Map initialization
Conditions
Actions
    Set PlayerUnit[1] = Blood Mage 0001 <gen>
    Player Group - Pick every player in (All players) and do (Actions)
        Loop - Actions
            Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
            Trigger - Add to Save <gen> the event (Player - (Picked player) types a chat message containing -save as An exact match)
            Trigger - Add to Decrypt <gen> the event (Player - (Picked player) types a chat message containing -load  as An exact match)
Trigger - Run Save Setup <gen> (checking conditions)

I just set PlayerUnit initially. Btw, in all of the GUI code, there are mem leaks atm. Don't worry, I'll be taking them out. That Player Unit variable will work in the player group at one point, but I just want it to all be working first ^)^

Save Setup
Code:
Events
Conditions
Actions
    -------- List of Heroes --------
    Set SaveLoad_Heroes[1] = Paladin
    Set SaveLoad_Heroes[2] = Archmage
    Set SaveLoad_Heroes[3] = Mountain King
    Set SaveLoad_Heroes[4] = Blood Mage
    -------- Number of Heroes --------
    Set SaveLoad_Heroes_LastIndex = 4
    -------- List of Items --------
    Set SaveLoad_Items[1] = Claws of Attack +15
    Set SaveLoad_Items[2] = Cheese
    Set SaveLoad_Items[3] = Wand of Lightning Shield
    Set SaveLoad_Items[4] = Magic Key Chain
    -------- Number of Items --------
    Set SaveLoad_Items_LastIndex = 4
    -------- List of Abilities --------
    Set SaveLoad_Abilities[1] = Banish
    Set SaveLoad_Abilities[2] = Flame Strike
    Set SaveLoad_Abilities[3] = Phoenix
    Set SaveLoad_Abilities[4] = Siphon Mana
    -------- Number of Abilities --------
    Set SaveLoad_Abilities_LastIndex = 4
    -------- Encryption ^)^ --------
    Set Alphabet[1] = abcjkl$%&mwxyNOPQRSzABCDM456TUVWnopqrstuvXYZ012EFGHIJKL3789@#<>?defghi=+~\
    Set Alphabet[2] = @%fx1B&<0C>?=+~\abc#$deyzDAEvwF6789Gghijklm2345nopqrstuHIJKLMNOPQRSTUVWXYZ
    Set Alphabet[3] = $%&=+~\a<>?ghiCDjkl01ef2634mOPQnKopqzbcd57uvy89BA@#ErstFGXHIJLMNRwxSTUVWYZ
    Set Alphabet[4] = U+~\Ya<?4ghDjkl0EtFr5pf3=mOeoQT>1iCqZPzbc%d7uvyW89nV2KB$&A@#s6GXHIJLMNRwxS
    Set Alphabet[5] = eMDjkl\0Etbc%7uvy2KB$U+hr5pf3=m1iC4g&A@#s6~GXHOYa<?NFqZPzRwoQT>dIJLW89nVxS
    Set Alphabet[6] = RwoQT>5pf3=mA@#s6~1iC4g&GXHOYac%7uvy2<?NFqZetbKB$U+hrPzdIJLW89nVxSMDjkl\0E
    Set Alphabet[8] = =T>#5mAp@sCy?42\0EgoQHVxS6~1Gvw<U+%NbKFtWBR7f3XOuDjkqZeYac$hrPzdIJL89nliM&
    Set basemax = 8
    -------- Sequencing --------
    Set Sequencer[1] = 1234567
    Set Sequencer[2] = 7123456
    Set Sequencer[3] = 6712345
    Set Sequencer[4] = 3425671
    Set Sequencer[5] = 5367142
    Set Sequencer[6] = 2534671
    Set Sequencer[7] = 4625713
    Set SequencerMax = 7
    Set SaveLoad_CaseSensitive = True
    Set SaveLoad_UsePlayername = True
    -------- Required: false --------
    Set SaveLoad_Initialized = False
    -------- Leave as is. Used to autocreate variables when copy & pasting to a new map --------
    Set Code = AceHart
    Set Save[1] = 0
    Set SaveCount = 1
    Set Validate = False
    Set SaveLoad_Compress[1] = 0
    Set SaveLoad_Uncompress[1] = 0

Ok, you can see my sequencer and alphabet thingie up there. I also set up max variables so they are quick and easy to increase. : D

Save
Code:
Events
Conditions
Actions
    Set Player = (Player number of (Triggering player))
    -------- Prepare the save array with this player's Hero --------
    Set SaveLoad_UsePlayername = False
    Set SaveCount = 1
    Set base = (Random integer number between 1 and basemax)
    Set base2 = base
    Set Save[SaveCount] = base
    Set base = basemax
    Set SaveCount = (SaveCount + 1)
    Set s = (Random integer number between 1 and SequencerMax)
    Set Save[SaveCount] = s
    Custom script:   set udg_Code = SaveLoad_Encode() + "-"
    Set SaveLoad_UsePlayername = True
    Set SaveCount = 0
    -------- Storing Stuff Into Code ^)^ --------
    For each (Integer base) from 1 to 7, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Substring(Sequencer[s], base, base)) Equal to 1
                Then - Actions
                    -------- Gold --------
                    Set SaveCount = (SaveCount + 1)
                    Set Save[SaveCount] = ((Triggering player) Current gold)
                Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            (Substring(Sequencer[s], base, base)) Equal to 2
                        Then - Actions
                            -------- Lumber --------
                            Set SaveCount = (SaveCount + 1)
                            Set Save[SaveCount] = ((Triggering player) Current lumber)
                        Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                If - Conditions
                                    (Substring(Sequencer[s], base, base)) Equal to 3
                                Then - Actions
                                    -------- Save the Hero --------
                                    Set SaveCount = (SaveCount + 1)
                                    Set TempUnit = PlayerUnit[Player]
                                    Custom script:   set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
                                Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        If - Conditions
                                            (Substring(Sequencer[s], base, base)) Equal to 4
                                        Then - Actions
                                            -------- Hero level --------
                                            Set SaveCount = (SaveCount + 1)
                                            Set Save[SaveCount] = (Hero level of TempUnit)
                                        Else - Actions
                                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                If - Conditions
                                                    (Substring(Sequencer[s], base, base)) Equal to 5
                                                Then - Actions
                                                    -------- Add all items --------
                                                    Set SaveCount = (SaveCount + 1)
                                                    Set Save[SaveCount] = (Number of items carried by TempUnit)
                                                Else - Actions
                                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        If - Conditions
                                                        Then - Actions
                                                            For each (Integer A) from 1 to 6, do (Actions)
                                                                Loop - Actions
                                                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                        If - Conditions
                                                                            ((Item carried by TempUnit in slot (Integer A)) is owned) Equal to True
                                                                        Then - Actions
                                                                            -------- The actual item --------
                                                                            Set SaveCount = (SaveCount + 1)
                                                                            Set TempItem = (Item carried by TempUnit in slot (Integer A))
                                                                            Custom script:   set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
                                                                            -------- The number of charges it has --------
                                                                            Set SaveCount = (SaveCount + 1)
                                                                            Set Save[SaveCount] = (Charges remaining in (Item carried by TempUnit in slot (Integer A)))
                                                                        Else - Actions
                                                        Else - Actions
                                                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                If - Conditions
                                                                    (Substring(Sequencer[s], base, base)) Equal to 7
                                                                Then - Actions
                                                                    -------- Add all abilities --------
                                                                    For each (Integer A) from 1 to SaveLoad_Abilities_LastIndex, do (Actions)
                                                                        Loop - Actions
                                                                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                If - Conditions
                                                                                    (Level of SaveLoad_Abilities[(Integer A)] for TempUnit) Greater than 0
                                                                                Then - Actions
                                                                                    -------- The actual ability --------
                                                                                    Set SaveCount = (SaveCount + 1)
                                                                                    Set Save[SaveCount] = (Integer A)
                                                                                    -------- Its level --------
                                                                                    Set SaveCount = (SaveCount + 1)
                                                                                    Set Save[SaveCount] = (Level of SaveLoad_Abilities[(Integer A)] for TempUnit)
                                                                                Else - Actions
                                                                Else - Actions
    -------- Turn values into code --------
    Set base = base2
    Custom script:   set udg_Code = udg_Code + SaveLoad_Encode()
    -------- Show code to player --------
    Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
    Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code

Ok, how this works:
First set savecount to 1
Turn off the player name check ^)^

get random base, set a temporary variable base 2 to that random base as base changes later on. Then get the random sequence. Store both into the save code. Set base to the basemax (lol), encrypt those 2 and put a - at the end. After that, store the rest of the code, set base to our temp var base2, encrypt it all : D.

It works like a charm. You can see how the sequencer works too. Any piece of that code can be anywhere in the code. It's quite cool. The decryption works the same way as you'll see ^)^

Decryption
Code:
Events
Conditions
    (Substring((Entered chat string), 1, 6)) Equal to -load 
    (Length of (Entered chat string)) Greater than 6
Actions
    -------- Try to decode what was typed --------
    Set SaveCount = 1
    Set SaveLoad_UsePlayername = False
    Set base = basemax
    Set length = 1
    Set bool = False
    For each (Integer A) from 2 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
                    bool Equal to False
                Then - Actions
                    Set length = (length + 1)
                Else - 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 -
                    bool Equal to False
                Then - Actions
                    Set bool = True
                Else - Actions
    Set Code = (Substring((Entered chat string), 7, length))
    Custom script:   set udg_Validate = SaveLoad_Decode( udg_Code )
    Set base = Save[SaveCount]
    Set SaveCount = (SaveCount + 1)
    Set s = Save[SaveCount]
    Set SaveLoad_UsePlayername = True
    Set Code = (Substring((Entered chat string), (length + 1), (Length of (Entered chat string))))
    Custom script:   set udg_Validate = SaveLoad_Decode( udg_Code )
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            Validate Equal to False
        Then - Actions
            -------- Invalid code --------
            Game - Display to (Player group((Triggering player))) for 120.00 seconds the text: There's some error ...
        Else - Actions
            -------- It worked, let's do something with it --------
            Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                Loop - Actions
                    Unit - Remove (Picked unit) from the game
            Set SaveCount = 1
            Set TempInteger = SaveCount
            For each (Integer base) from 1 to 7, do (Actions)
                Loop - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            (Substring(Sequencer[s], base, base)) Equal to 1
                        Then - Actions
                            Player - Set (Triggering player) Current gold to Save[SaveCount]
                            Set SaveCount = (SaveCount + 1)
                        Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                If - Conditions
                                    (Substring(Sequencer[s], base, base)) Equal to 2
                                Then - Actions
                                    Player - Set (Triggering player) Current lumber to Save[SaveCount]
                                    Set SaveCount = (SaveCount + 1)
                                Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        If - Conditions
                                            (Substring(Sequencer[s], base, base)) Equal to 3
                                        Then - Actions
                                            Custom script:   set udg_TempUnitType = SaveLoad_Integer2Unit(udg_Save[udg_SaveCount])
                                            Unit - Create 1 TempUnitType for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                            Set SaveCount = (SaveCount + 1)
                                        Else - Actions
                                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                If - Conditions
                                                    (Substring(Sequencer[s], base, base)) Equal to 4
                                                Then - Actions
                                                    Hero - Set (Last created unit) Hero-level to Save[SaveCount], Hide level-up graphics
                                                    Set SaveCount = (SaveCount + 1)
                                                Else - Actions
                                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        If - Conditions
                                                            (Substring(Sequencer[s], base, base)) Equal to 5
                                                        Then - Actions
                                                            Set items = Save[SaveCount]
                                                        Else - Actions
                                                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                If - Conditions
                                                                    (Substring(Sequencer[s], base, base)) Equal to 6
                                                                Then - Actions
                                                                    For each (Integer A) from 1 to items, do (Actions)
                                                                        Loop - Actions
                                                                            Set SaveCount = (SaveCount + 1)
                                                                            Custom script:   set udg_TempItemType = SaveLoad_Integer2Item(udg_Save[udg_SaveCount])
                                                                            Hero - Create TempItemType and give it to (Last created unit)
                                                                            Set SaveCount = (SaveCount + 1)
                                                                            Item - Set charges remaining in (Last created item) to Save[SaveCount]
                                                                Else - Actions
                                                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                        If - Conditions
                                                                            (Substring(Sequencer[s], base, base)) Equal to 7
                                                                        Then - Actions
                                                                            For each (Integer SaveCount) from (SaveCount + 1) to TempInteger, do (Actions)
                                                                                Loop - Actions
                                                                                    For each (Integer A) from 1 to Save[(SaveCount + 1)], do (Actions)
                                                                                        Loop - Actions
                                                                                            Custom script:   call SelectHeroSkill( GetLastCreatedUnit(), udg_SaveLoad_Abilities[ udg_Save[ udg_SaveCount ] ] )
                                                                                    Set SaveCount = (SaveCount + 1)
                                                                        Else - Actions
Ok, so at the very beginning, you can see me calculating how long the sequencer/base sets are, heh. I'm paranoid about it since it can be subject to change, so I just like to calculate it right away. The loop will be optimized for instant exit when it goes to JASS, kk.

So, it's pretty much working backwards. It sets base to basemax again getting ready to decrypt the beginning of the code. Then after it finds the length, it sets the validate from 7 to that length. After that, it uses basemax to decrypt it. From there, it just takes the sequencer out and the randomed base out. It decrypts the rest of the code with the randomed base value, then it goes thru the code with the sequencer in a cooleo for loop : D

So atm, the decryption displays nothing, does nothing, and i'm like uh... ???

lol

any help would be appreciated ^)^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top