Lipcot
2014-12-11 12:45:05
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
This one only
Are you a member of any other communities?
Powerboat
Tell us about yourself…
Please show us one (or multiple) of your scripts.
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
This one only
Are you a member of any other communities?
Powerboat
Tell us about yourself…
From: undorak7
I'm an 18 year old guy from Argentina, im currently studying bussines administration on one of the biggest universities ( or college, as you wish) on my country. I've been head of my school and have played rugby for about 6 years now. I would define myself as a cool nerd. From the outside, i look like really cool guy, plays rugby, gets good girls and stuff. But when im alone i like coding, history and learning stuff nobody cares about (in my country atleast). Im good by nature, i mean, i can't do harm on purpose to anyone, unless you provoke me.
I've lived 3 years in brazil from around 4 to 7 years old, and that made me grow up in a different environment than all my friends here, so im kind of a toad of another pond here, i've always had a different thought process than them.
I'm a scottish and gale descendant, so my customs are different from the majority of the people in my country. In my family we take values(honesty, honor, etc ,etc) really seriously.
I think this is enough about me, dont want to bore you all :)
Please show us one (or multiple) of your scripts.
program Nature_Spirit_Graahk;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
{===============================================================================
[Undorak's Nature Graahk]
[This Version of the script is to be used for SRL member application]
[Future Version will probably be released after SRL application Result]
[This must be edited for multiplayer use if wanted]
===============================================================================}
{==============================================================================}
{================================ Setup ==================================}
{==============================================================================}
const
Debug := true;
DrawOnSmart := true;
ShowScriptPaint := true;
{Account info}
Login := '';
Password := '';
DesiredWorld := '';
{Breaks}
DoBreaks := True; // Do we break? (recommended)
BreakIn := 80; // How much time between breaks? (minutes)
BreakRandomness := 10; // How much randomness to BreakIn ? (minutes)
BreakForMin := 7; // Minimum time to break for (minutes)
BreakForMax := 15; // Maximum time to break for (minutes)
DoSleep := True; // Do we Sleep?
SleepIn := 14; // How long until a long break? (hours)
SleepRandomness := 30; // How much randomness to SleepnIn ? (minutes)
SleepForMin := 4; // Minimum Sleep time (hours)
SleepForMax := 8; // Maximum sleep time (hours)
{Action Bar}
actionbar_SmallPouch := 6;
actionbar_MediumPouch := 7;
actionbar_LargePouch := 8;
actionbar_GiantPouch := 9;
actionbar_RoD := 4; //Ring Of Duelling Slot
actionbar_RepairSpell := 2; //Supports ONLY NPC contact.
{Bank}
RoDSlot:= 1; // in which bank slot do we have the RoD?
sumPouchSlot := 3; // in which bank slot do we have the graahk pouch?
Bank_presetCrafting := 1; // preset with pouches + pure ess
Bank_presetRepairing := 2; // preset with repair runes
{Colors}
GraahkHue := 0.18;
GraahkSat := 2.84;
GraahkColor := 5740000;
GraahkTol := 11;
AltarHue := 0.12;
AltarSat := 3.56;
AltarColor := 5233055;
AltarTol := 10;
CraftAltarHue := 1.39;
CraftAltarSat := 0.73;
CraftAltarColor := 5853270;
CraftAltarTol := 2;
YellowBirdHue := 0.03;
YellowBirdSat := 2.44;
YellowBirdColor := 3469039;
YellowBirdTol := 6;
ObeliskHue := 0.10;
ObeliskSat := 2.01;
ObeliskColor := 6666190;
ObeliskTol := 9;
ActionBarGPouchHue := 0.10;
ActionBarGPouchSat := 1.21;
ActionBarGPouchColor := 3491664;
ActionBarGPouchTol := 10;
RingInPackHue := 0.2;
RingInPackSat := 0.14;
RingInPackColor := 1076494;
RingInPackTol := 15;
MageHeadHue := 0.00;
MageHeadSat := 1.47;
MageHeadColor := 1184276;
MageHeadTol := 2;
{==============================================================================}
{============================= End Setup ===============================}
{========================= Do not touch below this ============================}
{==============================================================================}
var
{Break Vars}
Sbreaks, Breaks, Sleeptime, Breaktime, TimeOnBreak: integer;
breakTimer, TimeOnBreakTimer, SleepTimer: TTimeMarker;
{Proggy}
Natint, NatsMade, profit, profitPerHour, Trips, PaintBMP: integer;
NatRune, CurrentStatus, TimeTilNextBreak: string;
{Other Globals}
RingCharges: Integer;
FamiliarDying, RechargeSumm, PouchRepairment, TripIsReady, FirstTrip: boolean;
{==============================================================================}
{==============================================================================}
{==============================================================================}
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := login;
password := password;
isActive := true;
isMember := true;
World := desiredworld;
end;
currentPlayer := 0;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Prints Progress report on Debug -----------------------------------------}
{------------------------------------------------------------------------------}
procedure progressReport();
begin
profit := (NatsMade * (Natint));
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
TimeOnBreak := round(TimeOnBreakTimer.getTime() / 60000);
if not Debug then
clearDebug();
{================================ Report ======================================}
writeLn('========================================================');
writeLn('Undoraks Nature Graahk');
writeLn('Time Run: ' + timeRunning);
writeLn('Runes Crafted: ' + intToStr(NatsMade) + ' Profit Made: ' + intToStr(profit));
writeLn('Money P/H: ' + intToStr(profitPerHour));
writeLn('Time on Break: ' + intToStr(TimeOnBreak) + ' minutes ');
writeLn('Normal Breaks Taken: ' + intToStr(breaks) + ' Long Breaks Taken:' + intToStr(sbreaks));
writeLn('========================================================');
{==============================================================================}
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Prints Progress report on screen and Debug ------------------------------}
{------------------------------------------------------------------------------}
procedure paintOnSmart();
var
doingString, moneyphString, timeString, natsString: string;
begin
if not isLoggedIn() then
exit;
TimeString := mstoTime(getTimeRunning(), TIME_BARE);
DoingString := 'Crafting Nats with Graahk';
NatsString:= (intToStr(NatsMade));
MoneyphString:= (intToStr(profitPerHour));
progressreport;
smartImage.clear;
smartImage.drawBitmap(PaintBMP, Point(2, 462));
//smartImage.drawText(DoingString, point(176, 514), upChars, false, 16777215);
smartImage.drawText(TimeString, point(161, 519), upChars, false, 16777215);
smartImage.drawText(TimeTilNextBreak, point(201, 536), upChars, false, 16777215);
smartImage.drawText(NatsString, point(194, 554), upChars, false, 16777215);
smartImage.drawText(MoneyphString, point(211, 573), upChars, false, 16777215);
smartImage.drawText(CurrentStatus, point(145, 502), upChars, false, 16777215);
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7-------------------------------------------------------------}
{Use: Performs a random antiban(short duration) -------------------------------}
{------------------------------------------------------------------------------}
procedure antiban(rand: integer);
begin
mousespeed := 25 + random(5);
case random(rand) of
0..12: smallRandomMouse(500 + random(150));
13..25: sleepAndMoveMouse(randomRange(600, 5500));
26..28: wait(randomRange(5000, 7000));
29..40: pickUpMouse();
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7-------------------------------------------------------------}
{Use: Performs a random antiban(long duration) --------------------------------}
{------------------------------------------------------------------------------}
procedure longAntiban(rand: integer);
begin
case random(rand) of
1..40: begin
CurrentStatus := 'Doing Long Antiban';
paintOnSmart;
writeLn('Simulating Checking Social Networks');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(30000, 40000));
pickUpMouse();
end;
41..61: begin
CurrentStatus := 'Doing Long Antiban';
paintOnSmart;
writeLn('Simulating Bored Human');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(6000, 8000));
pickUpMouse();
mousespeed:= 19 + random(3);
smallRandomMouse(1000 + random(500));
end;
62..102: begin
CurrentStatus := 'Doing Long Antiban';
paintOnSmart;
writeLn('Simulating Small afk');
sleepAndMoveMouse(750 + random(500));
wait(randomRange(5000, 8000));
pickUpMouse();
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Example: ---------------------------------------------------------------------}
{Uterminate('Problem Teleporting', ['DTM outdated', 'risons', 'unkown']) ------}
{------------------------------------------------------------------------------}
procedure Uterminate(problem: string; reason: TStringArray);
var
i: integer;
begin
Writeln('******************************************************');
Writeln(problem);
Writeln('Possible reasons are:');
for i := 0 to high(reason) do
begin
writeln(tostr(i) + '. ' + reason[i]);
end;
Writeln('Terminating script NOW!');
Writeln('******************************************************');
TerminateScript;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure freeStuff;
begin
writeLn('Freeing Stuff');
smartImage.clear;
smartimage.clear;
progressreport;
FreeBitmap(PaintBMP);
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7-------------------------------------------------------------}
{Use: Clicks an object and performs antiban -----------------------------------}
{------------------------------------------------------------------------------}
function undorakObjectFinder(hue, sat: extended; W, H, filterATPAmin, filterATPAmax, colour, tolerance, clickType: integer; mouseOverText, chooseOptions: array of string; bounds: Tbox): boolean;
var
x, y, i: integer;
p: Tpoint;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
exit;
mainScreen.setAngle(MS_ANGLE_HIGH); //Just to be sure
//if minimap.waitPlayerMoving() then
//begin
if not (findColorsSpiralTolerance(x, y, TPA, colour, bounds, tolerance, colorSetting(2, hue, sat))) then
exit(false);
ATPA := TPA.cluster(W, H);
ATPA.filterBetween(0,4);
ATPA.filterBetween(filterATPAmin,filterATPAmax);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
Antiban(1000);
if drawOnSmart then
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
if random(10) = 1 then
missMouse(middleTPA(ATPA[i]), true)
else mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(mouseOverText, 500) then
begin
if random(20) = 4 then
begin
fastClick(MOUSE_RIGHT);
Result := chooseOption.select(chooseoptions);
break;
end;
fastClick(clickType);
result := True;
break;
end;
end;
if drawOnSmart then
smartImage.clearArea(mainscreen.getBounds());
Antiban(300);
claimSpinTicket();
closeAdWindow();
//end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks in the actionbar if GIANT POUCH is degraded ----------------------}
{------------------------------------------------------------------------------}
function checkPouch: boolean;
var
x, y: integer;
TPA: TPointArray;
begin
result := false;
if bankscreen.isOpen then // If its open we cant see the actionbar
bankscreen.close;
if not (findcolorsspiralTolerance(x, y, TPA, ActionBarGpouchColor, actionBar.getSlotBox(Actionbar_GiantPouch), ActionBarGpouchTol, colorsetting(2, ActionBarGpouchHue, ActionBarGpouchSat))) then
begin
writeln('Giant Pouch is Degraded!');
PouchRepairment := true;
result := true;
end else writeLn('Giant Pouch is CHARGED');
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks in the actionbar if RoD is degraded ------------------------------}
{------------------------------------------------------------------------------}
function checkRing: boolean;
var
x, y, ringDTM: integer;
begin
ringDTM := DTMFromString('mggAAAHicY2NgYOAHYh4gZgFiASgfBJiBWBCIOYGYiwEBxGdJMSyfKMnQViLC8PKUEoNQtSgDGxcPWA02zIgDQwAAxQMGaw==');
result := false;
if (findDTM(ringDTM, x, y, actionbar.getSlotBox(actionbar_RoD))) then
begin
writeLn('Ring has charges');
result := true;
end else
begin
ringCharges := 0;
writeLn('Ring has run out of charges!');
end;
freeDTM(ringDTM);
end;
{------------------------------------------------------------------------------}
{Credits: Clarity--------------------------------------------------------------}
{Use: Checks for the Familiar 'buff' in the actionbar -------------------------}
{Note: Familiar 'buff' must be moved to the actibonar bounds ------------------}
{------------------------------------------------------------------------------}
function familiarExpired: boolean;
var
x, y, familiarDTM: Integer;
begin
familiarDTM := DTMFromString('mrAAAAHic42BgYPACYisoDoNifyB2AWJPIJ7OyMDQA8QroBjEnsYIEZ8AYq/dzhA1TRIF12+9xaDv78OgLMrAwAo0gxkPZiSAYQAA9vYQYw==');
result := (not findDTM(familiarDTM, x, y, actionbar.getBounds()));
writeln('Familiar Expired: ' + toStr(result) );
if result then familiarDying := true;
freeDTM(familiarDTM);
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks if we are in CW bank ---------------------------------------------}
{------------------------------------------------------------------------------}
function atBank: boolean;
var
point: TPoint;
begin
if bankscreen.isopen then
bankscreen.close;
result := false;
if minimap.findSymbol(point, MM_SYMBOL_BANK, minimap.getBounds()) then
result := true;
WriteLn('At Bank: ' + ToStr(result));
end;
{------------------------------------------------------------------------------}
{Credits: Clarity -------------------------------------------------------------}
{Edited By: Undorak7 ----------------------------------------------------------}
{Use: Repairs runecrafting pouches --------------------------------------------}
{Note: Used Clarity's because lazy of getting DTM's BMP's ---------------------}
{------------------------------------------------------------------------------}
function repairPouches: boolean;
var
chatheadDTM, contactInterface, x, y, tries: integer;
scrollpoint: Tpoint;
scrollbox: Tbox;
failsafe: TTimeMarker;
label
retry;
begin
retry:
CurrentStatus := ('Reparing Pouches');
PaintOnSmart();
chatheadDTM := DTMFromString('mlwAAAHicY2dgYJAAYhEglgdifiCWBWJdBghQhtJyUHlDINYBYj0gXtO/h0FN14BhzYS9DJunHmG4t7OPob2limHhvMlgc9AxF5RmxIOhAABwMw39');
contactInterface := BitmapFromString(66, 9, 'meJyNVdFOwzAMzNYNtahFVTcmNDY' + 'JDXhAfeP7+Rje+Qlu3GS556Q0iqrW9jkX55yOl11K6ev7BzNNx+f7' + 'frzs3k79875JYbRNBftjf3MNbWWu5m69rVZ4RhTsdHX3tYcQBQvSR' + 'j5Y6PXYwgWshyAeE0Z4PYov9skwsZv345zHkm0JBTIg7Nl6VwkFni' + '+HJsvQyuXt3mKFlZL64BJVUsqi/B7/dZEq9ZCFYCFf6lh8po2Kyma' + 'zAcjQ1ZhLUEh+6Lc3tl3NwnqGx2EjlGJC2WNUppdcrLmPBBnCbeNL' + 'UCR5nV2NLpPV2X2IKWUzwaSpfsQyXwThgxVNqAtR3II1i1QVlqeHN' + 'WY2IUfkfNXYnxJKPH1Z4lmgAfHkxeVzUjMlVVt74l1uDF5csig+EY' + 'Yr1HYhOXmhzZ9FSRvsMmM1g5ppVdkFh4gqHu44/V9EPURNlgjwZHk' + '7ZS9SUVEMwJHJcUv7iN2q9wsEDy/N');
scrollBox := IntToBox(291 + random(15), 184 + random(15), 497 - random(15), 330 - random(15));
scrollPoint := scrollBox.getrandomPoint;
if not bankscreen.isopen then
begin
if bankscreen.open(BANK_CHEST_CW) then
wait(randomrange(1000, 2000));
end;
failsafe.start();
if bankscreen.isOpen(500) then
begin
repeat
sendKeys(toStr(bank_PresetRepairing), 100, 200);
wait(randomrange(250, 750));
until (not bankscreen.isOpen) or (failsafe.getTime() > 180000);
sendKeys(toStr(actionBar_RepairSpell), 100, 200);
wait(randomrange(450, 1500));
if findBitmapIn(contactInterface, x, y, mainscreen.getBounds()) then
begin
repeat
inc(tries);
mouseScroll(scrollPoint, 2 + random(2), true);
if findDTM(chatheadDTM, x, y, mainscreen.getBounds()) then
break;
wait(randomrange(400, 750));
until tries = 10 or findDTM(chatheadDTM, x, y, mainscreen.getBounds()) or (failsafe.getTime() > 9000);
Mouse((IntToBox(x + 360 - 15, y + 50 - 15, x + 360 + 15, y + 50 + 15).getrandompoint), MOUSE_LEFT, MOUSE_HUMAN);
antiban(800);
begin
repeat
conversationBox.continue(true, true);
antiban(400);
wait(gaussRangeInt(250, 600));
until conversationBox.findOption(['ouches']) or (failsafe.getTime() > 60000);
if failsafe.getTime() > 60000 then
if tries <=2 then goto retry;
conversationBox.selectOption(1);
repeat
conversationBox.continue(true, true);
antiban(1200);
wait(gaussRangeInt(150, 600));
until (not conversationBox.isOpen()) or (failsafe.getTime() > 180000);
antiban(800);
wait(gaussRangeInt(150, 600));
pouchrepairment := false;
writeln('Pouches repaired');
if bankscreen.open(BANK_CHEST_CW) then
begin
if bankscreen.isOpen then
begin
failsafe.start();
repeat
sendKeys(toStr(bank_PresetCrafting), 100, 200);
wait(gaussRangeInt(300, 700));
until (not bankscreen.isOpen) or (failsafe.getTime() > 180000);
end;
end;
freeBitmap(contactInterface);
freeDTM(chatheadDTM);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Gets a new ring from bank -----------------------------------------------}
{Note: Bank must be open already ----------------------------------------------}
{------------------------------------------------------------------------------}
function newRing: Boolean;
var
attempts: integer;
label
retry;
begin
CurrentStatus := ('Getting New Ring Of Duelling');
PaintOnSmart();
retry:
result:= false;
inc(attempts);
if bankscreen.isopen(1000) then
begin
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomrange(750, 1050));
bankscreen.withdraw(RoDSlot, 1, ['ing', 'Ring', 'Duelling', 'uelling']);
antiban(800);
wait(randomrange(400, 700));
bankscreen.close;
if not bankscreen.isopen(1000) then
begin
wait(randomrange(300, 600));
if UndorakObjectFinder(RingInPackHue, RingInPackSat, 5, 5, 0, 4, RingInPackColor, RingInPackTol, MOUSE_LEFT, ['Wear','ear','Ring', 'ing'], ['Wear','ear'], tabbackpack.getSlotBox(1)) then
begin
wait(randomrange(400, 750));
RingCharges := 8;
result := true;
Writeln('Got a new Ring Of Duelling');
end else
begin
Writeln('Failed getting new RoD');
bankscreen.open(BANK_CHEST_CW);
if attempts <= 3 then
goto retry;
if attempts > 3 then
Uterminate('Failed Getting new RoD', ['Misslicking due to color change','Run out of RoD','Unknown']);
end;
end;
end else
begin
if bankscreen.open(BANK_CHEST_CW) then
begin
if attempts <= 3 then goto retry;
if attempts > 3 then
Uterminate('Failed Getting new RoD', ['Misslicking due to color change','Run out of RoD','Unknown']);
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Opens CW bank -----------------------------------------------------------}
{Note: If its not on screen, it will move downwards or look for symbol --------}
{------------------------------------------------------------------------------}
function openBank: boolean;
var
attempts: integer;
symbolLocation: Tpoint;
moveBox: Tbox;
label
retry;
begin
retry:
if not isLoggedIn then
exit;
if not atbank then
exit(false);
result := false;
moveBox := inttobox(231, 333, 366, 382);
if bankscreen.open(BANK_CHEST_CW) then
begin
antiban(800);
if bankscreen.isOpen then
begin
writeln('Opened Bank succesfully');
if (RingCharges = 0) then
begin
NewRing;
Bankscreen.open(BANK_CHEST_CW);
if bankscreen.isOpen(1000) then
begin
antiban(800);
sendKeys(toStr(bank_PresetCrafting), 100, 200);
Wait(randomrange(500, 750));
end;
end else Writeln('Ring is Charged');
if pouchrepairment = true then
begin
RepairPouches;
Bankscreen.open(BANK_CHEST_CW);
if bankscreen.isOpen(1000) then
begin
sendKeys(toStr(bank_PresetCrafting), 100, 200);
Wait(randomrange(500, 750));
end;
end else writeln('Pouches are ok');
Result := true;
end else result := false;
end else
begin
Mouse(movebox.getRandomPoint, MOUSE_LEFT);
inc(attempts);
wait(randomrange(550, 1000));
minimap.waitPlayerMoving;
if attempts <= 3 then
begin
writeLn('Trying to find bank chest again!');
goto retry;
end else
begin
if minimap.findSymbol(symbolLocation, MM_SYMBOL_BANK, minimap.getBounds()) then
begin
MOUSE(point(symbolLocation.x-(random(-5,5)), symbolLocation.y-(random(-5,-5))), MOUSE_LEFT, MOUSE_HUMAN);
if attempts <= 4 then
begin
writeLn('trying one more time');
goto retry;
end else
begin
Uterminate('Could not find CASTLE WARS bank', ['We are somewhere with bank symbols but not castle wars', 'SRL function: bankscreen.open(bank_chest_CW) is not working properly', 'Unkown']);
end;
end else Uterminate('Could not find CASTLE WARS bank', ['We are somewhere with bank symbols but not castle wars', 'SRL function: bankscreen.open(bank_chest_CW) is not working properly', 'Unkown']);
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Gets preset 1 from bank -------------------------------------------------}
{Note: Bank must be open ------------------------------------------------------}
{------------------------------------------------------------------------------}
function preset1: boolean;
var
failSafe: TTimeMarker;
begin
failsafe.start();
repeat
sendKeys(toStr(bank_PresetCrafting), 100, 200);
wait(gaussRangeInt(300, 700));
until (not bankscreen.isOpen) or (failsafe.getTime() > 30000);
if (failsafe.getTime() > 30000) then
result := false
else result := true;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Opens bank, retrieves summ pouch and renews familiar --------------------}
{Note: it will finish with backpack full --------------------------------------}
{------------------------------------------------------------------------------}
function restoreFamiliar: boolean;
var
x, y: integer;
TPA: TPointArray;
begin
result := false;
if openbank then
begin
bankscreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomrange(1000, 2000));
bankscreen.withdraw(sumPouchSlot, 1, ['Spirit', 'pirit', 'graahk', 'pouch']);
wait(randomrange(1000, 2000));
bankscreen.close;
end;
if not gameTabs.isTabActive(TAB_BACKPACK) then
gameTabs.openTab(TAB_BACKPACK);
wait(randomrange(1000, 2000));
Mouse(tabbackpack.getSlotBox(1).getrandompoint, MOUSE_LEFT);
wait(randomrange(4000, 5000));
writeln('Succesfully renewed familiar');
if (findcolorsspiraltolerance(x, y, TPA, Graahkcolor, Mainscreen.getBounds(), GraahkTol, colorSetting(2, Graahkhue, GraahkSat))) then
begin
result := true;
writeln('Succesfully renewed familiar');
end else writeln('failed To renew Familiar');
if openbank then
preset1;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks if summoning points are under 35% --------------------------------}
{------------------------------------------------------------------------------}
function RechargeSummoning: boolean;
var
Percentage: integer;
begin
percentage := actionbar.getSummoningPercent();
If percentage <= 35 then
result:= true
else result := false;
RechargeSumm := result;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Does preset1 and fills all pouches --------------------------------------}
{------------------------------------------------------------------------------}
function ReadyTrip: boolean;
var
countA, CountB, CountC, x, y: integer;
TPA: TpointArray;
label
full;
label
full2;
begin
if not isLoggedIn then
exit;
CurrentStatus := ('Filling Pouches for next trip');
PaintOnSmart();
if TripIsReady then
begin
Writeln('Pouches Are full already');
exit(true);
end;
if tabbackpack.isfull then goto full;
if openbank then
begin
if bankscreen.isopen(1000) then
begin
wait(randomrange(300, 700));
if preset1 then
begin
if bankscreen.isOpen(100) then //In case of false positive
begin
antiban(400);
Mouse((inttobox(184, 567, 208, 584)).getrandompoint, MOUSE_LEFT);
end;
wait(randomrange(300, 750));
full:
countA := Tabbackpack.count;
sendKeys(toStr(actionBar_GiantPouch), 100, 200);
tabBackpack.waitForShift(1000);
countB := Tabbackpack.count;
if CountA = CountB then
begin
case random(1, 2) of
0..1: MOUSE(actionBar.getSlotBox(Actionbar_GiantPouch).getrandompoint, MOUSE_LEFT);
2..2: MOUSE(TabBackpack.getSlotBox(5).getrandompoint, MOUSE_LEFT);
end;
wait(randomrange(300, 750));
end;
if bankscreen.isOpen(500) then
wait(randomrange(1000, 2000));
if not (findcolorsspiralTolerance(x, y, TPA, ActionBarGpouchColor, actionBar.getSlotBox(Actionbar_GiantPouch), ActionBarGpouchTol, colorsetting(2, ActionBarGpouchHue, ActionBarGpouchSat))) then
begin
PouchRepairment := True;
repairpouches;
writeln('Continuing Ready trip.');
end;
result := true;
end else result := false;
end else writeln('Bank didnt open');
end else result := false;
if tabbackpack.isfull then goto full2;
if openbank then
begin
wait(randomrange(500, 1000));
if preset1 then
begin
wait(randomrange(500, 850));
full2:
sendKeys(toStr(actionBar_SmallPouch), 100, 200);
antiban(4000);
tabBackpack.waitForShift(1500);
wait(randomrange(200, 500));
sendKeys(toStr(actionBar_MediumPouch), 100, 200);
antiban(4000);
tabBackpack.waitForShift(1500);
wait(randomrange(200, 500));
sendKeys(toStr(actionBar_LargePouch), 100, 200);
antiban(4000);
tabBackpack.waitForShift(1500);
wait(randomrange(200, 500));
end;
if openbank then
begin
if preset1 then
begin
writeln('Trip is ready');
longAntiban(5000);
TripIsReady := True;
result:= true;
end else
begin
writeln('We could not prepare for trip');
exit(false);
end;
end else Result := false;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks if Small pouch is filled -----------------------------------------}
{Note: I use this to determine that all pouches were filled -------------------}
{------------------------------------------------------------------------------}
function pouchesFilled: Boolean;
label
full;
begin
if not isLoggedIn then
exit;
if tabbackpack.isfull then goto full;
if openbank then
begin
if preset1 then
begin
full:
Mouse(tabbackpack.getSlotBox(2).getrandompoint, MOUSE_MOVE);
if isMouseOverText(['Empty','mpty'], 500) then
begin
writeln('Pouches Are already filled');
TripIsReady := True;
end else TripIsReady := False;
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Finds the Graahk and teleports ------------------------------------------}
{------------------------------------------------------------------------------}
function teleToAltar: boolean;
var
attempts: integer;
label
retry;
begin
retry:
CurrentStatus := 'Teleporting To Altar';
PaintOnSmart();
result := false;
if not isLoggedIn then
exit;
if not TripIsReady then
exit;
if not checkRing then
begin
newRing;
if openbank then
preset1;
end;
if familiarExpired then
begin
writeln('Familiar expired, restoring it before Travelling')
if restoreFamiliar then
begin
Writeln('restored familiar correctly')
end;
end;
inc(attempts);
if TripIsReady then
begin
if UndorakObjectFinder(GraahkHue, GraahkSat, 20, 10, 0, 10, GraahkColor, GraahkTol, MOUSE_LEFT, ['Interact', 'Spirit', 'nteract'], ['Interact', 'nteract'], mainscreen.getbounds()) then
begin
wait(randomrange(500, 750));
minimap.waitPlayerMoving;
antiban(400);
wait(randomrange(500, 750));
if conversationBox.selectOption(2) then
begin
antiban(400);
writeln('Teleported from Graahk');
wait(randomrange(4500, 6000));
longantiban(5000);
result:= true;
end;
end else
begin
writeln('We Could not find the Graahk calling him.');
longantiban(1000);
MOUSE((inttobox(440, 400, 450, 412)).getrandompoint, MOUSE_RIGHT, MOUSE_ACCURATE);
if chooseoption.optionsExist(['Call', 'all'], 80) then
begin
chooseoption.select(['Call', 'all'], 500);
if attempts <= 5 then goto retry;
end;
result := false;
end;
end else ReadyTrip;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Runs to the Altar -------------------------------------------------------}
{Note: Checks for summoning points, if true, recharges them -------------------}
{------------------------------------------------------------------------------}
procedure ToAltar();
var
attempts: integer;
PathToAltar: TpointArray;
PathToObelisk: TpointArray;
label
retry;
begin
retry:
if not isLoggedIn() then
exit;
if not TripIsReady then exit;
CurrentStatus := ('Running to Altar');
PaintOnSmart();
PathToAltar := [Point(196, 204), Point(211, 202), Point(230, 200), Point(252, 199), Point(273, 193), Point(292, 189), Point(309, 185), Point(333, 181), Point(348, 171), Point(360, 160), Point(371, 143), Point(388, 129), Point(401, 116), Point(430, 114), Point(450, 112), Point(472, 114), Point(494, 125), Point(506, 138)];
PathToObelisk := [Point(196, 204), Point(211, 202), Point(230, 200), Point(252, 199), Point(273, 193), Point(292, 189), Point(309, 185), Point(333, 181), Point(348, 171), Point(360, 160), Point(371, 143), Point(388, 129), Point(401, 116), Point(430, 114)];
RechargeSummoning;
if not RechargeSumm then
begin
if sps.walkPath(PathToAltar) then
begin
writeln('Running to Altar');
longantiban(5000);
end else
begin
if not sps.blindWalk(Point(500, 288)) then
begin
if attempts <= 3 then goto retry;
uTerminate('Failed running to altar', ['Sps map failed','We were not in altar zone','Colours changed','Unknown']);
end;
end;
end else
begin
if sps.walkPath(PathToObelisk) then
begin
Writeln('Going to Recharge Summ points at obelisk');
if UndorakObjectFinder(ObeliskHue, ObeliskSat, 10, 15, 0, 5, ObeliskColor, ObeliskTol, MOUSE_LEFT, ['Small','mall','Obelisk','Renew','enew'], ['Small','mall','Obelisk','Renew','enew'], mainscreen.getbounds()) then
begin
Writeln('Recharged Summoning Points succesfully');
RechargeSumm := False;
minimap.waitplayermoving;
wait(randomrange(1000, 3000));
if sps.walkPath(PathToAltar) then
begin
writeln('Running to Altar');
end else
begin
if not sps.blindWalk(Point(509, 278)) then
begin
if attempts <= 3 then goto retry;
uTerminate('Failed running to altar', ['Sps map failed','We were not in altar zone','Colours changed','Unknown']);
end;
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks if we are at altar -----------------------------------------------}
{Note: Searches for the yellow birds on top of the pillars --------------------}
{------------------------------------------------------------------------------}
function AtAltar: Boolean;
var
x, y: integer;
TPA: TPointArray;
begin
wait(100);
if findColorsSpiralTolerance(x, y, TPA, YellowBirdColor, mainScreen.getBounds(), YellowBirdTol, colorSetting(2, YellowBirdHue, YellowBirdSat)) then
begin
writeln('We are at Altar');
result:= true;
end else
begin
Writeln('Could not find yellow birds.');
result:= false;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Enters the nature atlar -------------------------------------------------}
{------------------------------------------------------------------------------}
function enterAltar: Boolean;
var
symbolLocation: Tpoint;
failsafe: TTimeMarker;
begin
result := false;
if not isLoggedIn then
exit;
CurrentStatus := ('Entering Altar');
PaintOnSmart();
if undorakObjectFinder(AltarHue, AltarSat, 20, 20, 0, 10, AltarColor, AltarTol, Mouse_LEFT, ['nter','uins','Mysterious'], ['nter','uins','Mysterious'], mainscreen.getbounds()) then
begin
wait(500);
minimap.isPlayerMoving;
result:= True;
if not ataltar then
begin
repeat
wait(randomrange(1000, 1500));
longantiban(4000);
until ataltar = true or (failsafe.getTime() > 30000);
wait(randomrange(250, 500)); //wait for freeze/lag
end;
end else
begin
if minimap.findSymbol(symbolLocation, MM_SYMBOL_RUNECRAFTING, minimap.getBounds()) then
begin
MOUSE(symbollocation, MOUSE_LEFT, MOUSE_HUMAN);
end;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Clicks the nature altar (make runes) ------------------------------------}
{Note: increases values for proggy --------------------------------------------}
{------------------------------------------------------------------------------}
function craftRunes: boolean;
var
NatAmount, Attempt: integer;
label
retry;
begin
retry:
if not isLoggedIn then
exit;
inc(attempt);
wait(100);
CurrentStatus := ('Crafting Runes');
PaintOnSmart();
if UndorakObjectFinder(CraftAltarHue, CraftAltarSat, 20, 20, 0, 10, CraftAltarColor, CraftAltarTol, MOUSE_LEFT, ['Altar','ltar','rune'], ['Altar','ltar','rune'], mainscreen.getbounds()) then
begin
wait(randomrange(750, 1050));
minimap.waitPlayerMoving;
wait(randomrange(500, 700));
NatAmount := getItemAmount(tabBackpack.getSlotBox(1));
inc(trips);
NatsMade := NatsMade + NatAmount;
if NatAmount > 1 then
TripIsReady := False;
Result:= true;
paintonsmart;
if NatAmount >= 100 then
begin
writeln('Succesfully crafted ' + intToStr(NatAmount) + ' Nature Runes');
progressreport;
end else
begin
writeln('Something went wrong, we did less than 100 runes');
TripIsReady := False;
Result:= True;
end;
longantiban(5000);
end else
begin
writeln('Did not click the altar, Trying one more time');
if attempt <= 6 then goto retry;
result := false;
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Teleports to bank using Ring Of Duelling --------------------------------}
{Note: DTM taken from Clarity's Mud rune script. Credits to him. --------------}
{------------------------------------------------------------------------------}
function teleToBank: boolean;
var
x, y, ringDTM, attempts: integer;
TPA: TPointArray;
failsafe: TTimeMarker;
label
retry;
begin
retry:
if not isLoggedIn then
exit;
CurrentStatus := ('Status: Teleporting To Bank');
PaintOnSmart();
failsafe.start();
inc(attempts);
repeat
antiban(800);
sendKeys(toStr(actionBar_RoD), 100, 200);
if not conversationBox.isOpen(random(2000, 3000)) then
begin
antiban(400);
Mouse((actionBar.getSlotBox((actionbar_RoD)).getRandomPoint), Mouse_LEFT);
conversationBox.isOpen(random(2000, 3000));
wait(randomrange(500, 1000));
end;
until conversationBox.isOpen() or (failsafe.getTime() > 30000);
if (not conversationBox.isOpen) then
begin
writeln('Conversation Box didnt open, something is wrong!');
if attempts <= 3 then goto retry;
if attempts > 3 then
Uterminate('Something went wrong with bank teleporting', ['Ring DTM is outdated', 'Started script with 1 charge in ring', 'Unknown']);
end;
wait(randomrange(250, 550));
antiban(400);
repeat
sendKeys('2', 100, 200);
wait(randomrange(500, 1000));
if (not conversationBox.isOpen) then
break;
until (failsafe.getTime() > 95000) or (not conversationBox.isOpen);
repeat
wait(randomrange(500, 1000));
antiban(400);
until atbank or (failsafe.getTime() > 120000);
wait(randomrange(2000, 3000)); //lag or freeze wait
if atBank then
writeln('At Bank')
else if attempts <= 3 then goto retry;
checkRing;
checkPouch;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Logs in and sets FirstTrip ----------------------------------------------}
{------------------------------------------------------------------------------}
procedure customLogIn;
begin
wait(3000); //lag
players[currentPlayer].login();
writeln('waiting a bit');
wait(randomrange(4000, 5000));
exitSquealOfFortune();
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
mainscreen.setZoom(true);
FirstTrip := True;
TripIsReady := false;
ringcharges := 0;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Performs break with User's data -----------------------------------------}
{------------------------------------------------------------------------------}
procedure doBreak();
var
timeleft: integer;
totalBreak: extended;
timeInBreak: TTimemarker;
begin
TimeOnBreakTimer.start();
if not isLoggedIn() then
exit;
totalbreak := randomrange((BreakForMin*60000), (BreakForMax*60000));
CurrentStatus := ('Status: doing small break');
paintOnSmart;
clearDebug();
writeLn('Breaking For: ' + toStr(round((totalBreak/60000))) + ' Minutes');
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
timeinbreak.start();
repeat
wait(60000);
timeleft := round((round(totalBreak) - timeInBreak.getTime())/60000);
writeln('Break Time Left: ' + intToStr(timeleft) + ' minutes');
until timeinbreak.getTime() >= totalBreak;
writeln('Finished break, logging in again');
inc(breaks);
TimeOnBreakTimer.pause();
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Performs sleep break with User's data -----------------------------------}
{------------------------------------------------------------------------------}
procedure sleepBreak;
var
timeleft: integer;
totalBreak: extended;
timeInBreak: TTimemarker;
begin
TimeOnBreakTimer.start();
CurrentStatus := ('Status: Sleeping Break');
PaintOnSmart();
clearDebug();
totalBreak := randomrange((SleepForMin*60*60000), (SleepForMax*60*60000));
writeLn('Sleeping For aproximately: '+ toStr(round((totalBreak/60/60000))) + ' Hours');
players[currentPlayer].logout;
mouseOffClient(OFF_CLIENT_RANDOM);
timeinbreak.start();
repeat
wait(300000);
timeleft := round((round(totalBreak) - timeInBreak.getTime())/60/60000);
if timeleft > 1 then
begin
writeLn('Sleep Time Left : ' + intToStr(timeleft) + ' Hours');
end else
begin
timeleft := round((round(totalBreak) - timeInBreak.getTime())/60000);
writeln('Break Time Left: ' + intToStr(timeleft) + ' minutes');
end;
until timeinbreak.getTime() >= totalBreak;
writeln('Finished break, logging in again');
inc(Sbreaks);
TimeOnBreakTimer.pause();
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Checks for breaktimes and Gives time until break ------------------------}
{------------------------------------------------------------------------------}
procedure breakHandler;
begin
if DoBreaks then
if breakTimer.getTime() >= breaktime then
begin
doBreak();
breakTimer.reset();
breaktime := (BreakIn*60000) + randomrange((BreakRandomness * -60000), (BreakRandomness * 60000));
writeLn('We are breaking again in: ' + intToStr(round(breaktime/60000)) + ' minutes');
breakTimer.start();
if not isLoggedIn() then
customlogin;
end else
begin
writeLn('Time til next break: ' + intToStr(round((breaktime - breakTimer.getTime())/60000)) + ' minutes');
TimeTilNextBreak := (intToStr(round((breaktime - breakTimer.getTime())/60000))) + ' minutes';
end;
if DoSleep then
if sleeptimer.getTime() >= sleeptime then
begin
SleepBreak;
sleeptimer.reset();
sleeptimer.start();
SleepTime := (BreakIn*60000) + randomrange((BreakRandomness * -60000), (BreakRandomness * 60000));
writeLn('We are sleeping again in: ' + intToStr(round(SleepTime/60/60000)) + ' hours');
if not isLoggedIn() then
customlogin;
end else
begin
writeLn('Time til next sleep: ' + intToStr(round((SleepTime - sleepTimer.getTime())/60/60000)) + ' hours');
end;
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Gets prices from GE -----------------------------------------------------}
{------------------------------------------------------------------------------}
procedure getPrice();
var
p : string;
begin
writeln('Recieving GE Prices');
p := getPage('http://services.runescape.com/m=itemdb_rs/Nature_rune/viewitem.ws?obj=561');
NatRune := between('Current Guide Price <span>', '</span>', p);
writeln('Nature Rune: ' +toStr(Natrune));
NatRune := replace(Natrune, ',', '', [rfReplaceAll]);
Natint := strToInt(NatRune);
wait(1000);
end;
{------------------------------------------------------------------------------}
{Credits: By Kevin, modified by Clarity --------------------------------------}
{Use: Downloads needed files --------------------------------------------------}
{------------------------------------------------------------------------------}
procedure checkForFiles(filePath, message, link: string);
var
progFile: longInt;
fileName: string;
begin
fileName := AppPath + filePath;
try
if not fileExists(fileName) then
begin
writeLn('-- INSTALLATION STATUS: ' + message + ' does not exist - Downloading now.');
progFile := createFile(fileName);
end
else
begin
writeLn('-- INSTALLATION STATUS: ' + message + ' exists.');
exit;
end;
closeFile(progFile);
progFile := rewriteFile(fileName, false);
writeFileString(progFile, getPage(link));
writeLn('-- INSTALLATION STATUS: ' + message + ' has been downloaded.');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
{------------------------------------------------------------------------------}
{Credits: ClarityMudRunes -----------------------------------------------------}
{Use: Checks if we need to download anything ----------------------------------}
{------------------------------------------------------------------------------}
procedure proggyImages;
begin
writeLn('Checking if we need to download anything');
if not directoryExists(appPath + 'scripts/UndorakGraahk/') then
begin
try
createDirectory(appPath + 'scripts/UndorakGraahk/');
writeLn('Created a new folder in Simba/Scripts/');
except
end;
end;
checkForFiles('scripts/UndorakGraahk/scriptpaint.png', 'ScriptPaint', 'http://i.imgur.com/HTjTLiV.png');
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Sets everything up! -----------------------------------------------------}
{------------------------------------------------------------------------------}
procedure setup;
begin
smartPlugins := ['d3d9.dll'];
clearDebug();
smartEnableDrawing := true;
smartShowConsole := false;
setupSRL();
declarePlayers();
If Not Debug Then
DisableSRLDebug := True;
SPS.setup('NATS_MAP2', RUNESCAPE_OTHER);
GetPrice();
if showScriptPaint then
begin
proggyImages;
PaintBMP := loadBitmap(appPath + '/Scripts/UndorakGraahk/ScriptPaint.png');
fastReplaceColor(PaintBMP, 0, 1);
end;
if DoBreaks then
begin
breaktime := (BreakIn*60000) + randomrange((BreakRandomness * -60000), (BreakRandomness * 60000));
writeLn('We are going to break in: ' + intToStr(round(breaktime/60000)) + ' minutes');
end;
if DoSleep then
begin
sleeptime := (SleepIn*60*60000) + randomrange((SleepRandomness * -60000) , (SleepRandomness * 60000));
writeLn('We are sleeping in: ' + intToStr(round(SleepTime/60/60000)) + ' hours');
end;
addOnTerminate('freeStuff');
RingCharges := 8;
FirstTrip := True;
breakTimer.start();
sleeptimer.start();
end;
{------------------------------------------------------------------------------}
{Credits: Undorak7 ------------------------------------------------------------}
{Use: Makes things tidy :)-----------------------------------------------------}
{------------------------------------------------------------------------------}
procedure mainloop();
begin
repeat
if not isLoggedIn() then
customlogin;
breakHandler;
if not atbank then
teletobank;
if FirstTrip then
begin
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
mainscreen.setZoom(true);
if openbank then
newRing;
if familiarexpired then
RestoreFamiliar;
if openbank then
preset1;
if checkPouch then
begin
if openbank then
repairPouches;
end;
if not pouchesFilled then
Readytrip;
FirstTrip := False;
writeln('First trip ready');
end;
if Readytrip then
begin
if teletoaltar then
begin
ToAltar;
EnterAltar;
if CraftRunes then
TeleToBank;
end else TeleToBank;
end;
until (false);
end;
{------------------------------------------------------------------------------}
{----------------------------------------------------------------------}
{--------------------------------------------------------------}
{------------------------------------------------------}
{----------------------------------------------}
{---------------------------------------}
{-------------------------------}
{--------MainLoop-------}
begin
Setup;
paintonsmart;
MainLoop;
end.
{--------The End--------}
source: 