Jump to content
Korean Random
Sign in to follow this  
ahwa

Кто может помочь мне пересмотреть PY

Recommended Posts

import Math
import BigWorld
import Vehicle
import CommandMapping
import Keys, ResMgr
from Avatar import PlayerAvatar
from gui.WindowsManager import g_windowsManager
from AvatarInputHandler.control_modes import ArcadeControlMode, SniperControlMode, StrategicControlMode
from constants import SERVER_TICK_LENGTH
from gui import SystemMessages
from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView
oo000 = SERVER_TICK_LENGTH / 10
ii = {'enemies_list': [],
 'speed_list': [],
 'dir_list': [],
 'aim_elastic': 0.5,
 'target_last_shot_point': None,
 'target_last_speed': 0.0,
 'target': None,
 'target_id': None,
 'max_ray_koef': 0.8,
 'AimOffset1': 2.2,
 'AutoOffset': True,
 'minOffset0': 2.0,
 'minOffset1': 1.69,
 'minOffset2': 1.7,
 'minOffset3': 1.77,
 'minOffset4': 1.78,
 'minOffset5': 1.79,
 'minOffset6': 1.87,
 'minOffset7': 1.88,
 'minOffset8': 1.89,
 'AimPointy0': 0.84,
 'AimPointy1': 0.0,
 'AimPointy2': -0.5,
 'AimPointy3': -1.0,
 'AimPointx0': 1.0,
 'AimPointx1': 2.0,
 'AimPointx2': 0.0,
 'AimPointx3': -1.0,
 'AimPointx4': -2.0,
 'KeyPointy': 'KEY_NUMPAD0',
 'KeyPointx': 'KEY_NUMPADPERIOD'}

AimOffset = ii['AimOffset1']
AimPointy = ii['AimPointy1']
AimPointx = ii['AimPointx2']
EnemyId = None
Check_dist = True
old_AimOffset = 0.0
#Kilometer = None


isLogin = True
LOGIN_TEXT_MESSAGE = '<font color="#cc9933"><b>AutoAimbot</b></font>'
old_populate = LobbyView._populate

def new_populate(self):
    global isLogin
    old_populate(self)
    if isLogin:
        SystemMessages.pushI18nMessage(LOGIN_TEXT_MESSAGE, type=SystemMessages.SM_TYPE.Warning)
        isLogin = False

LobbyView._populate = new_populate
oOOo = ArcadeControlMode.handleKeyEvent
O0 = SniperControlMode.handleKeyEvent
o0O = StrategicControlMode.handleKeyEvent
iI11I1II1I1I = PlayerAvatar.vehicle_onEnterWorld
oooo = PlayerAvatar.vehicle_onLeaveWorld
old_PlayerAvatar = PlayerAvatar.handleKey

class ii11i:

    def update(self):
        global ii
        global AimOffset
        global AimPointy
        global AimPointx
        global Kilometer
        global old_AimOffset
        global Check_dist


        if ii['target'] is None or ii['target_id'] not in ii['enemies_list'] or not BigWorld.player().arena.vehicles.get(ii

['target_id'])['isAlive']:
            I11i.lost()
            return
        else:
            O0O = ii['target'].typeDescriptor
            Oo = ii['target'].position



            I1ii11iIi11i = None
            if ii['target_last_shot_point'] is None:
                I1ii11iIi11i = Oo
            else:
                I1ii11iIi11i = ii['target_last_shot_point']
            ii['target_last_shot_point'] = Oo
            I1IiI = abs(round(ii['target'].filter.speedInfo.value[0], 2))
            ii['speed_list'].append(I1IiI)
            if len(ii['speed_list']) > 5:
                ii['speed_list'].pop(0)
            I1IiI = 0.0
            for o0OOO in ii['speed_list']:
                I1IiI = I1IiI + o0OOO

            #Kilometer = (BigWorld.player().position - BigWorld.entity(ii['target_id']).position).length

       

            if ii['AutoOffset']:
                dist = (BigWorld.player().position - BigWorld.entity(ii['target_id']).position).length

                if Check_dist and dist < 18:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset0']
                    AimPointy = ii['AimPointy2']
                    Check_dist = False
                if not Check_dist and dist > 18:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                        AimPointy = ii['AimPointy1']
                    Check_dist = True


                if Check_dist and dist < 20:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset1']
                    AimPointy = ii['AimPointy2']
                    Check_dist = False
                if not Check_dist and dist > 20:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                        AimPointy = ii['AimPointy1']
                    Check_dist = True


                if Check_dist and dist < 30:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset2']
                    AimPointy = ii['AimPointy2']
                    Check_dist = False
                if not Check_dist and dist > 30:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                        AimPointy = ii['AimPointy1']
                    Check_dist = True

                if Check_dist and dist < 50:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset3']
                    Check_dist = False
                if not Check_dist and dist > 50:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True


                if Check_dist and dist < 100:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset4']
                    Check_dist = False
                if not Check_dist and dist > 100:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True


                if Check_dist and dist < 200:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset5']
                    Check_dist = False
                if not Check_dist and dist > 200:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True


                if Check_dist and dist < 300:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset6']
                    Check_dist = False
                if not Check_dist and dist > 300:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True


                if Check_dist and dist < 400:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset7']
                    Check_dist = False
                if not Check_dist and dist > 400:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True

                if Check_dist and dist < 500:
                    old_AimOffset = AimOffset
                    AimOffset = ii['minOffset8']
                    Check_dist = False
                if not Check_dist and dist > 500:
                    if AimOffset == ii['minOffset0']:
                        AimOffset = old_AimOffset
                    Check_dist = True


            I1IiI = I1IiI / len(ii['speed_list']) * AimOffset
            IiiIII111iI = Oo - I1ii11iIi11i
            IiiIII111iI.normalise()
            ii['dir_list'].append(IiiIII111iI)
            if len(ii['dir_list']) > 3:
                ii['dir_list'].pop(0)
            IiiIII111iI = (0, 0, 0)
            for o0OOO in ii['dir_list']:
                IiiIII111iI = IiiIII111iI + o0OOO

            IiiIII111iI = IiiIII111iI / len(ii['dir_list'])
            OoI1Ii11I1Ii1i = BigWorld.player().vehicleTypeDescriptor.shot['speed']
            Ooo = BigWorld.player().vehicleTypeDescriptor.shot['gravity']
            o0oOoO00o = BigWorld.player().vehicleTypeDescriptor.shot['maxDistance']
            i1 = (BigWorld.player().position - Oo).length
            i1 = i1 * (o0oOoO00o - Ooo) / o0oOoO00o
            oOOoo00O0O = i1 / OoI1Ii11I1Ii1i
            i1111 = I1IiI * oOOoo00O0O
            i11 = Oo + IiiIII111iI * i1111
            I11 = i11

            I11.y += O0O.chassis['hullPosition'].y + O0O.hull['turretPositions'][0].y + AimPointy
            I11.x += O0O.chassis['hullPosition'].x + O0O.hull['turretPositions'][0].x + AimPointx
            BigWorld.player().gunRotator._VehicleGunRotator__updateShotPointOnServer(I11)
            BigWorld.player().gunRotator._VehicleGunRotator__rotate(I11, oo000 * 2)
            BigWorld.player().gunRotator._VehicleGunRotator__updateGunMarker()
            return
            return

class I11i:
    autoaim = None
        
    @staticmethod
    def add(autoaim):
        I11i.remove()
        I11i.autoaim = autoaim
        i1iIIi1 = BigWorld.player()
        i1iIIi1.soundNotifications.play('target_captured')
        if hasattr(i1iIIi1, 'gunRotator'):
            BigWorld.player().gunRotator.clientMode = False
        I11i.update()
        BigWorld.flushPythonLog()

    @staticmethod
    def remove():
        if I11i.autoaim is None:
            return
        else:
            i1iIIi1 = BigWorld.player()
            I11i.autoaim = None
            if hasattr(i1iIIi1, 'gunRotator'):
                BigWorld.player().gunRotator.clientMode = True
            i1iIIi1.soundNotifications.play('target_unlocked')
            return
            return

    @staticmethod
    def lost():
        if I11i.autoaim is None:
            return
        else:
            i1iIIi1 = BigWorld.player()
            I11i.autoaim = None
            if hasattr(i1iIIi1, 'gunRotator'):
                BigWorld.player().gunRotator.clientMode = True
            i1iIIi1.soundNotifications.play('target_lost')
            return
            return


    @staticmethod
    def hasAutoAim():
        return I11i.autoaim is not None

    @staticmethod
    def update():
        if I11i.hasAutoAim():
            I11i.autoaim.update()
            BigWorld.callback(oo000, I11i.update)


def i1iIIIiI1I():
    OOoO000O0OO = BigWorld.camera().position

    iiI1IiI = BigWorld.player().inputHandler.getDesiredShotPoint()

    if OOoO000O0OO is None or iiI1IiI is None:
        return
    else:
        dir = iiI1IiI - OOoO000O0OO
        dir.normalise()
        OOoO000O0OO = OOoO000O0OO + dir * 10
        iiI1IiI = OOoO000O0OO + dir * 1000
        IIooOoOoo0O = 10000
        OooO0 = None
        for II11iiii1Ii in BigWorld.entities.values():
            if type(II11iiii1Ii) is Vehicle.Vehicle and BigWorld.player().arena.vehicles.get(II11iiii1Ii.id)['isAlive'] and 

BigWorld.player().arena.vehicles[BigWorld.player().playerVehicleID]['team'] != BigWorld.player().arena.vehicles

[II11iiii1Ii.id]['team']:
                #Kilometer = (BigWorld.player().position - BigWorld.entity(II11iiii1Ii.id).position).length
                EnemyId = str(BigWorld.player().arena.vehicles.get(II11iiii1Ii.id)['vehicleType'].type.shortUserString)
                with open('ID.txt', 'a') as fc:
                    fc.write(str(EnemyId)+"\n")
                OO0o = (OOoO000O0OO - II11iiii1Ii.position).length
                OooO0o0Oo = OOoO000O0OO + dir * OO0o
                Oo00OOOOO = (OooO0o0Oo - II11iiii1Ii.position).length
                if OO0o * ii['max_ray_koef'] > Oo00OOOOO and Oo00OOOOO < IIooOoOoo0O:
                    IIooOoOoo0O = Oo00OOOOO
                    OooO0 = II11iiii1Ii
        if OooO0 != ii['target']:
            return OooO0
        return
        return


def OO0o00o():
    return hasattr(BigWorld.player(), 'arena')

def III1ii1iII(id):
    return OO0o00o() and id in BigWorld.player().arena.vehicles and BigWorld.player().arena.vehicles.get(id)['isAlive']


def i11Iiii(id):
    return OO0o00o() and BigWorld.player().arena.vehicles[BigWorld.player().playerVehicleID]['team'] == BigWorld.player

().arena.vehicles[id]['team']


#---handleKeyEvent--Start--ii['target'].typeDescriptor.chassis-#

def Tp():
    if ii['target_id'] is not None:
       impactType =  BigWorld.player().arena.vehicles.get(ii['target_id'])['vehicleType'].type.tags
       impactTag = ['lightTank',
         'mediumTank',
         'heavyTank',
         'AT-SPG',
         'SPG']
       impactSet = set(impactType & frozenset(impactTag)).pop()
       if impactSet == impactTag[0]:
          ii['AimPointy1'] = -0.2

          ii['AimPointx0'] = 0.5
          ii['AimPointx1'] = 0.9
          ii['AimPointx3'] = -0.5
          ii['AimPointx4'] = -0.9
       if impactSet == impactTag[1]:
          ii['AimPointy1'] = 0.2


       if impactSet == impactTag[2]:
          ii['AimPointy1'] = 0.2

          ii['AimPointx0'] = 3.5
          ii['AimPointx1'] = 3.8
          ii['AimPointx3'] = -3.5
          ii['AimPointx4'] = -3.8

       if impactSet == impactTag[3]:
          ii['AimPointy1'] = -0.35

          ii['AimPointx2'] = -0.6

       if impactSet == impactTag[4]:
          ii['AimPointy1'] = -0.4

    if ii['target_id'] is None:
       ii['AimPointy1'] = 0.0

       ii['AimPointx2'] = 0.0

def i1IiIiiI(self, isDown, key, mods, event = None):
    global AimPointy
    global AimPointx
    if CommandMapping is None:
        return oOOo(self, isDown, key, mods, event)
    else:
        I1I = CommandMapping.g_instance
        isFiredLockTarget = I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET, key) and isDown
        if isFiredLockTarget:
            oOO00oOO = i1iIIIiI1I()
            if oOO00oOO is None:
                ii['target_id'] = None
                ii['target'] = None
                I11i.remove()
                Tp()
                if AimPointx == ii['AimPointx0']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx1']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx3']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx4']:
                   AimPointx = ii['AimPointx2']
                if AimPointy == ii['AimPointy0']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy2']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy3']:
                   AimPointy = ii['AimPointy1']

                return oOOo(self, isDown, key, mods, event)
            if oOO00oOO is not None and III1ii1iII(oOO00oOO.id) and not i11Iiii(oOO00oOO.id):
                ii['target_id'] = oOO00oOO.id
                ii['target'] = oOO00oOO
                Tp()
                I11i.add(ii11i())
            return 
        if I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET_OFF, key) and isDown:
            ii['target_id'] = None
            ii['target'] = None
            I11i.remove()
            Tp()
            if AimPointx == ii['AimPointx0']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx1']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx3']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx4']:
               AimPointx = ii['AimPointx2']
            if AimPointy == ii['AimPointy0']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy2']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy3']:
               AimPointy = ii['AimPointy1']
        return oOOo(self, isDown, key, mods, event)
        return

def Oooo0Ooo000(self, isDown, key, mods, event = None):
    global AimPointy
    global AimPointx
    if CommandMapping is None:
        return O0(self, isDown, key, mods, event)
    else:
        I1I = CommandMapping.g_instance
        isFiredLockTarget = I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET, key) and isDown
        if isFiredLockTarget:
            oOO00oOO = i1iIIIiI1I()
            if oOO00oOO is None:
                ii['target_id'] = None
                ii['target'] = None
                I11i.remove()
                Tp()
                if AimPointx == ii['AimPointx0']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx1']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx3']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx4']:
                   AimPointx = ii['AimPointx2']

                if AimPointy == ii['AimPointy0']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy2']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy3']:
                   AimPointy = ii['AimPointy1']
                return O0(self, isDown, key, mods, event)
            if oOO00oOO is not None and III1ii1iII(oOO00oOO.id) and not i11Iiii(oOO00oOO.id):
                ii['target_id'] = oOO00oOO.id
                ii['target'] = oOO00oOO
                Tp()
                I11i.add(ii11i())
            return 

        if I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET_OFF, key) and isDown:
            ii['target_id'] = None
            ii['target'] = None
            I11i.remove()
            Tp()
            if AimPointx == ii['AimPointx0']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx1']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx3']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx4']:
               AimPointx = ii['AimPointx2']
            if AimPointy == ii['AimPointy0']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy2']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy3']:
               AimPointy = ii['AimPointy1']
        return O0(self, isDown, key, mods, event)
        return

def IIiIi11i1(self, isDown, key, mods, event = None):
    global AimPointy
    global AimPointx
    if CommandMapping is None:
        return o0O(self, isDown, key, mods, event)
    else:
        I1I = CommandMapping.g_instance
        isFiredLockTarget = I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET, key) and isDown
        if isFiredLockTarget:
            oOO00oOO = i1iIIIiI1I()
            if oOO00oOO is None:
                ii['target_id'] = None
                ii['target'] = None
                I11i.remove()
                Tp()
                if AimPointx == ii['AimPointx0']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx1']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx3']:
                   AimPointx = ii['AimPointx2']
                if AimPointx == ii['AimPointx4']:
                   AimPointx = ii['AimPointx2']

                if AimPointy == ii['AimPointy0']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy2']:
                   AimPointy = ii['AimPointy1']
                if AimPointy == ii['AimPointy3']:
                   AimPointy = ii['AimPointy1']

                return o0O(self, isDown, key, mods, event)

            if oOO00oOO is not None and III1ii1iII(oOO00oOO.id) and not i11Iiii(oOO00oOO.id):
                ii['target_id'] = oOO00oOO.id
                ii['target'] = oOO00oOO
                Tp()
                I11i.add(ii11i())
            return
        if I1I.isFired(CommandMapping.CMD_CM_LOCK_TARGET_OFF, key) and isDown:
            ii['target_id'] = None
            ii['target'] = None
            I11i.remove()
            Tp()
            if AimPointx == ii['AimPointx0']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx1']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx3']:
               AimPointx = ii['AimPointx2']
            if AimPointx == ii['AimPointx4']:
               AimPointx = ii['AimPointx2']

            if AimPointy == ii['AimPointy0']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy2']:
               AimPointy = ii['AimPointy1']
            if AimPointy == ii['AimPointy3']:
               AimPointy = ii['AimPointy1']

        return o0O(self, isDown, key, mods, event)
        return

#---handleKeyEvent--End---#

def o0O0o0Oo(self, vehicle):
    iI11I1II1I1I(self, vehicle)
    if III1ii1iII(vehicle.id) and not i11Iiii(vehicle.id):
        if vehicle.id not in ii['enemies_list']:
            ii['enemies_list'].append(vehicle.id)


def O0O0O(self, vehicle):
    oooo(self, vehicle)
    if vehicle.id in ii['enemies_list']:
        ii['enemies_list'].remove(vehicle.id)


def IIii1Ii1(targetID, atackerID, reason):
    if targetID in ii['enemies_list']:
        ii['enemies_list'].remove(targetID)


def O00Oo000ooO0():
    ii['enemies_list'] = []
    ii['speed_list'] = []
    ii['target'] = None
    ii['target_id'] = None
    return


def Ii1iIiii1():
    BigWorld.player().arena.onVehicleKilled += IIii1Ii1
    O00Oo000ooO0()


def OO00o():
    BigWorld.player().arena.onVehicleKilled -= IIii1Ii1
    O00Oo000ooO0()


def new_PlayerAvatar(self, isDown, key, mods):
    global AimPointy
    global AimPointx
    old_PlayerAvatar(self, isDown, key, mods)
    if BigWorld.player() is None:
        return
    elif not BigWorld.player().isOnArena:
        return
    elif BigWorld.player().inputHandler is None:
        return
    else:
        if key == getattr(Keys, ii['KeyPointx']) and isDown:
            if AimPointx == ii['AimPointx2']:
                AimPointx = ii['AimPointx3']
                
                return

            elif AimPointx == ii['AimPointx3']:
                AimPointx = ii['AimPointx4']
                
                return

            elif AimPointx == ii['AimPointx4']:
                AimPointx = ii['AimPointx0']
                
                return

            elif AimPointx == ii['AimPointx0']:
                AimPointx = ii['AimPointx1']
                
                return
            else:
                AimPointx = ii['AimPointx2']
                
                return

        if key == getattr(Keys, ii['KeyPointy']) and isDown:
            if AimPointy == ii['AimPointy0']:
                Tp()
                AimPointy = ii['AimPointy1']
                
                return
            elif AimPointy == ii['AimPointy1']:
                AimPointy = ii['AimPointy2']
                
                return
            elif AimPointy == ii['AimPointy2']:
                AimPointy = ii['AimPointy3']
                
                return
            else:
                AimPointy = ii['AimPointy0']
                
                return
        else:
            return
        return
        return


PlayerAvatar.handleKey = new_PlayerAvatar
ArcadeControlMode.handleKeyEvent = i1IiIiiI
SniperControlMode.handleKeyEvent = Oooo0Ooo000
StrategicControlMode.handleKeyEvent = IIiIi11i1
PlayerAvatar.vehicle_onEnterWorld = o0O0o0Oo
PlayerAvatar.vehicle_onLeaveWorld = O0O0O
g_windowsManager.onInitBattleGUI += Ii1iIiii1
g_windowsManager.onDestroyBattleGUI += OO00o

Кто может помочь мне быть более точной коррекции или лучший способ

Спасибо !!

  • Downvote 5

Share this post


Link to post

Short link
Share on other sites

более точной коррекции - Тут надо заходить в тестовые комнаты и настраивать упреждение.. 

 

Спроси у того кто правил прицел, есть на этом сайте (ник "sae" вроде правил) а изначальный автор "Lportii" (тоже есть)  ))

 

И вообще тут читеров не любят а уважают хороших людей улучшающих игру...

Edited by KACTET

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...