Author Topic: Client_AFKBot Improvements  (Read 1229 times)

Thanks, but it gives me syntax errors, at the 2nd to last line where you define $afkBot
third to last, forgot a ; at the end of the line actually.

third to last, forgot a ; at the end of the line actually.
Still gives an error :c

What is this supposed to do anyways?

What is this supposed to do anyways?
It's my experiment for random actions. Anyway, Headcrab Zombie, please fix your script :c

I fixed the error that Ipquarx listed and it works fine for me
Just add a semicolon to the end of the getRandom call

I fixed the error that Ipquarx listed and it works fine for me
Just add a semicolon to the end of the getRandom call
Ah thanks, but does anybody know a way for me to client-sidedly detect if there is a brick near my player in any direction?

How do you activate it?

How do you activate it?
afkBot();

It doesn't loop.
Ah thanks, but does anybody know a way for me to client-sidedly detect if there is a brick near my player in any direction?
nexus knows this for sure.

afkBot();

It doesn't loop.nexus knows this for sure.
Oh, well if it doesnt loop then i dont really have a point in getting it.

Ah thanks, but does anybody know a way for me to client-sidedly detect if there is a brick near my player in any direction?
The only way I can think of doing this unless raycasts actually work clientside is the following:

Code: [Select]
function getClosestBrick()
{
%myPos = serverConnection.getControlObject().getPosition();
for(%i=0; %i < serverConnection.getCount(); %i++)
{
%o = serverConnection.getObject(%i);
if(%o.getClassname() $= "fxDTSBrick")
{
%dist = vectorDist(%myPos, %o.getPosition());
if(%dist < %closest || %closest $= "")
{
%closest = %dist;
%closestbrick = %o;
}
}
}
return %o;
}

code-snip

This is the only way. If you are in a server with a lot of bricks, you'll see a decrease in performance.
« Last Edit: August 10, 2012, 01:48:37 AM by elm »