Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


lua script aob changing then freeze?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
kentpachi1
Newbie cheater
Reputation: 0

Joined: 16 Jun 2014
Posts: 15

PostPosted: Thu Apr 18, 2024 7:25 pm    Post subject: lua script aob changing then freeze? Reply with quote

how do you freeze the value when changing aob?


example, in the line of my script



function cockgrow()
searchV = '?? ?? ?? ?? EC 51 B8 3D 00 00 00 3F'
replaceV = '?? ?? ?? ?? 00 00 00 40 00 00 00 3F'
AOBRep(searchV,replaceV)



I want to freeze the value i change from EC 51 B8 3D to 0
script is long but basically theres a GUI and a button and if i press the button, it will change that AoB but unfortunately, I have to repetitively press it whenever the value is changed again.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1307

PostPosted: Thu Apr 18, 2024 9:56 pm    Post subject: Reply with quote

I assume you have a unique aob code and that you initiate a transaction based on a single result.
Otherwise it will return the first result!
You can bind it to a button.

Code:
local addressList = getAddressList()
local mr1
local sr1 = true

function addAddres1(adrr)
local memRec = addressList.createMemoryRecord()
memRec.Type=8
memRec.ShowAsHex=true
memRec.Description= 'MyDescription'
memRec.Address=adrr
end

-- yourTrainer.Button.OnClick=function()
local search=tostring("?? ?? ?? ?? EC 51 B8 3D 00 00 00 3F")
if sr1==true then
   aobs1=AOBScan(search)
  if aobs1~=nil then
    addAddres1(stringlist_getString(aobs1,1-1)) --,aobs2)
    mr1 = addressList.getMemoryRecordByDescription("MyDescription")
      if mr1 then
        mr1.Value = tostring("?? ?? ?? ?? 00 00 00 40 00 00 00 3F")
        mr1.Active = true
        print("Hack - True")
        sr1=false
      end
    end
    aobs1.Destroy()
  else
    mr1.Active = false
    mr1.Value = tostring("?? ?? ?? ?? EC 51 B8 3D 00 00 00 3F")
    addrCnt = addresslist_getCount(addressList)
      if addrCnt>0 then
        memoryrecord_delete(addresslist_getMemoryRecord(addressList,"MyDescription"))
      end
      print("Hack - False")
end
--end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kentpachi1
Newbie cheater
Reputation: 0

Joined: 16 Jun 2014
Posts: 15

PostPosted: Thu Apr 18, 2024 11:13 pm    Post subject: Reply with quote

AylinCE wrote:
I assume you have a unique aob code and that you initiate a transaction based on a single result.
Otherwise it will return the first result!
You can bind it to a button.

Code:
local addressList = getAddressList()
local mr1
local sr1 = true

function addAddres1(adrr)
local memRec = addressList.createMemoryRecord()
memRec.Type=8
memRec.ShowAsHex=true
memRec.Description= 'MyDescription'
memRec.Address=adrr
end

-- yourTrainer.Button.OnClick=function()
local search=tostring("?? ?? ?? ?? EC 51 B8 3D 00 00 00 3F")
if sr1==true then
   aobs1=AOBScan(search)
  if aobs1~=nil then
    addAddres1(stringlist_getString(aobs1,1-1)) --,aobs2)
    mr1 = addressList.getMemoryRecordByDescription("MyDescription")
      if mr1 then
        mr1.Value = tostring("?? ?? ?? ?? 00 00 00 40 00 00 00 3F")
        mr1.Active = true
        print("Hack - True")
        sr1=false
      end
    end
    aobs1.Destroy()
  else
    mr1.Active = false
    mr1.Value = tostring("?? ?? ?? ?? EC 51 B8 3D 00 00 00 3F")
    addrCnt = addresslist_getCount(addressList)
      if addrCnt>0 then
        memoryrecord_delete(addresslist_getMemoryRecord(addressList,"MyDescription"))
      end
      print("Hack - False")
end
--end


yes you are correct only 1 result

tested it just now, it seems it doesnt work.
the lua execution says Hack - True

but it didnt change the AoB at all, i tried manuall searching the AoB and I can still find it not changed.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1307

PostPosted: Fri Apr 19, 2024 4:50 am    Post subject: Reply with quote

It works in my case.
You do not need to search for the AOB code separately, the code will automatically appear in the address list and be activated, as in the image.


_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites