Cstrike
2010-08-27 13:06:23
Keldagrim Runite Miner
Mines at Keldagrim, banks, and makes you rich.
By: Cstrike
As of Nov 14th 2010 [STATUS: WORKS Core of the program works (worldhopper, miner, remembering what worlds to mine…etc)]
*As long as my main remains unbanned, this script will be continually updated. Until that time, if that time exists…. enjoy. Once [or if] I get banned, this script will no longer be maintained.*
Hello everyone, I applied for SRL members with this script and another woodcutter. As you can see I got in, and I would love to share with you guys my runite miner.
Features
- Mines a full load (27+)
- Goes to bank
- Returns and begins mining
- Remembers all worlds with rune ore and time
- Returns to worlds
- Erases worlds that are too old/messed up/ones you mine from upon returning from the data base
- Does not create any files, only uses variables [arrays] to store the data
- Has many failsafes, and failsafes for the world array remembering thing (ex: removes worlds that are repeated, worlds with 0 players, or anything unusual)
IMPORTANT Setup instructions
Failure to read will not allow the script to work.
- Don't have any favorited worlds, sorry.
- Make sure SMART and SRL and Reflection are completely up to date
- Copy your worldswitcher.scar in your SRL/Core folder to something like "WorldSwitcherBackup.scar". You need the worldswitcher.scar that I've attached to change worlds. Thanks to Shuttleu, he updated the worldchanger so it actually selects worlds now. Without the one I've attached, it will not be able to switch worlds and thus the script will never really work. In addition, I added two lines (you should see the commented //000000000's) which allow my script to get the players per world. I tried using other methods but the script doesnt seem to save certain things (Whoever created the worldswitcher may be able to help me here!)
- Copy the WorldSwitcher.Scar I've attached and place it in the SRL/Core folder
- If there are certain worlds you CANNOT go to, edit them out of the array called 'MembersWorldArray'. (search it) This is if you don't want to go to worlds like 1500+ skill total…etc NOTE: I've already removed pvp worlds and ensured all worlds are safe!
- Set yourself up per instructions below and hit run
How to set yourself up:
- Set yourself up between the rune rocks at the Keldagrim mine
- Make sure you're facing north, and place yourself east or southeast of the western most rock
- Have pick equipped
- Do not carry an amulet of glory unless you dont mind losing money
- MOST IMPORTANTLY: Folow the instructions or the script will NOT work!
- Doesn't support multiplayer yet, sorry. Also, if you have multiple accounts that can access Keldagrim, can you share how you did it? Lol.
- The only thing thus far that nerfs the script is when you get a connection error. I agree that my scripting sort of sucks to failsafe it and sometimes doesn't work, but I will hopefully fix that. Also, it takes a while to test it because you have to wait for the error and be present.
- Does not mine the first world (yet) because it doesn't remember the world due to the SRL members world thing not working for me. You may be able to mod it by adding MiningLoop; at the beginning though.
- Turn on debug if you like to know whats going on
- DO NOT CLICK ON SMART, I've screwed over the mining procedure and world changing many times by doing so. When it says "connecting in X seconds", then you can click on it fine. :)
Drawbacks:
- It will sometimes miss a rock occasionally if it spawns shortly after preparing to leave
- It may arrive at worlds slightly late if a few of them crop up at the same time
- Sometimes the rounding is bad, I'm woring on fixing that
- there is a C:/[sound] that you can use to alert you when the script terminates
- Not multiplayer
I'm also attaching the worldswticher.scar that is edited with the updates so you can see that this is not some bullshit script.
I have tested this between me and my close close friend. This hasn't been leaked (if it is by someone, nothing I can do), and we've been using it for 5-7 days.
Results:
- In 4-5 days I made 20 million gp worth of rune ore (AFTER the rune ore re-calibrates itself to 17.5k/ea)
UPDATE: Look at this proggy ;)
[-----[#]-----[#]-----( ARRAY CHART )-----[#]-----[#]-----]
W: 69 Players: 985 Time: [edit] in case jagex is looking
W: 143 Players: 890 Time: [edit] in case jagex is looking
W: 67 Players: 559 Time: [edit] in case jagex is looking
W: 98 Players: 688 Time: [edit] in case jagex is looking
W: 56 Players: 697 Time: [edit] in case jagex is looking
[-----[#]-----[#]-----(-------------)-----[#]-----[#]-----]
InvCount: 0 Times banked: 9 Time running: 15.52.37I made ~4.25 mil overnight assuming that the price returns to 17.5k/ea- I just got one running for 20+ hours. It banked 17 times. Very nice yield :D
WorldSwitcher [new one]
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- » WorldSwitch routines --//
//-----------------------------------------------------------------//
// * function WorldScreen: Boolean; // by Narcle
// * function OpenWorldScreen: Boolean; // by Bionicle1800
// * function UpdateWorlds: Boolean; // by mixster & Nava2
// * procedure LoadWorldArrays; // by Narcle
// * function FindWorld(W: integer): Boolean; // by Narcle
// * function GetWorldInfo(World: Integer; var WorldRec: TWorld): Boolean; // by Narcle
// * function WS_CurrentWorld(var World: Integer): Boolean; // by IceFire908
// * function GetWorldInfo(World: Integer; var WorldRec: TWorld): Boolean; // by Narcle
// * function FindWorld(W: integer): Boolean; // by Narcle
// * function SelectWorld(WorldNumber: Integer): Boolean; // by Narcle & ZephyrsFury
// * function RandomWorld(Members, PvP: Boolean): Integer; // by Narcle & mixster
// * function ChangeWorld(W: Integer): Boolean; // by Nava2
// * Procedure OrderWorlds(by: string; Descending: boolean); // by NaumanAkhlaQ
// * Function ChooseWorldBy(SettingsNames:TStringArray; SettingsDescending: TBooleanArray; Members, PVP: boolean): boolean; // by Rasta Magician
type
TWorld = record
Number, PlayerNo: Integer;
Members: Boolean;
Prefix, Location, Activity, Language: String;
LootShare, QuickChat, PVP: Boolean;
end;
TWorldArray = array of TWorld;
var
WorldArray: TWorldArray;
WorldsOrdered: Boolean;
WorldPlayerCountNumber : Integer; //0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
function ExitToLobby: Boolean; forward;
function LogInPlayer: Boolean; forward;
{*******************************************************************************
function WorldScreen: Boolean;
by: IceFire908
Description: Returns true if the World screen is open.
*******************************************************************************}
function WorldScreen: Boolean;
begin
Result := (GetLobbyTab = L_WorldSelect);
end;
{*******************************************************************************
function OpenWorldScreen: Boolean;
by: Bionicle1800
Description: Opens the world screen. Returns true if world screen is opened.
*******************************************************************************}
function OpenWorldScreen: Boolean;
begin
Result := LobbyTab(2);
end;
const
SRL_LG_ENGLISH = 0;
SRL_LG_GERMAN = 1;
SRL_LG_FRENCH = 2;
SRL_LG_PORTUGUESE = 3;
SRL_WORLDPARSE_LANG = SRL_LG_ENGLISH;
{*******************************************************************************
procedure UpdateWorlds;
by: mixster
Description: Parses the worlds page into Worlds.INI
*******************************************************************************}
function UpdateWorlds: Boolean;
var
worldList: TWorldArray;
str, Path: string;
tsa, tsb: TStringArray;
W, I, H, Time: Integer;
begin
try
Result := True;
Path := IncludePath + 'SRL\SRL\misc\Worlds.INI';
Writeln('NOTE: Attempting to update the Worlds.INI, please allow the script to access this file.');
Time := GetTimeRunning;
W := RewriteFile(Path, False);
CloseFile(W);
if (SRL_WORLDPARSE_LANG = SRL_LG_ENGLISH) then
str := ''
else
str := 'l=' + IntToStr(SRL_WORLDPARSE_LANG) + '/';
str := GetPage('http://www.runescape.com/' + str + 'slu.ws?order=WMPLA');
Delete(str, 1, Pos('<a href="?order=MWPLA">', str));
Delete(str, 1, Pos('<tr', str) + 3);
tsa := srl_Explode(str, '<tr');
H := High(tsa);
SetLength(worldList, H + 1);
for I := 0 to H do
with worldList[I] do
begin
tsb := srl_Explode(tsa[I], '<td');
if High(tsb) < 5 then
begin
Writeln('Skipping world "' + IntToStr(I + 1) + '" because explosion didn''t return enough values');
Continue;
end;
PlayerNo := StrToIntDef(Between('>', '<', tsb[2]), 2000);
if (Between('"', '"', tsb[3]) = 'a') or (Between('"', '"', tsb[3]) = 'a d') then
begin
Location := 'Activity';
Activity := Between('>', '<', tsb[3]);
end
else
begin
Location := Between('>', '<', tsb[3]);
Activity := '';
end;
Prefix := Between('http://', '.runescape', tsb[1]);
if Prefix = '' then
Prefix := Replace(Lowercase(Between('>' + #10, #10 + #10, tsb[1])), ' ', '');
Number := StrToIntDef(Replace(Prefix, 'world', ''), -1);
if Number = -1 then
begin
Writeln('Invalid world number produced: ' + Prefix);
Writeln('Assuming has suffix, trying again');
str := Replace(Prefix, 'world', '');
Number := StrToIntDef(Copy(str, 1, Length(str) - 1), -1);
if Number = -1 then
Writeln('Failed to gather a world number')
else
Writeln('Succeeded, got ' + IntToStr(Number));
end;
LootShare := Between('"', '"', tsb[4]) = 'd';
QuickChat := Activity = 'Quick Chat';
PvP := Activity = 'PvP World';
Members := Between('"', '"', tsb[5]) = 'm';
end;
//Writeln('Writing to the INI File. T: ' + IntToStr(GetTimeRunning - W));
except
Result := False;
//SRL_Warn('UpdateWorlds', ExceptionToString(ExceptionType, ExceptionParam), Warn_AllVersions);
end;
if not Result then Exit;
WriteINI('Worlds', 'Count', IntToStr(High(worldList) + 1), Path);
WriteINI('Worlds', 'High', IntToStr(worldList[High(worldList)].Number) + #13#10, Path);
H := High(worldList);
for I := 0 to H do
with worldList[I] do
begin
Str := 'World' + IntToStr(Number);
DeleteINI(Str, '', Path);
WriteINI(Str, 'Prefix', Prefix, Path);
WriteINI(Str, 'Activity', Activity, Path);
//WriteINI(Str, 'Type', BoolToStr(Members), Path);
if (Members) then
WriteINI(Str, 'Type', 'Members', Path)
else
WriteINI(Str, 'Type', 'Free', Path);
//WriteINI(Str, 'Flag', fla + 'Flag', Path);
WriteINI(Str, 'Location', Location, Path);
WriteINI(Str, 'LootShare', BoolToStr(LootShare), Path);
WriteINI(Str, 'QuickChat', BoolToStr(QuickChat), Path);
WriteINI(Str, 'PvP', BoolToStr(PvP) + #13#10, Path);
end;
Writeln('Parsed Worlds Page into Worlds.INI. Took ' + IntToStr(GetTimeRunning - Time) + ' ms.');
end;
{*******************************************************************************
procedure LoadWorldArrays;
by: Narcle; Edits by Nava2
Description: Loads the world array into WorldArray from Worlds.ini
*******************************************************************************}
procedure LoadWorldArrays;
var
i, H, Hw: integer;
begin
try
H := StrToInt(ReadINI('Worlds', 'High', IncludePath + 'SRL\SRL\misc\Worlds.ini'));
except
Writeln('LoadWorldArrays: Could not load world arrays, attempting to rewrite Worlds.INI');
if not UpdateWorlds then
begin
SRL_Warn('LoadWorldArrays', 'Could not Load World arrays, please download mixster''s world parser, and replace Worlds.ini', Warn_AllVersions);
Exit;
end;
end;
SetArrayLength(WorldArray, H + 1);
for i := 1 to H do
if not (ReadINI('World' + IntToStr(i), 'Prefix', IncludePath + 'SRL\SRL\misc\Worlds.ini') = '') then
begin
WorldArray[Hw].Number := i;
WorldArray[Hw].Prefix := ReadINI('World' + IntToStr(i), 'Prefix', IncludePath + 'SRL\SRL\misc\worlds.ini');
WorldArray[Hw].Members := (ReadINI('World' + IntToStr(i), 'Type', IncludePath + 'SRL\SRL\misc\worlds.ini') = 'Members');
WorldArray[Hw].LootShare := StrToBool(ReadINI('World' + IntToStr(i), 'Lootshare', IncludePath + 'SRL\SRL\misc\worlds.ini'));
WorldArray[Hw].QuickChat := StrToBool(ReadINI('World' + IntToStr(i), 'Quickchat', IncludePath + 'SRL\SRL\misc\worlds.ini'));
WorldArray[Hw].PVP := StrToBool(ReadINI('World' + IntToStr(i), 'PvP', IncludePath + 'SRL\SRL\misc\worlds.ini'));
WorldArray[Hw].Language := ReadINI('World' + IntToStr(i), 'ServLang', IncludePath + 'SRL\SRL\misc\worlds.ini');
Inc(Hw);
end;
SetArrayLength(WorldArray, Hw);
end;
{*******************************************************************************
function WS_CurrentWorld(var World: Integer): Boolean;
by: IceFire908
Description: Results true if the current world is members,returns world number.
World returns -1 if failed. Only works at world screen.
*******************************************************************************}
function WS_CurrentWorld(var World: Integer): Boolean;
var
P: TPoint;
begin
World := -1;
if (not (WorldScreen)) then
Exit;
if (IsTextInAreaEx(618, 74, 705, 96, P.X, P.Y, 'orld', 0, SmallChars, False, False, 0, 1, clWhite)) then
World := StrToIntDef(GetNumbers(Trim(GetTextAtEx(P.X, P.Y, 0, SmallChars, False, False, 0, 1, clWhite, 15, False, tr_AllChars))), -1);
Result := FindColorTolerance(P.X, P.Y, 3141117, 596, 64, 701, 100, 20);
end;
{*******************************************************************************
function FindWorld(W: integer): Boolean;
by: Narcle
Description: Scrolls to area and returns true if world was found
*******************************************************************************}
function FindWorld(W: integer): Boolean;
Var
WPos, SPos, i, x, y, H, CurW: integer;
BarPos: TPoint;
begin
if not WorldScreen then
Exit;
WS_CurrentWorld(CurW);
if (W = CurW) then
begin
Result := True;
WriteLn('Already on world ' + IntToStr(W));
Exit;
end;
if Length(WorldArray) < 1 then
LoadWorldArrays;
H := High(WorldArray);
for i := 0 to H do
if (WorldArray[i].Number = W) then
begin
WPos := i+1;
Break;
end;
SPos := Round(WPos/(H+1)*100);
if not WorldsOrdered then
begin
Mouse(116, 125, 4, 4, true);//makes them drop down
WorldsOrdered := true;
wait(500+random(500));
end;
case W of
1..15: BarPos:= Point(700, 162);
16..30: BarPos:= Point(700, 192);
31..44: BarPos:= Point(700, 217);
45..57: BarPos:= Point(700, 241);
58..73: BarPos:= Point(700, 267);
74..87: BarPos:= Point(700, 292);
88..102: BarPos:= Point(700, 315);
103..115: BarPos:= Point(700, 338);
116..135: BarPos:= Point(700, 362);
136..153: BarPos:= Point(700, 385);
154..169: BarPos:= Point(700, 409);
end;
Mouse(BarPos.x, BarPos.y, 0, 0, true);
wait(300+Random(100));
Result := IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(W) + ' ', 0, StatChars, False, False, -1, 2, 16579836) or
IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(W) + ' ', 0, StatChars, False, False, -1, 2, 6618364);
end;
{*******************************************************************************
function GetWorldInfo(World: Integer; var WorldRec: TWorld): Boolean;
by: Narcle
Description: Records World info into TWorld record, also Results true if world
was found
*******************************************************************************}
function GetWorldInfo(World: Integer; var WorldRec: TWorld): Boolean;
var
xx, yy, x, y, Color: integer;
begin
if (WorldScreen) then
begin
Color := 16579836;//white
if not IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(World) + ' ', 0, StatChars, False, False, 0, 2, Color) then
begin
Color := 6618364;//yellow
if IsTextInAreaEx(84, 134, 134, 440, X, Y, IntToStr(World) + ' ', 0, StatChars, False, False, 0, 2, Color) then
WorldRec.Members := true
else
Exit;
end;
WorldRec.Number := World;
WorldRec.PlayerNo := StrToIntDef(Trim(GetTextAtEx(137, y, 0, StatChars, False, False, 0, 2, Color, 5, False, tr_Digits)), -1);
WorldRec.Activity := Trim(GetTextAtEx(238, y, 0, StatChars, False, False, 0, 2, Color, 24, False, tr_AllChars));
WorldRec.LootShare := FindColor(xx, yy, 7711612, 600, y-4, 636, y+14);
WorldRec.QuickChat := Pos('uick', WorldRec.Activity) > 0;
WorldRec.PVP := Pos('ounty', WorldRec.Activity) > 0;
WorldPlayerCountNumber := (WorldRec.PlayerNo); // 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Result := (WorldRec.PlayerNo > 0);
end;
end;
{*******************************************************************************
Function SelectWorld(W: Integer): Boolean;
by: Narcle & ZephyrsFury
Description: Switches to the specified world. Returns true if successful.
*******************************************************************************}
function SelectWorld(W: integer): boolean;
var
x, y, xx, yy, T, CurW: integer;
WRec: TWorld;
begin
if OpenWorldScreen then
begin
wait(400+random(200));
WS_CurrentWorld(CurW);
if (W = CurW) then
begin
Result := True;
WriteLn('Already on world ' + IntToStr(W));
Exit;
end;
if FindWorld(W) then
begin
wait(100+random(100));
if GetWorldInfo(W, WRec) then
begin
Writeln('World: '+inttostr(WRec.Number)+', Players: '+inttostr(WRec.PlayerNo)+', Members: '+Booltostr(WRec.Members)+', PvP: '+Booltostr(WRec.PVP));
if FindText(x, y, ' '+inttostr(W)+' ', StatChars, 84, 134, 134, 440) then
begin
MMouse(x, y, 500, 4);
GetMousePos(x, y);
wait(400+random(100));
if FindColor(xx, yy, 6316128, x-20, y-2, x+20, y+2) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
T := GetSystemTime;
if FindColor(xx, yy, 19890, x-20, y-2, x+20, y+2) then
begin
Writeln('World '+inttostr(W)+' selected.');
Result := true;
end;
end;
end;
end else
WriteLn('World ' + IntToStr(W) + ' is either OFFLINE or FULL.');
end else
WriteLn('Failed to find World ' + IntToStr(W) + '!');
if (not(Result)) then TypeByte(vk_Escape);
end;
end;
{*******************************************************************************
function RandomWorld(Members, PvP: Boolean): Integer;
by: Narcle & mixster
Description: Returns a random world by paramaters.
*******************************************************************************}
function RandomWorld(Members, PvP: Boolean): Integer;
var
i, H, l: integer;
wArray: TWorldArray;
begin
if High(WorldArray) < 0 then
LoadWorldArrays;
H := High(WorldArray);
SetLength(wArray, H + 1);
for i := 0 to H do
if (WorldArray[i].Members = Members) and (WorldArray[i].PvP = PvP) and (InStrArr(WorldArray[i].Language, ['English', ''], False)) then
begin
wArray[l] := WorldArray[i];
Inc(l);
end;
Result := wArray[random(l)].Number;
end;
{*******************************************************************************
function ChangeWorld(W: Integer): Boolean;
by: Nava2
Description: Changes to world W. Returns True if successful.
*******************************************************************************}
function ChangeWorld(W: Integer): Boolean;
begin
while LoggedIn do ExitToLobby;
Result := SelectWorld(W);
LoginPlayer;
end;
{*******************************************************************************
Procedure OrderWorlds(by: string; Descending: boolean);
by: NaumanAkhlaQ
Description: Orders worlds by 'by' in order 'Descending'
Check function for valid params of 'by'
Descending = true means the left button
*******************************************************************************}
procedure OrderWorlds(by: string; Descending: boolean);
var
ATPA: T2DPointArray;
Arr: array of tstringarray;
TPA: TPointArray;
I: Byte;
TB: TBox;
begin
Arr := [TStringArray(['world', 'w', 'worlds']), TStringArray(['players', 'pl', 'player']), TStringArray(['activity', 'location', 'loc', 'act']),
TStringArray(['ls', 'lootshare']), TStringArray(['type', 't']), TStringArray(['ping', 'pi'])];
for I := 0 To High(Arr) do
if InStrArr(Lowercase(By), Arr[i], False) then
Break;
FindColorsTolerance(TPA, 1074576, 0, 0, 716, 141, 1);
ATPA := SplitTPA(TPA, 2);
SortATPAFromFirstPoint(ATPA, Point(91, 124));
TB := GetTPABounds(ATPA[(I * 2) + Integer(Descending)]);
MouseBox(TB.x1, TB.y1, TB.x2, TB.y2, 1);
end;
{*******************************************************************************
Function ChooseWorldBy(SettingsNames:TStringArray; SettingsDescending: array of boolean; Members, PVP: boolean): boolean;
by: Rasta Magician
Description: Chooses a world by SettingsNames , ordered by SettingsDescending
Takes into account Members and PVP
Check OrderWorlds for valid params for SettingsNames
*******************************************************************************}
function ChooseWorldBy(SettingsNames:TStringArray; SettingsDescending: array of boolean; Members, PVP: boolean): boolean;
var
TPA: TPointArray;
i, C : integer;
begin
if not WorldScreen then
if not OpenWorldScreen then
exit;
if length(SettingsNames) <> length(SettingsDescending) then
begin
srl_warn('ChooseWorldBy', 'Arrays are not the same length', warn_AllVersions);
SelectWorld(RandomWorld(Members, PVP));
exit;
end;
for i:= 0 to High(SettingsNames) do
begin
OrderWorlds(SettingsNames[i], SettingsDescending[i]);
wait(1000+random(200));
end;
wait(1500+random(500));
for i:= 0 to 15 do //16 worlds show up in screen
begin
FindColorsTolerance(TPA, 16777215, 182, 150+18*i, 206, 159+18*i, 0);
C := Length(TPA);
if (C = 0)or(C = 66) then //failed detection or full
Continue;
if (Members)xor(GetColor(620, 157+18*i) <> 11316396) then
Continue;
if (PVP)xor(GetColor(589, 156+18*i) <> 1251528) then
Continue;
MouseBox(79, 148+18*i, 685, 165+18*i, 1);
for c := 0 to 4 do
begin
wait(200);
Result := not WorldScreen;
if Result then exit;
end;
end;
Result := false;
writeln('Failed to sort the worlds. Choosing random world. Members: ' +
BoolToStr(Members) + '; PVP: ' + BoolToStr(PVP) + ';');
SelectWorld(RandomWorld(Members, PVP));
end;
Rune miner
{------------------------------------------------------------------------------]
$
One miner to rule them all: $$$
The runite miner $$$$
By: Cstrike $$$$$
V: 1.0 $$$$777
$$$$777
77777777
777777777
7777777III
7777IIIIIIII
ZZ IIIIIIIIIIIII
ZZZ IIIIIIIIIIIII
$$$$$$Z IIIIIII???????
Z$$$$$$$$$$ 7IIII?????????III
$$$$ $$$$$$$$$$$$ ????????????????Z
$$77777 $$$$7777$$$$ZZ ?????????????????ZZ
$$ $$$777777$$$$77777$$$$$$$ZZ7?????????????????$$$
$$$$$$77777777777777777777$$$ZZZ?????????????????$$$
ZZ$$$$7777III 777IIIIIII7777$$$$$$$Z??????????????$$$$
ZZZ$$$$ZZIIII 777IIIIIIIIIII777$$$$$$$$???????????7777
ZZZ7777ZZZIII 777IIIIIIIIIIII777$$$$$$$$Z??????????7777
$ZZZ77777$$$$Z IIIIIII????IIIIIII7777$$$$$$?????????7777D
$$ZZZZ77777$$$$ IIIIIII??????IIIIIII777777$$$$ ???????7777
$$ZZZZ777777$$$$ III??????????IIIIIIIIII$$$$$$ ???????IIII
$$$ZZZZ$$$7777$$$$$III????????????????IIII777777ZZZ ??IIIIII
$$$$ZZZZ$$$IIIII7777 ???????????++++???IIII77777$$$
ZZZZ$$$IIIII7777I???????++++++++???IIII7777$$$$
ZZZZ$$$$IIIII77777???????++++++++???IIIIII$$$$ZZZ
$$$$IIIIII7777Z???+++++++++++++IIIIII7777ZZZ
777IIIII777 $???+++++++++++++IIIII7777$
IIII 7???++++????????????77
????????????????
?????????????
[------------------------------------------------------------------------------]
Instructions
=============
1) Load your account between the two rocks. Account must be in the middle.
2) This obviously means at Keldagrim for now, Heroes Guild will come later
3) Do not start at bank, the script will take you to a bank and do it for you
4) You must wield your rune pick for now, or else it will get banked
5) Everything else is banked as well (gems, strange rock, other?)
6) Don't wear a dragonstone amulet since you will clog yourself with gems
7) Remove worlds from the members list which you cannot go to
Ex: Skill world 1500 if youre less
Ex: Laggy worlds on the opposite side of earth [if they lag terminate you]
8) You need to enter your pin. If you think this will scam you, don't use it...
[------------------------------------------------------------------------------]
***************
** Important **
***************
- Do not click smart while its active! This tends to fuck up the mining process
- If you want to know the process, turn debug on
- Connection errors will nerf [terminate] the script,there are failsafes though
- Remove worlds from the members list which you cannot
- To find 'debugOn' variable, use the search function for *debugOn :=*
[------------------------------------------------------------------------------}
program RuneMinerElite;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
const
{--- Setup Constants---}
WORLD = 157;
MEMBERS = true;
SIGNED = true;
RockCol = 10985325; // Rune rock color and tolerance
RockTol = 6;
sqX1 = MSCX - 65; // This is a 65 radius box around the player
sqY1 = MSCY - 65; // and this code is used for detecting if there
sqX2 = MSCX + 65; // is a runite rock color match, meaning that
sqY2 = MSCY + 65; // it will keep mining.
boxL1X = 210; // These boxes are designed to look 'L'eft, 'R'ight, and 'U'p
boxL1Y = 123; // above the player. These detect rune rocks in these ranges
boxL2X = 249; // so that the script can see if there is still rune being
boxL2Y = 196; // mined or not.
boxR1X = 278; // X1/Y1 is top left of box, X2/Y2 is bottom left
boxR1Y = 140;
boxR2X = 342;
boxR2Y = 222;
boxU1X = 212;
boxU1Y = 132;
boxU2X = 277;
boxU2Y = 258;
boxX1 = 249;
boxY1 = 136;
boxX2 = 317;
boxY2 = 224;
//WorldPlayerCountNumber = 1000;
{----------------------}
var
PlayerNumberArray, WorldNumArray, MarkedTimeArray, MembersWorldArray : TIntegerArray; // World table array
debugOn : Boolean; // Debug
x, y, CurrentWorldActive, timesBanked, scriptRunning : Integer; // Mouse cursor
procedure DeclarePlayers;
begin
NumberOfPlayers(1); // How many players? 1 account = "1', 5 accounts = "5"...
CurrentPlayer := 0; // Start at player "zero" (aka player 1)
Players[0].Name := '';//Your RuneScape UserName
Players[0].Pass := '';//Your RuneScape PassWord
Players[0].Nick := ''; //3-4 letters from name
Players[0].Active:= True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
Players[0].Pin := '';
debugOn := false; // Set to "False" if you do not want debug on
end;
// Debug procedure | I think this idea was originally taken from Xcan, so assume that
procedure Debug (s : String);
begin
if debugOn then
begin
Writeln ('DEBUG: ' + s);
end;
end;
procedure AwkwardText;
begin
if not LoggedIn then Exit;
case Random(13) of
0: writeln ('Pillage mining since "79.');
1: writeln ('YOU NOW HAVE HEAVY SANDVICH YAUH?!');
2: writeln ('Even God couldnt code something this epic.');
3: writeln ('Holmes on homes, tonight at 11.');
4: writeln ('This program is better than getting laid.');
5: writeln ('Did you know: Without me, dragon claws would still be 32 million?');
6: writeln ('Im the reason party hat prices are dropping.');
7: writeln ('I make third age armor look like mithril.');
8: writeln ('Who needs 99 prayer? You do.');
9: writeln ('If you ever thought of getting that herblore cape...');
10: writeln ('Duke Nukems muscle fibers are made out of my essence.');
11: writeln ('You could buy a car in real life with what Im making you...');
12: writeln ('If others are jealous of you, they have reason to be because of me.');
13: writeln ('I define sexy. Sexy = benefits me, benefits me = money, I = money.');
end;
end;
// Delete a value of the array and shrink its size [Good for deleting worlds] | Originally created by IceFire908, 'for to do 'line modified by me
procedure DeleteIntegerFromArray(var Arr: TIntegerArray; Index: Integer);
var
TempArr: TIntegerArray;
I, L: Integer;
begin
SetLength(TempArr, Length(Arr) - 1);
for I := 0 to High(Arr) do // <-- Modded here
if (I <> Index) then
begin
TempArr[L] := Arr[I];
Inc(L);
end;
Arr := TempArr;
end;
// This cleans up the world array when you want to add a new array
procedure WorldArrayCleanerSpecific (worldnum : Integer);
var i : Integer;
begin
debug ('SPECIFIC CLEANUP REQUESTED [World '+ IntToStr(worldnum)+']');
for i := 0 to High(WorldNumArray) do
begin
if WorldNumArray[i] = worldnum then
begin
DeleteIntegerFromArray (WorldNumArray, i);
Debug ('Deleted WorldNum array #' + IntToStr(worldnum));
DeleteIntegerFromArray (PlayerNumberArray, i);
Debug ('Deleted PlayerNum array #' + IntToStr(worldnum));
DeleteIntegerFromArray (MarkedTimeArray, i);
Debug ('Deleted MarkedTime array #' + IntToStr(worldnum));
end;
end;
end;
// Removes irritating adjacent worlds that crop up due to world lag errors
procedure AdjacentWorldRemover;
var tempi, i : Integer;
begin
Debug ('Checking for double worlds since WorldNumArray > 0');
if (high(WorldNumArray) > 0) then
begin
tempi := 0; // failsafe
for i:=1 to High(WorldNumArray) do
begin
Debug (IntToStr(i)+ ' = ' + IntToStr(WorldNumArray[i]));
if WorldNumArray[i] = WorldNumArray[(i-1)] then
begin
Debug ('match found @ ' + IntToStr(WorldNumArray[i]));
tempi := i;
end;
end;
if tempi > 0 then
begin
Debug ('Removing i = '+IntToStr(tempi));
//DeleteIntegerFromArray (WorldNumArray, tempi);
WorldArrayCleanerSpecific (WorldNumArray[tempi]);
end;
wait (100+random(50));
{
Debug ('---');
Debug ('new array:');
for i:=0 to High(WorldNumArray) do
begin
Debug (IntToStr(i)+ ' = ' + IntToStr(WorldNumArray[i]));
end;
}
end;
end;
// This cleans up generic fuck ups like "Players = 0, -1"...etc | Also, this will purge worlds that have been sitting around too long (great for resetting after a bank!)
procedure WorldArrayCleanerGeneral;
var i : Integer;
arrayCounter, originalBounds, failsafeabort : Integer;
begin
Debug ('Now cleaning');
Debug ('High playernumarray: ' +IntToStr(High(PlayerNumberArray)));
wait (500);
AdjacentWorldRemover; // Clean adjacent screw ups
originalBounds := High(PlayerNumberArray);
arrayCounter := 0;
failsafeabort := 0;
repeat
for i := 0 to High(PlayerNumberArray) do
begin
if (PlayerNumberArray[i] < 1) or (WorldNumArray[i] < 1) or (TimeFromMark(MarkedTimeArray[i]) > 1800000) then
begin
Debug (inttostr(i) + '/'+ inttostr(High(PlayerNumberArray)));
Debug ('Generic cleanup: Deleted WorldNum array #' + IntToStr(WorldNumArray[i]));
DeleteIntegerFromArray (WorldNumArray, i);
Debug ('Generic cleanup: Deleted PlayerNum array #' + IntToStr(PlayerNumberArray[i]));
DeleteIntegerFromArray (PlayerNumberArray, i);
Debug ('Generic cleanup: Deleted MarkedTime array #' + IntToStr(MarkedTimeArray[i]));
DeleteIntegerFromArray (MarkedTimeArray, i);
Inc(arrayCounter); // If error found, restart loop (or else it only finds up to world[i-(# of errors)]
end;
end;
wait (10);
Inc(failsafeabort);
until (arrayCounter > originalBounds) or (failsafeabort > 50)
Debug ('Done cleaning.');
end;
// Antiban (though not really that useful)
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(25) of
0: begin
BoredHuman;
Debug ('ANTIBAN: Did bored human');
end;
end;
end;
// This procedure sets up the worlds that we should only go to | Therefore, we don't end up on any pvp or f2p worlds
procedure SetupWorlds;
begin
MembersWorldArray := [9, 12, 15, 22, 23, 24, 27, 28, 31, 36,
39, 42, 44, 45, 46, 48, 51, 52, 53, 54,
56, 58, 60, 64, 66, 67, 68, 69, 70, 71,
76, 77, 78, 79, 82, 83, 84, 88, 89, 91,
92, 97, 98, 99, 100, 103, 104, 110, 111, 112,
115, 116, 117, 121, 129, 130, 131, 132, 138, 142,
143, 144, 145, 148, 151, 156, 157, 158, 159, 160,
164, 166];
// 10 worlds per horizontal row for easy counting
// Add or remove worlds to suit your needs
end;
// Add world to the 'WorldNumArray' | Thanks to Shuttleu for this code
procedure AddWorldToList (WorldNum, CountOfPlayersKnown: Integer);
begin
SetArrayLength (WorldNumArray, Length(WorldNumArray)+1); // Add world number
WorldNumArray[High(WorldNumArray)]:= WorldNum;
Debug ('Added world "'+ IntToStr(WorldNum) +'" to World Roster array'); // Add player number
SetArrayLength (PlayerNumberArray, Length(PlayerNumberArray)+1);
PlayerNumberArray[High(PlayerNumberArray)]:= CountOfPlayersKnown;
Debug ('Added players: "'+ IntToStr(CountOfPlayersKnown) +'" to World Roster array');
SetArrayLength (MarkedTimeArray, Length(MarkedTimeArray)+1); // Add time mark
MarkTime (MarkedTimeArray[High(MarkedTimeArray)]);
Debug ('Added time "'+ IntToStr(MarkedTimeArray[High(MarkedTimeArray)]) +'" to World Roster array');
end;
// Checks tiles to see if we're farther away from rune rocks than we think, returns true if we need to move closer
function AreWeTooFarFromRuneRocks : Boolean;
var currentTile : TTile;
miningTileArray : TTileArray;
i : Integer;
begin
currentTile := GetMyPos;
miningTileArray := [Tile(2870, 10260), Tile(2871, 10260), Tile(2871, 10261)];
result := true;
for i:=0 to High(miningTileArray) do
begin
if (currentTile = miningTileArray[i]) then
begin
result := false;
Debug ('We are in the correct mining spot');
end;
end;
end;
// Find rune rock procedure | Taken from AutoColorAid (ACA 2.0) | Find rune rock right
function FindRuneRockRight (var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.83);
if not(FindColorsTolerance(arP, RockCol, 278, 142, 346, 220, RockTol)) then
begin
Debug ('No rune rock color found (on this world)');
wait (10+random(10));
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 98) and (R <= 123) and (G >= 141) and (G <= 176) and (B >= 147) and (B <= 184) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 20.14) and (X <= 31.92) and (Y >= 24.12) and (Y <= 38.23) and (Z >= 31.59) and (Z <= 50.50) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('ine')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Debug ('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
// Find rune rock procedure TOP
function FindRuneRockTop (var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.83);
if not(FindColorsTolerance(arP, RockCol, 202, 127, 270, 183, RockTol)) then
begin
Debug ('No rune rock color found (on this world)');
wait (10+random(10));
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 98) and (R <= 123) and (G >= 141) and (G <= 176) and (B >= 147) and (B <= 184) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 20.14) and (X <= 31.92) and (Y >= 24.12) and (Y <= 38.23) and (Z >= 31.59) and (Z <= 50.50) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('ine')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Debug ('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
function MiningLoop : Boolean;
var arP : TPointArray;
abortCount : Integer;
rightRockTimeAbort, topRockTimeAbort : Integer;
miningTileFailsafe : TTile;
begin
If not LoggedIn then Exit;
result := false;
if AreWeTooFarFromRuneRocks then // Get us closer to the rune rocks if were somewhat far away
begin
debug ('walking to tile closer to rune rocks');
miningTileFailsafe := Tile(2871, 10261);
WalkToTile (miningTileFailsafe, 0, 0);
wait (1500+random(1000));
end;
Debug ('looking for RIGHT rock');
if FindRuneRockRight (x, y) then
begin
result := true;
debug ('Found R, clicking');
Mouse (x, y, 3, 3, false);
ChooseOption ('ine');
wait (2000+random(1000));
MarkTime (rightRockTimeAbort);
repeat
wait (150+random(225));
debug ('waiting...');
if abortCount > 0 then
begin
Debug ('Resetting abortCount to 0');
abortCount := 0; // We found the rock, default it
end;
until (not (FindColorsTolerance(arP, RockCol, 278, 142, 346, 220, RockTol))) or ((TimeFromMark (rightRockTimeAbort)) > 120000)
debug ('No more R rock!');
end;
wait (1000+random(700));
debug ('looking for TOP rock');
if FindRuneRockTop (x, y) then // Rune rock top
begin
result := true;
Debug ('Found T, clicking');
Mouse (x, y, 3, 3, false);
ChooseOption ('ine');
wait (2000+random(1000));
MarkTime (topRockTimeAbort);
abortCount := 0;
repeat // Failsafe since it sometimes thinks the rock is mined when its not
wait (200+random(125));
if ((FindColorsTolerance(arP, RockCol, 202, 127, 270, 183, RockTol))) then
begin
repeat // While script detects rune rock top color
Debug ('mining... ['+IntToStr(abortCount)+'/5]');
wait (450+random(350));
abortCount := 0;
until (not (FindColorsTolerance(arP, RockCol, 202, 127, 270, 183, RockTol))) or ((TimeFromMark (topRockTimeAbort)) > 120000) // Bail @ 2 mins
end;
Debug ('Top rock NOT detected anymore');
if abortCount < 5 then
begin
Debug ('Lost rune rock top, but we dont believe it [Abortcount = '+IntToStr(abortCount)+']');
end;
Inc (abortCount);
wait (50+random(100));
if ((TimeFromMark (topRockTimeAbort)) > 120000) then
begin
Debug ('We dun goofed, the consequences will never be the same [We hit a fail safe for the top rock w/ time]');
end;
until (abortCount > 4) or ((TimeFromMark (topRockTimeAbort)) > 120000)
end;
Debug ('* Done mining *');
end;
// This outputs the current world list roster (w/ all data) for debugging | NOTE: Only works with debug on (aka: debugOn = true)
procedure OutputChart;
var i : Integer;
scriptRunningTime : String;
begin
if not debugOn then ClearDebug;
scriptRunningTime := MsToTime ((TimeFromMark(scriptRunning)), 4);
writeln ('');
writeln ('[-----[#]-----[#]-----( ARRAY CHART )-----[#]-----[#]-----]');
for i := 0 to High(WorldNumArray) do
begin
Writeln ('W: '+ IntToStr(WorldNumArray[i]) +' Players: '+ IntToStr(PlayerNumberArray[i]) +' Time: '+ IntToStr(TimeFromMark(MarkedTimeArray[i])) +' ['+IntToStr(round((25-((PlayerNumberArray[i])/160))*60000))+' is respawn]'); //+ IntToStr());
end;
writeln ('[-----[#]-----[#]-----(-------------)-----[#]-----[#]-----]');
writeln ('InvCount: '+IntToStr(InvCount) + ' Times banked: '+IntToStr(timesBanked) + ' Time running: '+scriptRunningTime); //Added this most recently
writeln ('Inspirational text of the minute:');
AwkwardText;
writeln ('');
end;
// Change to a random world to look for rune, assuming no time matchups found with rune rock table tracker
procedure ChangeRandomWorld;
var
RandomWorldSelected, worldCountFailsafe, i : Integer;
var
worldCompare : Boolean;
begin
worldCountFailsafe := 0;
repeat // This repeat means that the program will pick a random world that is *not* currently in our World Array Queue
worldCompare := true;
RandomWorldSelected := MembersWorldArray[Random((High(MembersWorldArray)+1))];
for i:=0 to (High(WorldNumArray)) do
begin
if (WorldNumArray[i] = RandomWorldSelected) then
begin
Debug ('Accidentally hit the same world ['+inttostr(WorldNumArray[i])+']... finding new one');
worldCompare := false;
Inc(worldCountFailsafe);
end;
end;
until (worldCompare) or (worldCountFailSafe > (High (MembersWorldArray)))
if (worldCountFailSafe > (High (MembersWorldArray))) then //The script below is if it aborted due to a fail safe... this should never occur
begin
writeln ('Major fuckup occured! All worlds are logged, aborting script!');
PlaySound ('C:/beepcalm.wav');
wait (100);
TerminateScript;
end;
Debug ('Random world chosen: '+ IntToStr(RandomWorldSelected));
ChangeWorld (RandomWorldSelected); // Pick random world from the array, picks between 0 and high from the array
CurrentWorldActive := RandomWorldSelected; // This will end up in world tracker array if it has rune
end;
// This is designed to return "0" if nothings ready, (number) if that world is ready to be mined at
function CheckWorldTimes : Integer;
var i : Integer;
begin
result := 0; // If no worlds are ready to be mined (true) then it will stay return false
Debug ('Checking world times');
for i := 0 to High(WorldNumArray) do
begin
if TimeFromMark(MarkedTimeArray[i]) > (round(((25-((PlayerNumberArray[i])/160))*60000)-30000)) then // Stupid minute conversion stuff :(
begin
Debug ('World '+ IntToStr(WorldNumArray[i]) +' is ready!');
result := WorldNumArray[i];
Break;
end
end;
end;
function CheckPlayerNumber(world : Integer) : Integer;
var i : Integer;
begin
result := -1;
Debug ('Checking for player # at world '+IntToStr(world));
for i := 0 to High(WorldNumArray) do
begin
Debug ('i='+IntToStr(i) + '= world'+IntToStr(WorldNumArray[i]));
if (world = WorldNumArray[i]) then
begin
Debug ('World '+ IntToStr(WorldNumArray[i]) +' found to have player # '+ IntToStr(PlayerNumberArray[i]));
result := PlayerNumberArray[i];
Break;
end
end;
end;
// This checks the possible time difference due to player fluctuation | Returns the time difference so the robot can judge if its worth it
function RespawnTimeDif (prevPlayerCount : Integer) : Integer;
var prevTimeInt, currentTimeInt : Integer;
var prevTime, currentTime : Extended;
begin
prevTime := 160/prevPlayerCount; // These just ensure the # isnt rounded
prevTime := 25-prevTime;
prevTime := prevTime*60000
prevTimeInt := round (prevTime);
Debug ('prevTimeInt = '+IntToStr (prevTimeInt));
currentTime := 160/WorldPlayerCountNumber; // These just ensure the # isnt rounded
currentTime := 25-prevTime;
currentTime := prevTime*60000
currentTimeInt := round (prevTime);
Debug (' currentTimeInt = ' +IntToStr(currentTimeInt));
result := currentTimeInt-prevTimeInt; // This returns a value saying that 'our current player # is (changed up or down) since last login
Debug ('Difference in time: '+IntToStr(currentTimeInt-prevTimeInt)+' ms');
end;
// This is the bank colors picked that works with the bank booths
function FindKeldagrimBank(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
if not(FindColorsTolerance(arP, 7045776, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Debug ('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 10.24) and (H <= 10.50) and (S >= 14.27) and (S <= 15.44) and (L >= 48.02) and (L <= 50.41) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 20.93) and (X <= 23.38) and (Y >= 21.75) and (Y <= 24.20) and (Z >= 16.44) and (Z <= 17.92) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('oot')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
begin
Debug ('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
function LoadPathToBankTile : TTileArray;
begin
SetLength (Result, 6);
Result := [
Tile(2874, 10251), Tile(2872, 10236), Tile(2864, 10230),
Tile(2849, 10229), Tile(2845, 10220), Tile(2838, 10207)];
end;
function LoadPathToMineTile : TTileArray;
begin
SetLength (Result, 6);
Result := [
Tile(2845, 10220), Tile(2849, 10229), Tile(2864, 10230),
Tile(2872, 10236), Tile(2874, 10251), Tile(2872, 10261)];
end;
procedure WalkToBankWalkPath;
var TTilePath1 : TTileArray;
begin
If not LoggedIn then Exit;
writeln ('Walking to bank');
TTilePath1 := LoadPathToBankTile;
WalkPath (TTilePath1);
end;
function WalkToMineWalkPath : Boolean;
var TTilePath2 : TTileArray;
begin
result := false;
If not LoggedIn then Exit;
writeln ('Walking to mine');
TTilePath2 := LoadPathToMineTile;
if WalkPath (TTilePath2) then result := true;
end;
procedure BankStuff;
begin
If not LoggedIn then Exit;
wait (1000+random(534));
if PinScreen then
begin
Debug ('found pin screen, entering pin...');
InPin(Players[0].Pin)
end else
begin
Debug ('No pin screen found');
end;
if BankScreen then
begin
Debug ('Bank screen found, depositing stuff!');
wait (250+random(500));
if DepositAll then
begin
Debug ('All ore deposited!!');
wait (250+random(500));
if CloseBank then
begin
Debug ('closed bank successfully!');
wait (250+random(500));
Inc (timesBanked);
Debug ('Banked times increased to: '+IntToStr(timesBanked));
end;
end;
end;
end;
procedure IdentifyBank;
begin
if FindKeldagrimBank(x, y) then
begin
Mouse (x, y, 1, 1, false);
ChooseOption ('qu');
wait (3000+random(1500));
end else
begin
writeln ('Did not find bank Object, using Spiral mouse');
if SpiralMouse (x, y, MSX1, MSY1, MSX2, MSY2, 'ank', 15, 12) then
begin
Mouse (x, y, 1, 1, false);
wait (500);
ChooseOption ('uic');
end else writeln ('Warning, didnt find bank');
end;
end;
// Checks tiles to see if we're lost, true = really lost
function CheckIfReallyLost : Boolean;
var currentTile : TTile;
begin
currentTile := GetMyPos;
if (currentTile.x > 2873) or (currentTile.x < 2834) then
begin
writeln ('Uh Oh! We are outside of the X axis area!');
result := true;
end;
if (currentTile.y > 10261) or (currentTile.y < 10207) then
begin
writeln ('Uh Oh! We are outside of the Y axis area!');
result := true;
end;
end;
// Return true if there is an error
function WorldScreenError : Boolean;
begin
result := false;
if (FindColorTolerance (x, y, 2044518, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
result := true;
Debug ('Found WorldScreenError! Oh no! Trying to fix...');
Mouse (380, 315, 3, 3, true);
wait (5000+random(2500));
if (FindColorTolerance (x, y, 2044518, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
result := true;
Debug ('Error screen still open... WorldScreenError = true, running Exit;');
Exit;
end else
begin
Debug ('Attemping to click "click here to play"');
Mouse (380, 315, 3, 3, true);
wait (5000);
// Gotta figure something out here
end;
end;
end;
procedure CheckForConnectionErrors;
begin
If not LoggedIn then
begin
Mouse (319, 464, 3, 3, true); // Try clicking 'click here to play
if WorldScreenError then // See if we have a stupid connection error fuck up.
begin
Writeln ('WorldScreenError function returned true... fuck!');
end else
begin
writeln ('WorldScreenError function returned FALSE!');
end;
wait (50+random(250));
writeln ('Dangerous lag occured, waiting 20 (+ random 5) more seconds before abortion');
wait (20000+random(5000));
if not LoggedIn then
begin
writeln ('WARNING: Serious error occured, not logged in when supposed to be, TERMINATING');
PlaySound ('C:/beepcalm.wav');
wait (100);
TerminateScript;
end else
begin
writeln ('Problem seems to have resolved hopefully...');
end;
end;
end;
procedure Bank;
begin
WalkToBankWalkPath;
wait (700+random(1000));
IdentifyBank;
BankStuff;
wait (700+random(1000));
WalkToMineWalkPath;
end;
procedure CheckWorldsOrFindRandomWorld;
var worldToBeActive, RespawnTimeDifMarkTime : Integer;
begin
if CheckWorldTimes > 0 then // If true, means that a world is ready
begin
worldToBeActive := CheckWorldTimes;
ChangeWorld (worldToBeActive);
wait (1000+random(250));
WorldArrayCleanerSpecific (worldToBeActive);
Debug (IntToStr((RespawnTimeDif (CheckPlayerNumber(worldToBeActive))))); // Give us the number!
if ((RespawnTimeDif (CheckPlayerNumber(worldToBeActive))) < 30000) then
begin
MarkTime (RespawnTimeDifMarkTime);
Debug ('Respawn time is less than 30,000... waiting to see if ore is found');
repeat
wait (100+random(150));
until (TimeFromMark(RespawnTimeDifMarkTime) > (21000+random(5000))) or (FindRuneRockRight (x,y)) or (FindRuneRockTop (x,y)) // Until 30 seconds are up OR it finds rune rocks available
end;
Debug ('Waited longer than 30 seconds OR found rune');
worldToBeActive := 0; // Reset value for safety
end else
begin
Debug ('No worlds ready, lets change world');
ChangeRandomWorld;
end;
end;
// Main loop of the script :)
procedure MainLoop;
begin
WorldArrayCleanerGeneral; // Clean up crap worlds with bad/repeating data
wait (400+random(400)); // This allows for the lag at the beginning log in, which shows rune ore when there isnt...
CheckForConnectionErrors;
FindNonInventoryRandoms;
if CheckIfReallyLost then
begin
if WalkToMineWalkPath then
begin
writeln ('Was able to recover from being lost');
end else
begin
writeln ('Okay were REALLY lost for now, script aborting');
PlaySound ('C:/beepcalm.wav');
wait (100);
TerminateScript;
end;
end;
if InvCount > 26 then Bank;
AntiBan;
wait (50);
if MiningLoop then // Mine the rock, returns true if it found any rune rocks
begin
Debug ('Rock mined, adding world to roster!');
Debug ('Current world: '+ IntToStr(CurrentWorldActive)+ ' - Player count: '+ IntToStr (WorldPlayerCountNumber));
AddWorldToList (CurrentWorldActive, WorldPlayerCountNumber);
end else
begin
Debug ('No rune rock was found on this world');
end;
FindNormalRandoms;
OutputChart;
CheckWorldsOrFindRandomWorld;
end;
procedure DefineVariables;
begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
Smart_SuperDetail := False;
timesBanked := 0;
scriptRunning := 0;
end;
begin
DefineVariables;
SetupSRL;
SetupReflectionEx(true);
SetupWorlds;
DeclarePlayers;
LogInPlayer;
MakeCompass ('n');
SetAngle (true);
SetRun (true);
ChangeRandomWorld;
Debug ('MAIN LOOP STARTING...');
MarkTime (scriptRunning);
repeat
MainLoop;
until (false) // Fix later
writeln ('Script terminated');
end.If you have ANY problems or lack of clarity in my messy instructions, please post here
Potential bugs
- Does not support saved favorite worlds… this may mess it up. Sorry, I can't help this.
Thank you :)