Jump to content
  • 0

Saving adress after First search and edit future call automatically Edit


Zeps
 Share

Question

HEll oanyone know how to actually do it

after the frist call it will search and edit it and then save and so the future calls it directly edit on the user prompt??

 

local s = gg.prompt(
    {"★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;50]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ʀᴀʀᴇ ᴛɪᴄᴋᴇᴛ◄★: [1;50]"}, 
    {1, 1}, 
    {"number", "number"}
)
if s == nil then 
    gg.alert("★[►ᴏᴘᴇʀᴀᴛɪᴏɴ ᴄᴀɴᴄᴇʟᴇᴅ◄]★..")
    Game()
end
local lib = "libnative-lib.so:bss"
local pi = gg.getRangesList(lib)[1].start
local firstAddr = pi + 0x2B92D8
local lastAddr = pi + 0x2B92E4

local value1 = gg.getValues({{address = firstAddr, flags = gg.TYPE_DWORD}})[1].value
local value2 = gg.getValues({{address = lastAddr, flags = gg.TYPE_DWORD}})[1].value

gg.searchNumber(value1 .. ";0~~0;" .. value2 .. "::45", gg.TYPE_DWORD)

for i = 1, 4 do
    local results = gg.getResults(gg.getResultsCount())

    if #results < 2 then
        gg.alert("★[►ɴᴏᴛ ᴇɴᴏᴜɢʜ ʀᴇsᴜʟᴛs ʀᴇᴍᴀɪɴɪɴɢ ғᴏʀ ɪᴛᴇᴍ◄]★" .. i)
        return
    end
    results[1].value = s[i]
    results[2].value = 0
    gg.setValues({results[1], results[2]})
    gg.removeResults({results[1], results[2]})
end

gg.clearResults()
gg.toast("★[►ᴀʟʟ ɪᴛᴇᴍs ᴜᴘᴅᴀᴛᴇᴅ sᴜᴄᴄᴇssғᴜʟʟʏ!◄]★")
gg.clearResults()

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
14 hours ago, MonkeySAN said:

you can just use the lib+offset then make the edit.

no need to get the values and use it for search afterward.

was that written by you or it actually from someone else?

 

wirtten by me that offsets are both from firs and second thanks btw i found that on someone else post i just revamped some of it

is there a way to save it? so the future call of the function just actually edit it by the prompt

 

Link to comment
Share on other sites

  • 0
14 hours ago, MonkeySAN said:

you can just use the lib+offset then make the edit.

no need to get the values and use it for search afterward.

was that written by you or it actually from someone else?

 

its actually six values from the first offer down to last offset which is the last addrs doing it manually like Lib + offset will just waste my time so i did that instead but i just need to actually save it so the future call function instead of search it will just promp and edit to the one

that will only happen once the function is first called the future calls will be just using the save thing

 

Link to comment
Share on other sites

  • 0
6 minutes ago, MonkeySAN said:

like i said just need..

lib+offset then edit.

its simple and fast enough.

no need for searching then save the address for future use.

thats for The Battle Cats, Silver and Gold Ticket if im not mistaken.

waste of time?

how many lines does it takes from all that writting?

it took me less than 20 lines to do the same job.

 

for the future thing there are like 16 or even 20 items so making a seperate offset for each one and finding it again in future update will take time but thanks for the guide if icant resolve my error i might use your advise

Link to comment
Share on other sites

  • 0
18 minutes ago, MonkeySAN said:

like i said just need..

lib+offset then edit.

its simple and fast enough.

no need for searching then save the address for future use.

thats for The Battle Cats, Silver and Gold Ticket if im not mistaken.

waste of time?

how many lines does it takes from all that writting?

it took me less than 20 lines to do the same job.

 

local s = gg.prompt(
    {"★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;50]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ʀᴀʀᴇ ᴛɪᴄᴋᴇᴛ◄★: [1;50]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ʟᴜᴄᴋʏ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;50]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ɢᴏʟᴅ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;50]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ᴘʟᴀᴛɪɴᴜᴍ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;5]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ʟᴇɢᴇɴᴅ ᴄᴀᴛ ᴛɪᴄᴋᴇᴛ◄★: [1;2]",
     "★►ᴇɴᴛᴇʀ ᴠᴀʟᴜᴇ ғᴏʀ ᴘʟᴀᴛɪɴᴜᴍ ᴄʀʏsᴛᴀʟs◄★: [1;10]"},
    {1, 1, 1, 1, 1, 1, 1}, 
    {"number", "number", "number", "number", "number", "number", "number"}
)

if s == nil then 
    gg.alert("★[►ᴏᴘᴇʀᴀᴛɪᴏɴ ᴄᴀɴᴄᴇʟᴇᴅ◄]★..")
    Game()
end

local lib = "libnative-lib.so:bss"
local pi = gg.getRangesList(lib)[1].start

local function setValuesInRange(firstAddr, lastAddr, value)

    local startAddress = pi + firstAddr
    local endAddress = pi + lastAddr

    for addr = startAddress, endAddress, 4 do  
        if addr % 8 == 0 then  
            gg.setValues({{address = addr, flags = gg.TYPE_DWORD, value = value }})
        else
            gg.setValues({{address = addr, flags = gg.TYPE_DWORD, value = 0}})
        end
    end
end
local addresses = {
    {0x2B92D8, 0x2B92E4}, 
    {0x3970, 0x397C},     
    {0x2EC0, 0x2ED4}      
}
setValuesInRange(addresses[1][1], addresses[1][2], s[1])  
setValuesInRange(addresses[2][1], addresses[2][2], s[3])  
setValuesInRange(addresses[3][1], addresses[3][2], s[5])  
gg.toast("★[►ʙʀɪʟʟɪᴀɴᴛ! ᴀʟʟ ᴠᴀʟᴜᴇs ᴜᴘᴅᴀᴛᴇᴅ!◄]★")



thanks i think i manged to make it work using this


how my little brain figured it out is that instead of search it i basicly just make it edit from first address to last addres to user promp value, 0

Edited by Zeps
Link to comment
Share on other sites

  • 0
Just now, MonkeySAN said:

oh btw.

your game was 32bit or 64bit?

my game 64bit and the latest version(and some several previous version ago) stop using :bss region.

now it use Other region which not as easy (but still managable) as bss region.

64 bit !. currently doing 32 bit since a lot of people are still on 32 bit for some reason i use both bss and so

1 minute ago, MonkeySAN said:

oh btw.

your game was 32bit or 64bit?

my game 64bit and the latest version(and some several previous version ago) stop using :bss region.

now it use Other region which not as easy (but still managable) as bss region.

also to fix the region being other install the game as xapk to reset the region to be Cb i had the same issue before it was A 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.