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 


How to write value when x = 1?

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

Joined: 31 Jan 2013
Posts: 10

PostPosted: Thu Feb 07, 2013 9:55 am    Post subject: How to write value when x = 1? Reply with quote

Hello.
Basically, I would like CE to make a value = 1, when another address is equal to 200.

In other words,
If address 00D03000 = '200', then write the value '1' to address 00469000.


Could someone please help me accomplish this goal?
CE is very powerful and I know there is a way to do this!
Back to top
View user's profile Send private message
Screitor
Cheater
Reputation: 1

Joined: 26 Nov 2012
Posts: 33
Location: Venezuela

PostPosted: Thu Feb 07, 2013 2:37 pm    Post subject: Reply with quote

Write your own program to do it, that should be easy and faster.
_________________
Everybody lies.


Last edited by Screitor on Sat Feb 09, 2013 6:58 pm; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Thu Feb 07, 2013 2:44 pm    Post subject: Reply with quote

execute this script:

Code:

function writeif200(sender)
  if readInteger("00D03000")==200 then
    writeInteger("00469000", 1)
  end
end

t=createTimer(nil, true)
timer_onTimer(t, writeif200)
timer_setInterval(t, 100) --check every 100 milliseconds

_________________
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
engineer_professor
Newbie cheater
Reputation: 0

Joined: 31 Jan 2013
Posts: 10

PostPosted: Wed Feb 13, 2013 9:02 am    Post subject: Reply with quote

Dark Byte wrote:
execute this script:

Code:

function writeif200(sender)
  if readInteger("00D03000")==200 then
    writeInteger("00469000", 1)
  end
end

t=createTimer(nil, true)
timer_onTimer(t, writeif200)
timer_setInterval(t, 100) --check every 100 milliseconds


thank you for this,
one more question: how to modify this script so that I can make "00D07000" equal to the value at "00E07000" ?

(the value at 00E07000 changes often, so i need 00D07000 to always match it!)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Wed Feb 13, 2013 9:34 am    Post subject: Reply with quote

writeInteger("00D07000", readInteger("00E07000"))

alternatively, just add both 00D07000 and 00E07000 to the cheat table
freeze 00d07000 and change the value to "(descriptionof00e07000)" (without the quotes, with the braces)

_________________
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
engineer_professor
Newbie cheater
Reputation: 0

Joined: 31 Jan 2013
Posts: 10

PostPosted: Thu Jun 27, 2013 1:34 pm    Post subject: Reply with quote

thanks,

and is it possible to change 'writeInteger' and 'readInteger' to make it read and write 4 bytes instead of one?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Thu Jun 27, 2013 2:28 pm    Post subject: Reply with quote

Integer is 4 bytes
_________________
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
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