Jump to content
  • 0

LUA script taking too long to load saved list


kuruvita

Question

The script below takes too long to load the saved lists. So the level has already started by the time the list is loaded.

Is there a way to add the values in the saved lists to the script? I think if everything is run off memory (RAM) instead of pulling values from storage, GG would be able to change the values fast enough.

Thanks.

gg.clearResults()
local ARMOR = {}
ARMOR[1] = {}

if gg.isVisible(true)
   then gg.setVisible(false)
   end

::LOOP::

ARMOR[1].address = 0x81737278
ARMOR[1].flags = gg.TYPE_FLOAT
ARMOR = gg.getValues(ARMOR)

if ARMOR[1].value == '5000.0'
   then gg.loadList('/sdcard/Notes/x.txt', gg.LOAD_VALUES_FREEZE)
   end

ARMOR[1].address = 0x81737294
ARMOR[1].flags = gg.TYPE_FLOAT
ARMOR = gg.getValues(ARMOR)

if ARMOR[1].value == '5000.0'
   then gg.loadList('/sdcard/Notes/y.txt', gg.LOAD_VALUES_FREEZE)
   end

if gg.isVisible(true)
   then goto BYE
   end

goto LOOP

::BYE::

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • Administrators
2 hours ago, kuruvita said:

The script below takes too long to load the saved lists.

Maybe it is very big.

2 hours ago, kuruvita said:

Is there a way to add the values in the saved lists to the script?

Currently no easy way. We have plans about add this into API. Currently you can open save list as file and edit it if understand of it format.

_______________________________________________
added 1 minute later

And you try load lists in endless loop without any wait. I think this is bad idea.

Link to comment
Share on other sites

Thanks Enyby. It was great that you guys added in the loadList command - super useful.

Can I write directly to a memory address using setValues? In the script I listed above, I want to change the float value at 0x81737294 to 10000. How do I do that?

I'm too stupid to understand the example in the help section. :)

Link to comment
Share on other sites

  • Administrators
1 hour ago, kuruvita said:

Can I write directly to a memory address using setValues?

Yes.

1 hour ago, kuruvita said:

I want to change the float value at 0x81737294 to 10000. How do I do that?

https://gameguardian.net/help/classgg.html#a91d0ba1d5ff843ce26eef210dae956f1

local t = {}
t[1] = {}
t[1].address = 0x18004030 -- some desired address
t[1].flags = gg.TYPE_DWORD
t[1].value = 12345
t[2] = {}
t[2].address = 0x18004040 -- another desired address
t[2].flags = gg.TYPE_BYTE
t[2].value = '7Fh'
print('Set', t, gg.setValues(t))

Here set 12345 into 0x18004030 and 7Fh into 0x18004040.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.