Jump to content
  • 0

How to implement Nearby Search in LUA Script for address that keeps changing


Question

Posted (edited)

Hello,

 

Wondering if someone can please help me. I have a group search and refined value like this:

 

gg.searchNumber("0.10000000149;2.5;6.0::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)
gg.refineNumber("6", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)

local t = gg.getResults(1)
gg.addListItems(t)
t = nil

 

What I'd like to do is use the result of "6" from above to perform a "NearBy Search" with an "After" distance of 500 for value: -1 DWORD.  The problem is the address of the "6" keeps changing when I restart the game. Is there a proper way to code the script so that it does what I need even when the address of the "6" changes?  I've searched and played around with it and couldn't figure it out at all. Not even sure if it's doable. That's why I'm asking.  Would appreciate any assistance.

Edited by Sami1982

4 answers to this question

Recommended Posts

  • 1
Posted

im not an expert but try this and see if it work for you

gg.searchNumber("0.10000000149;2.5;6.0::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)
gg.refineNumber("6", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)

local results = gg.getResults(1)
local baseAddress = results[1].address
local offset = 0x500

gg.clearResults()
gg.searchNumber("-1", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, baseAddress, baseAddress + offset, 0)

 

  • 0
Posted (edited)
10 hours ago, Sami1982 said:

Hello,

 

Wondering if someone can please help me. I have a group search and refined value like this:

 

gg.searchNumber("0.10000000149;2.5;6.0::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)
gg.refineNumber("6", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)

local t = gg.getResults(1)
gg.addListItems(t)
t = nil

 

What I'd like to do is use the result of "6" from above to perform a "NearBy Search" with an "After" distance of 500 for value: -1 DWORD.  The problem is the address of the "6" keeps changing when I restart the game. Is there a proper way to code the script so that it does what I need even when the address of the "6" changes?  I've searched and played around with it and couldn't figure it out at all. Not even sure if it's doable. That's why I'm asking.  Would appreciate any assistance.



But if you did a nearby search of 500 you should be able to find another group search that is better and more static.

Edited by nok1a
  • 0
Posted
9 hours ago, nok1a said:



But if you did a nearby search of 500 you should be able to find another group search that is better and more static.

Yeah unfortunately it's so weird and unreliable. I tried various group searches and backwards pointer searches. It works 4 or 5 times in a row when I restart the game, but then sadly it stops working 😞 

  • 0
Posted (edited)
3 hours ago, MonkeySAN said:

care to share the game name?

and what are you searching for?

Thanks for the response. Sorry It's kind of a long story and confusing lol.  But let me try to better clarify my question. It's pretty specific and straight forward. When I get my refined result from my group search, which is that number "6", I long press on it, and select "search nearby" and I search for -1 Dword with "After distance" of 500. The problem is, the address (as shown in the attached screenshot) is always different when I restart the game. Is there a way to write something in the script to perform this "long press/search nearby" without knowing what that address will be? That's all I need to know.

screen_shot.jpg

Edited by Sami1982

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