howler2345
24th July 2005, 09:14
Ok everyone, im almost sure all of you have a postrender function and a pawnrelated function in your aimbot... well i have a way to take out pawnrelated and make the script in your bot run a little faster.
Say if you just got the basicbot source and you wanted to make it run a little faster. This is what you would start out with.
function PostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
MyCanvas = Canvas;
MyCanvas.SetDrawColor(255,0,0);
MyCanvas.bCenter=True;
If (MyController.Pawn != None)
{
PawnRelated();
}
}
function PawnRelated ()
{
BestTargetLocation = NullVector;
MyLocation = MyController.Pawn.EyePosition();
MyPingCorrection = PingCorrection(MyController.Pawn);
If ( MyController.Pawn.Weapon.AmmoType.AmmoAmount == 0)
{
MyController.Pawn.ServerReload();
}
For (I=0; I < MyController.GameReplicationInfo.PRIArray.Length; I++)
{
PRI = MyController.GameReplicationInfo.PRIArray[I];
If ( PRI.Team.TeamIndex != MyController.Pawn.PlayerReplicationInfo.Team.TeamI ndex && !PRI.isDead() )
{
CurrentTargetLocation = PRI.GetPawnLocation();
if (bESP)
{
ESPvector = MyController.Player.Console.WorldToScreen(CurrentT argetLocation);
MyCanvas.SetPos(ESPvector.X, ESPvector.Y);
MyCanvas.DrawTextClipped(PRI.PlayerName);
}
TargetPawn = PRI.myPawn;
If (TargetPawn == None && CurrentTargetLocation != NullVector)
{
CurrentTargetLocation.Z += rand(40);
If (MyController.FastTrace(CurrentTargetLocation,MyLo cation + PingCorrection(MyController.Pawn)))
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
Else
{
if (bWallHack)
{
MyCanvas.DrawActor(TargetPawn,False,True);
TargetPawn.bHidden=False;
}
CurrentTargetLocation = GetBone();
If (CurrentTargetLocation != NullVector)
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
}
}
If (BestTargetLocation != NullVector)
{
If (bAutoAim)
{
AimRotation = rotator( BestTargetLocation - MyLocation );
MyController.SetRotation(AimRotation);
If (bAutoFire)
{
For (K=0;K < FireRate;K++)
{
MyController.Pawn.Weapon.ServerFire(True,False,Fal se);
}
}
}
}
}
To make it faster you just make it like this.
function PostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
MyCanvas = Canvas;
MyCanvas.SetDrawColor(255,0,0);
MyCanvas.bCenter=True;
BestTargetLocation = NullVector;
MyLocation = MyController.Pawn.EyePosition();
MyPingCorrection = PingCorrection(MyController.Pawn);
If ( MyController.Pawn.Weapon.AmmoType.AmmoAmount == 0)
{
MyController.Pawn.ServerReload();
}
For (I=0; I < MyController.GameReplicationInfo.PRIArray.Length; I++)
{
PRI = MyController.GameReplicationInfo.PRIArray[I];
If ( PRI.Team.TeamIndex != MyController.Pawn.PlayerReplicationInfo.Team.TeamI ndex && !PRI.isDead() )
{
CurrentTargetLocation = PRI.GetPawnLocation();
if (bESP)
{
ESPvector = MyController.Player.Console.WorldToScreen(CurrentT argetLocation);
MyCanvas.SetPos(ESPvector.X, ESPvector.Y);
MyCanvas.DrawTextClipped(PRI.PlayerName);
}
TargetPawn = PRI.myPawn;
If (TargetPawn == None && CurrentTargetLocation != NullVector)
{
CurrentTargetLocation.Z += rand(40);
If (MyController.FastTrace(CurrentTargetLocation,MyLo cation + PingCorrection(MyController.Pawn)))
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
Else
{
if (bWallHack)
{
MyCanvas.DrawActor(TargetPawn,False,True);
TargetPawn.bHidden=False;
}
CurrentTargetLocation = GetBone();
If (CurrentTargetLocation != NullVector)
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
}
}
If (BestTargetLocation != NullVector)
{
If (bAutoAim)
{
AimRotation = rotator( BestTargetLocation - MyLocation );
MyController.SetRotation(AimRotation);
If (bAutoFire)
{
For (K=0;K < FireRate;K++)
{
MyController.Pawn.Weapon.ServerFire(True,False,Fal se);
}
}
}
}
}
This may cause a few minor bugs and whatnot, and esp and everythign will always be on even if your dead, but i beleive it is worth it for how much speed is gained in doing this.
Greets,
Howler
PS. - Im drunk, so if there is something wrong, just tell me and ill fix it :)
EDIT-this also goes along with alot of other things...you can put prefire in there, healthbars, shit even your aimbot if you do it right...have fun :)
Say if you just got the basicbot source and you wanted to make it run a little faster. This is what you would start out with.
function PostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
MyCanvas = Canvas;
MyCanvas.SetDrawColor(255,0,0);
MyCanvas.bCenter=True;
If (MyController.Pawn != None)
{
PawnRelated();
}
}
function PawnRelated ()
{
BestTargetLocation = NullVector;
MyLocation = MyController.Pawn.EyePosition();
MyPingCorrection = PingCorrection(MyController.Pawn);
If ( MyController.Pawn.Weapon.AmmoType.AmmoAmount == 0)
{
MyController.Pawn.ServerReload();
}
For (I=0; I < MyController.GameReplicationInfo.PRIArray.Length; I++)
{
PRI = MyController.GameReplicationInfo.PRIArray[I];
If ( PRI.Team.TeamIndex != MyController.Pawn.PlayerReplicationInfo.Team.TeamI ndex && !PRI.isDead() )
{
CurrentTargetLocation = PRI.GetPawnLocation();
if (bESP)
{
ESPvector = MyController.Player.Console.WorldToScreen(CurrentT argetLocation);
MyCanvas.SetPos(ESPvector.X, ESPvector.Y);
MyCanvas.DrawTextClipped(PRI.PlayerName);
}
TargetPawn = PRI.myPawn;
If (TargetPawn == None && CurrentTargetLocation != NullVector)
{
CurrentTargetLocation.Z += rand(40);
If (MyController.FastTrace(CurrentTargetLocation,MyLo cation + PingCorrection(MyController.Pawn)))
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
Else
{
if (bWallHack)
{
MyCanvas.DrawActor(TargetPawn,False,True);
TargetPawn.bHidden=False;
}
CurrentTargetLocation = GetBone();
If (CurrentTargetLocation != NullVector)
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
}
}
If (BestTargetLocation != NullVector)
{
If (bAutoAim)
{
AimRotation = rotator( BestTargetLocation - MyLocation );
MyController.SetRotation(AimRotation);
If (bAutoFire)
{
For (K=0;K < FireRate;K++)
{
MyController.Pawn.Weapon.ServerFire(True,False,Fal se);
}
}
}
}
}
To make it faster you just make it like this.
function PostRender (Canvas Canvas)
{
MyController = ViewportOwner.Actor;
MyCanvas = Canvas;
MyCanvas.SetDrawColor(255,0,0);
MyCanvas.bCenter=True;
BestTargetLocation = NullVector;
MyLocation = MyController.Pawn.EyePosition();
MyPingCorrection = PingCorrection(MyController.Pawn);
If ( MyController.Pawn.Weapon.AmmoType.AmmoAmount == 0)
{
MyController.Pawn.ServerReload();
}
For (I=0; I < MyController.GameReplicationInfo.PRIArray.Length; I++)
{
PRI = MyController.GameReplicationInfo.PRIArray[I];
If ( PRI.Team.TeamIndex != MyController.Pawn.PlayerReplicationInfo.Team.TeamI ndex && !PRI.isDead() )
{
CurrentTargetLocation = PRI.GetPawnLocation();
if (bESP)
{
ESPvector = MyController.Player.Console.WorldToScreen(CurrentT argetLocation);
MyCanvas.SetPos(ESPvector.X, ESPvector.Y);
MyCanvas.DrawTextClipped(PRI.PlayerName);
}
TargetPawn = PRI.myPawn;
If (TargetPawn == None && CurrentTargetLocation != NullVector)
{
CurrentTargetLocation.Z += rand(40);
If (MyController.FastTrace(CurrentTargetLocation,MyLo cation + PingCorrection(MyController.Pawn)))
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
Else
{
if (bWallHack)
{
MyCanvas.DrawActor(TargetPawn,False,True);
TargetPawn.bHidden=False;
}
CurrentTargetLocation = GetBone();
If (CurrentTargetLocation != NullVector)
{
If ( BestTargetLocation == NullVector || Vsize(CurrentTargetLocation - MyLocation) < Vsize(BestTargetLocation - MyLocation) )
{
BestTargetLocation = CurrentTargetLocation;
}
}
}
}
}
If (BestTargetLocation != NullVector)
{
If (bAutoAim)
{
AimRotation = rotator( BestTargetLocation - MyLocation );
MyController.SetRotation(AimRotation);
If (bAutoFire)
{
For (K=0;K < FireRate;K++)
{
MyController.Pawn.Weapon.ServerFire(True,False,Fal se);
}
}
}
}
}
This may cause a few minor bugs and whatnot, and esp and everythign will always be on even if your dead, but i beleive it is worth it for how much speed is gained in doing this.
Greets,
Howler
PS. - Im drunk, so if there is something wrong, just tell me and ill fix it :)
EDIT-this also goes along with alot of other things...you can put prefire in there, healthbars, shit even your aimbot if you do it right...have fun :)