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 


Fix Aimbot accuracy for third person game

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Der5t
Newbie cheater
Reputation: 0

Joined: 10 Mar 2014
Posts: 14

PostPosted: Sun Aug 28, 2016 11:05 am    Post subject: Fix Aimbot accuracy for third person game Reply with quote

So I tried my hand at making an aimbot for Vice City.Here's a part of my lua code.

Code:

  local CompleteCircleAngle = math.pi*2
  local West= math.pi*2 --West is 0. pi * 2 is max value of the X mouse Axis
  local East=math.pi
  local North=math.pi+(math.pi/2)
  local South=math.pi-(math.pi/2)

  if EnemyX > MyX and EnemyY > MyY then
    Quadrant = 1 --North-East
    local deltaX = EnemyX-MyX
    local deltaY = EnemyY-MyY
    local AngleX = math.atan2(deltaY,deltaX) * 180/math.pi --Convert to degrees
    local AngleXPercentage = AngleX/360 --Get percentage of the angle
    local ToWriteAngleX = East + (CompleteCircleAngle * AngleXPercentage)
    writeFloat(PlayerMouseX, ToWriteAngleX)
  elseif EnemyX < MyX and EnemyY > MyY then
    Quadrant = 2 --North-West
    local deltaX = MyX-EnemyX
    local deltaY = EnemyY-MyY
    local AngleX = math.atan2(deltaY,deltaX) * 180/math.pi
    local AngleXPercentage = AngleX/360
    local ToWriteAngleX = West - (CompleteCircleAngle * AngleXPercentage)
    writeFloat(PlayerMouseX, ToWriteAngleX)
  elseif EnemyX < MyX and EnemyY < MyY then
    Quadrant = 3 --South-West
    local deltaX = MyX-EnemyX
    local deltaY = MyY-EnemyY
    local AngleX = math.atan2(deltaY,deltaX) * 180/math.pi
    local AngleXPercentage = AngleX/360
    local ToWriteAngleX = West + (CompleteCircleAngle * AngleXPercentage)
    writeFloat(PlayerMouseX, ToWriteAngleX)
  else--if EnemyX > MyX and EnemyY < MyY then
    Quadrant = 4 --South-East
    local deltaX = EnemyX-MyX
    local deltaY = MyY-EnemyY
    local AngleX = math.atan2(deltaY,deltaX) * 180/math.pi
    local AngleXPercentage = AngleX/360
    local ToWriteAngleX = East - (CompleteCircleAngle * AngleXPercentage)
    writeFloat(PlayerMouseX, ToWriteAngleX)
  end

2dDistance = math.sqrt(math.pow(EnemyX - MyX,2) + math.pow(readFloat(EnemyY) - readFloat(MyY),2))

  if EnemyZ > MyZ then
    local deltaZ = EnemyZ - (MyZ)
    local AngleY = math.atan2(deltaZ, 2dDistance) * 180/math.pi
    local AngleYPercentage = AngleY/360
    local ToWriteAngleY = 0 + (CompleteCircleAngle * AngleYPercentage)
    writeFloat(PlayerMouseY, ToWriteAngleY)
  else
    local deltaZ = (MyZ) - EnemyZ
    local AngleY = math.atan2(deltaZ, 2dDistance) * 180/math.pi
    local AngleYPercentage = AngleY/360
    local ToWriteAngleY = 0 - (CompleteCircleAngle * AngleYPercentage)
    writeFloat(PlayerMouseY, ToWriteAngleY)
  end


When I execute it, my X mouse lands exactly on the player.But Y mouse is inaccurate (I tried some ways to fix it but it didn't work).
The problem is with my distance from enemy.The close/further I move, My Y mouse changes (by aimbot) but it does so inaccurately.

Some notes:

The game is third person.
The closer I get to the player, the lower the aim should get.
The camera rotates around the player in a circular path when I move mouse up/down.
X mouse axis increases when I turn counter clockwise.

I'll try uploading some ingame screenshots or diagram maybe.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Aug 31, 2016 3:42 pm    Post subject: Re: Fix Aimbot accuracy for third person game Reply with quote

Well I have some difficulty to understand script, more to the game counter strike I made this script.
Code:

Camera_X = getAddress('cstrike.exe+19DC408')
Camera_Y = getAddress('cstrike.exe+19DC404')
bot = {'[cstrike.exe+1101CFC]+3AC','[cstrike.exe+1101CFC]+3B0','[cstrike.exe+1101CFC]+3B4'}
player = {'[cstrike.exe+1101CFC]+88','[cstrike.exe+1101CFC]+8C','[cstrike.exe+1101CFC]+90'}

function aimbot()

         calcX=readFloat(player[2])-readFloat(bot[2])
         calcY=readFloat(player[1])-readFloat(bot[1])
         calcZ=readFloat(player[3])-readFloat(bot[3])+5 --control Y mouse

         ZXdistance=math.sqrt(math.pow(calcX, 2)+math.pow(calcY, 2))

         angleX=math.deg(math.atan2(calcX, calcY))-180 --control X mouse
         angleY=math.deg(math.atan2(calcZ, ZXdistance))

         if (isKeyPressed(VK_V)) then
            writeFloat(Camera_X, angleX)
            writeFloat(Camera_Y, angleY)
         end
end

if t then t.destroy(); t=nil end
t=createTimer(nil)
timer_setInterval(t, 1)
timer_onTimer(t, aimbot)
Back to top
View user's profile Send private message
Der5t
Newbie cheater
Reputation: 0

Joined: 10 Mar 2014
Posts: 14

PostPosted: Thu Sep 01, 2016 4:54 am    Post subject: Reply with quote

My code is doing pretty much the same what yours is.But I don't understand how I can get the Y Camera Aim.

Here are two diagrams.



Third Person.png
 Description:
My Game Aim
 Filesize:  24.44 KB
 Viewed:  8810 Time(s)

Third Person.png



First Person.png
 Description:
First Person Aim
 Filesize:  7.88 KB
 Viewed:  8810 Time(s)

First Person.png


Back to top
View user's profile Send private message
Bl4D3
How do I cheat?
Reputation: 0

Joined: 02 Aug 2017
Posts: 1

PostPosted: Wed Aug 02, 2017 3:51 am    Post subject: Reply with quote

Hello did you get successful in making aimbot for vice city ?
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