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 set a value to 1 every 500ms?

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

Joined: 05 Jan 2016
Posts: 61
Location: Germany

PostPosted: Sat Jun 04, 2016 12:59 pm    Post subject: How to set a value to 1 every 500ms? Reply with quote

Hey!

I am wondering how you can set a value to 1 every 500ms. You should also be able to enable it and disable it. I know there is a timer for it but I dont know how you can enable and disable this timer with a checkbox for example.

If you want to explain it to me, please use this address: "FTLGame.exe"+0039BA94 with offsets: 10, 20, 0, 150, 488.

regards, TPRammus
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Sat Jun 04, 2016 1:13 pm    Post subject: Reply with quote

Code:
alloc(PTR,512)
label(invalid)

PTR:
pushad
//Follow Pointer
mov eax,["FTLGame.exe"+0039BA94]
or eax,eax
je invalid    //jump if invalid Pointer
mov eax,[eax+10]
or eax,eax
je invalid
mov eax,[eax+20]
or eax,eax
je invalid
mov eax,[eax+0]
or eax,eax
je invalid
mov eax,[eax+150]
or eax,eax
je invalid
mov eax,[eax+488]
or eax,eax
je invalid

//[eax] now contains the value you want to read/edit
mov dword ptr [eax],1

invalid:
push #500     //500ms Timeout
call sleep
popad
jmp PTR

createthread(PTR)


Something like this?
Back to top
View user's profile Send private message
TPRammus
Advanced Cheater
Reputation: 0

Joined: 05 Jan 2016
Posts: 61
Location: Germany

PostPosted: Sat Jun 04, 2016 1:45 pm    Post subject: Reply with quote

hhhuut wrote:
Something like this?


Sorry but I dont know what I'm supposed to do now.
I excpected something like this:
Code:
function CECheckbox1Change(sender)
  if (checkbox_getState(UDF1.CECheckBox1) == 1) then
//code
  else
//code
end
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4296

PostPosted: Sat Jun 04, 2016 2:09 pm    Post subject: This post has 1 review(s) Reply with quote

That's assembly, not Lua.
Code:
t = createTimer(UDF1.CECheckBox1, false)
t.Interval = 500
t.OnTimer = function(sender)
  writeInteger(0x1234ABCD,1)
end

function CECheckbox1Change(sender)
  t.Enabled = UDF1.CECheckBox1.Checked
end

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

Joined: 05 Jan 2016
Posts: 61
Location: Germany

PostPosted: Sat Jun 04, 2016 2:31 pm    Post subject: Reply with quote

ParkourPenguin wrote:
That's assembly, not Lua. (...)


Thank you very much! Everything works fine.
I will give you a rep asap :) <3 (as soon as I get the rights to rep)
And thank you too hhhuut :)

regards, TPRammus
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Sat Jun 04, 2016 2:55 pm    Post subject: Reply with quote

Yeah sorry, somehow missed you were looking for a LUA function ^^
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