Jump to content
  • 0

offset in lua


blocx

Question

hi all someone can tell what is wrong please ?

local function h3()

gg.setRanges(gg.REGION_C_ALLOC)

gg.searchNumber("147;144;145;105::100", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0)
revert = gg.getResults(5232, nil, nil, nil, nil, nil, nil, nil, nil)
gg.refineNumber("147", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0)
r = gg.getResults(100)


t[1] = {}
t[1].address = r[1].address + 0x4
t[1].flags = gg.TYPE_DWORD
t[1].value = 99
gg.setValues(t)

t[2] = {}
t[2].address = r[1].address + 0x8
t[2].flags = gg.TYPE_DWORD
t[2].value = 0
gg.setValues(t)

gg.clearResults()
gg.toast("👌 FREE ITEMS (BOOSTED) 👍")
end

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

and i see that you repeat the same logic two times, dont repeat yourself, when you use something more than one time try to make a function so you can use it multiple time.

local function h3()
  local function setVal (address, value)
    local t = {{
        address = address,
        flags = 4,
        value = value,
    }}
    gg.setValues(t)
  end
  
  gg.clearResults()
  gg.setRanges(gg.REGION_C_ALLOC)
  gg.searchNumber("147;144;145;105::100", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0)
  revert = gg.getResults(5232, nil, nil, nil, nil, nil, nil, nil, nil)
  gg.refineNumber("147", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0)
  addr = gg.getResults(100)[1].address
  
  setVal (addr + 0x4, 99)
  setVal (addr + 0x8, 0)
  gg.toast(" FREE ITEMS (BOOSTED) ")
end

h3()

 

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.