SCAR Code:
{.Script Info:
# ScriptName = Rogues' Den Thiever
# Author = Hey321
# Description = Thieves... In the Rogues' Den... Duh
# Version = 0.2 BETA
# Date = Sunday, Sept. 23, 2007
# Comments = This is beta, expect bugs, don't complain about them! Just let me know! I'll fix em asap!
/Script Info}
{
Credits:
Pwnaz0r (You rock man!) for the walking to and from, and opening bank
Wt-Fakawi for the base of my eat food function, had no idea how to do it, his script
showed me how ;)
N3ss3s for my colors of the safe :P}
Program RoguesDenThief;
{.include srl/srl.scar}
var
x, y, Unsuccesful, Thiefs, food : Integer;
Const
TheSRLId = '';
TheSRLPassword = '';
function bankEmerald: boolean;
var
hiscolor: array [0..1] of integer;
ex, ey, i: integer;
begin
for i := 1 to 4 do
begin
case i of
1: MakeCompass('N');
2: MakeCompass('S');
3: MakeCompass('E');
4: MakeCompass('W');
end;
result:= false;
ColorToleranceSpeed(2);
hiscolor[0]:= 8234195;
hiscolor[1]:= 5271929;
if FindColorSpiralTolerance(ex, ey, hiscolor[0], MSX1, MSY1, MSX2, MSY2, 5)then
if FindColorSpiralTolerance(ex, ey, hiscolor[1], ex - 20, ey - 20, ex + 20, ey + 20, 5)then
begin
Mouse(ex, ey, 0, 0, false);
if chooseoption('ank')then
begin
MakeCompass('N');
Flag;
result:= true;
exit;
end;
end;
end;
MakeCompass('N');
end;
function WalkTobank: boolean;
var
sx, sy: integer;
begin
SymbolAccuracy:= 0.8;
if findsymbol(sx,sy,'bank')then
begin
if FindColorSpiralTolerance(sx, sy, 195836, MMX1, MMY1, MMX2, MMY2, 1)then
begin
mouse(sx, sy + 5, 2, 2, true);
flag;
end;
end else
begin
sx:= 698;
sy:= 39;
if FindColorSpiralTolerance(sx, sy, 195836, MMX1, MMY1, MMX2, MMY2, 1)then
begin
Mouse(sx, sy + 2, 2, 2, true);
flag;
result:= bankEmerald;
end;
end;
end;
function MakeMiddleDDTM: integer;
var
DDTM: TDTM;
begin
DDTM.MainPoint.x := 654;
DDTM.MainPoint.y := 78;
DDTM.MainPoint.AreaSize := 0;
DDTM.MainPoint.AreaShape := 0;
DDTM.MainPoint.Color := 0;
DDTM.MainPoint.Tolerance := 0;
SetArrayLength(DDTM.SubPoints, 4);
DDTM.SubPoints[0].x := 663;
DDTM.SubPoints[0].y := 76;
DDTM.SubPoints[0].AreaSize := 2;
DDTM.SubPoints[0].AreaShape := 0;
DDTM.SubPoints[0].Color := 0;
DDTM.SubPoints[0].Tolerance := 0;
DDTM.SubPoints[1].x := 667;
DDTM.SubPoints[1].y := 97;
DDTM.SubPoints[1].AreaSize := 2;
DDTM.SubPoints[1].AreaShape := 0;
DDTM.SubPoints[1].Color := 0;
DDTM.SubPoints[1].Tolerance := 0;
DDTM.SubPoints[2].x := 655;
DDTM.SubPoints[2].y := 97;
DDTM.SubPoints[2].AreaSize := 2;
DDTM.SubPoints[2].AreaShape := 0;
DDTM.SubPoints[2].Color := 0;
DDTM.SubPoints[2].Tolerance := 0;
DDTM.SubPoints[3].x := 648;
DDTM.SubPoints[3].y := 87;
DDTM.SubPoints[3].AreaSize := 2;
DDTM.SubPoints[3].AreaShape := 0;
DDTM.SubPoints[3].Color := 0;
DDTM.SubPoints[3].Tolerance := 0;
Result := AddDTM(DDTM);
end;
function WalkBack: boolean;
var
cx, cy: integer;
begin
MakeCompass('N');
If DTMRotated(MakeMiddleDDTM,cx,cy,MMX1,MMy1,MMX2,MMY2)then
begin
Mouse(cx,cy - 5,0,0,true);
Flag;
result:= true;
end;
end;
Procedure WithdrawFood;
begin
FixBank;
DepositAll;
If(FindColorTolerance(x, y, 1391016, MSX1, MSY1, MSX2, MSY2, 10)) Then
Begin
MMouse(x, y, 3, 3);
GetMousePos(x, y)
Mouse(x, y, 0, 0, false);
ChooseOption('10');
CloseBank;
end;
end;
Procedure WaitToThief;
var
Waited : Integer;
Begin
Repeat
Waited:=Waited+1
Wait(2000);
FindNormalRandoms;
Status(IntToStr(Waited))
If(InChat('trap!')) Or
(InChat('loot.')) Then
Begin
Wait(1000)
If(InChat('loot.')) Then
ReportVars[3]:= 1;
Break;
End;
Until(Waited=5)
Waited:=0
End;
function IsUpTextEx(s: string): boolean;
begin
result:= Pos(s, rs_getuptext) <> 0;
end;
function FindSafe(var x, y: integer; Colors: array of integer): boolean;
var
cts: integer;
begin
cts:= GetColorToleranceSpeed;
SetColorSpeed2Modifiers(0.5,0.5);
ColorToleranceSpeed(2);
if FindColorSpiralTolerance(x, y, Colors[0], MSX1, MSY1, MSX2, MSY2, 10) then
if FindColorSpiralTolerance(x, y, Colors[1], MSX1, MSY1, MSX2, MSY2, 10) then
if FindColorSpiralTolerance(x, y, Colors[2], MSX1, MSY1, MSX2, MSY2, 10) then
begin
MMouse(x, y, 0, 0);
if IsUpTextEx('rack Wall') then
begin
result:= true;
ColorToleranceSpeed(cts);
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
WaitToThief;
end else
FindSafe(x, y, [1119509, 5405, 2510699, 1783627, 1583412])
if result then exit;
end;
end;
Procedure FoodEat;
Var
HealAmount, HPLeft, HPTotal: Integer;
begin
HPLeft := GetSkillAmount('hitpoints');
HPTotal := GetSkillLevel('hitpoints');
HealAmount:=9;
GameTab(4)
If(HPTotal>=HPLeft+HealAmount)Then
Begin
If(FindColorTolerance(x, y, 1391016, MIX1, MIY1, MIX2, MIY2, 10)) Then
Mouse(x, y, 3, 3, true);
End;
End;
Procedure Progress;
Var
GotThiefDone : Integer;
Begin
ClearDebug;
WriteLn('Thieved ' + IntToStr(Thiefs) + ' times');
WriteLn('Got Caught ' + IntToStr(Unsuccesful) + ' times');
GotThiefDone:=Thiefs-Unsuccesful;
WriteLn(IntToStr(GotThiefDone) + ' succesful thieves');
WriteLn('Worked For: ' + TimeRunning);
End;
begin
SetupSrl;
ScriptId:= '329';
SRLId:= TheSRLId;
SRLPassword:= TheSRLPassword;
ActivateClient;
Repeat
WalkToBank;
FindNormalRandoms;
MakeCompass('N');
Repeat
FindNormalRandoms;
bankEmerald;
Wait(100)
Until(Bankscreen);
Wait(50)
WithdrawFood;
FindNormalRandoms;
Wait(1000+random(500))
WalkBack;
MakeCompass('s');
Repeat
Progress;
Wait(1000)
If(InChat('trigger'))Then
Begin
FoodEat();
Unsuccesful:=Unsuccesful+1
SRLRandomsReport;
end;
inc(Thiefs);
FindNormalRandoms;
FindSafe(x, y, [1119509, 5405, 2510699, 1783627, 1583412])
ReportVars[0]:= 1;
SRLRandomsReport;
Wait(1000)
If(InChat('get loot'))Then
ReportVars[2]:= 1;
FindNormalRandoms;
Until(Not(FindColorTolerance(x, y, 1391016, MIX1, MIY1, MIX2, MIY2, 10)))
FindNormalRandoms;
Until(False)
end.