Skip to content

Instantly share code, notes, and snippets.

@alexbakker
Created May 6, 2014 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbakker/c363d34039590c1a1225 to your computer and use it in GitHub Desktop.
Save alexbakker/c363d34039590c1a1225 to your computer and use it in GitHub Desktop.
InfinityScript Aimbot
using System;
using InfinityScript;
namespace Bot_Script
{
class Aimbot : BaseScript
{
/*
* bullettrace = 88
* bullettracepassed = 116
*
* Thanks zxz0O0
*/
public Aimbot()
{
PlayerConnected += new Action<Entity>(entity =>
{
DoAimbot(entity);
entity.OnNotify("giveLoadout", ent => { AfterDelay(5000, () => ent.Call("iprintlnbold", "You've been given a loadout, enjoy")); });
});
}
private string OtherTeam(string team)
{
if (team == "axis")
return "allies";
else
return "axis";
}
private void DoAimbot(Entity player)
{
OnInterval(10, () =>
{
if (!player.IsAlive)
return true;
Entity targetEnt = null;
foreach (Entity p in Players)
{
if (!p.IsAlive)
continue;
if (player.EntRef == p.EntRef)
continue;
if (player.GetField<string>("sessionteam") == p.GetField<string>("sessionteam"))
if (Call<string>("getdvar", "g_gametype") != "dm")
continue;
if (Call<int>(116, player.Call<Vector3>("getTagOrigin", "j_head"), p.Call<Vector3>("getTagOrigin", "j_head"), false, player) != 1)
continue;
if (targetEnt != null)
{
if (Call<int>("closer", player.Call<Vector3>("getTagOrigin", "j_head"), p.Call<Vector3>("getTagOrigin", "j_head"), targetEnt.Call<Vector3>("getTagOrigin", "j_head")) == 1)
targetEnt = p;
}
else
{
targetEnt = p;
}
}
if (targetEnt != null)
player.Call("setplayerangles", Call<Vector3>("VectorToAngles", (targetEnt.Call<Vector3>("getTagOrigin", "j_head")) - (player.Call<Vector3>("getTagOrigin", "j_head"))));
return true;
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment