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 


Bits

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sat Aug 07, 2021 5:17 am    Post subject: Bits Reply with quote

How i can use bits to write in integer
Those bits
Code:
 -- Bits are in decimal
1 -- Default
2 -- Multiply speed
4 -- Multiply jump
8 -- Multiply damage
16 -- Multiply defence
32 -- Multiply critical hit
64 -- Multiply defence,critical,damage
128 --Unknown?

_________________
void(__cdecl *Haxing)(HWND hGameWindow)
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Sat Aug 07, 2021 8:03 am    Post subject: Reply with quote

Bits are not decimal. They're base 2. Decimal is base 10 but your request is somewhat confusing.

You want to convert integer to bits and vice-versa?
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Aug 07, 2021 9:08 am    Post subject: Reply with quote

You have to use bitwise operators to set/check individual bits.

https://en.wikipedia.org/wiki/Bitwise_operation

_________________
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sat Aug 07, 2021 10:57 am    Post subject: Reply with quote

I'm not sure what 1 means. If it's an uneven value all other bits are ignored ?

Anyhow, ignoring the weird bit 1, if you wish to activate Multiply damage (8) then

Code:

writeBytes(address,readBytes(address,1) | 8)


to disable Multiply damage:
Code:

writeBytes(address,readBytes(address,1) & ~8)


to activate both Multiply damage (8) and Multiply critical hit (32)
Code:

writeBytes(address,readBytes(address,1) | 8 | 32)


to deactivate both of them at the same time:
Code:

writeBytes(address,readBytes(address,1) & ~( 8 | 32))

_________________
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
Back to top
View user's profile Send private message MSN Messenger
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Sun Aug 08, 2021 12:42 pm    Post subject: Reply with quote

Thanks for help
_________________
void(__cdecl *Haxing)(HWND hGameWindow)
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