Log in

View Full Version : Autofighter help



hoopla
04-05-2012, 06:12 PM
I have figured out how to properly setup my fighting, eating and banking functions. How can I detect if a door is open and if so, to open and continue attacking or free oneself to continue on?

Abu
04-05-2012, 06:14 PM
Check the uptext brah :garfield:


EDIT: e.g,
if IsUpText('pen') then
OpenDoor
else
ContinueFighting

hoopla
04-05-2012, 06:22 PM
I suppose using DTM's would be the best method of detection?

hoopla
04-05-2012, 06:55 PM
program GrapePicker;
{$DEFINE SRL5}
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i SRL/SRL/skill/fighting.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{$i sps/sps.simba}

///////////////////////////////////
//start setup
///////////////////////////////////

const
RandAmount = 25;


procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
End;

End;

///////////////////////////////////
///////////////////////////////////
///// end setup
///////////////////////////////////
///////////////////////////////////




procedure SetupChar;

begin

SetupSRL();
SetAngle(0);
end;


procedure MSI_RandomFKey;
var
i, randInt, randKey, currTab: Integer;
keys: array[0..4] of Word;
begin
currTab := GetCurrentTab(); // Get the current tab player is on

keys[0] := VK_F1;
keys[1] := VK_F2;
keys[2] := VK_F3;
keys[3] := VK_F4;
keys[4] := VK_F5;

randInt := Random(6);

case randInt of
0..4:
begin
KeyDown(keys[randInt]);
wait(35+random(85));
KeyUp(keys[randInt]);
end;

else
for i := 1 to 3 do
begin
randKey := Random(5);
KeyDown(keys[randKey]);
wait(35+random(85));
KeyUp(keys[randKey]);
end;
end;
wait(75+random(100));
GameTab(currTab); // Reset to starting tab
end;

//random antibans to use
procedure GAntiBan;
begin
writeln('Choosing random antiban');
case random(11) of
0 : begin
writeln('Random click selected');
RandomRClick;
end;
1 : begin
writeln('Random movement selected');
RandomMovement;
end;
2 : begin
writeln('Hover skill strength');
HoverSkill(skill_strength,false);
end;
3 : begin
writeln('Prayer tab selected');
GameTab(27);
Wait(randomrange(400,800));
end;
4 : begin
writeln('Random Angle selected');
end;
5 : begin
writeln('Random Fkey selected');
MSI_RandomFKey;
end;
6 : begin
writeln('Hover Skill (HP) selected');
HoverSkill(skill_hitpoints,false);
Wait(randomrange(300,600));
end;
7 : begin
writeln('Game Tab stats selected');
GameTab(23);
end;
8 : begin
writeln('Pickup Mouse selected');
PickUpMouse;
end;
9 : begin
writeln('Random wait selected');
Wait(randomrange(1000,2000));
end;
10 : begin
writeln('Hover Skill attack selected');
HoverSkill('attack',false);
end;
end;
Wait(randomrange(500,1000));
end;

Procedure ToBank;
begin
ClickNorth(0);
if ObjDTM_Walk('115:53:5:1:7:83:42:1:7:49:83:1:7:62:1 04:10:7:103:37:10:7:103:25', 0, 100, 80, True) then
begin

repeat
wait(100);
until(Not IsMoving);
end;
begin
if ObjDTM_Walk('79:53:11:1:7:49:67:10:7:69:62:10:7:70 :50:10:7:70:41:10:7:70:25:10:7:70:17:10:7:115:54:1 0:7:115:46:10:7:115:38:10:7:115:30:10:7:115:21', 0, 100, 80, True) then
begin

repeat
wait(100);
until(Not IsMoving);
end;
end;
end;

Procedure ToGaurds;
begin
ClickNorth(0);
if ObjDTM_Walk('53:111:11:0:7:83:40:10:7:71:92:10:7:7 0:71:10:7:70:63:10:7:70:55:10:7:70:47:10:7:115:75: 10:7:115:67:10:7:115:51:10:7:115:43:10:7:115:83', 0, 100, 80, True) then
begin

repeat
wait(100);
until(Not IsMoving);
end;
end;


Function FindNPC(Colors: TIntegerArray; TheUpText: TStringArray; midx, midy: integer): Boolean;
Var
T,i,X,Y: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
Begin
MarkTime(T);
Repeat
SetArrayLength(ATPA, Length(Colors));
for i := 0 to High(Colors) do
FindColorsSpiralTolerance(midx, midy, ATPA[i], Colors[i], MSX1, MSY1, MSX2, MSY2, 5);
TPA := MergeATPA(ATPA);
ATPA := TPAtoATPAEx(TPA, 15, 15);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
if (Length(ATPA) = 0) then
Exit;

MiddleTPAEx(ATPA[0], x, y);

if (TimeFromMark(T) > 5000) then
Exit;

MMouse(x, y, 10, 10);
Wait(randomrange(115,225));
If(IsUpTextMultiCustom(TheUpText)) then
begin
ClickMouse2(True);
if DidRedClick then
begin
Result := True;
Break;
end;
end;
Until(Result)
end;

procedure GetOutF;
begin
case random(2) of
0 : begin
KeyDown(VK_Tab);
wait(35+random(100));

wait(35+random(100));
KeyUp(VK_Tab);
wait(25+random(70));

wait(35+random(100));
end;
1 : begin
ExamineInv;
end;
end;
end;

procedure GMoveMouse;
begin
case random(4) of
0 : begin
mMouse(5,25,10,20);
end;
1 : begin
mMouse(250,150,40,40);
end;
2 : begin
mMouse(505,350,50,50);
end;
3 : begin
mMouse(30,315,20,40);
end;
end;
end;
//laakes
Procedure RAntiBan;
begin
Wait(randomrange(200,400));
case random(RandAmount) of
0 : begin
writeln('Random Wait AntiBan');
Wait(randomrange(1100,2500));
end;
1 : begin
GAntiBan;
end;
2 : begin
writeln('pickup mouse / GMoveMouse');
PickUpMouse;
Wait(randomrange(25,100));
GMoveMouse;
Wait(randomrange(250,300));
end;
3 : begin
writeln('Double GMoveMouse');
GMoveMouse;
Wait(randomrange(45,100));
GMoveMouse;
end;
end;
end;

Function Eat(What: String): Boolean;
var
I: Integer;
begin
Result := False;
If Not LoggedIn then ToBank;
if (HPPercent < 75) then
If InvEmpty then ToBank
else
for i := 1 to 28 do
begin
InvMouse(I, 3);
if IsUpText(What) then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Result := True;
Exit;
end;
end;
end;
//laake's

procedure KillGaurd;
var
sX,sY: Integer;
label
fighting;
begin
if findNPC([1473691, 3244445, 3116439, 4307667], ['ttack','uard'], MSCX, MSCY) then
writeln('Gaurd is bieng killed!');
fighting:
While IsMoving do
wait(1);
FindNormalRandoms;
wait(randomrange(1400,2000));
if FindBlackChatMessage('omeone else is fighting') then
begin
writeln('Someone else may be doing the same as you!');
case random(4) of
0 : begin
sX := MSX1;
sY := MSY1;
end;
1 : begin
sX := MSX1;
sY := MSY2;
end;
2 : begin
sX := MSX2;
sY := MSY1;
end;
3 : begin
sX := MSX2;
sY := MSY2;
end;
end;
if findNPC([1473691, 3244445, 3116439, 4307667], ['ttack','uard'], MSCX, MSCY) then
GetOutF;
goto fighting;
end else
begin
if InFight then
begin
repeat
FindNormalRandoms;
writeln('Destroying');
Eat('Eat');
RAntiBan;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end;
wait(randomrange(200,400));
end;
end;

procedure Startup;
begin
Smart_Server := 69;
Smart_Members:= true;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
ObjDTM_Setup;
DeclarePlayers;
LogInPlayer;
MouseSpeed := 200;
wait(100+random(100));
end;

begin
Startup;
SetupChar;
repeat
repeat
KillGaurd;
until InvEmpty or (hppercent < 45);
begin
ToBank;
OpenBankNPC;
if BankScreen then
begin
DepositAll;
wait(50 + Random(250));
Withdraw(0, 0, 10);
wait(50 + Random(250));
CloseBank;
wait(50 + Random(250));
end;
begin
ToGaurds;
end;
end;
FindNormalRandoms;
until not LoggedIn
writeln('stopping script');
TerminateScript;
end.

As you can see, I just modified the Grape Killer to not pick up anything and fixed the banking (changed from Invfull > InvEmpty...it now will actually bank correctly...What I want to do it to it is add world switch if more than 2 players are detected, add door detection and failsafes for randoms/locked door to logout..Also, it withdraws 20 of food, instead of 10.

Also, no failsafe (if, you = dumbass x n0fo0d).

This is a cracked out version that just whips ass, doesn't fuck with the vino, ya heard boiii. It's a community thing, no anti, fuck, add to it if you can make it better and post for fucks sakes - I don't believe anyone charged you for Simba, eh? fucktardssss

Must start at the Gaurds (hahaha)

hoopla
04-05-2012, 08:09 PM
Currently has bug where if inv does not equal empty, say for some reason it did pick up something, it will not bank.

hoopla
04-06-2012, 12:59 AM
124 peeks, no advice?