Arhowk >.<
private static method init2 takes nothing returns nothing
local Encoder encoder = Encoder.create("2b28ab097eaef7cf15d2154f16a6883c")
local Code data = Code.create()
local AES_Data loaded
local integer playerId = 0
//for testing purposes so that all 12 players have different codes
call SetRandomSeed(GetRandomInt(-2147483647, 2147483647) + GetPlayerId(GetLocalPlayer()))
call WaitForGameToStart()
//loads 100 random integers
call loadData(data)
//call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,BitInt(data).toString())
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,"Saved")
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,"Bit Count: "+I2S(BitInt(data).bitCount))
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,BitInt(data).toString())
call data.encrypt(encoder)
call data.save("myFirstMap", "myFirstFile")
call data.destroy()
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,"Loaded")
set loaded = Code.load("myFirstMap", "myFirstFile")
loop
if (0 != loaded[playerId]) then
set data = loaded[playerId]
call data.decrypt(encoder)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,BitInt(data).toString())
//call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,I2S(data.read()))
call data.destroy()
endif
set playerId = playerId + 1
exitwhen playerId == 12
endloop
call loaded.destroy()
endmethod