Werttit
2014-03-05 10:17:11
Hello everyone, I just finished my first script! It makes cosmic runes in Zanaris, and currently requires 66 agility.
It has no pouch support (yet) and it's overall a pretty messy script. After all, I have never really scripted before. :p
Currently it doesn't even login itself, so you have to start it already logged in. (has problems choosing the world)
I don't recommend running it for long periods, as it is still very bot-like!
1. Download COSMIC_MAP.png and place in …SPS/img/runescape_other
2. Start in Zanaris bank and have your pure essence in the 10th slot of bank (first row, last column).
3. Report bugs!
If you notice any code in the script that could be written shorter or could be more reliable, please leave some feedback! :)
It has no pouch support (yet) and it's overall a pretty messy script. After all, I have never really scripted before. :p
Currently it doesn't even login itself, so you have to start it already logged in. (has problems choosing the world)
I don't recommend running it for long periods, as it is still very bot-like!
1. Download COSMIC_MAP.png and place in …SPS/img/runescape_other
2. Start in Zanaris bank and have your pure essence in the 10th slot of bank (first row, last column).
3. Report bugs!
If you notice any code in the script that could be written shorter or could be more reliable, please leave some feedback! :)
program CosmicRunner;
{$DEFINE SMART}
{$I srl-6/srl.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
TripsDone: integer;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'username';
password := 'password';
isActive := true;
isMember := true;
world := 105; // change this world to your default one
end
currentPlayer := 0;
end;
/////////////////////////////////////////// Don't touch below unless you know what you're doing
procedure runToCosmicRuins();
var
pathBankToCut, pathInsideShortcut, pathCutToRuins: TPointArray;
x, y: integer;
begin
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
pathBankToCut := [Point(61, 44), Point(75, 44), Point(88, 71), Point(133, 79),
Point(168, 94), Point(178, 119), Point(195, 138), Point(204, 176),
Point(203, 214), Point(190, 240), Point(184, 267)]
if SPS.walkPath(pathBankToCut) then
minimap.waitPlayerMoving()
else
writeLn('Something went wrong when walking to the shortcut!');
mainscreen.findObject(x, y, 13301244, 4, colorSetting(2, 0.59, 2.68), mainscreen.playerPoint, 30, 30, 60, ['utting', 'wall']);
if (random(9) < 4) then
smallRandomMouse();
Wait(randomRange(4998, 5996));
pathInsideShortcut := [Point(184, 271), Point(154, 296)]
if SPS.walkPath(pathInsideShortcut) then
minimap.waitPlayerMoving()
else
writeLn('Something went wrong inside the shortcut!');
mainscreen.findObject(x, y, 13301244, 4, colorSetting(2, 0.59, 2.68), mainscreen.playerPoint, 30, 30, 60, ['utting', 'wall']);
Wait(randomRange(4698, 5996));
pathCutToRuins := [Point(155, 301), Point(138, 333), Point(154, 362)]
if SPS.walkPath(pathCutToRuins) then
minimap.waitPlayerMoving()
else
writeLn('Something went wrong when walking to the ruins!');
if not mainscreen.findObject(x, y, 12019609, 20, colorSetting(2, 0.05, 1.63), mainscreen.playerPoint, 30, 10, 40, ['ysterious', 'ruins']) then
begin
minimap.setAngle(MM_DIRECTION_EAST);
mainScreen.setAngle(MS_ANGLE_HIGH);
if not mainscreen.findObject(x, y, 12019609, 20, colorSetting(2, 0.05, 1.63), mainscreen.playerPoint, 30, 10, 40, ['ysterious', 'ruins']) then
begin
WriteLn('Failed to find Mysterious Ruins!');
players[currentPlayer].logout();
end;
Wait(randomRange(259, 567));
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
Wait(randomRange(1355, 2109));
end;
end;
procedure craftRunes();
var
minimapAltar: TBoxArray;
x, y, i, r: integer;
T, P: TPoint;
AltarMM: TBoxArray = [[680, 20, 704, 33], [758, 100, 779, 120],
[680, 179, 695, 191], [597, 91, 615, 115]];
begin
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
r := randomRange(1, 3);
for i to high(AltarMM) do
if findColorSpiralTolerance(x, y, 4473406, AltarMM[i], 19) then
begin
P := [x+r, y+r];
writeLn('Color found in minimap!');
mouse(P, MOUSE_LEFT);
end;
Wait(randomRange(8595, 9654));
if not mainScreen.findObject(x, y, 6642529, 9, colorSetting(2, 0.84, 0.20), mainscreen.playerPoint, 30, 10, 40, ['ltar']) then
begin
minimap.setAngle(MM_DIRECTION_EAST);
mainScreen.setAngle(MS_ANGLE_HIGH);
if not mainScreen.findObject(x, y, 6642529, 9, colorSetting(2, 0.84, 0.20), mainscreen.playerPoint, 30, 10, 40, ['ltar']) then
begin
WriteLn('Failed to find Cosmic Altar!');
players[currentPlayer].logout();
end;
Wait(randomRange(259, 567));
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
if (random(10) < 4) then
hoverSkill(SKILL_RUNECRAFTING);
end;
inc(TripsDone);
Wait(randomRange(3540, 4120));
minimap.findSymbol(T, MM_SYMBOL_ARROW, minimap.getBounds());
Wait(randomRange(140, 220));
mouse(T, MOUSE_LEFT);
Wait(randomRange(9134, 9859));
if not mainScreen.findObject(x, y, 9606557, 7, colorSetting(2, 0.44, 0.23), mainscreen.playerPoint, 10, 10, 5, ['ortal']) then
begin
Wait(randomRange(320, 450));
if not mainScreen.findObject(x, y, 9606557, 7, colorSetting(2, 0.44, 0.23), mainscreen.playerPoint, 10, 10, 5, ['ortal']) then
begin
WriteLn('Failed to find Portal to Zanaris!');
players[currentPlayer].logout();
end;
Wait(randomRange(1355, 2109));
end;
end;
procedure runToBank();
var
pathRuinsToCut, pathShortcut, pathCutToBank: TPointArray;
x, y: integer;
P, T: TPoint;
begin
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
FindColorSpiralTolerance(x, y, 4177682, 689, 34, 713, 58, 7);
T := [x, y];
mouse(T, MOUSE_LEFT);
Wait(randomRange(5876, 6344));
mainscreen.findObject(x, y, 13301244, 4, colorSetting(2, 0.59, 2.68), mainscreen.playerPoint, 30, 30, 40, ['utting', 'wall']);
Wait(randomRange(5198, 6196));
pathShortcut := [Point(154, 296), Point(184, 271)]
if SPS.walkPath(pathShortcut) then
minimap.waitPlayerMoving()
else
writeLn('Something went wrong inside the shortcut!');
mainscreen.findObject(x, y, 13301244, 4, colorSetting(2, 0.59, 2.68), mainscreen.playerPoint, 30, 30, 40, ['utting', 'wall']);
Wait(randomRange(4498, 5996));
pathCutToBank := [Point(183, 266), Point(191, 241), Point(203, 214),
Point(206, 187), Point(201, 162), Point(192, 139),
Point(179, 121), Point(166, 100), Point(157, 82),
Point(128, 75), Point(94, 73), Point(76, 52)]
if SPS.walkPath(pathCutToBank) then
minimap.waitPlayerMoving()
else
writeLn('Something went wrong when walking to the bank!');
minimap.findSymbol(P, MM_SYMBOL_BANK, minimap.getBounds());
mouse(P, MOUSE_LEFT);
Wait(randomRange(800, 1104));
end;
procedure bankEverything();
var
x, y: integer;
begin
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
if not mainscreen.findObject(x, y, 9696761, 4, colorSetting(2, 0.17, 2.64), mainscreen.playerPoint, 5, 5, 5, ['ank', 'booth']) then
begin
WriteLn('Failed to find a bank booth!');
players[currentPlayer].logout();
end;
Wait(randomRange(2356, 2891));
if (bankScreen.isOpen()) then
begin
writeLn('Found open bankscreen!');
Wait(randomRange(273, 360));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
if (random(32) > 13) then
mouseOffClient(OFF_CLIENT_RANDOM);
Wait(randomRange(353, 500));
bankScreen.Withdraw(10, WITHDRAW_AMOUNT_ALL, ['']);
Wait(randomRange(253, 410));
bankScreen.close;
end;
end;
procedure progressReport();
var
runesCrafted, runesPerHour: integer;
begin
runesCrafted := TripsDone * 56;
runesPerHour := round((runesCrafted * 60 ) / (getTimeRunning() / 60000));
clearDebug();
writeLn('****************************************');
writeLn('* CosmicRunner v1.01 by Werttit');
writeLn('* Runtime: ' + timeRunning);
writeLn('* Cosmic runes crafted: ' + intToStr(runesCrafted));
writeLn('* Cosmic runes per hour: ' + intToStr(runesPerHour));
writeLn('****************************************');
writeLn(intToStr(TripsDone));
end;
begin
clearDebug();
setupSRL();
declarePlayers();
SPS.setup('COSMIC_MAP', RUNESCAPE_OTHER);
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
progressReport();
bankEverything();
runToCosmicRuins();
Wait(randomRange(2209, 3186));
craftRunes();
Wait(randomRange(2900, 3980));
runToBank();
Wait(randomRange(1000, 1980));
until(false);
end.