Methrend
2012-01-05 12:33:04
How Long have You Played Runescape?
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
In terms of languages known,
Java, C, C#, C++, Ruby, Perl, PHP, Python, possibly a few others I can't think of at the moment.
Are you a member of any other communities?
None pertaining to runescape and/or runescape botting
Tell us about yourself…
Please show us one (or multiple) of your scripts.
1 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
In terms of languages known,
Java, C, C#, C++, Ruby, Perl, PHP, Python, possibly a few others I can't think of at the moment.
Are you a member of any other communities?
None pertaining to runescape and/or runescape botting
Tell us about yourself…
From: Methrend
I'm currently almost 20 years of age, residing in Brisbane, Australia. My major interests lie in all IT work, both hardware and software, with my main love being programming (of any sort, from software through to web development). I'm currently studying a Game Development degree and working as a Junior Developer for a high-status website. I heavily enjoy the challenges presented in coding various projects pertaining to games (anything from simple macros to full-fledged programs) and have become really interested in the runescape botting scene as it provides an almost unique challenge.
Currently the only script I have released is my Dwarven Resource Miner and I'm hoping to work on this a bit more before starting a new project, so that I don't lose focus. This script is posted below for your perusal, and can also be found in the "First Scripts" section
(Direct Link: http://villavu.com/forum/showthread.php?t=70929)
Please show us one (or multiple) of your scripts.
program MethDwarfMiner;
{$define SMART}
{$i srl/srl.simba}
var
numOre, numGems, numLoads, ORE_DTM, GEM_DTM, tempMX, tempMY:integer;
const
SRLStats_Username = 'Anonymous';
SRLStats_Password = 'anon1337';
LOADS = 100; //How many loads per player
DROP_GEMS = False; //Set to true to drop gems, leave false to bank
PICKAXE_EQUIPPED = True; // Set to false if pickaxe is in your inventory
BETA_MINING = False; // Set to true to use a potentially faster, but buggier mining method
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Change Accordingly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 4 lowercase letters from your character name
Players[0].Active := True;
{
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
}
end;
(* ******************************************************************************
CREDIT TO Mayazcherquoi on IRC / Daniel on Forums
Finds multiple instances of colour, spiralling outwards from (cx, cy). Returns
only points that are not within the bounds of any of the multiple TBox's
specified in parametre, SkipBoxArray.
- by Daniel
****************************************************************************** *)
function FindColorsSpiralToleranceSkipBoxArray(const cx, cy: Integer; var Points: TPointArray; const Colour, x1, y1, x2, y2, Tolerance: Integer; SkipBoxArray: TBoxArray): Boolean;
var
I, arrLen: Integer; { Go through Points array }
sI, sArrLen: Integer; { Go through SkipBoxArray }
addCnt: Integer; { Additions count }
canAdd: Boolean; { Can add to array? }
tempPoints: TPointArray;
begin
Result := FindColorsSpiralTolerance(cx, cy, tempPoints, Colour, x1, y1, x2, y2, Tolerance);
if(not(Result)) then
Exit;
arrLen := High(tempPoints);
SetArrayLength(Points, arrLen + 1);
addCnt := 0;
sArrLen := High(SkipBoxArray);
for I := 0 to arrLen do
begin
canAdd := True;
for sI := 0 to sArrLen do
begin
if(InRange(tempPoints[I].X, SkipBoxArray[sI].X1, SkipBoxArray[sI].X2) and
InRange(tempPoints[I].Y, SkipBoxArray[sI].Y1, SkipBoxArray[sI].Y2)) then
begin
canAdd := False;
Break;
end;
end;
if(canAdd) then
begin
Points[addCnt] := tempPoints[I];
Inc(addCnt);
end;
end;
end;
function FindColorSpiralToleranceSkipBoxArray(var x, y: Integer; const cx, cy: Integer; const Colour, x1, y1, x2, y2, Tolerance: Integer; SkipBoxArray: TBoxArray): Boolean;
var
tempPoints: TPointArray;
begin
Result := FindColorsSpiralToleranceSkipBoxArray(cx, cy, tempPoints, Colour, x1, y1, x2, y2, Tolerance, SkipBoxArray);
Result := (Length(tempPoints) > 0);
if(not(Result)) then
Exit;
x := tempPoints[0].x;
y := tempPoints[0].y;
end;
function FindColorSpiralToleranceSkipBox(var x, y: Integer; const cx, cy: Integer; const Colour, x1, y1, x2, y2, Tolerance: Integer; SkipBox: TBox): Boolean;
begin
Result := FindColorSpiralToleranceSkipBoxArray(x, y, cx, cy, Colour, x1, y1, x2, y2, Tolerance, [SkipBox]);
end;
(* ******************************************************************************
End of code that isn't mine
****************************************************************************** *)
procedure AntiBan;
begin
if(not(LoggedIn)) then
Exit;
If FindNormalRandoms Then
begin
Players[CurrentPlayer].Active := False;
numLoads := 0;
NextPlayer(Players[CurrentPlayer].Active);
Exit;
end;
case Random(80) of
10: RandomRClick;
20: HoverSkill('Mining', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
end;
procedure WalkToBank(atCoal:Boolean);
begin
MakeCompass(0);
wait(1000 + random(666));
if (atCoal) then
begin
RadialWalkTolerance(9931140, 264, 300, 70, 0, 1, 18);
wait(500 + random(227));
end;
RadialWalkTolerance(6778480, 285, 250, 62, 1, 0, 13);
wait(1000 + random(666));
end;
procedure WalkToCoal(atBank:Boolean);
begin
if (atBank) then
begin
RadialWalkTolerance(9931140, 106, 70, 50, 0, 0, 18);
wait(500 + random(227));
end;
RadialWalkTolerance(4808039, 84, 105, 67, -1, 0, 15);
wait(1000 + random(666));
end;
function isMining:Boolean;
var
Box: TBox;
begin
Box := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(Box, 250, 500) > 260);
end;
function FindBox(open:Boolean):Boolean;
var
x, y, CTS: Integer;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.58);
while (FindColorSpiralTolerance(x, y, 6653850, MSX1, MSY1, MSX2, MSY2, 3)) do
begin
MMouse(x, y, 2, 2);
if IsUpText('posit') then
begin
if (open) then
begin
Mouse(x, y, 2, 2, mouse_right);
end;
Result := True;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
exit;
end;
end;
Result := False;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function FindOre(mine, moveMouse:Boolean):Boolean;
var
x, y, CTS: Integer;
skipOre: TBox;
pointsA: TPointArray;
begin
skipOre := IntToBox(tempMX - 30, tempMY - 30, tempMX + 30, tempMY + 30);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.23);
FindColorsSpiralTolerance(x, y, pointsA, 1776668, MSX1, MSY1, MSX2, MSY2, 4)
//while (FindColorSpiralTolerance(x, y, 1776668, MSX1, MSY1, MSX2, MSY2, 4)) do
while (FindColorSpiralToleranceSkipBox(x, y, MSCX, MSCY, 1776668, MSX1 + 10, MSY1 + 10, MSX2, MSY2, 4, skipOre)) do
begin
if (moveMouse) then
MMouse(x, y, 2, 2);
if (IsUpText('ine') or OptionsExist(['ine'], False)) then
begin
Result := True;
if (mine) then
begin
Mouse(x, y, 2, 2, mouse_right);
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
exit;
end;
end;
Result := False;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure FindOreSpot(x, y: Integer);
var
direction, yTrigPoint, xTrigPoint: Integer;
begin
yTrigPoint := (iAbs(256 - x));
if ((x >= MSCX) and (x <= (MSCX + 167))) then
begin
if (y > (MSCY + yTrigPoint)) then
direction := 3
else if (y < (MSCY - yTrigPoint)) then
direction := 1
else
direction := 0
end else if ((x <= MSCX) and (x > (MSCX - 167))) then
begin
if (y > (MSCY + yTrigPoint)) then
direction := 3
else if (y < (MSCY - yTrigPoint)) then
direction := 1
else
direction := 2
end else if (x > (MSCX + 167)) then
direction := 0
else if (x < (MSCX - 167)) then
direction := 2;
case direction of
0:
begin
x := (MSCX + 40);
y := (MSCY);
end;
1:
begin
x := (MSCX);
y := (MSCY - 40);
end;
2:
begin
x := (MSCX - 40);
y := (MSCY);
end;
3:
begin
x := (MSCX);
y := (MSCY + 40);
end;
end;
tempMX := x;
tempMY := y;
end;
procedure MineOre;
var
i, x, y, prevMX, prevMY: Integer;
begin
while (not InvFull) do
begin
If FindNormalRandoms Then
begin
Players[CurrentPlayer].Active := False;
numLoads := 0;
NextPlayer(Players[CurrentPlayer].Active);
Exit;
end;
if (BETA_MINING) then
begin
if ((FindOre(true, true)) and (not InvFull)) then
begin
while ((FindOre(false, false)) and (not InvFull)) do
begin
while ((OptionsExist(['ine'], False)) and (not InvFull)) do
begin
GetMousePos(prevMX, prevMY);
FindOreSpot(prevMX, prevMY);
ChooseOption('ine');
wait(random(300));
AntiBan;
repeat
wait(random(200));
until (not isMoving)
FindOre(True, True);
//while (MouseTooClose(tempMX, tempMY)) do
while (not OptionsExist(['ine'], False)) do
begin
FindOre(True, True);
end;
repeat
wait(random(100));
until (not isMining);
end;
if (OptionsExist(['ancel'], false)) then
ChooseOption('ancel');
FindOre(True, True);
end;
end;
end else
begin
if FindOre(True, True) then
begin
ChooseOption('ine');
wait(random(200));
AntiBan;
repeat
wait(random(500));
until (not isMining);
end;
end;
if (not InvFull) then
begin
i := i + 1;
if (i = 20) then
begin
i := 0;
if FindBox(False) then
begin
WalkToCoal(True);
end else
begin
WalkToCoal(False);
end;
end;
end;
end;
if (DROP_GEMS) then
begin
while (FindDTM(GEM_DTM, x, y, MIX1, MIY1, MIX2, MIY2)) do
begin
Mouse(x, y, 2, 2, mouse_right);
ChooseOption('rop');
end;
end;
If (Not InvFull) then
begin
MineOre;
end;
end;
procedure DepositOre;
var i, j, d, o, g: integer;
begin
d := 0;
i := 0;
j := 0;
g := CountItems('dtm', GEM_DTM, []);
o := CountItems('dtm', ORE_DTM, []);
repeat
If FindNormalRandoms Then
begin
Players[CurrentPlayer].Active := False;
numLoads := 0;
NextPlayer(Players[CurrentPlayer].Active);
Exit;
end;
if FindBox(False) then
begin
FindBox(True);
ChooseOption('posit');
while ((not DepositScreen) and (j < 20)) do
begin
wait(random(500));
j := j + 1;
end;
if (DepositScreen) then
begin
if (PICKAXE_EQUIPPED) then
begin
DepositAll;
d := 1;
end else
begin
Deposit(2, 28, True);
d := 1;
end;
numOre := numOre + o;
numGems := numGems + g;
numLoads := numLoads + 1;
stats_IncVariable('Loads Done', 1);
stats_IncVariable('Coal Ore (Mined)', o);
stats_IncVariable('Gems (Mined)', g);
end;
if (j >= 20) then
begin
j := 0
end;
end else
begin
i := i + 1;
end;
if (i = 10) then
begin
i := 0;
if FindOre(False, True) then
begin
WalkToBank(True);
end else
begin
WalkToBank(False);
end;
end;
until (d = 1);
wait(1000 + random(750));
end;
procedure CheckAtStart;
begin
if (FindBox(False)) then
begin
WalkToCoal(True);
end;
if not (FindOre(False, True)) then
begin;
WalkToCoal(False);
end;
end;
procedure ProgReport;
begin
Stats_Commit;
Writeln(' ');
Writeln(' Methrends Dwarf Coal Miner ');
Writeln(' Running For: ' + TimeRunning);
Writeln(' Total Ores Deposited: ' + IntToStr(numOre));
If (DROP_GEMS = False) then
Writeln(' Total Gems Deposited: ' + IntToStr(numGems));
Writeln(' ');
end;
begin
Smart_Server := 0;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
SetupSRLStats(439, SRLStats_Username, SRLStats_Password);
DeclarePlayers;
ORE_DTM := DTMFromString('mggAAAHicY2NgYHBmYWCwg+IgIDYCYl8gPgKU2wrEl4B4PxCfAOLTQKyiLA0kmTDwfwbsgBEHhgAAwY8HvQ==');
GEM_DTM := DTMFromString('mAAEAAHic42FgYJjBxMCwEIjnA/ECKJ4LxJOAuAeIu4F4KhD3Q/lljBBcBMRVQFwHxA1AXA/ElVDxLCDOBuJcIBYQKgDawkQ0/s9AGmAkESMDAEPLDnQ=');
while (not (AllPlayersInactive)) do
begin
if not LoggedIn then
LoginPlayer;
while(not LoggedIn) do
wait(1000);
MakeCompass(0);
SetAngle(SRL_ANGLE_HIGH);
tempMX := MSCX;
tempMY := MSCY;
while(LoggedIn) do
begin
CheckAtStart;
MineOre;
AntiBan;
WalkToBank(True);
AntiBan;
DepositOre;
ProgReport;
WalkToCoal(True);
if ((numLoads = LOADS) and (length(Players) > 1 )) then
begin
numLoads := 0;
NextPlayer(Players[CurrentPlayer].Active);
end;
end;
end;
end.