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 


[Solved] Deus EX HR:DC - Battery regen script
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Mon Oct 28, 2013 4:25 am    Post subject: [Solved] Deus EX HR:DC - Battery regen script Reply with quote

Heya!

When I was playing the original Deus Ex Human Revolution I was using the following script:
Code:
local addr = "[[[[[dxhr.exe+015A8718]+294]+780]+4]+344]+274";
 local f = createForm( true );
 local t = createTimer( f, true );
 timer_setInterval( t, 1000 );

 timer_onTimer( t, function( )
   local energy = readFloat(addr);
   if math.abs(energy % 30.0) < 0.005 then
     writeFloat(addr, energy + 0.05);
   end
 end );


Now with the new version of the game being out I figured it would only need a new pointer. So I filtered out a new one:
Code:
"[[[[[DXHRDC.exe+01608278]+27c]+134]+278]+134]+14";

Sadly nothing happens.

Is there something else I am missing?

Extremely grateful for any pointers.


Last edited by ohm on Tue Oct 29, 2013 6:57 pm; edited 2 times in total
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 7:28 am    Post subject: Reply with quote

How many rescans did you do?
_________________
Back to top
View user's profile Send private message MSN Messenger
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Mon Oct 28, 2013 7:53 am    Post subject: Reply with quote

8, but does that matter?
As long as the pointer value works "just for the moment", the script should do it's thing, right?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 8:06 am    Post subject: Reply with quote

I saw pointers that are valid only when pause menu is enabled or only when game window is minimized (ALT-TAB'ed). Pointer you found, is it valid all the time?

Try checking "repeat rescan until stopped" option ("rescan pointerlist" window).

_________________
Back to top
View user's profile Send private message MSN Messenger
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Mon Oct 28, 2013 8:28 am    Post subject: Reply with quote

It works just fine while playing, if I add a shortkey to the pointer, and press said key while playing, the energy value changes accordingly.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 1:58 pm    Post subject: Reply with quote

When you have one full battery, value should be 30.

The lua script, it checks if value is very close to multiple of 30. If yes, it increases value by 0.05 once. Then, the game mechanics increase this value automatically up to next multiple of 30.

Maybe on "hard" regeneration is disabled?

_________________
Back to top
View user's profile Send private message MSN Messenger
Hardboot
How do I cheat?
Reputation: 0

Joined: 28 Oct 2013
Posts: 2

PostPosted: Mon Oct 28, 2013 3:00 pm    Post subject: Reply with quote

Also looking for a solution to this.

While I know nothing about Cheat Engine's mechanics, I do know that DXHRDC adds a script that checks your difficulty settings before your energy recharges, as the difficulty 0 and 1 both recharge two battery cells by default, instead of the original one.

While difficulty 2 plays the same as DXHR, could that script be interfering with this mod?
Back to top
View user's profile Send private message
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Mon Oct 28, 2013 4:08 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
Maybe on "hard" regeneration is disabled?

If I do the same thing that the script is supposed to do, by myself: add 0,05 energy to a full battery, the next one starts charging just fine.

I don't know what is wrong with the scirpt, but effectively it's not hooking into the game. Has anything changed how cheat engine handles lua scripts or anything like that?

Thanks for your time btw. =)
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 4:11 pm    Post subject: Reply with quote

Better just tell your step by step.

You manually launch game, then CE, attach CE to game, execute above script? Above script, you posted full script or only part of it?

_________________
Back to top
View user's profile Send private message MSN Messenger
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Mon Oct 28, 2013 4:31 pm    Post subject: Reply with quote

1. Lunch game, load save.
2. Tab, start CE.
3. Hook and load script

And ye, that's the full script.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 5:16 pm    Post subject: Reply with quote

I don't know, this script looks good
Code:
 local addr = "[[[[[DXHRDC.exe+01608278]+27c]+134]+278]+134]+14"
 local f = createForm( true )
 local t = createTimer( f, true )
 timer_setInterval( t, 1000 )

 timer_onTimer( t, function( )
   local energy = readFloat(addr)
   if math.abs(energy % 30.0) < 0.005 then
     writeFloat(addr, energy + 0.05)
   end
 end )

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Oct 28, 2013 5:24 pm    Post subject: Reply with quote

Open lua engine and then execute this:
Code:

addr = "[[[[[DXHRDC.exe+01608278]+27c]+134]+278]+134]+14"
print(string.format('%x', getAddress(addr))


My guess is that you've put the offsets in the wrong order (the top(last) offset is 14, which is a lot different from 274, and usually the last offset doesn't change too much)

_________________
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


Last edited by Dark Byte on Mon Oct 28, 2013 5:56 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 28, 2013 5:32 pm    Post subject: Reply with quote

Possible.



_________________
Back to top
View user's profile Send private message MSN Messenger
ohm
Newbie cheater
Reputation: 0

Joined: 28 Oct 2013
Posts: 12

PostPosted: Tue Oct 29, 2013 2:06 am    Post subject: Reply with quote

Ha, I knew I did something different when I found the pointer the last time around. This was indeed what I missed.

Thanks for figuring that out! =)
Back to top
View user's profile Send private message
xerrolnanoha
How do I cheat?
Reputation: 0

Joined: 29 Oct 2013
Posts: 1

PostPosted: Tue Oct 29, 2013 6:29 pm    Post subject: Reply with quote

ohm wrote:
Ha, I knew I did something different when I found the pointer the last time around. This was indeed what I missed.

Thanks for figuring that out! =)


Might I ask for the new order, please?
Would be very grateful Smile
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
Goto page 1, 2  Next
Page 1 of 2

 
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