Simba Code:
program testbandit;
{$DEFINE SMART}
{$i srl/srl.simba}
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;
procedure StatsGuise(wat:String);
begin
StatsGuise(wat);
Disguise(wat);
end;
procedure Antiban;
begin
case Random(90) of
20: HoverSkill('Thieving', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
Writeln('Antiban in action!');
Wait(2000 + Random(500));
end;
function Bandit: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.14);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Procedure FastDropSlot(Slot: Integer);
Var
TB: TBox;
begin
Case Slot of
7: TB := IntToBox(648,250,682,280);
8: TB := IntToBox(690,250,724,280);
9: TB := IntToBox(564,286,598,316);
10: TB := IntToBox(606,286,640,316);
11: TB := IntToBox(648,286,682,316);
12: TB := IntToBox(690,286,724,316);
13: TB := IntToBox(564,322,598,352);
14: TB := IntToBox(606,322,640,352);
15: TB := IntToBox(648,322,682,352);
16: TB := IntToBox(690,322,724,352);
17: TB := IntToBox(564,358,598,388);
18: TB := IntToBox(606,358,640,388);
19: TB := IntToBox(648,358,682,388);
20: TB := IntToBox(690,358,724,388);
21: TB := IntToBox(564,394,598,424);
22: TB := IntToBox(606,394,640,424);
23: TB := IntToBox(648,394,682,424);
24: TB := IntToBox(690,394,724,424);
25: TB := IntToBox(564,430,598,460);
26: TB := IntToBox(606,430,640,460);
27: TB := IntToBox(648,430,682,460);
28: TB := IntToBox(690,430,724,460);
end;
MouseSpeed := RandomRange(26,39);
MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, mouse_right);
WaitOptionMulti(['Drop', 'rop R', 'op R'], 400);
end;
Procedure DropRemaining;
Var
I: Integer;
begin
For I := 8 downto 7 do
begin
if (I = 9) then
Break;
FastDropSlot(I);
end;
For I := 9 to high(12) do
begin
if (I = 13) then
Break;
FastDropSlot(I);
end;
For I := 16 downto 13 do
begin
if (I = 17) then
Break;
FastDropSlot(I);
end;
For I := 17 to high(20) do
begin
if (I = 21) then
Break;
FastDropSlot(I);
end;
For I := 24 downto 21 do
begin
if (I = 25) then
Break;
FastDropSlot(I);
end;
For I := 25 to high(28) do
begin
if (I = 29) then
Break;
FastDropSlot(I);
end;
end;
procedure EatFood;
var
Food: integer;
x, y: integer;
begin
//change to lobs**
Food := DTMFromString('mAAEAAHic42FgYJjAzMAwBYg7gbgFijuhYjOBeAEUzwXieUAcxsjAEAjFIHYMECcAcRwQx0LZkUAcBMS+QBzgbgu0hYkETBpgJBEjAwDd9gw2');
GameTab(tab_Inv);
wait(100+random(20));
FindNormalRandoms;
if FindBitmapToleranceIn(Food, x, y, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(x, y, 2, 2, true); // leftclick food
writeln('Eat yo Food!');
wait(1000+random(200));
end;
FreeBitmap(Food);
end;
Procedure HpCheck;
begin
WriteLn('Checking HP');
if (HPPercent < 40) then
begin
repeat
FindNormalRandoms;
EatFood;
until(HPPercent > 90) //should eat all 5 foods in invy --> need to restock
//begin
//walk to store
//sell noted
//buy unnoted
//return to spot
//end; ---> Will return into pickpocketing procedure.
end;
if (HPPercent > 40) then
Case Random(2) of
1:AntiBan;
2:Wait(3500 + Random(500));
end;
end;
Procedure Pickpocket;
var
x, y: Integer;
begin
repeat
if(not(LoggedIn))then
Exit;
SetAngle(SRL_ANGLE_HIGH);
x:=MSCX;
y:=MSCY;
If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then
begin
WriteLn('Found Bandit');
GetMousePos(x, y);
Mouse(x, y, 5, 5, False);
WaitOption('Pick', 500)
end;
If FindBlackChatMessage('ail') Then
begin
WriteLn('Stunned')
HpCheck;
end;
//find Fail here
//begin
//HpCheck; //Antiban or Wait if HPPercent > 40
//maybe put if (not(find fail) continue???
until(InvFull);
begin
FindNormalRandoms;
WriteLn('Droping');
DropRemaining;
end;
end;
begin
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL;
DeclarePlayers;
LoginPlayer;
repeat
FindNormalRandoms;
Pickpocket;
Until(AllPlayersInactive);
end.