Velvet Glam
2012-03-15 18:50:02
How Long have You Played Runescape?
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
Pascal & Java
Are you a member of any other communities?
No not really
Tell us about yourself…
Please show us one (or multiple) of your scripts.
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
N/A
What is your general programming knowledge?
Pascal & Java
Are you a member of any other communities?
No not really
Tell us about yourself…
From: Velvet Glam
I have been lurking around alot of botting sites, however, SRL caught my eye and I started coding alot of things using just trial and error. This seems like a community I could become a part of..
Below I have pasted my guild miner(it would not allow me to attach it). Keep in mind it is just beta, however, you will see it has alot of advance things in it :).
Please show us one (or multiple) of your scripts.
program new;
{$i SRL/SRL/Misc/Smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/Misc/PaintSmart.simba}
{$i SRL/SRL/Misc/Debug.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
WorldInfo := [False, 42];
Active := True;
end;
end;
const
MM_ARROW = 1787389;
MM_BANK = 2413294;
SPARKLE_COLOR = 16709107;
var
ladderColor, rockColor: Integer;
mskPick, mskGem: Integer;
bmpCoal: Integer;
dtmGuildDoor: Integer;
relocateTime: Integer;
//statistics
ores, gems: Integer;
startTime: Integer;
procedure fillMem;
begin
mskPick := BitmapFromString(16, 9, 'beNpjYICA/2DAQARAVkmkFkztZ' +
'GukXBcmF9NYXH5EFsT0CISNVT2uECCoGN3lAG4NX6E=');
mskGem := BitmapFromString(13, 23, 'beNpjYPgPBgzEAVorJkk9dVUO' +
'iLJBbu9gDrrBr+w/IQBSCgA7dHGP');
bmpCoal := BitmapFromString(5, 5, 'beNpTlpaVFVNQkAAiZWVpIE' +
'LjIrPV1GThbExZZQBTtQkP');
dtmGuildDoor := DTMFromString('mlwAAAHicY2dgYNjCxMCwHoh3A/FWIN4GxEuA+BgQuyJheyD2AmJnIHYB4s' +
'+M7AzfX/8FYxdjJTBmBYqBsAjQXBjWgGIjKGbEg6EAAEFnD/I=');
end;
var
chatName, chatText: String;
prevLine, curLine: String;
function inChatText(textArr: TStringArray): Boolean;
var
i: Integer;
begin
result := False;
for i := 0 to High(textArr) do
begin
result := Pos(textArr[i], Lowercase(chatText)) > 0;
if result then
Exit;
end;
end;
function myRespond: Boolean;
var
blueTPA, blackTPA, textTPA: TPointArray;
bounds: TBox;
responses: TStringArray;
response, level: String;
label
resp;
begin
result := False;
FindColors(blueTPA, clBlue, MCX1, 445, MCX2, 457);
if Length(blueTPA) < 1 then
Exit;
FindColors(blackTPA, clBlack, MCX1, 445, MCX2, 457);
if Length(blackTPA) < 1 then
Exit;
textTPA := CombineTPA(blueTPA, blackTPA);
prevLine := chatText;
bounds := GetTPABounds(textTPA);
with bounds do
begin
chatName := Trim(GetTextAtEx(x1 - 1, y1 - 2, 0, SmallChars, False, False,
0, 1, clBlack, 80, False, tr_AllChars));
Delete(chatName, Pos(':', chatName), 4);
chatText := Trim(GetTextAtEx(x1 - 1, y1 - 2, 0, SmallChars, False, False,
0, 1, clBlue, 80, False, tr_AllChars));
end;
curLine := chatText;
if PrevLine <> CurLine then
begin
if Pos(Copy(Players[CurrentPlayer].Name, 1, 4), Lowercase(chatName)) > 0 then
Exit;
if inChatText(['mining', 'mine']) and inChatText(['level', 'lvl']) then
begin
result := True;
level := IntToStr(GetSkillLevel(SKILL_MINING));
Responses := ['lvl '+level,
'My Mining level is '+Level+'.',
level,
'level '+level,
level+' mining'];
goto resp;
end;
end;
Exit;
resp :
if Result then
begin
response := responses[Random(High(responses))];
TypeSend(response);
WriteLn('Responded: '+response);
WriteLn('To: '+chatName+': '+chatText);
end;
end;
function findRockColor: Integer;
var
TPA: TPointArray;
T2D: T2DPointArray;
colorArray: TIntegerArray;
i: Integer;
begin
result := -1;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(8.43, 0.59);
FindColorsTolerance(TPA, 5263692, MMX1, MMY1, MMX2, MMY2, 6);
SetColorToleranceSpeed(1);
if Length(TPA) > 0 then
T2D := TPAToATPA(TPA, 4)
else
Exit;
for i := 0 to High(T2D) do
begin
if ( not InRange(Length(T2D[i]), 10, 50) ) then
Continue;
colorArray := GetColors(T2D[i]);
ClearSameIntegers(colorArray);
if Length(colorArray) = 2 then
if Max(colorArray[0], colorArray[1]) - Min(colorArray[0], colorArray[1]) = 1316630 then
begin
result := Max(colorArray[0], colorArray[1]);
Break;
end;
end;
end;
function findLadderColor: Integer;
var
TPA: TPointArray;
begin
Result := -1;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.62, 3.92);
FindColorsTolerance(TPA, 536408, MMX1, MMY1, MMX2, MMY2, 2);
SetColorToleranceSpeed(1);
FilterPointsPie(TPA, 0, 360, 0, 65, MMCX, MMCY);
if Length(TPA) > 0 then
Result := GetColor(TPA[0].x, TPA[0].y);
end;
function pixelChange(bounds: TBox; time: Integer; rock: Boolean): Integer;
var
bmp1, bmp2, col1, col2, i, j: Integer;
height, width: Integer;
begin
result := 0;
with bounds do
begin
bmp1 := BitmapFromClient(x1, y1, x2, y2);
Wait(time);
bmp2 := BitmapFromClient(x1, y1, x2, y2);
if ( not rock ) then
result := CalculatePixelShift(bmp1, bmp2, IntToBox(0, 0, x2 - x1, y2 - y1))
else
begin
width := x2 - x1;
height := y2 - y1;
for i := 0 to width do
for j := 0 to height do
begin
col1 := FastGetPixel(bmp1, i, j);
col2 := FastGetPixel(bmp2, i, j);
if ( col1 = SPARKLE_COLOR ) or ( col2 = SPARKLE_COLOR ) then
Continue
else if col1 <> col2 then
result := result + 1;
end;
end;
end;
FreeBitmap(bmp1);
FreeBitmap(bmp2);
end;
procedure waitUntilStoppedMoving;
var
t: Integer;
begin
FFlag(0);
t := GetSystemTime;
while GetSystemTime - t < 850 do
begin
if pixelChange(IntToBox(MMCX - 30, MMCY - 30, MMCX + 30, MMCY + 30), 100, False) > 75 then
t := GetSystemTime;
Wait(35 + Random(65));
end;
end;
function findFaladorEastBank(out x, y: Integer): Boolean;
var
TPA: TPointArray;
T2D: T2DPointArray;
bx, by, dotColor, i: Integer;
begin
result := False;
dotColor := -1;
Freeze;
FindColors(TPA, 65536, MMX1, MMY1, MMX2, MMY2);
FilterPointsPie(TPA, 0, 360, 0, 76, MMCX, MMCY);
for i := 0 to High(TPA) do
if ( GetColor(TPA[i].x - 1, TPA[i].y - 1) - GetColor(TPA[i].x, TPA[i].y - 1) = 4369 ) then
begin
dotColor := GetColor(TPA[i].x, TPA[i].y - 2);
Break;
end;
UnFreeze;
if dotColor = -1 then
begin
WRITELN('MMDOTCOLOR NOT FOUND!');
TerminateScript;
end;
FindColors(TPA, dotColor, MMX1, MMY1, MMX2, MMY2);
if Length(TPA) > 0 then
T2D := SplitTPAEx(TPA, 6, 3)
else
Exit;
for i := 0 to High(T2D) do
if Length(T2D[i]) >= 8 then
Break;
if i = Length(T2D) then
Exit;
MiddleTPAEx(T2D[i], x, y);
if FindColor(bx, by, MM_BANK, MMX1, MMY1, MMX2, MMY2) then
result := Distance(bx, by, x, y) < 35;
end;
function inGuild: Boolean;
begin
result := PercentColorMM(SRL_GetBlackBackground, 0) > 40;
//result := findRockColor <> -1;
end;
function nearGuildDoor: Boolean;
var
p: TPoint;
x, y: Integer;
angle: Extended;
begin
result := False;
if ( not LoggedIn ) then
Exit;
if FindDTMRotated(dtmGuildDoor, x, y, MMX1, MMY1, MMX2, MMY2, -PI*2, PI*2, PI/30, angle) then
if Distance(x, y, MMCX, MMCY) < 40 then
begin
WriteLn('Player is near guild door..');
p := Point(x, y);
p := RotatePoint(Point(x, y + 50),
2 * PI - rs_GetCompassAngleRadians,
p.x, p.y);
Mouse(p.x, p.y, 0, 0, True);
waitUntilStoppedMoving;
end;
end;
function relocateInGuild: Boolean;
var
TPA: TPointArray;
T2D: T2DPointArray;
p: TPoint;
i: Integer;
begin
result := nearGuildDoor;
if result or ( not LoggedIn ) then
Exit;
if GetSystemTime - relocateTime < 25000 then
Exit;
WriteLn('Relocating..');
rockColor := findRockColor;
if rockColor = -1 then
begin
WRITELN('ROCKCOLOR NOT FOUND!');
TerminateScript;
end;
FindColors(TPA, rockColor, MMX1, MMY1, MMX2, MMY2);
FilterPointsPie(TPA, 0, 360, 35, 76, MMCX, MMCY);
if Length(TPA) > 0 then
T2D := SplitTPAEx(TPA, 5, 5)
else
Exit;
SortATPASize(T2D, True);
for i := 0 to High(T2D) do
if Length(T2D[i]) > 65 then
begin
result := True;
p := MiddleTPA(T2D[i]);
Mouse(p.x, p.y, 0, 0, True);
waitUntilStoppedMoving;
Break;
end;
end;
function successfulClick(x, y: Integer): Boolean;
var
t: Integer;
begin
result := False;
t := GetSystemTime;
while GetSystemTime - t < 250 do
begin
if CountColor(1695663, x - 5, y - 5, x + 5, y + 5) > 8 then
Break;
result := CountColorTolerance(395676, x - 5, y - 5, x + 5, y + 5, 1) > 0;
if result then
Break;
Wait(1);
end;
end;
function climbLadder: Boolean;
var
TPA: TPointArray;
T2D: T2DPointArray;
bounds: TBox;
p: TPoint;
i, minCount, t, x, y: Integer;
option: String;
begin
result := False;
if ( not LoggedIn ) then
Exit;
if inGuild then
begin
option := 'limb-up';
minCount := 100;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.19, 0.50);
FindColorsTolerance(TPA, 3818568, MSX1, MSY1, MSX2, MSY2, 8);
SetColorToleranceSpeed(1);
if Length(TPA) > 0 then
T2D := SplitTPAEx(TPA, 1, 1)
else
Exit;
end else
begin
option := 'limb-down';
minCount := 25;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.09, 0.91);
FindColorsTolerance(TPA, 3295068, MSX1, MSY1, MSX2, MSY2, 11);
if Length(TPA) > 0 then
T2D := SplitTPA(TPA, 5)
else
Exit;
SortATPASize(T2D, True);
bounds := GetTPABounds(T2D[0]);
SetToleranceSpeed2Modifiers(0.09, 0.17);
with bounds do
FindColorsTolerance(TPA, 4680575, x1, y1, x2, y2, 4);
SetColorToleranceSpeed(1);
if Length(TPA) > 0 then
T2D := SplitTPA(TPA, 1)
else
Exit;
end;
SortATPAFromFirstPoint(T2D, Point(MSCX, MSCY));
for i := 0 to High(T2D) do
begin
if Length(T2D[i]) < minCount then
Continue;
p := MiddleTPA(T2D[i]);
MMouse(p.x, p.y, 0, 0);
//bounds := GetTPABounds(T2D[i]);
//with bounds do
// MMouse(RandomRange(x1 + 2, x2 - 2), RandomRange(y1 + 2, y2 - 2), 0, 0);
if ( not Pos('adder', rs_GetUpText) > 0 ) then
Continue;
GetMousePos(x, y);
if Random(35) = 3 then
begin
Mouse(x, y, 0, 0, False);
result := ChooseOption(Option);
end else
begin
Mouse(x, y, 0, 0, True);
result := successfulClick(x, y);
if ( not result ) then
begin
WriteLn('Miss-clicked ladder!');
waitUntilStoppedMoving;
Exit;
end;
end;
if result then
Break;
end;
if result then
begin
result := False;
t := GetSystemTime;
while ( GetSystemTime - t < 7500 ) and
( not result ) do
begin
if option = 'limb-up' then
result := ( not inGuild )
else
result := inGuild;
Wait(15 + Random(65));
end;
end;
end;
function constrainBounds(bounds: TBox): TBox;
begin
with bounds do
begin
result := IntToBox(x1, y1, x2, y2);
if x1 < MSX1 then
result.x1 := MSX1;
if y1 < MSY1 then
result.y1 := MSY1;
if x2 > MSX2 then
result.x2 := MSX2;
if y2 > MSY2 then
result.y2 := MSY2;
end;
end;
function getMSAngle(ax, ay: Integer): Extended;
begin
result := Degrees(ArcTan2(ay - MSCY, ax - MSCX)) + 90;
if Result < 0 then
Result := Result + 360;
end;
function oreCount: Integer;
var
bounds: TBox;
i: Integer;
begin
result := 0;
for i := 1 to 28 do
begin
bounds := InvBox(i);
with bounds do
if InIntArray([168, 178, 180], CountColor(131072, x1, y1, x2, y2)) then
result := result + 1;
end;
end;
const
COAL_COLOR = 2434598;
COAL_TOLERANCE = 10;
COAL_HUE = 1.67;
COAL_SAT = 0.27;
function followRock(var rx, ry: Integer): Boolean;
var
TPA: TPointArray;
bounds: TBox;
t: Integer;
begin
result := False;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(COAL_HUE, COAL_SAT);
t := GetSystemTime;
while GetSystemTime - t < 1000 do
begin
if GetSystemTime - t > 500 then
if pixelChange(IntToBox(MMCX - 30, MMCY - 30, MMCX + 30, MMCY + 30), 100, False) > 75 then
t := GetSystemTime;
bounds := constrainBounds(IntToBox(rx - 18, ry - 18, rx + 18, ry + 18));
SMART_DrawBox(bounds);
with bounds do
if ( not FindColorsSpiralTolerance(rx, ry, TPA, COAL_COLOR, x1, y1, x2, y2, COAL_TOLERANCE) ) then
FindColorsSpiralTolerance(rx, ry, TPA, SPARKLE_COLOR, x1, y1, x2, y2, 0);
if Length(TPA) > 0 then
MiddleTPAEx(TPA, rx, ry)
else
begin
SetColorToleranceSpeed(1);
Exit;
end;
end;
result := Distance(rx, ry, MSCX, MSCY) < 60;
SetColorToleranceSpeed(1);
end;
function rockGone(rx, ry: Integer; angle: Integer): Boolean;
var
count, i: Integer;
bounds: TBox;
begin
result := False;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(COAL_HUE, COAL_SAT);
bounds := constrainBounds(IntToBox(rx - 12, ry - 12, rx + 12, ry + 12));
count := 0;
with bounds do
if InRange(angle, 0, 40) or
InRange(angle, 320, 360) then
begin
for i := 0 to 5 do
begin
if FindColorSpiralTolerance(rx, ry, COAL_COLOR, x1, y1, x2, y2, COAL_TOLERANCE) or
FindColorSpiral(rx, ry, SPARKLE_COLOR, x1, y1, x2, y2) then
count := count + 1;
Wait(50 + Random(50));
end;
result := count = 0;
end else
result := ( not FindColorSpiralTolerance(rx, ry, COAL_COLOR, x1, y1, x2, y2, COAL_TOLERANCE) ) and
( not FindColorSpiral(rx, ry, SPARKLE_COLOR, x1, y1, x2, y2) );
SetColorToleranceSpeed(1);
end;
function isMining: Boolean;
begin
result := AveragePixelShift(IntToBox(245, 135, 285, 195), 125, 500) > 250;
end;
function mineRock: Boolean;
var
TPA: TPointArray;
oreT2D, rockT2D: T2DPointArray;
bounds: TBox;
i, t, tmpCount, rockMidX, rockMidY, x, y: Integer;
angle{, density}: Extended;
begin
result := False;
if ( not LoggedIn ) or InvFull then
Exit;
nearGuildDoor;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(COAL_HUE, COAL_SAT);
FindColorsTolerance(TPA, COAL_COLOR, MSX1, MSY1, MSX2, MSY2, COAL_TOLERANCE);
SetColorToleranceSpeed(1);
if Length(TPA) > 0 then
oreT2D := TPAToATPA(TPA, 26)
else
begin
relocateInGuild;
relocateTime := GetSystemTime;
end;
SortATPAFromFirstPoint(oreT2D, Point(MSCX, MSCY));
for i := 0 to High(oreT2D) do
begin
if Length(oreT2D[i]) < 10 then
Continue;
//MiddleTPAEx(oreT2D[i], x, y);
bounds := GetTPABounds(oreT2D[i]);
with bounds do
begin
//density := Length(oreT2D[i]) / ((x2 - x1) * (y2 - y1) * 1.0);
//if density > 0.35 then
// Continue;
bounds := constrainBounds(IntToBox(x1 - 8, y1 - 8, x2 + 8, y2 + 8));
end;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.03, 0.09);
//bounds := constrainBounds(IntToBox(x - 18, y - 18, x + 18, y + 18));
with bounds do
FindColorsTolerance(TPA, 3499641, x1, y1, x2, y2, 15);
SetColorToleranceSpeed(1);
if Length(TPA) < 200 then
Continue
else
rockT2D := SplitTPA(TPA, 1);
SortATPASize(rockT2D, True);
bounds := GetTPABounds(rockT2D[0]);
with bounds do
begin
rockMidX := (x2 + x1) shr 1;
rockMidY := (y2 + y1) shr 1;
if Distance(rockMidX, rockMidY, MSCX, MSCY) > 60 then
if pixelChange(constrainBounds(IntToBox(x1 - 12, y1 - 12, x2 + 12, y2 + 12)), 100, True) > 0 then
Continue;
//MMouse(RandomRange(x1 + 4, x2 - 4), RandomRange(y1 + 4, y2 - 4), 0, 0);
MMouse(rockMidX, rockMidY, 0, 0);
end;
if ( not Pos('ocks', rs_GetUpText) > 0 ) then
Continue;
tmpCount := oreCount;
GetMousePos(x, y);
if Random(35) = 3 then
begin
Mouse(x, y, 0, 0, False);
result := ChooseOption('Mine');
if ( not result ) then
Exit;
end else
begin
Mouse(x, y, 0, 0, True);
result := successfulClick(x, y);
if ( not result ) then
begin
WriteLn('Miss-clicked rock!');
waitUntilStoppedMoving;
Exit;
end;
end;
if result then
Break;
end;
if ( not result ) then
Exit;
if ( not followRock(rockMidX, rockMidY) ) then
begin
WriteLn('Rock was not followed!');
waitUntilStoppedMoving;
Exit;
end else
angle := getMSAngle(rockMidX, rockMidY);
t := GetSystemTime;
repeat
for i := 0 to 3 do
begin
case i of
0 : if RockGone(rockMidX, rockMidY, Round(angle)) then
begin
WriteLn('Rock gone!');
Break;
end;
1 : if oreCount > tmpCount then
begin
WriteLn('Ore count increase!');
Break;
end;
2 : if GetSystemTime - t > 7500 then
if ( not isMining ) then
begin
WriteLn('Player is no longer mining!');
Break;
end else
t := GetSystemTime;
3 : myRespond;
//4 : timeout failsafe?
//5 : Randoms
end;
Wait(1);
end;
//Antiban
until ( i <> 4 ) or ( not LoggedIn ) or InvFull;
end;
function findOnMM(out x, y: Integer; color: Integer; rP: TPoint): Boolean;
var
TPA: TPointArray;
T2D: T2DpointArray;
p: TPoint;
begin
result := False;
FindColors(TPA, color, MMX1, MMY1, MMX2, MMY2);
if Length(TPA) > 0 then
begin
result := True;
T2D := SplitTPA(TPA, 10);
p := RotatePoint(rP,
2 * PI - rs_GetCompassAngleRadians,
MMCX, MMCY);
SortATPAFromFirstPoint(T2D, p);
MiddleTPAEx(T2D[0], x, y);
end;
end;
function radialCompassWalk(color, startRad, endRad, xOffset, yOffset, flagDist: Integer): Boolean;
var
TPA: TPointArray;
p: TPoint;
currentAngle, i, newStart, newEnd, x, y: Integer;
begin
Result := False;
currentAngle := Round(rs_GetCompassAngleDegrees);
if InRange(currentAngle, 0, 5) or InRange(currentAngle, 355, 360) then
begin
newStart := startRad;
newEnd := endRad;
end else
begin
newStart := startRad - currentAngle;
newEnd := endRad - currentAngle;
end;
if newStart < 0 then
newStart := newStart + 360;
if newEnd < 0 then
newEnd := newEnd + 360;
FindColors(TPA, color, MMX1, MMY1, MMX2, MMY2);
FilterPointsPie(TPA, newStart, newEnd, 10, 76, MMCX, MMCY);
if Length(TPA) > 0 then
begin
p := MiddleTPA(TPA);
p := RotatePoint(Point(p.x + xOffset, p.y + yOffset),
2 * PI - rs_GetCompassAngleRadians,
p.x, p.y);
i := Round(FixD(Degrees(ArcTan2(p.y - MMCY, p.x - MMCX)) + 90)) / 45;
case i of
0, 7, 8 : y := 1;
1, 2 : x := -1;
3, 4 : y := -1;
5, 6 : x := 1;
end;
i := 0;
while ( not rs_OnMinimap(p.x, p.y) ) and
( i < 50 ) do
begin
p.x := p.x + x;
p.y := p.y + y;
i := i + 1;
end;
Result := rs_OnMinimap(p.x, p.y);
if ( not Result ) then
Exit;
Mouse(p.x, p.y, 0, 0, True);
FFlag(flagDist);
if flagDist = 0 then
waitUntilStoppedMoving;
end;
end;
procedure toMine;
var
p: TPoint;
dist, t, x, y: Integer;
s: String;
label
ladder;
begin
if ( not LoggedIn ) then
Exit;
if GetMMLevels('run', s) < 55 then
RestUntil(RandomRange(85, 100));
SetRun(True);
if ( Random(20) = 3 ) or
( not findOnMM(x, y, MM_ARROW, Point(MMX1, MMCY)) )then
if findFaladorEastBank(x, y) then
begin
p := Point(x, y);
p := RotatePoint(Point(x + 45, y + 7),
2 * PI - rs_GetCompassAngleRadians,
p.x, p.y);
Mouse(p.x, p.y, 0, 0, True);
FFlag(10);
if findOnMM(x, y, MM_ARROW, Point(MMX1, MMCY)) then
begin
Mouse(x, y, 0, 0, True);
FFlag(0);
end;
goto ladder;
end;
Mouse(x, y, 0, 0, True);
dist := 50;
while dist > 30 do
begin
if findOnMM(x, y, MM_ARROW, Point(MMX1, MMCY)) then
dist := Distance(x, y, MMCX, MMCY);
Wait(100 + Random(150));
end;
waitUntilStoppedMoving;
ladder :
t := GetSystemTime;
while ( not climbLadder ) do
begin
if ( GetSystemTime - t > 30000 ) or ( not LoggedIn ) then
begin
Logout;
Exit;
end;
Wait(35 + Random(65));
//Randoms
end;
rockColor := findRockColor;
if rockColor = -1 then
begin
WRITELN('ROCKCOLOR NOT FOUND!');
TerminateScript;
end;
radialCompassWalk(rockColor, 70, 120, 15, 0, 10);
if Random(20) = 3 then
radialCompassWalk(rockColor, 70, 120, 10, 0, 10);
waitUntilStoppedMoving;
end;
function getLocation: String;
var
iCount, x, y: Integer;
begin
result := '';
iCount := InvCount;
if inGuild then
if iCount <> 28 then
result := 'guild'
else
result := 'tobank'
else if findFaladorEastBank(x, y) then
if (( iCount > 1 ) and ( Players[CurrentPlayer].Booleans[0] = False )) or
(( iCount > 0 ) and ( Players[CurrentPlayer].Booleans[0] = True )) then
result := 'bank'
else
result := 'tomine';
end;
procedure toBank;
var
p: TPoint;
t, x, y: Integer;
begin
if ( not LoggedIn ) then
Exit;
SetRun(False);
nearGuildDoor;
t := GetSystemTime;
while True do
begin
if ( GetSystemTime - t > 45000 ) or ( not LoggedIn ) then
begin
Logout;
Exit;
end;
//Randoms
ladderColor := findLadderColor;
if ladderColor <> - 1 then
if findOnMM(x, y, ladderColor, Point(MMCX, MMY2)) then
Break;
rockColor := findRockColor;
radialCompassWalk(rockColor, 240, 290, -15, 0, 10);
end;
Mouse(x, y, 0, 0, True);
waitUntilStoppedMoving;
t := GetSystemTime;
while ( not climbLadder ) do
begin
if ( GetSystemTime - t > 30000 ) or ( not LoggedIn ) then
begin
Logout;
Exit;
end;
Wait(35 + Random(65));
//Randoms
end;
ladderColor := findLadderColor;
if ladderColor = -1 then
begin
WRITELN('LADDERCOLOR NOT FOUND!');
TerminateScript;
end;
if findOnMM(x, y, ladderColor, Point(MMCX + 15, MMY1)) then
begin
p := Point(x, y);
p := RotatePoint(Point(x - 14, y),
2 * PI - rs_GetCompassAngleRadians,
p.x, p.y);
Mouse(p.x, p.y, 0, 0, True);
FFlag(10);
while ( not findFaladorEastBank(x, y) ) do /////////
Wait(100 + Random(150));
p := Point(x, y);
p := RotatePoint(Point(x + 5, y - 7),
2 * PI - rs_GetCompassAngleRadians,
p.x, p.y);
Mouse(p.x, p.y, 0, 0, True);
waitUntilStoppedMoving;
end;
end;
//Randomly use bankers
function openFaladorEastBank: Boolean;
var
TPA: TPointArray;
T2D: T2DPointArray;
p: TPoint;
bounds: TBox;
i, t, x, y: Integer;
begin
result := BankScreen;
if result then
Exit;
if findFaladorEastBank(x, y) then
p := MMToMS(Point(x, y));
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.05, 0.27);
FindColorsTolerance(TPA, 5338257, MSX1, MSY1, MSX2, MSY2, 3);
SetColorToleranceSpeed(1);
if Length(TPA) > 0 then
T2D := SplitTPA(TPA, 5)
else
Exit;
SortATPAFromFirstPoint(T2D, Point(MSCX, MSCY));
for i := 0 to High(T2D) do
begin
if Length(T2D[i]) < 100 then
Continue;
bounds := GetTPABounds(T2D[i]);
with bounds do
begin
if Distance(P.x, P.y, (x2 + x1) shr 1, (y2 + y1) shr 1) > 150 then
Continue;
MMouse(RandomRange(x1 + 5, x2 - 5), RandomRange(y1 + 5, y2 - 5), 0, 0);
end;
if ( not Pos('booth', rs_GetUpText) > 0 ) then
Continue;
GetMousePos(x, y);
if Random(35) = 3 then
begin
Mouse(x, y, 0, 0, False);
result := ChooseOption('ank Ban');
end else
begin
Mouse(x, y, 0, 0, True);
result := successfulClick(x, y);
if ( not result ) then
begin
WriteLn('Miss-clicked bank booth!');
waitUntilStoppedMoving;
Exit;
end;
end;
if Result then
Break;
end;
if Result then
begin
t := GetSystemTime;
while ( GetSystemTime - t < 7500 ) and
( not BankScreen ) do
Wait(15 + Random(65));
Result := BankScreen;
end;
end;
procedure bank;
var
Slot: TIntegerArray;
i, t, tmpCount, x, y: Integer;
bounds: TBox;
begin
if ( not LoggedIn ) then
Exit;
t := GetSystemTime;
while ( not openFaladorEastBank ) do
begin
if ( GetSystemTime - t > 60000 ) or
( not LoggedIn ) then
begin
Logout;
Exit;
end;
Wait(35 + Random(75));
end;
//statistics
ores := ores + CountItems('bitmap', bmpCoal, [10]);
gems := gems + CountItems('bitmap mask', mskGem, [5, 5]);
if ( not Players[CurrentPlayer].Booleans[0] ) or ( Random(5) = 0 ) then
begin
Slot := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
for i := 0 to 500 do
Swap(Slot[Random(Length(Slot))], Slot[Random(Length(Slot))]);
for i := 0 to High(Slot) do
begin
tmpCount := InvCount;
bounds := InvBox(Slot[i]);
with bounds do
begin
if CountColor(131072, x1, y1, x2, y2) = 0 then
Continue;
if FindBitmapMaskTolerance(mskPick, x, y, x1, y1, x2, y2, 5, 5) then
Continue;
Mouse(RandomRange(x1 + 10, x2 - 10), RandomRange(y1 + 10, y2 - 10), 0, 0, False);
end;
if ChooseOptionMulti(['it-All', 'eposit']) then
begin
t := GetSystemTime;
while ( InvCount = tmpCount ) and
( GetSystemTime - t < 1500 ) do
Wait(15 + Random(35));
end;
end;
end else
begin
Mouse(RandomRange(355, 380), RandomRange(300, 315), 0, 0, True);
t := GetSystemTime;
while ( InvCount > 0 ) and ( GetSystemTime - t < 1500 ) do
Wait(15 + Random(35));
end;
if Random(25) = 3 then
CloseBank;
end;
function checkPickaxe: Boolean;
var
bounds: TBox;
i, x, y: Integer;
begin
Result := False;
GameTab(26);
if FindBitmapMaskTolerance(mskPick, x, y, 569, 288, 602, 321, 5, 5) then
begin
WriteLn('Pickaxe Equipped!');
Result := True;
Players[CurrentPlayer].Booleans[0] := True;
Exit;
end else
begin
GameTab(25);
for i := 1 to 28 do
begin
bounds := InvBox(i);
with bounds do
if CountColor(131072, x1, y1, x2, y2) > 0 then
if FindBitmapMaskTolerance(mskPick, x, y, x1, y1, x2, y2, 5, 5) then
begin
WriteLn('Pickaxe not equipped!');
Result := True;
Players[CurrentPlayer].Booleans[0] := False;
Exit;
end;
end;
end;
end;
procedure progressReport;
var
seconds: Integer;
begin
seconds := ((GetSystemTime - startTime) / 1000) + 1;
WriteLn('-------------------------');
WriteLn('Worked for '+TimeRunning+'.');
WriteLn('Mined '+IntToStr(ores)+' ores.');
if gems > 0 then
WriteLn('Found '+IntToStr(gems)+' gem[s].');
WriteLn(IntToStr((3600 * ores) / seconds)+' Ores / HR');
WriteLn(IntToStr((3600 * (ores * 50)) / seconds)+' XP / HR');
WriteLn('-------------------------');
end;
var
mineFailCount: Integer;
begin
SMART_MEMBERS := True;
SMART_SERVER := 42;
SMART_SIGNED := True;
SMART_SUPERDETAIL := False;
SetupSRL;
DeclarePlayers;
fillMem;
ClearDebug;
startTime := GetSystemTime;
repeat
LoginPlayer;
SetAngle(0);
MakeCompass(RandomRange(0, 360));
if ( not checkPickaxe ) then
begin
WriteLn('Player does not have a pickaxe!');
//Logout;
end;
repeat
if ( not LoggedIn ) then
Break;
case getLocation of
'bank' : begin
bank;
progressReport;
end;
'tobank' : toBank;
'guild' : begin
while ( LoggedIn ) and ( not InvFull ) do
begin
//Randoms;
myRespond;
if mineRock then
mineFailCount := 0
else
mineFailCount := mineFailCount + 1;
if mineFailCount > 4 then
begin
relocateInGuild;
relocateTime := GetSystemTime;
end;
Wait(2);
end;
SMART_ClearCanvas;
end;
'tomine' : toMine;
else WRITELN('UKNOWN LOCATION');
end;
Wait(2);
until ( not LoggedIn );
until False;
end.