docfred
Geocacher
Kann mir jemand kurz erklären was die Funktion am Anfang der LUA-Cartridge aus URWIGO macht.
Alle Strings in der Cartridge werden mit dieser Funktion "konvertiert".
docfred
Code:
function _vsA(str)
local res = ""
local dtable = "\056\043\011\078\007\099\118\096\102\103\034\086\072\089\053\119\023\115\031\108\117\057\005\055\051\082\006\042\012\126\059\112\032\069\077\065\088\085\050\046\002\064\020\113\071\083\090\116\098\028\125\104\044\114\017\009\092\122\111\068\029\015\066\110\070\105\081\014\038\109\124\000\120\084\018\035\100\067\060\087\013\003\091\058\121\037\001\039\036\047\093\061\052\021\022\095\024\106\063\079\048\004\080\094\030\008\101\025\019\027\033\040\045\075\016\074\123\041\062\107\054\026\010\049\073\076\097"
for i=1, #str do
local b = str:byte(i)
if b > 0 and b <= 0x7F then
res = res .. string.char(dtable:byte(b))
else
res = res .. string.char(b)
end
end
return res
end
docfred