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 


Changing pointer values in lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
scared
How do I cheat?
Reputation: 0

Joined: 27 Dec 2022
Posts: 5

PostPosted: Tue Dec 27, 2022 9:07 am    Post subject: Changing pointer values in lua Reply with quote

i am trying to put a pointer's speed hack in a trackbar and make it customizable. i'm really stuck on this, this is the code i used for trying to assign a pointer value for every position of the trackbar:
Code:
 function CETrainerTrackBar1Change(sender)
  if sender.Position == 0 then
    writeFloat(0x1BCB5DAC,8)
  elseif sender.Position == 1 then
    writeFloat(0x1BCB5DAC,20)
  elseif sender.Position == 2 then
    writeFloat(0x1BCB5DAC,30)
  elseif sender.Position == 3 then
    writeFloat(0x1BCB5DAC,40)
  elseif sender.Position == 4 then
    writeFloat(0x1BCB5DAC,50)
  elseif sender.Position == 5 then
    writeFloat(0x1BCB5DAC,60
  elseif sender.Position == 6 then
    writeFloat(0x1BCB5DAC,70)
  elseif sender.Position == 7 then
    writeFloat(0x1BCB5DAC,80)
  elseif sender.Position == 8 then
    writeFloat(0x1BCB5DAC,90)
  elseif sender.Position == 9 then
    writeFloat(0x1BCB5DAC,100)
  elseif sender.Position == 10 then
    writeFloat(0x1BCB5DAC,110)
  else
    writeFloat(0x1BCB5DAC,8)
  end
end

also the pointer "1BCB5DAC" changes everytime so i don't know what to put to make it working



Screenshot_32.jpg
 Description:
 Filesize:  112.88 KB
 Viewed:  1080 Time(s)

Screenshot_32.jpg


Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Tue Dec 27, 2022 11:16 am    Post subject: Reply with quote

Try this:
Code:

function CETrainerTrackBar1Change(sender)
  local address = getAddressSafe(0x1BCB5DAC)
  local position = sender.Position
 
  if position == 0 then writeFloat(address, 8) return end

  if (position >= 1) and (position <= 10) then
    writeFloat(address, (position + 1) * 10)
  end
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Tue Dec 27, 2022 8:41 pm    Post subject: Reply with quote

memoryrecord.Value=newvalue
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
scared
How do I cheat?
Reputation: 0

Joined: 27 Dec 2022
Posts: 5

PostPosted: Mon Jan 02, 2023 11:13 am    Post subject: Reply with quote

LeFiXER wrote:
Try this:
Code:

function CETrainerTrackBar1Change(sender)
  local address = getAddressSafe(0x1BCB5DAC)
  local position = sender.Position
 
  if position == 0 then writeFloat(address, 8) return end

  if (position >= 1) and (position <= 10) then
    writeFloat(address, (position + 1) * 10)
  end
end
thank you
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