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 


[req]making script for select unit health.
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 8:14 pm    Post subject: Reply with quote

In your script
Code:
[ENABLE]
// asm code here
{$lua}
  -- Lua code here
{$asm}
// asm code here
[DISABLE]
// asm code here
{$lua}
  -- Lua code here
{$asm}
// asm code here

What is the difference in lua script for enable and disable.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 8:25 pm    Post subject: Reply with quote

The Lua part in the [ENABLE] section is run when you enable a script.

The Lua part in the [DISABLE] section is run when you disable a script.

Again, all the code I've posted (except for that) is meant to be put into the main Lua script window. You'll probably have to modify it if you want to put it into an AA script.

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 8:56 pm    Post subject: Reply with quote

You can bring a short example to me.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 9:15 pm    Post subject: Reply with quote

Weak unit script:
Code:
{$lua}
[ENABLE]
writeDouble(healthAddr,1)
[DISABLE]
writeDouble(healthAddr,100)

Invincible unit script:
Code:
{$lua}
[ENABLE]
local f = function()
  writeDouble(healthAddr,100)
end
if freezeHealthT and freezeHealthT.destroy then freezeHealthT.destroy() end
freezeHealthT = createTimer(nil,true)
freezeHealthT.Interval = 50
freezeHealthT.OnTimer = f

[DISABLE]
if freezeHealthT and freezeHealthT.destroy then freezeHealthT.destroy() end
freezeHealthT = nil

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 9:32 pm    Post subject: Reply with quote

in here does not require the asm codes
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 9:46 pm    Post subject: Reply with quote

Correct. That's if you want to put in any assembly into your script as well. Sometimes you do, sometimes you don't. It's optional.

Example:
Code:
[ENABLE]
alloc(newmem,512)
// do whatever with that newmem
{$lua}
writeDouble(healthAddr,1)
{$asm}
[DISABLE]
dealloc(newmem)
{$lua}
writeDouble(healthAddr,100)

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 9:55 pm    Post subject: Reply with quote

Do some scripts such as [label(exit)label,(returnhere),...]have not require(need)?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 9:57 pm    Post subject: Reply with quote

It depends on what those scripts do.

If you're making a code cave, then yes, most of that stuff is required. If you're just overriding memory (e.g. changing a sub to an add), then no, that stuff isn't required.

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 10:09 pm    Post subject: Reply with quote

I'm realized.
If we want in down script Instead of value 1 put max health script. for example this script for max health [fld dword ptr [ecx+48]].
Code:
writeDouble(healthAddr,1)


Last edited by sjl002 on Thu Nov 19, 2015 10:26 pm; edited 2 times in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 10:15 pm    Post subject: Reply with quote

I don't know what you're asking. What is [ecx+48]? Health? MaxHealth? And what do you want to do with that?
_________________
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
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 10:24 pm    Post subject: Reply with quote

this script for max health.I want value go to max.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Thu Nov 19, 2015 10:26 pm    Post subject: Reply with quote

You can just put it to whatever the max is.
Code:
{$lua}
[ENABLE]
writeDouble(healthAddr,999)
[DISABLE]
writeDouble(healthAddr,100)

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

Joined: 31 Aug 2013
Posts: 305

PostPosted: Thu Nov 19, 2015 10:34 pm    Post subject: Reply with quote

This means that only should put the X value in down script.
Code:
writeDouble(healthAddr,999)

What is this script work(do)?
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Sat Nov 21, 2015 11:53 am    Post subject: Reply with quote

help please please.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Sat Nov 21, 2015 12:07 pm    Post subject: Reply with quote

From main.lua:
Quote:
writeDouble(address,value) : Writes a double precision floating point to the specified address. Returns true on success

The address is just some integer, like I had posted in a previous script.

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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