speedster
2013-03-04 08:52:39
How Long have You Played Runescape?
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java/C#/Vb.Net/C/C++/MathLab/ASM/Pascal (thanks to Simba)
Are you a member of any other communities?
RobotzInDisguise ( <3 ). And on Sythe mostly for trading purposes.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
10 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java/C#/Vb.Net/C/C++/MathLab/ASM/Pascal (thanks to Simba)
Are you a member of any other communities?
RobotzInDisguise ( <3 ). And on Sythe mostly for trading purposes.
Tell us about yourself…
From: speedster
Well I started to play RuneScape in 2002, when I was just a kid, got myself banned in 2006, and resumed playing in 2009 :)
In RL, am a nice guy - went ahead and signed up at University - studying IT Science (Not bragging much about the University I study on as it isn't that hard core (wish it was :( ) - it has been a bit of help, but what and when I learn/study about new stuff I usually do it on my own).
I registered on SRL about a year ago - as someone mentioned you guys on Robotz In Disguise, was a bit curious how bots work :D. I had no clue how to script but I learned quickly :). It's just I found this 2007 RuneScape release to be a good moment to finally get SRL Members, since scripts for 2007 are scarce . :).
I don't have the permission to attach files in Manage Attachments, so I hope I did the right thing in addingbelow…
Please show us one (or multiple) of your scripts.
program OpenGraniteV1dot33;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I P07Include.Simba}
var
Line:TStringArray;
TotalXpGain,BombCount,LastBombIndex,BombIndex:Integer;
Granite:TIntegerArray;
BombBoxes:TBoxArray;
procedure DeclareDTMs;
var
i:Integer;
begin
SetLength(Granite,3);
for i := 0 to High(Granite) do
begin
case i of
0: Granite[i] := DTMFromString('mrAAAAHic42BgYHBhYmDwAGJHILYAYmsgdgBibyD2BWIfRgYGdyCOBeJwIPaH8sOA2A+IaxPcgKYw4sSsDPgBbp0QDAMAAJ8F8Q==');
1: Granite[i] := DTMFromString('mwQAAAHichcwxCoAgAEbhX6GhmzXYIARhuUWEQUHQ2GW8aQ+CRn3wra+VtFsp4cCFGysWbDjhjRQQMWHEgB4dHPIzczNFjeqVD5+/F+VYCGE=');
2: Granite[i] := DTMFromString('mwQAAAHic42RgYOAAYj4g5mKAAGYgZoOyeYGYHcpnh8oxQ/XAAA8QcwPx7PIIIMmIF3MxEAb4TYBgOAAA9vMB/g==');
end;
end;
end;
procedure FreeOurDTMs;
begin
FreeDTMs(Granite);
end;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
P07_PlayerName := '';
P07_PlayerPass := '';
Pin := '';
Active := True;
end;
end;
(*
GetUpText2
~~~~~~~~~
by DannyRS
GetUpText in certain situations
didn't scan the entire UpText Area,
failing some functions.
*)
Function P07_GetUpText2: String;
Var
WhiteT,BlueT,YellowT,OrangeT,FoundText: String;
Begin
WhiteT:=GetTextAtExWrap(8, 8, 175, 21, 0, 5, 1, 14541281, 55, 'P07UpChars');
BlueT:=GetTextAtExWrap(35, 8, 230, 21, 0, 5, 1, 13423640, 65, 'P07UpChars');
YellowT:=GetTextAtExWrap(35, 8, 230, 21, 0, 5, 1, 1235160, 40, 'P07UpChars');
OrangeT:=GetTextAtExWrap(35, 8, 230, 21, 0, 5, 1, 4687583, 53, 'P07UpChars');
FoundText:=WhiteT + ' ' + BlueT + YellowT + OrangeT;
FoundText:= ReplaceWrap(FoundText, '.', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, '/', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, '\', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, ',', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, '*', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, '^', '',[rfReplaceAll]);
FoundText:= ReplaceWrap(FoundText, '"', '',[rfReplaceAll]);
Result:=FoundText;
End;
function DropGranite:Boolean;
var
x,y,i:Integer;
begin
Result := False;
for i := 0 to High(Granite) do
begin
if FindDTM(Granite[i],x,y,MIX1,MIY1,MIX2,MIY2 ) then
begin
MMouse(x,y,3,3);
wait(135 + Random(45));
ClickMouse2(mouse_Right);
P07_WaitOptionMulti(['Drop','rop'],750) ;
Result := True;
case i of
0: TotalXpGain := TotalXpGain + 50;
1: TotalXpGain := TotalXpGain + 60;
2: TotalXpGain := TotalXpGain + 75;
end;
exit;
end;
end;
end;
procedure FindRandomMysteriousMan; //MoM AntiRandom
var
p:TPoint;
l,i:Integer;
tpa: TPointArray;
atpa: T2DPointArray;
timer:Integer;
begin
writeln('Anti-Random : Checking for the Mysterious Man');
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.27 , 0.0);
FindColorsTolerance(tpa, 2629376, 141 , 71, 350, 260, 2);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
writeln('Mysterious Man Detection: ' + inttostr(Length(tpa)));
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
for i := 0 to l-1 do
begin
writeln('Length[' + inttostr(i) + ']: ' + inttostr(Length(atpa[i])));
end;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 100) then
begin
continue;
end;
if (Length(atpa[i]) > 550) then
begin
continue;
end;
p := MiddleTPA(atpa[i]);
MMouse(p.x,p.y,2,2);
wait(250);
if P07_ContainsText(P07_GetUpText2, ['alk-to','alk-t']) then
begin
ClickMouse2(mouse_Left);
if P07_DidYellowClick then
begin
FindRandomMysteriousMan;
end;
MarkTime(timer);
repeat
wait(100+Random(50));
P07_ClickToContinue;
until TimeFromMark(timer) > 5000;
end;
end;
end;
procedure FindRandomPirate; //Pirate AntiRandom
var
p:TPoint;
l,i:Integer;
tpa: TPointArray;
atpa: T2DPointArray;
timer:Integer;
begin
writeln('Anti-Random : Checking for the Pirate');
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06 , 0.15);
FindColorsTolerance(tpa, 3686246, 141 , 71, 350, 260, 16);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
writeln('Pirate Detection: ' + inttostr(Length(tpa)));
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
for i := 0 to l-1 do
begin
writeln('Length[' + inttostr(i) + ']: ' + inttostr(Length(atpa[i])));
end;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 100) then
begin
continue;
end;
if (Length(atpa[i]) > 500) then
begin
continue;
end;
p := MiddleTPA(atpa[i]);
MMouse(p.x,p.y,2,2);
wait(250);
if P07_ContainsText(P07_GetUpText2,['alk-to','alk-t']) then
begin
ClickMouse2(mouse_Left);
if P07_DidYellowClick then
begin
FindRandomPirate;
end;
MarkTime(timer);
repeat
wait(100+Random(50));
P07_ClickToContinue;
until TimeFromMark(timer) > 5000;
end;
end;
end;
procedure FindRandomGenie; //Genie AntiRandom
var
p:TPoint;
l,i:Integer;
tpa: TPointArray;
atpa: T2DPointArray;
timer:Integer;
begin
writeln('Anti-Random : Checking for the djin');
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09 , 1.58);
FindColorsTolerance(tpa, 14582841, 141 , 71, 350, 260, 16);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
writeln('Djin Detection: ' + inttostr(Length(tpa)));
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
for i := 0 to l-1 do
begin
writeln('Length[' + inttostr(i) + ']: ' + inttostr(Length(atpa[i])));
end;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 100) then
begin
continue;
end;
if (Length(atpa[i]) > 550) then
begin
continue;
end;
p := MiddleTPA(atpa[i]);
MMouse(p.x,p.y,2,2);
wait(250);
if P07_ContainsText(P07_GetUpText2, ['alk-to','alk-t']) then
begin
ClickMouse2(mouse_Left);
if P07_DidYellowClick then
begin
FindRandomGenie;
end;
MarkTime(timer);
repeat
wait(100+Random(50));
P07_ClickToContinue;
until TimeFromMark(timer) > 5000;
end;
end;
end;
procedure FindStrangePlant; //StrangePlant AntiRandom
var
p:TPoint;
l,i,x,y:Integer;
tpa: TPointArray;
atpa: T2DPointArray;
timer,Fruit:Integer;
begin
Fruit := DTMFromString('mwQAAAHic42RgYDBlZmAwAGI9IDZihvCtgNgaiC2B2ByINzMxMKwH4q1AvAuIdwPxTiDeBMRrgXgFEPdnbAeaxogXczEQBvhNgGA4AACPnwor');
writeln('Anti-Random : Checking for Strange Plant');
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.39 , 0.81);
FindColorsTolerance(tpa, 613969, 141 , 71, 350, 260, 5);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
writeln('Plant Detection: ' + inttostr(Length(tpa)));
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
for i := 0 to l-1 do
begin
writeln('Length[' + inttostr(i) + ']: ' + inttostr(Length(atpa[i])));
end;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 125) then
begin
continue;
end;
if (Length(atpa[i]) > 550) then
begin
continue;
end;
p := MiddleTPA(atpa[i]);
MMouse(p.x,p.y,1,1);
wait(250);
if P07_ContainsText(P07_GetUpText2, ['ick','pick','Pick','range','lant']) then
begin
ClickMouse2(mouse_Left);
if P07_DidYellowClick then
begin
FindStrangePlant;
end;
MarkTime(timer);
repeat
if P07_TabInventoryTab(4) then
begin
if FindDTM(Fruit,x,y,P07_MIX1,P07_MIY1,P07_MIX2,P07_MIY2) then
begin
MMouse(x,y,2,2) ;
ClickMouse2(mouse_Left);
FreeDTM(Fruit);
exit;
end;
end;
until TimeFromMark(timer) > 5000;
FreeDTM(Fruit);
exit;
end;
end;
end;
procedure FindRandomRick; //RickTurpentine AntiRandom
var
p:TPoint;
l,i:Integer;
tpa: TPointArray;
atpa: T2DPointArray;
timer:Integer;
begin
writeln('Anti-Random : Checking for Rick Turpentine');
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00 , 0.15);
FindColorsTolerance(tpa, 3881791, 141 , 71, 350, 260, 10);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
writeln('Rick Detection: ' + inttostr(Length(tpa)));
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
for i := 0 to l-1 do
begin
writeln('Length[' + inttostr(i) + ']: ' + inttostr(Length(atpa[i])));
end;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 125) then
begin
continue;
end;
if (Length(atpa[i]) > 550) then
begin
continue;
end;
p := MiddleTPA(atpa[i]);
MMouse(p.x,p.y,2,2);
wait(250);
if P07_ContainsText(P07_GetUpText2, ['alk-to','alk-t','ick','urpent']) then
begin
ClickMouse2(mouse_Left);
if P07_DidYellowClick then
begin
FindRandomRick;
end;
MarkTime(timer);
repeat
wait(100+Random(50));
P07_ClickToContinue;
until TimeFromMark(timer) > 5000;
end;
end;
end;
procedure FindRandomNPCs;
begin
if (Length(GetMiniMapDotsIn('yellow', 626, 70, 659, 106)) > 0) then
begin
FindRandomRick;
FindStrangePlant;
FindRandomGenie;
FindRandomPirate;
FindRandomMysteriousMan;
end;
end;
function FixBox(tempBox:TBox):TBox; // Used to fix the box for drawing purposes.
var
tempint:Integer;
begin
if (tempBox.X1 > tempBox.X2 ) then
begin
tempint := tempBox.X1;
tempBox.x1 := tempBox.X2;
tempBox.x2 := tempint
end;
if (tempBox.Y1 > tempBox.Y2 ) then
begin
tempint := tempBox.Y1;
tempBox.Y1 := tempBox.Y2;
tempBox.Y2 := tempint
end;
Result := tempBox;
end;
function ClearBoxArray(tempBox:TBoxArray):TBoxArray;
var
i:Integer;
begin
for i := 0 to High(tempBox) do
begin
tempBox[i].X1 := 0;
tempBox[i].Y1 := 0;
tempBox[i].X2 := 0;
tempBox[i].Y2 := 0;
end;
Result := tempBox;
end;
procedure FindBombPixels(PixelArray:TIntegerArray); // This is where the magic happens :)
var
Counter,i:Integer;
begin
writeln(PixelArray);
Counter:=0;
for i := 0 to 9 do
begin
if PixelArray[i] > 70 then
inc(Counter);
if Counter > 2 then
begin
BombCount := 0;
exit;
end;
end;
for i := 0 to 9 do
begin
if (PixelArray[i] > 240) then
begin
if (LastBombIndex = -1) or (LastBombIndex = BombIndex-1) then
begin
inc(BombCount);
LastBombIndex := BombIndex;
end else
begin
BombCount := 0;
LastBombIndex := BombIndex;
end;
end;
if BombCount >= 3 then
begin
writeln('Suspected Exploding Rock detected, if false alarm - ');
writeln('please report on my thread with the latest debug (those numbers above)');
writeln('Thank you!')
MMouse(260,174,1,1);
wait(RandomRange(150,225));
ClickMouse2(mouse_left);
wait(RandomRange(150,225));
MMouse(260,174,1,1);
ClickMouse2(mouse_left);
wait(RandomRange(34500,45500)); // Random lasts 34.5 Seconds flat, no need to continuously check for it.
BombCount := 0 ;
exit;
end;
end;
end;
procedure FindGraniteRockBomb; // Tracking our rocks to scan them for pixelshift.
var
i, l: Integer;
p: TPoint;
tpa: TPointArray;
atpa: T2DPointArray;
begin
BombBoxes := ClearBoxArray(BombBoxes);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.24);
FindColorsTolerance(tpa, 4153723, 165, P07_MSY1, 386, P07_MSY2, 21);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2)
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
if l < 1 then exit;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 150) then // Object too small, skipping
begin
continue;
end;
if (Length(atpa[i]) > 500) then // Object too large, skipping
begin
continue;
end;
p := MiddleTPA(atpa[i]);
BombBoxes[i].X1 := p.x-15;
BombBoxes[i].Y1 := p.y-26;
BombBoxes[i].X2 := p.x+17;
BombBoxes[i].Y2 := p.y;
if (BombBoxes[i].X1 < MSX1) then BombBoxes[i].X1 := MSX1;
if (BombBoxes[i].Y1 < MSY1) then BombBoxes[i].Y1 := MSY1;
if (BombBoxes[i].X2 > MSX2) then BombBoxes[i].X2 := MSX2;
if (BombBoxes[i].Y2 > MSY2) then BombBoxes[i].Y2 := MSY2;
BombBoxes[i] := FixBox(BombBoxes[i]);
end;
FindBombPixels(PixelShiftMulti(BombBoxes,200));
end;
procedure FindGraniteRock;
var
i, l,temp: Integer;
p: TPoint;
tpa: TPointArray;
atpa: T2DPointArray;
randomkey:Integer;
MinDist,MinIndex:Integer;
begin
BombCount := 0;
LastBombIndex := -1;
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.24);
FindColorsTolerance(tpa, 4153723, 165, P07_MSY1, 386, P07_MSY2, 21);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2)
atpa := SplitTPA(tpa, 3);
SortATPASize(atpa, True);
l := Length(atpa);
MinDist := 10000;
if l < 1 then exit;
for i := 0 to l-1 do
begin
if (Length(atpa[i]) < 150) then // Object too small, skipping
begin
continue;
end;
if (Length(atpa[i]) > 500) then // Object too large, skipping
begin
continue;
end;
p := MiddleTPA(atpa[i]);
temp := Distance(273,187, p.x,p.y );
if (MinDist > temp) then
begin
MinDist := temp;
MinIndex := i;
end;
end;
p := MiddleTPA(atpa[MinIndex]);
MMouse(p.x, p.y, 2, 2);
Wait(105+Random(40));
if not P07_ContainsText(P07_GetUpText2, ['ine','ocks']) then
begin
case RandomRange(38,40) of
38: randomkey := 37;
39: randomkey := 39;
end;
keydown(randomkey);
wait(35);
keyup(randomkey);
exit;
end;
ClickMouse2(ClickLeft);
if P07_DidYellowClick then
begin
exit;
end else
begin
BombIndex := 0;
for i := 0 to 18 do
begin
FindGraniteRockBomb;
inc(BombIndex);
if DropGranite then break;
wait(350);
end;
end;
wait(350);
end;
procedure Progress;
var
i:Integer;
begin
// ClearDebug;
Line[0] := '|| XP/Hour: ' + inttostr(((3600*TotalXpGain) / (1+(GetTimeRunning/1000))));
Line[1] := '|| Total Xp: ' + inttostr(TotalXpGain);
Line[2] := '|| Time Running: ' + MsToTime(GetTimeRunning,3);
for i:=0 to High(Line) do
begin
writeln(Line[i]);
end;
end;
begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := False;
Smart_FixSpeed := False;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
DeclareDTMs;
SetLength(Line,3);
SetLength(BombBoxes,17);
SetupSRL;
AddOnTerminate('FreeOurDTMs');
TotalXpGain := 0;
SetupP07Include;
P07_LoginPlayer;
P07_MakeCompassWest;
P07_MakeCameraAngleHigh;
ClearDebug;
repeat
P07_TabInventoryTab(4);
FindRandomNPCs;
Progress;
FindGraniteRock;
until not P07_LoggedIn;
end.