|
Post by Sikat on Jul 5, 2017 0:36:35 GMT
Other than string, number, or boolean that is.
Sure I can use arrays of numbers but it would be better if I can save directly.
|
|
|
Post by Mercobots on Jul 5, 2017 1:19:20 GMT
i don't know if is what you are asking for but i usualy store the regions in named tables
REG = {} REG.screen = Region()
|
|
|
Post by Sikat on Jul 5, 2017 4:22:21 GMT
I mean save for future script runs. like preferencePutString
|
|
|
Post by barkingbarnacle on Jul 5, 2017 4:47:52 GMT
I mean save for future script runs. like preferencePutString I couldn't figure out how to get that one to work. I'll be following this.
|
|
|
Post by Mercobots on Jul 5, 2017 9:37:19 GMT
The only way e see is saving them in a file and load on bot start
|
|
|
Post by Mercobots on Aug 20, 2017 3:08:31 GMT
Hello i know this is coming a little late but i have the same issues for tables, this work for everything as regions, locations, tables ,etc but for now let me show the region example functions regions function preferencePutRegion(v, r) local s = tostring((string.format("Region(%d, %d, %d, %d)", r:getX(), r:getY(), r:getW(), r:getH()))) preferencePutString(v, s) end
function preferenceGetRegion(v, s) if preferenceGetString(v, s) then return loadstring('return ' .. preferenceGetString(v, s))() else return nil end end usageprint(preferenceGetRegion("MY_REGION",""))
preferencePutRegion("MY_REGION",Region(100,200,100,200))
print(preferenceGetRegion("MY_REGION","")) i will add all functions(table,loc,regions) to lualib once i have the time
|
|