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 


hi i need help

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

Joined: 09 Sep 2015
Posts: 48

PostPosted: Mon Oct 12, 2015 9:32 pm    Post subject: hi i need help Reply with quote

hi i need help liek in this script below theres a problem


ON:
local scan = "01 01 01 ?? 01 01 01"
local replace = "02 02 02 02 02 02"
local aob = AOBScan(scan)
if aob ~= nil then
local addr = getAddressList()
local size = (#replace + 1) / 3
for i = 0, aob.Count - 1 do
local mem = addr.createMemoryRecord()
mem.Description = "Address " .. i
mem.Address = aob[i]
mem.Type = vtByteArray
mem.Aob.Size = size
mem.Active = true
mem.Value = replace
end
aob.Destroy()
aob = nil
end

OFF:
local scan = "01 01 01 ?? 01 01 01"
local replace = "02 02 02 ?? 02 02 02" -- THIS ONE IS THE PROBLEM HOW DO I CHANGE IT BACK TO ITS OLD VALUE IF I DONT KNOW WHAT IT IS
local aob = AOBScan(scan)
if aob ~= nil then
local addr = getAddressList()
local size = (#replace + 1) / 3
for i = 0, aob.Count - 1 do
local mem = addr.createMemoryRecord()
mem.Description = "Address " .. i
mem.Address = aob[i]
mem.Type = vtByteArray
mem.Aob.Size = size
mem.Active = true
mem.Value = replace
end
aob.Destroy()
aob = nil
end
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Tue Oct 13, 2015 4:16 pm    Post subject: Reply with quote

I'm pretty sure CE just leaves it as whatever it was if you use a wildcard in the value you're setting an AoB to, so you probably don't need it if you don't modify that byte.

If you need to change that byte to something else later, just store its original value in some variable. You could also allocate some memory and store it there if you need to use assembly.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
zakusa
Cheater
Reputation: 0

Joined: 09 Sep 2015
Posts: 48

PostPosted: Sat Oct 17, 2015 3:57 pm    Post subject: Reply with quote

ya but can someone fix it
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sat Oct 17, 2015 7:47 pm    Post subject: Reply with quote

Could you tell me what this is suppose to do? All you said was that you didn't know how to change it back to its old value. Simply setting all the AoBs that were added to the address list to 01 01 01 ?? 01 01 01 would change them back to their original values.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sat Oct 17, 2015 10:12 pm    Post subject: Reply with quote

See this...

http://forum.cheatengine.org/viewtopic.php?t=584688
Back to top
View user's profile Send private message
zakusa
Cheater
Reputation: 0

Joined: 09 Sep 2015
Posts: 48

PostPosted: Sun Oct 18, 2015 7:00 am    Post subject: Reply with quote

ya liek it changes to 02 no matter what the value is and then i want it to change bak to whatever the old value was and corroder i keep getting error when i use his script
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Oct 18, 2015 8:15 am    Post subject: Reply with quote

That script looks like the perfect thing for what you say you're trying to do. Make sure you're copying and pasting that code into an auto assembler window and not the cheat table lua script window.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Oct 18, 2015 8:44 am    Post subject: Reply with quote

Whatever you're writing... it better have an asterisk next to EVERY script saying "CREATED BY ZANZER" ...
Code:
{$lua}
if syntaxcheck then return end
[ENABLE]
local scan = "01 01 01 ?? 01 01 01"
local replace = "02 02 02 02 02 02"
local aob = AOBScan(scan)
if aob ~= nil then
  local addr = getAddressList()
  local size = (#replace + 1) / 3
  for i = 0, aob.Count - 1 do
    local mem = addr.createMemoryRecord()
    mem.Address = aob[i]
    mem.Type = vtByteArray
    mem.Aob.Size = size
    mem.ShowAsHex = true
    mem.Description = "!" .. mem.Value
    mem.Active = true
    mem.Value = replace
  end
  aob.Destroy()
  aob = nil
end
[DISABLE]
local addr = getAddressList()
local i = addr.Count - 1
while i >= 0 do
  local mem = addr.MemoryRecord[i]
  i = i - 1
  local v = mem.Description
  if v:sub(1, 1) == "!" then
    mem.Active = false
    mem.Value = v:sub(2, #v)
    mem.Destroy()
  end
end
Back to top
View user's profile Send private message
zakusa
Cheater
Reputation: 0

Joined: 09 Sep 2015
Posts: 48

PostPosted: Sun Oct 18, 2015 9:39 am    Post subject: Reply with quote

it say error with {$lua}
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Oct 18, 2015 9:59 am    Post subject: Reply with quote

ParkourPenguin wrote:
Make sure you're copying and pasting that code into an auto assembler window and not the cheat table lua script window.

You should also go to "File -> Assign to current cheat table" after you paste it in. Then just check the "Active" box to enable the script.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
zakusa
Cheater
Reputation: 0

Joined: 09 Sep 2015
Posts: 48

PostPosted: Sun Oct 18, 2015 10:35 am    Post subject: Reply with quote

o ya this goes in auto assembly i was putting it in lua engine but ya how do i disable it
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Oct 18, 2015 10:39 am    Post subject: Reply with quote

Uncheck the "Active" box.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
zakusa
Cheater
Reputation: 0

Joined: 09 Sep 2015
Posts: 48

PostPosted: Sun Oct 18, 2015 12:22 pm    Post subject: ya Reply with quote

ya i uncheck the the active box but the hax is still there and ya how do i disable with a hotkey instead so liek i could put it in trainer then
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Oct 18, 2015 8:02 pm    Post subject: Reply with quote

If you copied and pasted all of Zanzer's code (this one) into a blank auto assembler window and didn't change the description of the addresses that script added, it should be working just fine. I'm not having any errors with it at all.

For the hotkeys, I dunno what to tell you, since I've never worked with them at all. I've seen tons of topics dealing with hotkeys, though, so searching around for it should prove to be lucrative. Here's some topics/posts I found that might help you out:
Easy way:
http://forum.cheatengine.org/viewtopic.php?t=582703

Harder do-it-yourself ways:
http://forum.cheatengine.org/viewtopic.php?p=5367222#5367222
http://forum.cheatengine.org/viewtopic.php?p=5610763#5610763

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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