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 


This lua script is right? // For AOB i need use what variabl

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
jededias
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 15 Apr 2017
Posts: 17

PostPosted: Sun May 07, 2017 4:42 pm    Post subject: This lua script is right? // For AOB i need use what variabl Reply with quote

Code:
function threadedAOBScan(t)
  local r=AOBScan(48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 BF)
scan.onScanDone = function(scan)
  local fl = createFoundList(scan)
  fl.initialize()
  for i=0, fl.Count-1 do
    writeDouble(fl.Address[i], 48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 80 BF)
  end
  r.destroy()
end

createNativeThread(threadedAOBScan)




What I put in writeDouble(fl.Address for aob?? writeAOB ?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4151
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon May 08, 2017 7:43 am    Post subject: Reply with quote

[quote="jededias"]
Code:
function threadedAOBScan(t)
  local r=AOBScan(48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 BF)
scan.onScanDone = function(scan)
  local fl = createFoundList(scan)
  fl.initialize()
  for i=0, fl.Count-1 do
    writeDouble(fl.Address[i], 48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 80 BF)
  end
  r.destroy()
end

createNativeThread(threadedAOBScan)


For AOBScan you do not need FoundList object.

_________________
Back to top
View user's profile Send private message MSN Messenger
Zanzer
I post too much
Reputation: 119

Joined: 09 Jun 2013
Posts: 3231

PostPosted: Mon May 08, 2017 4:12 pm    Post subject: Reply with quote

Need quotes around your AOB.
Code:
AOBScan("48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 BF")

You want to use writeBytes, not Double.
Lua hex notation starts with "0x".
Parameters are separated by a comma.
Code:
writeBytes(fl.Address[i], 0x48, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF)
Back to top
View user's profile Send private message
jededias
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 15 Apr 2017
Posts: 17

PostPosted: Sun May 14, 2017 7:20 pm    Post subject: This is right? Reply with quote

Code:
function threadedAOBScan(t)
  local r=AOBScan("48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 BF")
scan.onScanDone = function(scan)
writeBytes(fl.Address[i], 0x48, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF)
  end
  r.destroy()
end

createNativeThread(threadedAOBScan)


It's Right now?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4151
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon May 15, 2017 12:15 pm    Post subject: Reply with quote

Of course it is not OK. If you'll read information here on CEF (or read main.lua inside CE folder) you should understand.

AOBScan(aobstring) returns results as a StringList object containing all the results. If nothing found, it returns nil.


You are changing byte 23 from 0 to 1. So, offset is 22 decimal, 16 hexadecimal.


Code:
function threadedAOBScan(t)
  local r=AOBScan("48 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 BF")
  if r~=nil then
    writeBytes( r[0]..'+16' , 1 )
    r.destroy()
  end
end

createNativeThread(threadedAOBScan)

_________________
Back to top
View user's profile Send private message MSN Messenger
jededias
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 15 Apr 2017
Posts: 17

PostPosted: Mon May 15, 2017 11:09 pm    Post subject: mgr.inz.Player Reply with quote

mgr.inz.Player is possible do a luascript button that scan text? for example:

On click: Scan TextONE and change to TextTWO

??
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4151
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue May 16, 2017 8:20 am    Post subject: Reply with quote

textOne and textTwo must be have the same length.


Code:
function threadedAOBScan(t, textOne, textTwo)
  if (textOne and textTwo) and (#textOne==#textTwo) then
    local r = AOBScan( unpack(stringToByteTable(textOne)) )
    if r~=nil then
      writeString( r[0] , textTwo )
      r.destroy()
    end
  end
end

createNativeThread(threadedAOBScan, 'text one', 'text two')

_________________
Back to top
View user's profile Send private message MSN Messenger
jededias
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 15 Apr 2017
Posts: 17

PostPosted: Tue May 16, 2017 11:52 am    Post subject: Same length Reply with quote

only same length works?

TheTextOne
dont change to TheTextTwoOneHundredFive

?
Back to top
View user's profile Send private message
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