Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to use the script?
- 1. Open up developer tools
- 2. Go to console
- 3. Paste the script into the console and press enter (NOTE YOU HAVE TO BE IN THE GAME WHEN YOU'RE DONE LOADING INTO A SERVER)
- Controls
- Shift - 8x scope
- Ctrl - Even bigger scope
- Space (you can hold space or not, it's up to you) - Assisted aim
- 5 - Laser dot
- V - Walk to nearby items
- //game.predictor.weaponSystem.currentWeapon.cooldown
- game.simulator.id++;
- console.clear();
- var centerX = window.innerWidth / 2;
- var centerY = window.innerHeight / 2;
- var img = [ [ "https://i.imgur.com/gqvL4kz.png", "aimHealth" ] ];
- for ( var i in img )
- {
- window[ "image" + i ] = new Image();
- window[ "image" + i ].src = img[ i ];
- window[ "image" + i ].style.position = "absolute";
- window[ "image" + i ].style.display = "inline-block";
- window[ "image" + i ].id = img[ i ][ 1 ];
- window[ "image" + i ].style.width = "30px";
- window[ "image" + i ].style.marginLeft = "-15px";
- window[ "image" + i ].style.marginTop = "-15px";
- window[ "image" + i ].style.left = centerX + 'px';
- window[ "image" + i ].style.top = centerY + 'px';
- window[ "image" + i ].style.zIndex = Infinity;
- document.body.appendChild( window[ "image" + i ] );
- }
- function TouchKey ( c, k )
- {
- var e = new Event( "keydown" );
- e.key = c;
- e.keyCode = k;
- e.which = e.keyCode;
- e.altKey = false;
- e.ctrlKey = true;
- e.shiftKey = false;
- e.metaKey = false;
- e.bubbles = true;
- document.dispatchEvent( e );
- var f = new Event( "keyup" );
- f.key = c;
- f.keyCode = k;
- f.which = e.keyCode;
- f.altKey = false;
- f.ctrlKey = true;
- f.shiftKey = false;
- f.metaKey = false;
- f.bubbles = true;
- document.dispatchEvent( f );
- } // drop( 'e', 69 );
- function KeyUp ( c, k )
- {
- var e = new Event( "keyup" );
- e.key = c;
- e.keyCode = k;
- e.which = e.keyCode;
- e.altKey = false;
- e.ctrlKey = true;
- e.shiftKey = false;
- e.metaKey = false;
- e.bubbles = true;
- document.dispatchEvent( e );
- }
- function KeyDown ( c, k )
- {
- var e = new Event( "keydown" );
- e.key = c;
- e.keyCode = k;
- e.which = e.keyCode;
- e.altKey = false;
- e.ctrlKey = true;
- e.shiftKey = false;
- e.metaKey = false;
- e.bubbles = true;
- document.dispatchEvent( e );
- }
- function GetDistance ( x, y, x2, y2 )
- {
- return d = Math.sqrt( Math.pow( x - x2, 2 ) + Math.pow( y - y2, 2 ) );
- }
- function FindShootablePlayer ()
- {
- var cid = undefined;
- var CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState.mx, game.input.currentState.my );
- var d = Infinity;
- var MouseX = CoordinatesTranslation[ "x" ];
- var MouseY = CoordinatesTranslation[ "y" ];
- var Myself = game.renderer.myEntity;
- var player = undefined;
- var PlayerIdsArray = [];
- var Raydistance = undefined;
- var RayToPlayer = undefined;
- var ToPlayerDistance = Infinity;
- var ToPlayerDistance = undefined;
- //Retreive all players
- for ( var key of game.simulator.entities.keys() )
- {
- if ( game.simulator.entities.get( key ).id != Myself.id && game.simulator.entities.get( key ).isPlayer == true && game.simulator.entities.get( key ).isGhost == false )
- {
- PlayerIdsArray.push( game.simulator.entities.get( key ).id );
- }
- }
- if ( PlayerIdsArray.length == 0 )
- {
- TargetPlayer = undefined;
- return
- }
- //Remove non shootable players
- for ( let index = 0; index < PlayerIdsArray.length; index++ )
- {
- player = game.simulator.entities.get( PlayerIdsArray[ index ] );
- RayToPlayer = game.simulator.collisionSystem.computeRay(
- {
- x: Myself.x
- , y: Myself.y
- }, Math.atan2( player.y - Myself.y, player.x - Myself.x ), game.predictor.weaponSystem.currentWeapon.bulletTravelDistance );
- Raydistance = GetDistance( RayToPlayer.endX, RayToPlayer.endY, RayToPlayer.startX, RayToPlayer.startY );
- ToPlayerDistance = GetDistance( Myself.x, Myself.y, player.x, player.y );
- if ( Raydistance < ToPlayerDistance )
- {
- PlayerIdsArray.splice( index, 1 );
- }
- }
- //Get closest player
- for ( let index = 0; index < PlayerIdsArray.length; index++ )
- {
- player = game.simulator.entities.get( PlayerIdsArray[ index ] );
- ToPlayerDistance = GetDistance( MouseX, MouseY, player.x, player.y );
- if ( d > ToPlayerDistance )
- {
- d = ToPlayerDistance;
- cid = PlayerIdsArray[ index ];
- }
- }
- //asign TargetPlayer
- TargetPlayer = game.simulator.entities.get( cid );
- return
- }
- var Interval_Aimbot = 0;
- var Interval_FollowTarget = 0;
- var Interval_WalkToHealth = 0;
- var KeyMap = {};
- var Myself = 0;
- var TargetPlayer = undefined;
- var Toggle_Aimbot = false;
- var Toggle_FollowTarget = false;
- var Toggle_WalkToHealth = false;
- var LastuserX = 0;
- var LastuserY = 0;
- setInterval( FindShootablePlayer, 10 );
- onkeydown = onkeyup = function ( e )
- {
- e = e || event;
- KeyMap[ e.keyCode ] = e.type == 'keydown';
- //if ( ( e.keyCode == 32 ) && ( e.type == "keydown" ))
- //-----------------------------------------------------
- if ( e.keyCode == 82 && e.type == "keyup" )
- {
- MyReload();
- }
- if ( e.keyCode == 53 )
- {
- game.renderer.myEntity.addLaserSight();
- }
- if ( e.keyCode == 17 )
- {
- game.renderer.setZoomLevel( 1 );
- }
- if ( e.keyCode == 16 )
- {
- game.renderer.setZoomLevel( 2 );
- }
- if ( ( e.keyCode == 32 ) && ( e.type == "keydown" ) && ( Toggle_Aimbot == false ) )
- {
- Toggle_Aimbot = true;
- Interval_Aimbot = setInterval( Aimbot, 5 );
- }
- if ( ( e.keyCode == 32 ) && ( e.type == "keyup" ) && ( Toggle_Aimbot == true ) )
- {
- Toggle_Aimbot = false;
- clearInterval( Interval_Aimbot );
- Interval_Aimbot = 0;
- game.input.currentState.mouseDown = false;
- }
- if ( ( e.keyCode == 86 ) && ( e.type == "keydown" ) && ( Toggle_WalkToHealth ==
- false ) )
- {
- for ( var i in img )
- {
- window[ "image" + i ].style.display = "inline-block";
- }
- Toggle_WalkToHealth = true;
- Interval_WalkToHealth = setInterval( PickupHealth, 5 );
- }
- if ( ( e.keyCode == 86 ) && ( e.type == "keyup" ) && ( Toggle_WalkToHealth == true ) )
- {
- for ( var i in img )
- {
- window[ "image" + i ].style.display = "none";
- }
- Toggle_WalkToHealth = false;
- clearInterval( Interval_WalkToHealth );
- Interval_WalkToHealth = 0;
- game.input.currentState.a = false;
- game.input.currentState.d = false;
- game.input.currentState.s = false;
- game.input.currentState.w = false;
- }
- }
- function Aimbot ()
- {
- game.predictor.weaponSystem.currentWeapon.kickAmount = 0;
- game.predictor.weaponSystem.currentWeapon.recoilAccumulator = 0;
- game.predictor.weaponSystem.currentWeapon.recoilMax = 0;
- game.predictor.weaponSystem.currentWeapon.recoilStrength = 0;
- //Initialize variables
- var Myself = game.renderer.myEntity;
- var MyTargetVar = game.renderer.entities.get( TargetPlayer.id );
- var RayToPlayer = undefined;
- var Raydistance = undefined;
- var ToPlayerDistance = undefined;
- //Reload if needed
- if ( game.predictor.weaponSystem.currentWeapon.currentAmmo == 0 && game.predictor
- .weaponSystem.currentWeapon.isReloading == false )
- {
- MyReload();
- }
- //Heal if needed
- if ( Myself.hasBandages == true && Myself._hp < 70 )
- {
- game.input.currentState.one = true;
- setTimeout( function ()
- {
- game.input.currentState.one = false;
- }, 20 );
- }
- if ( Myself.hasPainkillers == true && Myself._hp < 69 )
- {
- game.input.currentState.two = true;
- setTimeout( function ()
- {
- game.input.currentState.two = false;
- }, 20 );
- }
- if ( Myself.hasMedpack == true && Myself._hp < 50 )
- {
- game.input.currentState.three = true;
- setTimeout( function ()
- {
- game.input.currentState.three = false;
- }, 20 );
- }
- //Exit if no target acquired
- if ( MyTargetVar == undefined )
- {
- return
- }
- //ConfirmShot
- RayToPlayer = game.simulator.collisionSystem.computeRay(
- {
- x: Myself.x
- , y: Myself.y
- }, Math.atan2( MyTargetVar.y - Myself.y, MyTargetVar.x - Myself.x ), game.predictor.weaponSystem.currentWeapon.bulletTravelDistance );
- Raydistance = GetDistance( RayToPlayer.endX, RayToPlayer.endY, RayToPlayer.startX, RayToPlayer.startY );
- ToPlayerDistance = GetDistance( Myself.x, Myself.y, MyTargetVar.x, MyTargetVar.y );
- if ( Raydistance > ToPlayerDistance )
- {
- AimToPos( MyTargetVar.x, MyTargetVar.y );
- game.input.frameState.mouseDown = true;
- }
- else
- {
- return
- }
- return
- }
- function AimToPos ( _x, _y )
- {
- var CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- //-----------------------------------------------------------
- if ( CoordinatesTranslation[ "x" ] + 20 < _x )
- {
- game.input.currentState.mx += 20
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] + 20 < _y )
- {
- game.input.currentState.my += 20
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "x" ] - 20 > _x )
- {
- game.input.currentState.mx -= 20
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] - 20 > _y )
- {
- game.input.currentState.my -= 20
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- //-----------------------------------------------------------
- if ( CoordinatesTranslation[ "x" ] + 5 < _x )
- {
- game.input.currentState.mx += 5
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] + 5 < _y )
- {
- game.input.currentState.my += 5
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "x" ] - 5 > _x )
- {
- game.input.currentState.mx -= 5
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] - 5 > _y )
- {
- game.input.currentState.my -= 5
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- //-----------------------------------------------------------
- if ( CoordinatesTranslation[ "x" ] < _x )
- {
- game.input.currentState.mx += 1
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] < _y )
- {
- game.input.currentState.my += 1
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "x" ] > _x )
- {
- game.input.currentState.mx -= 1
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- if ( CoordinatesTranslation[ "y" ] > _y )
- {
- game.input.currentState.my -= 1
- CoordinatesTranslation = game.renderer.toWorldCoordinates( game.input.currentState
- .mx, game.input.currentState.my );
- }
- }
- function MyReload ()
- {
- var activeStart = game.predictor.weaponSystem.currentWeapon.activeStart;
- var reloadDuration = game.predictor.weaponSystem.currentWeapon.reloadDuration;
- var progressCb = ( activeStart * reloadDuration * 1000 ) + 5;
- var Accumulator = game.predictor.weaponSystem.currentWeapon.reloadAccumulator;
- if ( game.predictor.weaponSystem.currentWeapon.isReloading == false )
- {
- TouchKey( 'r', 82 );
- }
- setTimeout( () =>
- {
- TouchKey( 'r', 82 );
- }, progressCb );
- }
- function PickupHealth ()
- {
- // 10 - MedPack
- // 11 - Bandages
- // 12 - PainKillers
- //
- function isInsideRect ( x, y )
- {
- var poisonx1 = game.simulator.poison.currX;
- var poisony1 = game.simulator.poison.currY;
- var poisonx2 = game.simulator.poison.currX + game.simulator.poison.currWidth;
- var poisony2 = game.simulator.poison.currY + game.simulator.poison.currWidth;
- if ( ( x >= poisonx1 ) && ( x <= poisonx2 ) &&
- ( y >= poisony1 ) && ( y <= poisony2 ) )
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- var BruhMapDump = game.simulator.entities.entries( "entries" );
- var Myself = game.renderer.myEntity;
- var HealthItems = [];
- //get all health items from visible map
- for ( var [ key, value ] of BruhMapDump )
- {
- var isInArea = isInsideRect( value[ "x" ], value[ "y" ] );
- if ( Myself.hasMedpack != true && value[ "weaponType" ] == 10 && isInArea == true )
- {
- HealthItems.push( value[ "id" ] );
- }
- if ( Myself.hasBandages != true && value[ "weaponType" ] == 11 && isInArea == true )
- {
- HealthItems.push( value[ "id" ] );
- }
- if ( Myself.hasPainkillers != true && value[ "weaponType" ] == 12 && isInArea == true )
- {
- HealthItems.push( value[ "id" ] );
- }
- if ( Myself.shields < 45 && value[ "weaponType" ] == 16 && isInArea == true )
- {
- HealthItems.push( value[ "id" ] );
- }
- }
- //Get closest item
- var item = 0;
- var ToItemDistance = 0;
- var d = Infinity;
- var cid = Infinity;
- for ( let index = 0; index < HealthItems.length; index++ )
- {
- item = game.simulator.entities.get( HealthItems[ index ] );
- ToItemDistance = GetDistance( Myself.x, Myself.y, item.x, item.y );
- if ( d > ToItemDistance )
- {
- d = ToItemDistance;
- cid = HealthItems[ index ];
- }
- }
- //asign item
- item = game.simulator.entities.get( cid );
- //Align image
- var img_finder_x = 0;
- var img_finder_y = 0;
- var img_translation_coordinates = game.renderer.toWorldCoordinates(
- img_finder_x, img_finder_y );
- while ( img_translation_coordinates[ "x" ] < item.x )
- {
- img_finder_x++;
- img_translation_coordinates = game.renderer.toWorldCoordinates( img_finder_x
- , img_finder_y );
- }
- while ( img_translation_coordinates[ "y" ] < item.y )
- {
- img_finder_y++;
- img_translation_coordinates = game.renderer.toWorldCoordinates( img_finder_x
- , img_finder_y );
- }
- for ( var i in img )
- {
- window[ "image" + i ].style.left = img_finder_x + 'px';
- window[ "image" + i ].style.top = img_finder_y + 'px';
- }
- //Move Accordingly
- if ( Myself.x > item.x - 2.22 )
- {
- if ( game.input.currentState.d == true )
- {
- game.input.currentState.d = false;
- }
- if ( game.input.currentState.a == false )
- {
- game.input.currentState.a = true;
- }
- }
- if ( Myself.x < item.x + 2.22 )
- {
- if ( game.input.currentState.a == true )
- {
- game.input.currentState.a = false;
- }
- if ( game.input.currentState.d == false )
- {
- game.input.currentState.d = true;
- }
- }
- if ( Myself.y < item.y + 2.22 )
- {
- if ( game.input.currentState.w == true )
- {
- game.input.currentState.w = false;
- }
- if ( game.input.currentState.s == false )
- {
- game.input.currentState.s = true;
- }
- }
- if ( Myself.y > item.y - 2.22 )
- {
- if ( game.input.currentState.s == true )
- {
- game.input.currentState.s = false;
- }
- if ( game.input.currentState.w == false )
- {
- game.input.currentState.w = true;
- }
- }
- if ( Myself.y > item.y - 2.22 && Myself.y < item.y + 2.22 )
- {
- if ( game.input.currentState.s == true )
- {
- game.input.currentState.s = false;
- }
- if ( game.input.currentState.w == true )
- {
- game.input.currentState.w = false;
- }
- }
- if ( Myself.x > item.x - 2.22 && Myself.x < item.x + 2.22 )
- {
- if ( game.input.currentState.a == true )
- {
- game.input.currentState.a = false;
- }
- if ( game.input.currentState.d == true )
- {
- game.input.currentState.d = false;
- }
- }
- if ( d < 2.5 )
- {
- TouchKey( 'e', 69 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement