naparnik Posted January 11, 2023 Share Posted January 11, 2023 How to use offsets in scripts? I need the script to search for the offset value, and then replace it. How to do it? Link to comment Share on other sites More sharing options...
HEROGAMEOfficial Posted January 11, 2023 Share Posted January 11, 2023 offset is (distance addres) from addres a to b, example: Address a = 1234 Address b = 1235 Offset = 4 Link to comment Share on other sites More sharing options...
naparnik Posted January 11, 2023 Author Share Posted January 11, 2023 can I have more details? 14 минут назад HEROGAMEOfficial сказал: 15 minutes ago, HEROGAMEOfficial said: смещение (расстояние addres) от addres a до b, пример: Адрес a = 1234 Адрес b = 1235 Смещение = 4 Here is an example of offset 0x5000 and how do I use it in the game, and replace the value by it Link to comment Share on other sites More sharing options...
Proejder Posted January 11, 2023 Share Posted January 11, 2023 4 hours ago, naparnik said: How to use offsets in scripts? I need the script to search for the offset value, and then replace it. How to do it? function isim(lib) if n == lib then return startAddress, endAddress end aralik = gg.getRangesList(lib or 'libunity') for i, v in ipairs(aralik) do if v.state == "Xa" then startAddress = v.start endAddress = aralik[#aralik]['end'] break end end return startAddress, endAddress end function setHexMemory(libisim, offset, hex) isim(libisim) t, hepsi = {}, 0 for h in string.gmatch(hex, "%S%S") do table.insert(t, {address = startAddress + offset + hepsi, flags = gg.TYPE_BYTE,value = h .. "r"}) hepsi = hepsi + 1 end sonuc = gg.setValues(t) if type(sonuc) ~= 'string' then return true else gg.alert(sonuc) return false end end function Main() menu = gg.choice({ 'features'..tekvur, ' ᴇxɪ̇ᴛ'}, nil,' namegame vnumber sᴄʀɪᴘᴛ\nɢᴀᴍᴇɢᴜᴀʀᴅɪᴀɴ ʙʏ yourname') if menu==1 then reward()end if menu==2 then Exit()end proejder=-1 end ac = ' [ᴏɴ]' kapa = ' [ᴏғғ]' tekvur = kapa function reward() if tekvur == kapa then setHexMemory("libunity", 0x77B344, "00 00 A0 40") gg.toast("cheat {ON]!") tekvur = ac else setHexMemory("libunity", 0x77B344, "0B 2E 11 3E") tekvur = kapa gg.toast("cheat {OFF]") end end function Exit() print("print message") os.exit() end s= '' while(true)do if gg.isVisible(true) then proejder=1 gg.setVisible(false) end gg.clearResults() if proejder==1 then Main() end end you can take inspiration from my sample template Link to comment Share on other sites More sharing options...
Question
naparnik
How to use offsets in scripts? I need the script to search for the offset value, and then replace it. How to do it?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.