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 


how to mov the nearest distance with Assembly

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Mon Feb 19, 2018 5:42 pm    Post subject: how to mov the nearest distance with Assembly Reply with quote

if the max Distance between me and my enemy is 20 .
and I have 3 enemy's in my map
the Distance between me and :
enemy1 → 5
enemy2 → 10
enemy3 →15

I want to mov base address of nearest enemy only with assembly .

to the register symbol [enemy__base].
eg mov [enemy__base],esi
ie. I want to get ( ESI )of nearest enemy to me
The problem is the far enemy is taken sometimes or the middle one ... I how to write them in order .. without using pointer of each one ..
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Mon Feb 19, 2018 11:55 pm    Post subject: Reply with quote

This is untested and you'll likely want to make adjustments for your particular situation.
Code:
code:
 cmp [enemy_base+4],esi
 jb @f
 mov [enemy_base+4],esi
@@:
 dec [enemy_base+8]
 jne return
 push eax
 mov eax,[enemy_base+4]
 mov [enemy_base],eax
 mov [enemy_base+4],ffff0000
 mov [enemy_base+8],3
 pop eax
 jmp return

enemy_base:
dd 0 ffff0000 3
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 Discussions 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