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 


Change Value only if its not the same adress as

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

Joined: 09 Nov 2013
Posts: 2

PostPosted: Sat Nov 09, 2013 11:12 am    Post subject: Change Value only if its not the same adress as Reply with quote

Hi,
I got 2 pointers (HP) 1st always show my HP, 2nd swtich to enemys HP until a creep spawn.
I would like to freeze both values 1st to 100 and 2nd to 1, but only if the address is not the same.

(Enemy dead)
Pointer1 -> OWN HP -> 100 ('12345678') (Freeze to 100)
Pointer2 -> OWN HP -> 100 ('12345678') (check if OWN HP - yes! dont Freeze to 1)
(Enemy alive)
Pointer1 -> OWN HP -> 100 ('12345678') (Freeze to 100)
Pointer2 -> ENEMY HP -> 50 ('87654321') (check if OWN HP - no! Freeze to 1)

Could someone please help me?
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: Sat Nov 09, 2013 11:37 am    Post subject: Reply with quote

Lua script
Code:
errorOnLookupFailure(false)

pointer1 = '[[[[jhgsdjhd.exe+18]+340]+124]+760]+234'
pointer2 = '[[[[jhgsdjhd.exe+18]+140]+44]+12C]+58'

if freezeTimer~=nil then freezeTimer.destroy();freezeTimer=nil;end

freezeTimer = createTimer(nil,false)
freezeTimer.Interval = 50
freezeTimer.OnTimer = function ()
  local PlayerAddress = getAddress(pointer1)
  local OtherAddress = getAddress(pointer2)

  if PlayerAddress==0 or OtherAddress==0 then return end

  writeInteger(PlayerAddress,100)

  if PlayerAddress~=OtherAddress then
    if readInteger(OtherAddress) >= 2 then
      writeInteger(OtherAddress,1)
    end
  end
end




Autoassemble script

Code:
[ENABLE]
LuaCall(freezeTimer.Enabled = true)

[DISABLE]
LuaCall(freezeTimer.Enabled = false)





Freeze enemy HP to 1 or just change it to 1 once?

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

Joined: 09 Nov 2013
Posts: 2

PostPosted: Sat Nov 09, 2013 11:51 am    Post subject: Reply with quote

Quote:
Freeze enemy HP to 1 or just change it to 1 once?

I dont know whats better. Every new creep should get 1 HP. So if its not freezed, i have to clickt it everytime a new creep spwans or not?

Edit: Ok ... Smile I put your script into my table and it work perfect. I want exactly that, what its doing now. Thank you mgr.inz.Player !!!
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