blocx Posted August 3, 2021 Share Posted August 3, 2021 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 More sharing options...
CmP Posted August 3, 2021 Share Posted August 3, 2021 Table in variable "t" needs to be created before it is used. t = {} t[1] = {} -- ... Link to comment Share on other sites More sharing options...
blocx Posted August 3, 2021 Author Share Posted August 3, 2021 thanks yes i missed this Link to comment Share on other sites More sharing options...
MAARS Posted August 3, 2021 Share Posted August 3, 2021 i suggest you this syntax to save some line and make it more clear local t = {{ address = r[1].address + 0x4, flags = 4, value = 99 }} gg.setValues(t) Link to comment Share on other sites More sharing options...
MAARS Posted August 3, 2021 Share Posted August 3, 2021 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 More sharing options...
blocx Posted August 4, 2021 Author Share Posted August 4, 2021 ty bro @MAARS Link to comment Share on other sites More sharing options...
Question
blocx
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
Archived
This topic is now archived and is closed to further replies.