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 


Conditional Value Change?

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

Joined: 04 Dec 2011
Posts: 27

PostPosted: Sun Dec 04, 2011 4:18 pm    Post subject: Conditional Value Change? Reply with quote

I'm sorry. Does not speak English well.

Example:

if 00400300 Value More than 500

00400300 Value Increased 100

else do nothing.

How to create code do?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Dec 04, 2011 5:18 pm    Post subject: Reply with quote

"Value More than" ? Really? Ok... (If not, try to figure out what to change...)


this is the main code
Code:

local tempvar=readInteger(0x00400300)

if (tempvar>500) then
  writeInteger(0x00400300, tempvar+100)
end

(if 00400300 is a float instead of 4 byte replace Integer with Float (readFloat))

Now if you wish to execute this function every second (1000 milliseconds) do:
Code:

function CheckAndAdjust(sender)
  local tempvar=readInteger(0x00400300)

  if (tempvar>500) then
    writeInteger(0x00400300, tempvar+100)
  end
end

t=createTimer(nil)
timer_setInterval(t, 1000)
timer_onTimer(t, CheckAndAdjust)
timer_setEnabled(t, true)


when you want to stop it do object_destroy(t)

_________________
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
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Mon Dec 05, 2011 12:59 am    Post subject: not change.... Reply with quote

I've tried does not change
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Dec 05, 2011 7:25 am    Post subject: Reply with quote

make sure that 00400300 is writable (it usually is not) and that the value is ABOVE 500
_________________
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
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Mon Dec 05, 2011 10:02 am    Post subject: thanks Reply with quote

Thank you very much!!! Dark byte
Back to top
View user's profile Send private message
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Mon Dec 05, 2011 7:29 pm    Post subject: how to use Pointer?? Reply with quote

how to use Pointer Address??

I know Use Normal address. (0x25EAECD4 bla bla~)

But, I don't know write pointer address...

EX) "games.exe"+0072C7E0 ...

How Use?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Dec 05, 2011 8:57 pm    Post subject: Reply with quote

replace readInteger(0x00400300) with readInteger("games.exe+0072c7e0")

as for pointers:
readInteger("[games.exe+0072c7e0]+offset1")

_________________
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
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Mon Dec 05, 2011 10:21 pm    Post subject: thank you Reply with quote

thank you very much~!!!!!!
Back to top
View user's profile Send private message
hack0535
Cheater
Reputation: 2

Joined: 16 Oct 2011
Posts: 28

PostPosted: Wed Jan 18, 2012 2:44 am    Post subject: Reply with quote

like this

multi level pointer!

readInteger("[[[[games.exe+0072c7e0]+offset1]+offset2]+offset3]")

Wink
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