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 


Simple Lua Script For Health Regen in Fighting Games

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

Joined: 15 Nov 2011
Posts: 8
Location: Brazil

PostPosted: Wed Nov 23, 2011 12:51 pm    Post subject: Simple Lua Script For Health Regen in Fighting Games Reply with quote

Hi,

I will show here a very very simple Lua script for active automatic Health Regeneration in a Fighting Game.

HereŽs the code:

timer = createTimer(nil,true) -- Create a Timer, for loop the code

timer_setInterval(timer,100) -- Set the interval (in millisecs) between one loop and other

function HP_Regen() -- Create a function for the health regen code

FullHP = 100 -- A global variable with the full health value

local ActHP = readInteger("HP Adress Here") -- Read the Actual health value

if (ActHP < FullHP) then -- If the Actual HP is minor than the FullHP...

writeInteger("HP Adress Here, Again",FullHP) -- Set the hp value to max

end -- End of If struct
end -- End of HP_Regen function

timer_onTimer(timer,HP_Regen) -- What to do if the timer do a loop ?Run the HP_Regen function !



Finish. This is the code. It like a simple "set value to" code, but in most of fight games, if you change directly the health value to other value, it donŽt
change at same time. the helath will be increased slooowwly.

Press "Ctrl+Alt+L" in your cheat table, add this code (overwriting some values above with the Health adress value) and save it.


Enjoy!

__________________________________________________________________________________________
EDIT:

Some games (in first place, in Emulators) use DOUBLE values (numbers with floating point with double precision) as health values. In these cases, youŽll need to change the "readInteger" and "writeInteger" functions in the code above , to "readDouble" and "writeDouble", else the code will fuck the health bar with a wrong value and probably the game will crash.

When the fight (in the game) begin, pause the game, and look the health address in your cheat table (probably it will be FULL =D). So, copy the value of the health and put it in the "FullHP" variable in the code above.

_________________
Something In Somplace...
Back to top
View user's profile Send private message
kickclock
Advanced Cheater
Reputation: 0

Joined: 15 Jan 2008
Posts: 73

PostPosted: Thu Dec 08, 2011 3:14 pm    Post subject: Reply with quote

thanks for this code, it is very useful for new hand like me .
_________________
Love CE
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