does this script still work?
is it possible to update the script?
sorry if it sounded rude. thank you
Oo, i just need to get my own alter and il be using this !
Could this be updated? It looks like a perfect prayer script.
Could this be updated? It looks like a perfect prayer script
I have a working copy of this script if anyone wants it. It's still damn solid - only had to redo the colors and tweak some of the walking.
http://puu.sh/isPr8/8da3a985f2.jpg
Sure thing.
Just got this proggy overnight:
http://puu.sh/itwfc/1544249eca.jpg
My Scripts:
Alch-O-Matic --- Enchant-O-Matic --- AIO Portable-O-Matic --- Wilderness Agility --- Ivy Chop-O-Matic --- Bone-O-Matic
Scripts: ClarityNex | ClaritySlayer | ClarityElfThief | ClarityBurialArmour | ClarityMudRunes | ClarityWells | ClarityProTables | ClarityArmadyl | ClarityHarps
ClarityDominonTower | ClarityAltar | ClarityCitadel | ClarityBarrows | ClarityEsswraith | ChampionScrollCamperTools & Extensions: OpenGL ID Highlight Tool | SRL-6 Messaging System | SRL Companion | Item DTM Generator | BBCode Converter
That sounds amazing! I have 60k dragon bones just ready to be loved Prayer is one of those skills that's just necessary to automate.
Whether you can do it or not, thanks anyways friend I've used a couple of your scripts now and it's quite obvious that you're an excellent scripter. I hope it goes well for you.
Jesus loves you
I'm never sure if I should be posting the fixed version to the thread or not, as I don't want to be doing that if the OP doesn't like it. I respond as soon as I see it if someone sends me a PM. Since you obviously don't mind, here's what I send people:
Simba Code:program ClarityAltar;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{ClarityAltar v2.00}
const
scriptVersion = '2.00';
usingDirectX = true;
showSRLDebug = false;
var
//Integers
bonesOffered, tripsCount, tripsPerHour, restoreSlot, familiarBonesMax, familiarBonesCurrent, antibanThreshold,
bonesSlot, marrentillSlot, pouchSlot, debugCount, scriptPaintBMP, internetConnectionThreshold: Integer;
//Extended
gainedXP, bonesXP, xpPerHour: Extended;
//Booleans
showScriptDebug, showScriptPaint, useBankPresets: Boolean;
//Strings
chapelLocation, altarOrientation, travelMethod, familiarType, burnerTendency, boneType: String;
//TTimeMarkers
failSafe, statsTimer: TTimeMarker;
//Arrays
newValues, oldValues: array [0..2] of Integer;
label
familiarExpiring;
procedure declarePlayers;
begin
setLength(players, 1);
with players[0] do
begin
//Basic Information
loginName := 'Username';
password := 'Password';
bankPIN := '';
isActive := true;
isMember := true;
world := -1;
//Script Specific Information
showScriptDebug := true; //Display script general debug info (text and onscreen)?
showScriptPaint := true; //Display on screen script paint?
useBankPresets := true; //Would you like to manually withdraw or use presets?
bonesSlot := 1; //What bank item slot contains your bones? MUST SPECIFY if using presets and familiar
marrentillSlot := 2; //What bank item slot contains your marrentills?
pouchSlot := 4; //Which bank item slot contains your familiar pouches?
restoreSlot := 5; //Which bank item slot contains your summoning restore item?
boneType := 'Dragon'; //What kind of bones are you offering? Scroll down to line 901 for supported bone/ash types and what to type in.
familiarType := 'Tortoise'; //'None' if no familiar. Supports 'Yak', 'Pig' (Tier 3 pig only), 'Tortoise', 'Terrorbird', 'Ant', and 'Kalphite'.
travelMethod := 'House Teleport'; //Only supported teleportation method at the moment.
chapelLocation := 'East'; //Where is your chapel located relative to your house portal? Must be adjacent by one room.
altarOrientation := 'East'; //How is your altar positioned in the chapel (what wall is it closest to)?
//Lag and Accuracy Modifiers
antibanThreshold := 15000; //Adjust to increase or decrease the amount of antiban the script performs. Threshold below 5000 not recommended.
end;
currentPlayer := 0;
end;
{==== End of Script Setup ====}
{==== IMPORTANT: DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ====}
{PROCEDURE -- ClarityDebug
Purpose: Custom debug procedure for my scripts.
Comments: None.}
procedure ClarityDebug(message: string);
begin
if showScriptDebug then
writeln(ToStr(debugCount) + ' | == ClarityDebug == | ' + message);
inc(debugCount);
end;
{FUNCTION -- modifiedMSBounds
Purpose: Creates a special mainscreen TBox bounds.
Comments: None.}
function modifiedMSBounds: TBox;
var
normalBox: TBox;
begin
normalBox := mainscreen.getBounds();
result := IntToBox(normalBox.X1 + 50, normalBox.Y1 + 50, normalBox.X2 - 50, normalBox.Y2 - 50);
end;
{PROCEDURE -- scriptStatus
Purpose: Paints current script activity onto the client if paint is enabled.
Comments: Thanks to The Mayor for the idea!}
procedure scriptStatus(status: string);
begin
if showScriptPaint then
begin
try
smartImage.clearArea(mainscreen.getBounds());
smartImage.drawText('STATUS: ', point(actionbar.x1 + 5, actionbar.y1 - 20), 'loginchars', true, clWhite);
smartImage.drawText(status, point(actionbar.x1 + 68, actionbar.y1 - 20), 'loginchars', true, clYellow);
except
end;
end;
end;
{PROCEDURE -- setupPlayer
Purpose: Starting procedure to make sure the camera and orientation is okay.
Comments: None.}
procedure setupPlayer;
begin
scriptStatus('Setting up player...');
wait(gaussRangeInt(500, 3000));
minimap.clickCompass;
wait(gaussRangeInt(200, 1500));
mainscreen.setAngle(MS_ANGLE_HIGH);
wait(gaussRangeInt(500, 1000));
end;
{PROCEDURE -- antiBan
Purpose: Make us look more like a human and less like a bot.
Comments: None.}
procedure antiBan;
begin
end;
{FUNCTION -- atBank
Purpose: Determines player location.
Comments: None.}
function atBank: boolean;
var
x, y, bankIcon: Integer;
symbolLoc: TPoint;
begin
result := false;
bankIcon := BitmapFromString(9, 6, 'meJyr659pU7bKpmoDCipbVdk11Sy0' +
'UNs3G4I0PdOQ2S2TZlskTzFPmlR8+k3J+Y+xh18C2UCRxr7pNW0Tj' +
'GN6gCjt6Dv1gJTgTbcg3Irm3sLqVr2IbiAKWn3XvGii95yTEG5ORW' +
'NWWaNGSBcUBbXC2WlFNQBkA0V0');
//if findBitmapIn(bankIcon, x, y, minimap.getBounds()) then result := true;
if minimap.findSymbol(symbolLoc, MM_SYMBOL_BANK, minimap.getBounds()) or minimap.findSymbol(symbolLoc, MM_SYMBOL_MINIGAME, minimap.getBounds()) or minimap.findSymbol(symbolLoc, MM_SYMBOL_TRANSPORTATION, minimap.getBounds()) then result := true;
ClarityDebug('At Bank: ' + ToStr(result));
freeBitmap(bankIcon);
end;
{FUNCTION -- familiarExpired
Purpose: Checks for familiar expiration text.
Comments: None.}
function familiarExpired: boolean;
var
TPA: TPointArray;
begin
if (familiarType = 'None') then exit(false);
result := findColorsTolerance(TPA, 127, IntToBox(13, 550, 575, 583), 0);
if result then ClarityDebug('Familiar Expired: ' + ToStr(result));
end;
{FUNCTION -- familiarOpen
Purpose: Checks for familiar interface bitmap.
Comments: None.}
function familiarOpen: boolean;
var
x, y, familiarInvent: Integer;
begin
result := false;
familiarInvent := BitmapFromString(29, 6, 'meJxNkbtKxEAUhrOTzW2Smc2YTJJ' +
'NXFmE2KggeENhwWLZxsrSFxAbWzttrfYFxG5BQTvt9wVEfQJ9BF9B' +
'/+HosHCK/5zJ/51LGs3rpS5FLlxEo7mIWCr8YRUj9V5/2MmZSQu+W' +
'id4TULWz6NKmi/JAi+0jUJ5enKcX1zBi5Cn5/gGRWjUyUVYrfhKJV' +
'BBmh5NChVBq+1dcTcnL3/4aLY20RctTGX+Hd6/i3YNXqSYxKJ6nGF' +
's0pnwgUL8dckksMujUe9yGgxbRyr35tGbvZWpS60R7v6463YGpUk7' +
'e2Oqm8VjNqgzq2lfSlUaYykMlsVMxj5o/YNDPAUes1jHcWqdkAXYH' +
'vfJm6cBlrK31TK0HQU3U5XrbTJ9Cl++iEOoRSy2w+n+scxiLQcaB1' +
'n8g9DB8ye/vg02dlzmwEgoutsve8V2QA==');
if findBitmapIn(familiarInvent, x, y, mainscreen.getBounds) then result := true;
if result then ClarityDebug('Familiar inventory is open.');
freeBitmap(familiarInvent);
end;
{FUNCTION -- teleportToHouse
Purpose: Teleports to your house using the teleport tablets.
Comments: None.}
function teleportToHouse: boolean;
var
houseScreen, x, y, attempts: Integer;
begin
if not isLoggedIn or not atBank then
exit;
result := false;
houseScreen := BitmapFromString(9, 16, 'meJyzcXC1CY8Jq2+onbdwLiqyISi' +
'VlBGPIYtHygwohSwLRP5hmjahVjahMqbmZhApIPIP8wQjTUM/RVs/' +
'FaAUXBas3hompapvBkQqYFlrWz8FmJSCIVQKKqtvBhSUsfVT1HORM' +
'fSTVjRUUjSEyCrrWEiDBRVhpLSinZCsgaC0srScAZAtBpeyBRkLt1' +
'QTSS+QVIB4DeJUsI0QVwkrGioauCPEIcqArtU3A1ohgyQCUmMTCmE' +
'DdUG028BJWz9lbS2gUQCES37g');
ClarityDebug('Teleporting to house.');
scriptStatus('Teleporting to house.');
sendKeys('x', 100, 200);
wait(gaussRangeInt(2000, 4000));
while attempts < 20 do
begin
ClarityDebug('Searching for house teleportation success bitmap. (Attempt ' + ToStr(attempts) + ')');
if findBitmapIn(houseScreen, x, y, modifiedMSBounds) then
begin
wait(gaussRangeInt(2000, 3000));
freeBitmap(houseScreen);
exit(true);
end
else
begin
ClarityDebug('Did not find bitmap, reattempting.');
wait(100);
inc(attempts);
end;
end;
freeBitmap(houseScreen);
antiBan;
wait(gaussRangeInt(3000, 5000));
end;
{PROCEDURE -- emergencyTerminate
Purpose: Script termination process.
Comments: None.}
procedure emergencyTerminate(reason: string);
begin
waitFunc(@teleportToHouse, 50, 60000);
scriptStatus('EMERGENCY TERMINATION');
antiBan;
ClarityDebug(reason);
freeBitmap(scriptPaintBMP);
terminateScript;
end;
{FUNCTION -- travelToBank
Purpose: Travels to the bank.
Comments: None.}
function travelToBank(priority: boolean): boolean;
var
bankLoc: TPoint;
begin
if not isLoggedIn then
exit;
if not priority and atBank then exit;
result := false;
wait(gaussRangeInt(500, 1500));
scriptStatus('Teleporting to the TzHaar Bank.');
ClarityDebug('Opening teleportation menu.');
sendKeys('1', 100, 200);
conversationBox.isOpen(20000);
wait(gaussRangeInt(100, 300));
ClarityDebug('Selecting Fight Caves option.');
sendKeys('3', 100, 200);
antiBan;
wait(gaussRangeInt(4000, 6000));
end;
{FUNCTION -- openBank
Purpose: Banks items to get ready for the next trip.
Comments: None.}
function openBank: boolean;
var
x, y, i, attempts: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
label
tryagain;
begin
tryagain:
if not isLoggedIn or not atBank or familiarOpen then
exit;
scriptStatus('Accessing the bank.');
ClarityDebug('openBank initiated.');
attempts := 0;
result := false;
while (attempts < 20) do
begin
if findColorsSpiralTolerance(x, y, TPA, 2803178, mainscreen.getBounds(), 5, colorSetting(2, 0.46, 2.61)) then
begin
mainscreen.filterPointsPlayer(TPA);
TPAtoATPAWrap(TPA, 20, ATPA);
sortATPASize(ATPA, true);
if showScriptDebug then
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(point(ATPA[i].getMiddle.X + random( -2, 2), ATPA[i].getMiddle.Y + random( -2, 2)), MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['ank'], 500) then
begin
fastClick(MOUSE_RIGHT);
if not chooseOption.optionsExist(['Bank', 'ank']) then
begin
chooseOption.close;
continue;
end;
chooseOption.select(['Bank','ank']);
_waitBankOrPinscreen(10000);
exit(true);
end
else
begin
ClarityDebug('Unable to locate the banker.');
smartImage.clearArea(modifiedMSBounds);
inc(attempts);
ClarityDebug('Attempts: ' + ToStr(attempts));
break;
end;
end;
end;
end;
travelToBank(true);
goto tryagain;
end;
{PROCEDURE -- bankItems
Purpose: Banks items.
Comments: None}
procedure bankItems(premature: boolean);
var
attempts, x, y, i, j, humanAmount: Integer;
familiarBox: TBox;
expired, withdrawn: boolean;
label
noFamiliar;
begin
if not isLoggedIn or not atBank then
exit;
expired := familiarExpired;
withdrawn := false;
ClarityDebug('bankItems initiated.');
openBank;
if pinScreen.isOpen then
pinScreen.enter(players[currentPlayer].bankPin);
repeat
ClarityDebug('Attempting to withdraw items from the bank.');
if familiarType = 'None' then goto noFamiliar;
if expired then
begin
scriptStatus('Renewing expired familiar.');
ClarityDebug('Familiar expired.');
mouse(IntToBox(397, 561, 412, 579).getGaussPoint(), MOUSE_LEFT);
wait(50 + Random(50));
bankScreen.withdraw(restoreSlot, 1, ['']);
wait(gaussRangeInt(100, 400));
bankScreen.withdraw(pouchSlot, 1, ['']);
bankScreen.close();
tabBackpack.waitWhileLocked();
wait(gaussRangeInt(100, 400));
tabBackpack.mouseSlot(1, MOUSE_LEFT);
wait(gaussRangeInt(100, 400));
actionbar.mouseIcon(AB_Bar_SUMMONING, MOUSE_RIGHT);
if chooseOption.optionsExist(['Renew']) then
begin
chooseOption.select(['Renew']);
wait(gaussRangeInt(100, 400));
end
else
begin
chooseOption.close();
tabBackpack.mouseSlot(2, MOUSE_LEFT);
wait(gaussRangeInt(100, 400));
end;
if tabBackpack.isItemInSlot(1) or tabBackpack.isItemInSlot(2) then
begin
ClarityDebug('Depositing restore item leftovers.');
openBank;
bankScreen.deposit([1, 2]);
wait(gaussRangeInt(100, 400));
end;
expired := false;
end else
goto noFamiliar;
until (familiarBonesCurrent >= familiarBonesMax);
noFamiliar:
_waitBankOrPinScreen(10000);
if useBankPresets then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
scriptStatus('Withdrawing bank preset.');
tabBackpack.waitWhileLocked();
wait(gaussRangeInt(750, 1000));
if conversationBox.isOpen() then
begin
wait(gaussRangeInt(500, 750));
typeByte(VK_ESCAPE);
wait(gaussRangeInt(200, 600));
end;
end else
begin
scriptStatus('Withdrawing two marrentill herbs.');
while not withdrawn do
begin
if bankScreen.withdraw(marrentillSlot, 2, ['']) then withdrawn := true;
end;
scriptStatus('Withdrawing bones.');
repeat
bankScreen.withdraw(bonesSlot, WITHDRAW_AMOUNT_ALL, ['']);
until (bankScreen.isPackFull);
wait(gaussRangeInt(100, 300));
bankScreen.close();
tabBackpack.waitWhileLocked();
end;
end;
{FUNCTION -- walkToAltar
Purpose: Walks to the altar.
Comments: None}
function walkToAltar: boolean;
var
walkPoint: TPoint;
begin
if not isLoggedIn or atBank then
exit;
if familiarExpired then
begin
scriptStatus('Stopping trip - familiar about to expire.');
wait(gaussRangeInt(1000, 4000));
travelToBank(false);
bankItems(true);
goto familiarExpiring;
end;
scriptStatus('Walking to your house altar.');
case chapelLocation of
'North': walkPoint := Point(minimap.cx + 3 + random(-5, 5), minimap.cy - 35 + random(-5, 5));
'South': walkPoint := Point(minimap.cx + 3 + random(-2, 2), minimap.cy + 35 + random(-5, 5));
'East': walkPoint := Point(minimap.cx + 35 + random(-2, 2), minimap.cy + random(-2, 2));
'West': walkPoint := Point(minimap.cx - 35 + random(-5, 5), minimap.cy + 5 + random(-5, 5));
end;
mouse(walkPoint, MOUSE_MOVE, MOUSE_HUMAN);
fastClick(MOUSE_LEFT);
wait(gaussRangeInt(500,1000));
minimap.waitPlayerMoving();
result := true;
end;
{FUNCTION -- locateAltar
Purpose: Searches for the altar.
Comments: None}
function locateAltar: TPoint;
var
x, y, i, attempts, altarDTM: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
searchBox, normalBox: TBox;
begin
if failsafe.getTime() > 900000 then
emergencyTerminate('Terminating due to run taking too long, script must have failed.');
if not isLoggedIn then
exit;
ClarityDebug('locateAltar initiated.');
attempts := 0;
normalBox := mainscreen.getBounds();
case altarOrientation of
'North': altarDTM := DTMFromString('mbQAAAHicY2VgYOBngAA5IJYBYiYonxFKswMxBxAvXrKJYc3qZQwb1q9h2LhhHRhzQfUjY0YsGAwAY6MKyw==');
'South': altarDTM := DTMFromString('mbQAAAHicY2VgYBBkgABmIFYGYnkg5gBidiBmhNIgsHjJZoYN69cwbNiwFkyvX7+agQsozo+GGbFgMAAAa5MK5A==');
'East': altarDTM := DTMFromString('mQwAAAHicY2ZgYGBmgABGIOaDsuWAeO68NQzLly9mWLVqBQMXkM8PxYxIGAgA00QGMw==');
'West': altarDTM := DTMFromString('mbQAAAHicY2WAAEYozQ7EHEAsAMSKSHIyQLx46WaG9etWg/HGDesY1q1dycAFFOdHw4xYMBgAAGBxCs0=');
end;
case altarOrientation of
'North': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40);
'South': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40);
'East': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40);
'West': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40);
end;
//Search boxes to be modified.
if showScriptDebug then
smartImage.drawBox(searchBox, clBlue);
while (attempts < 10) do
begin
if findDTM(altarDTM, x, y, searchBox) then
begin
if showScriptDebug then
smartImage.drawCross(Point(x, y), 15, clRed);
result := Point(x + random(-5, 5), y + random(-5, 5));
freeDTM(AltarDTM);
exit;
end
else
begin
ClarityDebug('Unable to locate an altar.');
smartImage.clearArea(modifiedMSBounds);
inc(attempts);
ClarityDebug('Attempts: ' + ToStr(attempts));
end;
end;
freeDTM(AltarDTM);
end;
{FUNCTION -- locateBurners
Purpose: Searches for the burners.
Comments: None}
function locateBurners: TPointArray;
var
x, y, i, attempts: integer;
TPA, clearTPA, burnerTPA: TPointArray;
ATPA: T2DPointArray;
altarPoint: TPoint;
playerBox, prayersBox, searchBox, filterBox: TBox;
begin
if failsafe.getTime() > 900000 then
emergencyTerminate('Terminating due to run taking too long, script must have failed.');
if not isLoggedIn then
exit;
ClarityDebug('locateBurners initiated.');
attempts := 0;
prayersBox := IntToBox(1, 29, mainscreen.x2, mainscreen.y2);
altarPoint := locateAltar;
case altarOrientation of
'North': searchBox := IntToBox(altarPoint.x - 85, altarPoint.y - 10, altarPoint.x + 83, altarPoint.y + 20);
'South': searchBox := IntToBox(altarPoint.x - 83, altarPoint.y - 7, altarPoint.x + 85, altarPoint.y + 20);
'East': searchBox := IntToBox(altarPoint.x - 16, altarPoint.y - 70, altarPoint.x + 10, altarPoint.y + 98);
'West': searchBox := IntToBox(altarPoint.x - 10, altarPoint.y - 70, altarPoint.x + 16, altarPoint.y + 98);
end;
case altarOrientation of
'North': filterBox := IntToBox(altarPoint.x - 45, altarPoint.y - 10, altarPoint.x + 45, altarPoint.y + 20);
'South': filterBox := IntToBox(altarPoint.x - 45, altarPoint.y - 7, altarPoint.x + 45, altarPoint.y + 20);
'East': filterBox := IntToBox(altarPoint.x - 16, altarPoint.y - 25, altarPoint.x + 10, altarPoint.y + 45);
'West': filterBox := IntToBox(altarPoint.x - 10, altarPoint.y - 25, altarPoint.x + 16, altarPoint.y + 45);
end;
if showScriptDebug then
begin
try
smartImage.clearArea(modifiedMSBounds);
smartImage.drawBox(searchBox, clLime);
smartImage.drawBox(filterBox, clWhite);
except end;
end;
clearTPA := filterBox.createTPA;
while (attempts < 10) do
begin
if findColorsSpiralTolerance(x, y, TPA, 4944016, searchBox, 14, colorSetting(2, 0.13, 0.32)) then
begin
mainscreen.filterPointsPlayer(TPA);
burnerTPA := TPA.clearTPAFrom(clearTPA);
TPAtoATPAWrap(burnerTPA, 30, ATPA);
ATPA.sortFromMidPoint(altarPoint);
if showScriptDebug then
smartImage.debugATPA(ATPA);
setLength(result, 2);
result[0] := ATPA[0].getMiddle();
result[1] := ATPA[1].getMiddle();
exit;
end
else
begin
ClarityDebug('Unable to locate a burner.');
smartImage.clearArea(modifiedMSBounds);
inc(attempts);
ClarityDebug('Attempts: ' + ToStr(attempts));
end;
end;
end;
{FUNCTION -- lightBurners
Purpose: Lights each burner.
Comments: None}
function lightBurners: boolean;
var
x, y, attempts: integer;
TheTPA: TPointArray;
ATPA: T2DPointArray;
playerBox, prayersBox: TBox;
failsafe2: TTimeMarker;
begin
failsafe2.start;
if failsafe.getTime() > 900000 then
emergencyTerminate('Terminating due to run taking too long, script must have failed.');
if not isLoggedIn then
exit;
if atBank then
exit;
ClarityDebug('lightBurners initiated.');
scriptStatus('Lighting the burners.');
while (attempts < 10) do
begin
TheTPA = locateBurners();
mouse(locateBurners[0], MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['L','ight'], 300) then
begin
fastClick(MOUSE_LEFT);
tabBackpack.waitForShift(5000);
wait(RandomRange(1400, 1600));
mouse(locateBurners[1], MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['L','ight'], 300) then
begin
fastClick(MOUSE_LEFT);
tabBackpack.waitForShift(5000);
wait(RandomRange(1400, 1600));
exit(true);
end else
begin
inc(attempts);
continue;
end;
end else
begin
inc(attempts);
continue;
end;
end;
end;
{FUNCTION -- offerBones
Purpose: Offers bones at the altar.
Comments: None}
function offerBones: boolean;
var
attempts: Integer;
begin
if not isLoggedIn or atBank then
exit;
ClarityDebug('offerBones initiated.');
scriptStatus('Offering bones to the gods');
while attempts < 10 do
begin
mouse(locateAltar, MOUSE_MOVE, MOUSE_HUMAN);
if not isMouseOverText(['Pray'], 250, true) then
begin
ClarityDebug('Pray option not present.');
scriptStatus('No pray option present - Retrying (Attempt ' + ToStr(attempts) + ')');
continue;
end;
fastClick(MOUSE_RIGHT);
if not chooseOption.optionsExist(['Off', 'er', 'Offer']) then
begin
ClarityDebug('Offer option not present.');
scriptStatus('No offer option present - Retrying (Attempt ' + ToStr(attempts) + ')');
chooseOption.close();
continue;
end;
result := chooseOption.select(['ffer']);
if result := true then
begin
exit;
end else
begin
inc(attempts);
end;
end;
end;
{FUNCTION -- waitOffering
Purpose: Wait and update inventory while offering bones.
Comments: None}
function waitOffering: boolean;
var
takeOutThreshold: Integer;
failsafe2: TTimeMarker;
begin
if not isLoggedIn or atBank then
exit;
result := false;
failsafe2.start;
familiarBonesCurrent := familiarBonesMax;
takeOutThreshold := (3 + gaussRangeInt(0, 5));
ClarityDebug('Threshold is: ' + ToStr(takeOutThreshold));
ClarityDebug('FBonesMax: ' + ToStr(familiarBonesMax));
ClarityDebug('FBonesCurrent: ' + ToStr(familiarBonesCurrent));
scriptStatus('Waiting for all bones to be offered.');
repeat
antiban;
if familiarExpired then
begin
scriptStatus('Stopping trip, familiar about to expire.');
wait(gaussRangeInt(1000, 4000));
travelToBank(false);
bankItems(true);
goto familiarExpiring;
end;
if (tabBackpack.Count < takeOutThreshold) and (familiarBonesCurrent > 0) then
begin
scriptStatus('Withdrawing more bones from your beast of burden.');
wait(gaussRangeInt(100, 400));
actionbar.mouseIcon(AB_Bar_SUMMONING, MOUSE_LEFT);
wait(gaussRangeInt(1000, 1500));
familiarBonesCurrent := (familiarBonesCurrent - (28 - takeOutThreshold));
ClarityDebug('FBonesCurrent: ' + ToStr(familiarBonesCurrent));
end;
scriptStatus('Waiting for all bones to be offered.');
wait(25 + Random(75));
until (tabBackpack.Count = 1) or (failsafe2.getTime > 120000);
inc(tripsCount);
wait(gaussRangeInt(1000, 4000));
end;
{PROCEDURE -- calculateStats
Purpose: Calculates stats for the stats commit.
Comments: None.}
procedure calculateStats();
var
i, gainedXPInt: integer;
calcValues: Array [0..2] of integer;
begin
gainedXPInt := round(gainedXP);
calcValues := [round(getTimeRunning() / 60000), bonesOffered, gainedXPInt];
for i := 0 to high(NewValues) do
begin
newValues[i] := calcValues[i] - oldValues[i];
oldValues[i] := calcValues[i];
end;
end;
{PROCEDURE -- sendStats
Purpose: Sends stats to Clarity Live Stats
Comments: None.}
function sendStats(): boolean;
var
c, i: integer;
statVars: Array [0..2] of string;
begin
statVars := ['Time', 'Bones', 'XP'];
c := initializeHTTPClient(false);
for i := 0 to high(statVars) do
addPostVariable(c, statVars[i], intToStr(newValues[i]));
result := pos('true', lowercase(postHTTPPageEx(c, 'http://srlclarity.com/commit/ClarityAltarCommit.php'))) <> 0;
freeHTTPClient(c);
if result then calculateStats();
end;
{PROCEDURE -- paintProgress
Purpose: Paints progress on SMART client.
Comments: None.}
procedure paintProgress;
var
bonesPerHour, x, y: Integer;
xpExt, xpPerHourExt: extended;
xpString, xpPerHourString: string;
xpArray, xpPerHourArray: array [0..1] of variant;
begin
if showScriptPaint then
begin
bonesOffered := tripsCount * (25 + familiarBonesMax);
gainedXP := bonesOffered * bonesXP;
xpPerHour := Round(gainedXP * (3600.0 / (GetTimeRunning / 1000.0)));
bonesPerHour := Round(bonesOffered * (3600.0 / (GetTimeRunning / 1000.0)));
xpExt := gainedXP;
xpPerHourExt := xpPerHour;
xpArray[0] := xpExt;
xpPerHourArray[0] := xpPerHourExt;
xpString := Format('%n', xpArray);
delete(xpString, length(xpString) - 3, 3);
xpPerHourString := Format('%n', xpPerHourArray);
delete(xpPerHourString, length(xpPerHourString) - 3, 3);
smartImage.drawBitmap(scriptPaintBMP, Point(3, 461));
smartImage.drawText(ToStr(TimeRunning), Point(120, 517), 'smallChars', true, clWhite);
smartImage.drawText(ToStr(bonesOffered), Point(120, 539), 'smallChars', true, clWhite);
smartImage.drawText(ToStr(bonesPerHour), Point(155, 560), 'smallChars', true, clWhite);
smartImage.drawText(xpString + ' XP', Point(455, 481), 'smallChars', true, clLime);
smartImage.drawText(xpPerHourString + ' XP/hr', Point(455, 497), 'smallChars', true, clLime);
if not showScriptDebug then clearDebug;
writeln('====== ClarityAltar Debug Progress Report ======');
writeln('Time Running: ' + ToStr(TimeRunning));
writeln('Total Offered: ' + ToStr(bonesOffered));
writeln('Offered/Hr: ' + ToStr(bonesPerHour));
writeln('Total XP: ' + xpString + ' XP');
writeln('XP/Hr: ' + xpPerHourString + ' XP/hr');
writeln('====== ================================== ======');
ClarityDebug('Our progress was painted.');
scriptStatus('Updated progress report.');
disguise('ClarityAltar v' + ToStr(scriptVersion) + ' - ' + xpString + ' XP, ' + xpPerHourString + ' XP/hr');
if statsTimer.getTime() > 300000 then
if sendStats() then
begin
ClarityDebug('Successfully committed usage statistics.');
scriptStatus('Committed usage stats to SRL Clarity Live Stats!');
wait(gaussRangeInt(500, 1500));
statsTimer.reset();
statsTimer.start();
end else
begin
ClarityDebug('Failed to commit usage statistics.');
scriptStatus('Failed to commit usage statistics.');
end;
end;
end;
{Procedure AutoupdateMe;
By: Shuttleu
Edited By: Ashaman88 & Clarity
Purpose: Autoupdates Script.}
procedure AutoUpdateMe;
var
Neifile: Integer;
OnlineVersion, NewScript, NeiFeilNennen: string;
begin
ClarityDebug('Checking for script updates...');
OnlineVersion := GetPage('http://pastebin.com/raw.php?i=4KDKG5UF');
ClarityDebug('Online Script Version: ' + OnlineVersion);
ClarityDebug('Local Script Version: ' + ScriptVersion) if (trim(OnlineVersion) > ScriptVersion) then
begin
ClarityDebug('Newer script version online!');
ClarityDebug('Autoupdating to newer version.');
NewScript := GetPage('http://pastebin.com/raw.php?i=nLgk3Ytq');
NeiFeilNennen := ScriptPath + 'ClarityAltar v' + OnlineVersion + '.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
ClarityDebug('Fatal error writing to ' + NeiFeilNennen + '!');
Terminatescript;
end;
end;
CloseFile(Neifile);
ClarityDebug('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.');
writeln('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.');
TerminateScript;
end
else
ClarityDebug('You have the latest version of the script!');
end;
{Procedure checkForFiles;
By: Kevin
Edited By: Clarity
Purpose: Checks/downloads files.}
procedure checkForFiles(filePath, message, link: string);
var
progFile: longInt;
fileName: string;
begin
fileName := AppPath + filePath;
try
if not fileExists(fileName) then
begin
ClarityDebug('-- INSTALLATION STATUS: ' + message + ' does not exist - Downloading now.');
progFile := createFile(fileName);
end
else
begin
ClarityDebug('-- INSTALLATION STATUS: ' + message + ' exists.');
exit;
end;
closeFile(progFile);
progFile := rewriteFile(fileName, false);
writeFileString(progFile, getPage(link));
ClarityDebug('-- INSTALLATION STATUS: ' + message + ' has been downloaded.');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
{PROCEDURE -- InstallClarityAltarAssets
Purpose: Determines whether files exist and dictates their installation.
Comments: None.}
procedure InstallClarityAltarAssets;
begin
ClarityDebug('Please wait...now installing ClarityAltar image assets to your computer...');
if not directoryExists(appPath + 'scripts/ClarityAltarImages/') then
begin
try
createDirectory(appPath + 'scripts/ClarityAltarImages/');
ClarityDebug('Created a new folder in Simba/Scripts/');
except
end;
end;
checkForFiles('scripts/ClarityAltarImages/scriptpaint.png', 'Script Paint', 'http://i.imgur.com/Qzv2cvg.png');
end;
{PROCEDURE -- mainLoop
Purpose: Script mainLoop.
Comments: None}
procedure mainLoop;
begin
failsafe.start;
claimSpinTicket();
paintProgress;
travelToBank(false);
bankItems(false);
familiarExpiring:
teleportToHouse;
walkToAltar;
lightBurners;
offerBones;
waitOffering;
end;
begin
clearDebug;
writeLn('ClarityAltar v' + scriptVersion);
writeLn('Initializing script...');
disableSRLDebug := not showSRLDebug;
smartEnableDrawing := true;
if usingDirectX then
smartPlugins := ['d3d9.dll'];
setupsrl;
declarePlayers;
antibanThreshold := antibanThreshold + random(-500, 500);
mouseSpeed := gaussRangeInt(20, 40);
ClarityDebug('ClarityAltar v' + scriptVersion);
ClarityDebug('Script initialized successfully.');
autoUpdateMe;
installClarityAltarAssets;
ClarityDebug('');
case usingDirectX of
true: ClarityDebug('GRAPHICS MODE: DirectX');
false: ClarityDebug('GRAPHICS MODE: OpenGL - expect worse performance!');
end;
wait(1000);
case familiarType of
'Yak': familiarBonesMax := 30;
'Pig': familiarBonesMax := 22;
'Tortoise': familiarBonesMax := 18;
'Terrorbird': familiarBonesMax := 12;
'Ant': familiarBonesMax := 9;
'Kalphite': familiarBonesMax := 6;
'None': familiarBonesMax := 0;
end;
case boneType of
'Frost Dragon': bonesXP := 630.0;
'Ourg': bonesXP := 490.0;
'Airut': bonesXP := 463.75;
'Dagannoth': bonesXP := 437.5;
'Dragon': bonesXP := 252.0;
'Infernal': bonesXP := 218.7;
'Wyvern': bonesXP := 175.0;
'Babydragon': bonesXP := 105.0;
'Big': bonesXP := 52.5;
'Accursed': bonesXP := 43.7;
'Other': bonesXP := 0.0;
end;
if showScriptPaint then
scriptPaintBMP := loadBitmap(appPath + '/Scripts/ClarityAltarImages/scriptpaint.png');
if not isLoggedIn then
if players[currentPlayer].login then
setupPlayer;
statsTimer.start();
ClarityDebug('Started');
while players.getActive > 0 do
mainLoop;
end.
Few things to note:
I built Oak incense burners instead of Marble burners; if this isn't the case for you, try the burner colors in the original script.
I only tested Tortoise, but I don't know why it wouldn't work with others.
I manually bound teleport to house to X.
I used East orientation for both Chapel and Altar (and I have not tested the other orientations!).
I use the default tileset for my house, so it looks like this (note that this is on high graphics and you should play on low):
http://puu.sh/iuhvU/0dfd60dcfe.jpg
I love this community. I really do. I find myself saying thank you in all of my posts it seems.
So, let me do it again. Thank you for the original, incredible work Clarity! Will update when I hit my goal. And also, thank you for sharing adc. It is working flawlessly.
EDIT:
Antiban is not working. An update would still be much appreciated Clarity
Jesus loves you
EDIT:
please delete. accidental double post
Jesus loves you
Ok, the script is now running very well. I had 4 main issues with the third party version posted earlier:
1. Would not detect incense burner occasionally, causing script to stop
2. Would attempt to click incense burner while still moving, causing a misclick
3. Would only click on banker's head to open bank, not anywhere else
4. Would right click a left click bank
I rectified the above 4 issues. My version is here:
All credit goes to Clarity and ADC's small changes.Code:program ClarityAltar; {$DEFINE SMART} {$I SRL-6/SRL.simba} {ClarityAltar v2.00} const scriptVersion = '2.00'; usingDirectX = true; showSRLDebug = false; var //Integers bonesOffered, tripsCount, tripsPerHour, restoreSlot, familiarBonesMax, familiarBonesCurrent, antibanThreshold, bonesSlot, marrentillSlot, pouchSlot, debugCount, scriptPaintBMP, internetConnectionThreshold: Integer; //Extended gainedXP, bonesXP, xpPerHour: Extended; //Booleans showScriptDebug, showScriptPaint, useBankPresets: Boolean; //Strings chapelLocation, altarOrientation, travelMethod, familiarType, burnerTendency, boneType: String; //TTimeMarkers failSafe, statsTimer: TTimeMarker; //Arrays newValues, oldValues: array [0..2] of Integer; label familiarExpiring; procedure declarePlayers; begin setLength(players, 1); with players[0] do begin //Basic Information loginName := 'username'; password := 'password'; bankPIN := ''; isActive := true; isMember := true; world := -1; //Script Specific Information showScriptDebug := false; //Display script general debug info (text and onscreen)? showScriptPaint := true; //Display on screen script paint? useBankPresets := true; //Would you like to manually withdraw or use presets? bonesSlot := 1; //What bank item slot contains your bones? MUST SPECIFY if using presets and familiar marrentillSlot := 2; //What bank item slot contains your marrentills? pouchSlot := 4; //Which bank item slot contains your familiar pouches? restoreSlot := 5; //Which bank item slot contains your summoning restore item? boneType := 'Dragon'; //What kind of bones are you offering? Scroll down to line 901 for supported bone/ash types and what to type in. familiarType := 'None'; //'None' if no familiar. Supports 'Yak', 'Pig' (Tier 3 pig only), 'Tortoise', 'Terrorbird', 'Ant', and 'Kalphite'. travelMethod := 'House Teleport'; //Only supported teleportation method at the moment. chapelLocation := 'East'; //Where is your chapel located relative to your house portal? Must be adjacent by one room. altarOrientation := 'East'; //How is your altar positioned in the chapel (what wall is it closest to)? //Lag and Accuracy Modifiers antibanThreshold := 15000; //Adjust to increase or decrease the amount of antiban the script performs. Threshold below 5000 not recommended. end; currentPlayer := 0; end; {==== End of Script Setup ====} {==== IMPORTANT: DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ====} {PROCEDURE -- ClarityDebug Purpose: Custom debug procedure for my scripts. Comments: None.} procedure ClarityDebug(message: string); begin if showScriptDebug then writeln(ToStr(debugCount) + ' | == ClarityDebug == | ' + message); inc(debugCount); end; {FUNCTION -- modifiedMSBounds Purpose: Creates a special mainscreen TBox bounds. Comments: None.} function modifiedMSBounds: TBox; var normalBox: TBox; begin normalBox := mainscreen.getBounds(); result := IntToBox(normalBox.X1 + 50, normalBox.Y1 + 50, normalBox.X2 - 50, normalBox.Y2 - 50); end; {PROCEDURE -- scriptStatus Purpose: Paints current script activity onto the client if paint is enabled. Comments: Thanks to The Mayor for the idea!} procedure scriptStatus(status: string); begin if showScriptPaint then begin try smartImage.clearArea(mainscreen.getBounds()); smartImage.drawText('STATUS: ', point(actionbar.x1 + 5, actionbar.y1 - 20), 'loginchars', true, clWhite); smartImage.drawText(status, point(actionbar.x1 + 68, actionbar.y1 - 20), 'loginchars', true, clYellow); except end; end; end; {PROCEDURE -- setupPlayer Purpose: Starting procedure to make sure the camera and orientation is okay. Comments: None.} procedure setupPlayer; begin scriptStatus('Setting up player...'); wait(gaussRangeInt(500, 3000)); minimap.clickCompass; wait(gaussRangeInt(200, 1500)); mainscreen.setAngle(MS_ANGLE_HIGH); wait(gaussRangeInt(500, 1000)); end; {PROCEDURE -- antiBan Purpose: Make us look more like a human and less like a bot. Comments: None.} procedure antiBan; begin end; {FUNCTION -- atBank Purpose: Determines player location. Comments: None.} function atBank: boolean; var x, y, bankIcon: Integer; symbolLoc: TPoint; begin result := false; bankIcon := BitmapFromString(9, 6, 'meJyr659pU7bKpmoDCipbVdk11Sy0' + 'UNs3G4I0PdOQ2S2TZlskTzFPmlR8+k3J+Y+xh18C2UCRxr7pNW0Tj' + 'GN6gCjt6Dv1gJTgTbcg3Irm3sLqVr2IbiAKWn3XvGii95yTEG5ORW' + 'NWWaNGSBcUBbXC2WlFNQBkA0V0'); //if findBitmapIn(bankIcon, x, y, minimap.getBounds()) then result := true; if minimap.findSymbol(symbolLoc, MM_SYMBOL_BANK, minimap.getBounds()) or minimap.findSymbol(symbolLoc, MM_SYMBOL_MINIGAME, minimap.getBounds()) or minimap.findSymbol(symbolLoc, MM_SYMBOL_TRANSPORTATION, minimap.getBounds()) then result := true; ClarityDebug('At Bank: ' + ToStr(result)); freeBitmap(bankIcon); end; {FUNCTION -- familiarExpired Purpose: Checks for familiar expiration text. Comments: None.} function familiarExpired: boolean; var TPA: TPointArray; begin if (familiarType = 'None') then exit(false); result := findColorsTolerance(TPA, 127, IntToBox(13, 550, 575, 583), 0); if result then ClarityDebug('Familiar Expired: ' + ToStr(result)); end; {FUNCTION -- familiarOpen Purpose: Checks for familiar interface bitmap. Comments: None.} function familiarOpen: boolean; var x, y, familiarInvent: Integer; begin result := false; familiarInvent := BitmapFromString(29, 6, 'meJxNkbtKxEAUhrOTzW2Smc2YTJJ' + 'NXFmE2KggeENhwWLZxsrSFxAbWzttrfYFxG5BQTvt9wVEfQJ9BF9B' + '/+HosHCK/5zJ/51LGs3rpS5FLlxEo7mIWCr8YRUj9V5/2MmZSQu+W' + 'id4TULWz6NKmi/JAi+0jUJ5enKcX1zBi5Cn5/gGRWjUyUVYrfhKJV' + 'BBmh5NChVBq+1dcTcnL3/4aLY20RctTGX+Hd6/i3YNXqSYxKJ6nGF' + 's0pnwgUL8dckksMujUe9yGgxbRyr35tGbvZWpS60R7v6463YGpUk7' + 'e2Oqm8VjNqgzq2lfSlUaYykMlsVMxj5o/YNDPAUes1jHcWqdkAXYH' + 'vfJm6cBlrK31TK0HQU3U5XrbTJ9Cl++iEOoRSy2w+n+scxiLQcaB1' + 'n8g9DB8ye/vg02dlzmwEgoutsve8V2QA=='); if findBitmapIn(familiarInvent, x, y, mainscreen.getBounds) then result := true; if result then ClarityDebug('Familiar inventory is open.'); freeBitmap(familiarInvent); end; {FUNCTION -- teleportToHouse Purpose: Teleports to your house using the teleport tablets. Comments: None.} function teleportToHouse: boolean; var houseScreen, x, y, attempts: Integer; begin if not isLoggedIn or not atBank then exit; result := false; houseScreen := BitmapFromString(9, 16, 'meJyzcXC1CY8Jq2+onbdwLiqyISi' + 'VlBGPIYtHygwohSwLRP5hmjahVjahMqbmZhApIPIP8wQjTUM/RVs/' + 'FaAUXBas3hompapvBkQqYFlrWz8FmJSCIVQKKqtvBhSUsfVT1HORM' + 'fSTVjRUUjSEyCrrWEiDBRVhpLSinZCsgaC0srScAZAtBpeyBRkLt1' + 'QTSS+QVIB4DeJUsI0QVwkrGioauCPEIcqArtU3A1ohgyQCUmMTCmE' + 'DdUG028BJWz9lbS2gUQCES37g'); ClarityDebug('Teleporting to house.'); scriptStatus('Teleporting to house.'); sendKeys('x', 100, 200); wait(gaussRangeInt(2000, 4000)); while attempts < 20 do begin ClarityDebug('Searching for house teleportation success bitmap. (Attempt ' + ToStr(attempts) + ')'); if findBitmapIn(houseScreen, x, y, modifiedMSBounds) then begin wait(gaussRangeInt(2000, 3000)); freeBitmap(houseScreen); exit(true); end else begin ClarityDebug('Did not find bitmap, reattempting.'); wait(100); inc(attempts); end; end; freeBitmap(houseScreen); antiBan; wait(gaussRangeInt(3000, 5000)); end; {PROCEDURE -- emergencyTerminate Purpose: Script termination process. Comments: None.} procedure emergencyTerminate(reason: string); begin waitFunc(@teleportToHouse, 50, 60000); scriptStatus('EMERGENCY TERMINATION'); antiBan; ClarityDebug(reason); freeBitmap(scriptPaintBMP); terminateScript; end; {FUNCTION -- travelToBank Purpose: Travels to the bank. Comments: None.} function travelToBank(priority: boolean): boolean; var bankLoc: TPoint; begin if not isLoggedIn then exit; if not priority and atBank then exit; result := false; wait(gaussRangeInt(500, 1500)); scriptStatus('Teleporting to the TzHaar Bank.'); ClarityDebug('Opening teleportation menu.'); sendKeys('1', 100, 200); conversationBox.isOpen(20000); wait(gaussRangeInt(100, 300)); ClarityDebug('Selecting Fight Caves option.'); sendKeys('3', 100, 200); antiBan; wait(gaussRangeInt(4000, 6000)); end; {FUNCTION -- openBank Purpose: Banks items to get ready for the next trip. Comments: None.} function openBank: boolean; var x, y, i, attempts: integer; TPA: TPointArray; ATPA: T2DPointArray; label tryagain; begin tryagain: if not isLoggedIn or not atBank or familiarOpen then exit; scriptStatus('Accessing the bank.'); ClarityDebug('openBank initiated.'); attempts := 0; result := false; while (attempts < 20) do begin if findColorsSpiralTolerance(x, y, TPA, 2803178, mainscreen.getBounds(), 5, colorSetting(2, 0.46, 2.61)) then begin mainscreen.filterPointsPlayer(TPA); TPAtoATPAWrap(TPA, 20, ATPA); sortATPASize(ATPA, true); if showScriptDebug then smartImage.debugATPA(ATPA); for i := 0 to high(ATPA) do begin mouse(point(ATPA[i].getMiddle.X + random( -3, 3), ATPA[i].getMiddle.Y + random( -2, 30)), MOUSE_MOVE, MOUSE_HUMAN); if isMouseOverText(['ank'], 500) then begin fastClick(MOUSE_LEFT); _waitBankOrPinscreen(randomRange(5000,10000)); if bankScreen.isOpen() then exit(true) else goto tryagain; end else begin ClarityDebug('Unable to locate the banker.'); smartImage.clearArea(modifiedMSBounds); inc(attempts); ClarityDebug('Attempts: ' + ToStr(attempts)); break; end; end; end; end; travelToBank(true); goto tryagain; end; {PROCEDURE -- bankItems Purpose: Banks items. Comments: None} procedure bankItems(premature: boolean); var attempts, x, y, i, j, humanAmount: Integer; familiarBox: TBox; expired, withdrawn: boolean; label noFamiliar; begin if not isLoggedIn or not atBank then exit; expired := familiarExpired; withdrawn := false; ClarityDebug('bankItems initiated.'); openBank; if pinScreen.isOpen then pinScreen.enter(players[currentPlayer].bankPin); repeat ClarityDebug('Attempting to withdraw items from the bank.'); if familiarType = 'None' then goto noFamiliar; if expired then begin scriptStatus('Renewing expired familiar.'); ClarityDebug('Familiar expired.'); mouse(IntToBox(397, 561, 412, 579).getGaussPoint(), MOUSE_LEFT); wait(50 + Random(50)); bankScreen.withdraw(restoreSlot, 1, ['']); wait(gaussRangeInt(100, 400)); bankScreen.withdraw(pouchSlot, 1, ['']); bankScreen.close(); tabBackpack.waitWhileLocked(); wait(gaussRangeInt(100, 400)); tabBackpack.mouseSlot(1, MOUSE_LEFT); wait(gaussRangeInt(100, 400)); actionbar.mouseIcon(AB_Bar_SUMMONING, MOUSE_RIGHT); if chooseOption.optionsExist(['Renew']) then begin chooseOption.select(['Renew']); wait(gaussRangeInt(100, 400)); end else begin chooseOption.close(); tabBackpack.mouseSlot(2, MOUSE_LEFT); wait(gaussRangeInt(100, 400)); end; if tabBackpack.isItemInSlot(1) or tabBackpack.isItemInSlot(2) then begin ClarityDebug('Depositing restore item leftovers.'); openBank; bankScreen.deposit([1, 2]); wait(gaussRangeInt(100, 400)); end; expired := false; end else goto noFamiliar; until (familiarBonesCurrent >= familiarBonesMax); noFamiliar: _waitBankOrPinScreen(10000); if useBankPresets then begin bankScreen.clickButton(BANK_BUTTON_PRESET_1); scriptStatus('Withdrawing bank preset.'); tabBackpack.waitWhileLocked(); wait(gaussRangeInt(750, 1000)); if conversationBox.isOpen() then begin wait(gaussRangeInt(500, 750)); typeByte(VK_ESCAPE); wait(gaussRangeInt(200, 600)); end; end else begin scriptStatus('Withdrawing two marrentill herbs.'); while not withdrawn do begin if bankScreen.withdraw(marrentillSlot, 2, ['']) then withdrawn := true; end; scriptStatus('Withdrawing bones.'); repeat bankScreen.withdraw(bonesSlot, WITHDRAW_AMOUNT_ALL, ['']); until (bankScreen.isPackFull); wait(gaussRangeInt(100, 300)); bankScreen.close(); tabBackpack.waitWhileLocked(); end; end; {FUNCTION -- walkToAltar Purpose: Walks to the altar. Comments: None} function walkToAltar: boolean; var walkPoint: TPoint; begin if not isLoggedIn or atBank then exit; if familiarExpired then begin scriptStatus('Stopping trip - familiar about to expire.'); wait(gaussRangeInt(1000, 4000)); travelToBank(false); bankItems(true); goto familiarExpiring; end; scriptStatus('Walking to your house altar.'); case chapelLocation of 'North': walkPoint := Point(minimap.cx + 3 + random(-5, 5), minimap.cy - 35 + random(-5, 5)); 'South': walkPoint := Point(minimap.cx + 3 + random(-2, 2), minimap.cy + 35 + random(-5, 5)); 'East': walkPoint := Point(minimap.cx + 35 + random(-2, 2), minimap.cy + random(-2, 2)); 'West': walkPoint := Point(minimap.cx - 35 + random(-5, 5), minimap.cy + 5 + random(-5, 5)); end; mouse(walkPoint, MOUSE_MOVE, MOUSE_HUMAN); fastClick(MOUSE_LEFT); wait(gaussRangeInt(1000,1500)); minimap.waitPlayerMoving(500,1000); wait(gaussRangeInt(1000,1500)); result := true; end; {FUNCTION -- locateAltar Purpose: Searches for the altar. Comments: None} function locateAltar: TPoint; var x, y, i, attempts, altarDTM: integer; TPA: TPointArray; ATPA: T2DPointArray; searchBox, normalBox: TBox; begin if failsafe.getTime() > 900000 then emergencyTerminate('Terminating due to run taking too long, script must have failed.'); if not isLoggedIn then exit; ClarityDebug('locateAltar initiated.'); attempts := 0; normalBox := mainscreen.getBounds(); case altarOrientation of 'North': altarDTM := DTMFromString('mbQAAAHicY2VgYOBngAA5IJYBYiYonxFKswMxBxAvXrKJYc3qZQwb1q9h2LhhHRhzQfUjY0YsGAwAY6MKyw=='); 'South': altarDTM := DTMFromString('mbQAAAHicY2VgYBBkgABmIFYGYnkg5gBidiBmhNIgsHjJZoYN69cwbNiwFkyvX7+agQsozo+GGbFgMAAAa5MK5A=='); 'East': altarDTM := DTMFromString('mQwAAAHicY2ZgYGBmgABGIOaDsuWAeO68NQzLly9mWLVqBQMXkM8PxYxIGAgA00QGMw=='); 'West': altarDTM := DTMFromString('mbQAAAHicY2WAAEYozQ7EHEAsAMSKSHIyQLx46WaG9etWg/HGDesY1q1dycAFFOdHw4xYMBgAAGBxCs0='); end; case altarOrientation of 'North': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40); 'South': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40); 'East': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40); 'West': searchBox := IntToBox(normalBox.X1 + 40, normalBox.Y1 + 40, normalBox.X2 - 40, normalBox.Y2 - 40); end; //Search boxes to be modified. if showScriptDebug then smartImage.drawBox(searchBox, clBlue); while (attempts < 10) do begin if findDTM(altarDTM, x, y, searchBox) then begin if showScriptDebug then smartImage.drawCross(Point(x, y), 15, clRed); result := Point(x + random(-5, 5), y + random(-5, 5)); freeDTM(AltarDTM); exit; end else begin ClarityDebug('Unable to locate an altar.'); smartImage.clearArea(modifiedMSBounds); inc(attempts); ClarityDebug('Attempts: ' + ToStr(attempts)); end; end; freeDTM(AltarDTM); end; {FUNCTION -- locateBurners Purpose: Searches for the burners. Comments: None} function locateBurners: TPointArray; var x, y, i, attempts: integer; TPA, clearTPA, burnerTPA: TPointArray; ATPA: T2DPointArray; altarPoint: TPoint; playerBox, prayersBox, searchBox, filterBox: TBox; begin if failsafe.getTime() > 900000 then emergencyTerminate('Terminating due to run taking too long, script must have failed.'); if not isLoggedIn then exit; ClarityDebug('locateBurners initiated.'); attempts := 0; prayersBox := IntToBox(1, 29, mainscreen.x2, mainscreen.y2); altarPoint := locateAltar; case altarOrientation of 'North': searchBox := IntToBox(altarPoint.x - 85, altarPoint.y - 10, altarPoint.x + 83, altarPoint.y + 20); 'South': searchBox := IntToBox(altarPoint.x - 83, altarPoint.y - 7, altarPoint.x + 85, altarPoint.y + 20); 'East': searchBox := IntToBox(altarPoint.x - 16, altarPoint.y - 70, altarPoint.x + 10, altarPoint.y + 98); 'West': searchBox := IntToBox(altarPoint.x - 10, altarPoint.y - 70, altarPoint.x + 16, altarPoint.y + 98); end; case altarOrientation of 'North': filterBox := IntToBox(altarPoint.x - 45, altarPoint.y - 10, altarPoint.x + 45, altarPoint.y + 20); 'South': filterBox := IntToBox(altarPoint.x - 45, altarPoint.y - 7, altarPoint.x + 45, altarPoint.y + 20); 'East': filterBox := IntToBox(altarPoint.x - 16, altarPoint.y - 25, altarPoint.x + 10, altarPoint.y + 45); 'West': filterBox := IntToBox(altarPoint.x - 10, altarPoint.y - 25, altarPoint.x + 16, altarPoint.y + 45); end; if showScriptDebug then begin try smartImage.clearArea(modifiedMSBounds); smartImage.drawBox(searchBox, clLime); smartImage.drawBox(filterBox, clWhite); except end; end; clearTPA := filterBox.createTPA; while (attempts < 10) do begin if findColorsSpiralTolerance(x, y, TPA, 4944016, searchBox, 15, colorSetting(2, 0.13, 0.32)) then begin mainscreen.filterPointsPlayer(TPA); burnerTPA := TPA.clearTPAFrom(clearTPA); TPAtoATPAWrap(burnerTPA, 30, ATPA); ATPA.sortFromMidPoint(altarPoint); if showScriptDebug then smartImage.debugATPA(ATPA); setLength(result, 2); result[0] := ATPA[0].getMiddle(); result[1] := ATPA[1].getMiddle(); exit; end else begin ClarityDebug('Unable to locate a burner.'); smartImage.clearArea(modifiedMSBounds); inc(attempts); ClarityDebug('Attempts: ' + ToStr(attempts)); end; end; end; {FUNCTION -- lightBurners Purpose: Lights each burner. Comments: None} function lightBurners: boolean; var x, y, attempts: integer; TheTPA: TPointArray; ATPA: T2DPointArray; playerBox, prayersBox: TBox; failsafe2: TTimeMarker; begin failsafe2.start; if failsafe.getTime() > 900000 then emergencyTerminate('Terminating due to run taking too long, script must have failed.'); if not isLoggedIn then exit; if atBank then exit; ClarityDebug('lightBurners initiated.'); scriptStatus('Lighting the burners.'); while (attempts < 10) do begin TheTPA = locateBurners(); mouse(locateBurners[0], MOUSE_MOVE, MOUSE_HUMAN); if isMouseOverText(['L','ight'], 300) then begin fastClick(MOUSE_LEFT); tabBackpack.waitForShift(5000); wait(RandomRange(1400, 1600)); mouse(locateBurners[1], MOUSE_MOVE, MOUSE_HUMAN); if isMouseOverText(['L','ight'], 300) then begin fastClick(MOUSE_LEFT); tabBackpack.waitForShift(6500); wait(RandomRange(1600, 1800)); exit(true); end else begin inc(attempts); continue; end; end else begin inc(attempts); continue; end; end; end; {FUNCTION -- offerBones Purpose: Offers bones at the altar. Comments: None} function offerBones: boolean; var attempts: Integer; begin if not isLoggedIn or atBank then exit; ClarityDebug('offerBones initiated.'); scriptStatus('Offering bones to the gods'); while attempts < 10 do begin mouse(locateAltar, MOUSE_MOVE, MOUSE_HUMAN); if not isMouseOverText(['Pray'], 250, true) then begin ClarityDebug('Pray option not present.'); scriptStatus('No pray option present - Retrying (Attempt ' + ToStr(attempts) + ')'); continue; end; fastClick(MOUSE_RIGHT); if not chooseOption.optionsExist(['Off', 'er', 'Offer']) then begin ClarityDebug('Offer option not present.'); scriptStatus('No offer option present - Retrying (Attempt ' + ToStr(attempts) + ')'); chooseOption.close(); continue; end; result := chooseOption.select(['ffer']); if result := true then begin exit; end else begin inc(attempts); end; end; end; {FUNCTION -- waitOffering Purpose: Wait and update inventory while offering bones. Comments: None} function waitOffering: boolean; var takeOutThreshold: Integer; failsafe2: TTimeMarker; begin if not isLoggedIn or atBank then exit; result := false; failsafe2.start; familiarBonesCurrent := familiarBonesMax; takeOutThreshold := (3 + gaussRangeInt(0, 5)); ClarityDebug('Threshold is: ' + ToStr(takeOutThreshold)); ClarityDebug('FBonesMax: ' + ToStr(familiarBonesMax)); ClarityDebug('FBonesCurrent: ' + ToStr(familiarBonesCurrent)); scriptStatus('Waiting for all bones to be offered.'); repeat antiban; if familiarExpired then begin scriptStatus('Stopping trip, familiar about to expire.'); wait(gaussRangeInt(1000, 4000)); travelToBank(false); bankItems(true); goto familiarExpiring; end; if (tabBackpack.Count < takeOutThreshold) and (familiarBonesCurrent > 0) then begin scriptStatus('Withdrawing more bones from your beast of burden.'); wait(gaussRangeInt(100, 400)); actionbar.mouseIcon(AB_Bar_SUMMONING, MOUSE_LEFT); wait(gaussRangeInt(1000, 1500)); familiarBonesCurrent := (familiarBonesCurrent - (28 - takeOutThreshold)); ClarityDebug('FBonesCurrent: ' + ToStr(familiarBonesCurrent)); end; scriptStatus('Waiting for all bones to be offered.'); wait(25 + Random(75)); until (tabBackpack.Count = 1) or (failsafe2.getTime > 120000); inc(tripsCount); wait(gaussRangeInt(1000, 4000)); end; {PROCEDURE -- calculateStats Purpose: Calculates stats for the stats commit. Comments: None.} procedure calculateStats(); var i, gainedXPInt: integer; calcValues: Array [0..2] of integer; begin gainedXPInt := round(gainedXP); calcValues := [round(getTimeRunning() / 60000), bonesOffered, gainedXPInt]; for i := 0 to high(NewValues) do begin newValues[i] := calcValues[i] - oldValues[i]; oldValues[i] := calcValues[i]; end; end; {PROCEDURE -- sendStats Purpose: Sends stats to Clarity Live Stats Comments: None.} function sendStats(): boolean; var c, i: integer; statVars: Array [0..2] of string; begin statVars := ['Time', 'Bones', 'XP']; c := initializeHTTPClient(false); for i := 0 to high(statVars) do addPostVariable(c, statVars[i], intToStr(newValues[i])); result := pos('true', lowercase(postHTTPPageEx(c, 'http://srlclarity.com/commit/ClarityAltarCommit.php'))) <> 0; freeHTTPClient(c); if result then calculateStats(); end; {PROCEDURE -- paintProgress Purpose: Paints progress on SMART client. Comments: None.} procedure paintProgress; var bonesPerHour, x, y: Integer; xpExt, xpPerHourExt: extended; xpString, xpPerHourString: string; xpArray, xpPerHourArray: array [0..1] of variant; begin if showScriptPaint then begin bonesOffered := tripsCount * (25 + familiarBonesMax); gainedXP := bonesOffered * bonesXP; xpPerHour := Round(gainedXP * (3600.0 / (GetTimeRunning / 1000.0))); bonesPerHour := Round(bonesOffered * (3600.0 / (GetTimeRunning / 1000.0))); xpExt := gainedXP; xpPerHourExt := xpPerHour; xpArray[0] := xpExt; xpPerHourArray[0] := xpPerHourExt; xpString := Format('%n', xpArray); delete(xpString, length(xpString) - 3, 3); xpPerHourString := Format('%n', xpPerHourArray); delete(xpPerHourString, length(xpPerHourString) - 3, 3); smartImage.drawBitmap(scriptPaintBMP, Point(3, 461)); smartImage.drawText(ToStr(TimeRunning), Point(120, 517), 'smallChars', true, clWhite); smartImage.drawText(ToStr(bonesOffered), Point(120, 539), 'smallChars', true, clWhite); smartImage.drawText(ToStr(bonesPerHour), Point(155, 560), 'smallChars', true, clWhite); smartImage.drawText(xpString + ' XP', Point(455, 481), 'smallChars', true, clLime); smartImage.drawText(xpPerHourString + ' XP/hr', Point(455, 497), 'smallChars', true, clLime); if not showScriptDebug then clearDebug; writeln('====== ClarityAltar Debug Progress Report ======'); writeln('Time Running: ' + ToStr(TimeRunning)); writeln('Total Offered: ' + ToStr(bonesOffered)); writeln('Offered/Hr: ' + ToStr(bonesPerHour)); writeln('Total XP: ' + xpString + ' XP'); writeln('XP/Hr: ' + xpPerHourString + ' XP/hr'); writeln('====== ================================== ======'); ClarityDebug('Our progress was painted.'); scriptStatus('Updated progress report.'); disguise('ClarityAltar v' + ToStr(scriptVersion) + ' - ' + xpString + ' XP, ' + xpPerHourString + ' XP/hr'); if statsTimer.getTime() > 300000 then if sendStats() then begin ClarityDebug('Successfully committed usage statistics.'); scriptStatus('Committed usage stats to SRL Clarity Live Stats!'); wait(gaussRangeInt(500, 1500)); statsTimer.reset(); statsTimer.start(); end else begin ClarityDebug('Failed to commit usage statistics.'); scriptStatus('Failed to commit usage statistics.'); end; end; end; {Procedure AutoupdateMe; By: Shuttleu Edited By: Ashaman88 & Clarity Purpose: Autoupdates Script.} procedure AutoUpdateMe; var Neifile: Integer; OnlineVersion, NewScript, NeiFeilNennen: string; begin ClarityDebug('Checking for script updates...'); OnlineVersion := GetPage('http://pastebin.com/raw.php?i=4KDKG5UF'); ClarityDebug('Online Script Version: ' + OnlineVersion); ClarityDebug('Local Script Version: ' + ScriptVersion) if (trim(OnlineVersion) > ScriptVersion) then begin ClarityDebug('Newer script version online!'); ClarityDebug('Autoupdating to newer version.'); NewScript := GetPage('http://pastebin.com/raw.php?i=nLgk3Ytq'); NeiFeilNennen := ScriptPath + 'ClarityAltar v' + OnlineVersion + '.simba'; Neifile := Rewritefile(NeiFeilNennen, true); try WriteFileString(Neifile, NewScript); except begin ClarityDebug('Fatal error writing to ' + NeiFeilNennen + '!'); Terminatescript; end; end; CloseFile(Neifile); ClarityDebug('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.'); writeln('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.'); TerminateScript; end else ClarityDebug('You have the latest version of the script!'); end; {Procedure checkForFiles; By: Kevin Edited By: Clarity Purpose: Checks/downloads files.} procedure checkForFiles(filePath, message, link: string); var progFile: longInt; fileName: string; begin fileName := AppPath + filePath; try if not fileExists(fileName) then begin ClarityDebug('-- INSTALLATION STATUS: ' + message + ' does not exist - Downloading now.'); progFile := createFile(fileName); end else begin ClarityDebug('-- INSTALLATION STATUS: ' + message + ' exists.'); exit; end; closeFile(progFile); progFile := rewriteFile(fileName, false); writeFileString(progFile, getPage(link)); ClarityDebug('-- INSTALLATION STATUS: ' + message + ' has been downloaded.'); finally if (progFile > 0) then closeFile(progFile); end; end; {PROCEDURE -- InstallClarityAltarAssets Purpose: Determines whether files exist and dictates their installation. Comments: None.} procedure InstallClarityAltarAssets; begin ClarityDebug('Please wait...now installing ClarityAltar image assets to your computer...'); if not directoryExists(appPath + 'scripts/ClarityAltarImages/') then begin try createDirectory(appPath + 'scripts/ClarityAltarImages/'); ClarityDebug('Created a new folder in Simba/Scripts/'); except end; end; checkForFiles('scripts/ClarityAltarImages/scriptpaint.png', 'Script Paint', 'http://i.imgur.com/Qzv2cvg.png'); end; {PROCEDURE -- mainLoop Purpose: Script mainLoop. Comments: None} procedure mainLoop; begin failsafe.start; claimSpinTicket(); paintProgress; travelToBank(false); bankItems(false); familiarExpiring: teleportToHouse; walkToAltar; lightBurners; offerBones; waitOffering; end; begin clearDebug; writeLn('ClarityAltar v' + scriptVersion); writeLn('Initializing script...'); disableSRLDebug := not showSRLDebug; smartEnableDrawing := true; if usingDirectX then smartPlugins := ['d3d9.dll']; setupsrl; declarePlayers; antibanThreshold := antibanThreshold + random(-500, 500); mouseSpeed := gaussRangeInt(20, 40); ClarityDebug('ClarityAltar v' + scriptVersion); ClarityDebug('Script initialized successfully.'); autoUpdateMe; installClarityAltarAssets; ClarityDebug(''); case usingDirectX of true: ClarityDebug('GRAPHICS MODE: DirectX'); false: ClarityDebug('GRAPHICS MODE: OpenGL - expect worse performance!'); end; wait(1000); case familiarType of 'Yak': familiarBonesMax := 30; 'Pig': familiarBonesMax := 22; 'Tortoise': familiarBonesMax := 18; 'Terrorbird': familiarBonesMax := 12; 'Ant': familiarBonesMax := 9; 'Kalphite': familiarBonesMax := 6; 'None': familiarBonesMax := 0; end; case boneType of 'Frost Dragon': bonesXP := 630.0; 'Ourg': bonesXP := 490.0; 'Airut': bonesXP := 463.75; 'Dagannoth': bonesXP := 437.5; 'Dragon': bonesXP := 252.0; 'Infernal': bonesXP := 218.7; 'Wyvern': bonesXP := 175.0; 'Babydragon': bonesXP := 105.0; 'Big': bonesXP := 52.5; 'Accursed': bonesXP := 43.7; 'Other': bonesXP := 0.0; end; if showScriptPaint then scriptPaintBMP := loadBitmap(appPath + '/Scripts/ClarityAltarImages/scriptpaint.png'); if not isLoggedIn then if players[currentPlayer].login then setupPlayer; statsTimer.start(); ClarityDebug('Started'); while players.getActive > 0 do mainLoop; end.
EDIT:
Jesus loves you
+Rep to both of you for contributing!
I don't have access to an account that can test this script right now, but when I do I hope to officially make an update to the first post. Until then, looks like these awesome script edits will work fine for everyone!
Scripts: ClarityNex | ClaritySlayer | ClarityElfThief | ClarityBurialArmour | ClarityMudRunes | ClarityWells | ClarityProTables | ClarityArmadyl | ClarityHarps
ClarityDominonTower | ClarityAltar | ClarityCitadel | ClarityBarrows | ClarityEsswraith | ChampionScrollCamperTools & Extensions: OpenGL ID Highlight Tool | SRL-6 Messaging System | SRL Companion | Item DTM Generator | BBCode Converter
tried using the scripts from the comments
my character is clicking the same incense burner numerous times even when out of marrentill
will do this for 3 minutes before offering bones :/
Last edited by wingerfinger; 08-11-2015 at 03:34 AM.
LV 99 skills so far
- Fletching 99/99- Divination 99/99
Defense 99/99 Range 99/99
There are currently 1 users browsing this thread. (0 members and 1 guests)