-
-
Save anonymous/b99d45e89496564c2ec27cf3173d3a2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program enchEdgevilleGold; | |
{$DEFINE smart} | |
{$i SRL-6/SRL.simba} | |
{$DEFINE debug_on} // Comment out this line to disable script debug/warning/error messages | |
///////////////////////////////////////////////////////////// | |
// Fill out the constants and the DeclarePlayers procedure // | |
///////////////////////////////////////////////////////////// | |
const | |
BANK_QUICK_BUTTON = '1'; // This script uses bank quick slot keys. Put your quick slot key here. | |
TRIPS_TO_DO = 100000; // Total loads to do before script termination. | |
var | |
tripnumber, barsmade: Integer; | |
barsperhour, xpperhour: Extended; | |
procedure declarePlayers(); | |
begin | |
Players.Setup([''], 'default'); // *** Fill this out, playername = Name of the account in player manager, filename = name of the player file *** | |
SetLength(Players,1); | |
// *** If NOT using the player manager, fill out the loginname and password below, otherwise ignore those two *** | |
with players[0] do | |
begin | |
// loginName := ''; {Remove the "//" from this line if you arent using player manager} | |
// password := ''; {Remove the "//" from this line if you arent using player manager} | |
IsActive := True; | |
//pin := ''; | |
end; | |
CurrentPlayer := 0; | |
end; | |
/////////////// | |
// End setup // | |
/////////////// | |
procedure writeDebug(text: String); | |
begin | |
{$IFDEF debug_on} writeLn('[DEBUG] : ' + text); {$ENDIF} | |
end; | |
procedure writeError(text: String); | |
begin | |
{$IFDEF debug_on} | |
writeln(''); | |
writeLn('[ERROR] : ' + text); | |
writeln(''); | |
{$ENDIF} | |
terminateScript(); | |
end; | |
procedure setUpPlayer(); | |
begin | |
if (not isLoggedIn()) then | |
Players[CurrentPlayer].Login(); | |
if (minimap.getAngleDegrees() <> MM_DIRECTION_SOUTH) then | |
minimap.clickCompass(); | |
mainscreen.setAngle(MS_ANGLE_HIGH); | |
end; | |
procedure antiban(); //Credit to Ashaman88 | |
var | |
i: Integer; | |
begin | |
i := 1 + random(600); | |
writeDebug('Performing antiban procedure with case: ' + IntToStr(i)); | |
case i of | |
1: boredHuman(True); | |
2..7: | |
begin | |
hoverSkill(SKILL_SMITHING); | |
wait(gaussRangeInt(1000, 2000)); | |
end; | |
8..50: pickUpMouse(); | |
51..100: mouseMovingObject(); | |
101..400: mouseOffClient(OFF_CLIENT_RANDOM, randomRange(3000, 8000)); | |
501..600: wait(randomRange(1000, 2000)); | |
end; | |
end; | |
procedure bank(); | |
var | |
bankAttempts: Integer; | |
destPoint: TPoint; | |
begin | |
if (not isLoggedIn()) then | |
setUpPlayer(); | |
writeDebug('Perfoming bank procedure'); | |
if bankScreen.isOpen(500) then | |
begin | |
typesend(BANK_QUICK_BUTTON, false); | |
wait(300 + random(300)); | |
exit(); | |
end; | |
writeDebug('Searching for bank'); | |
if (minimap.findSymbol(destPoint, MM_SYMBOL_BANK, minimap.getBounds())) then | |
begin | |
writeDebug('Found bank, moving there'); | |
mouse(destPoint.offset(Point(5 + random(5), random(5))), MOUSE_LEFT, MOUSE_HUMAN); | |
wait(5500 + random(800)); | |
repeat | |
writeDebug('Attempting to open banker'); | |
bankScreen.open(BANK_NPC_BLUE); | |
wait(600 + random(700)); | |
inc(bankAttempts); | |
until (bankScreen.isOpen() or (bankAttempts > 6)); | |
if (bankAttempts > 6) then | |
writeError('Failed to open bank after 7 tries'); | |
writeDebug('Opened bank, withdrawing new inv'); | |
repeat | |
typesend(BANK_QUICK_BUTTON, false); | |
until (not bankScreen.isOpen()); | |
wait(100 + random(400)); | |
end else | |
writeError('Could not find bank minimap symbol'); | |
end; | |
procedure smith(); | |
var | |
x, y: Integer; | |
destPoint: TPoint; | |
furnaceAttempts: Integer; | |
begin | |
if (not isLoggedIn()) then | |
setUpPlayer(); | |
writeDebug('Perfoming smith procedure'); | |
writeDebug('Searching for furnace icon'); | |
if (minimap.findSymbol(destPoint, MM_SYMBOL_FURNACE, minimap.getBounds())) then | |
begin | |
writeDebug('Found furnace icon, moving there'); | |
mouse(destPoint.offset(Point(random(5), 5 + random(10))), MOUSE_LEFT, MOUSE_HUMAN); | |
wait(5000 + random(800)); | |
repeat | |
writeDebug('Attempting to open furnace'); | |
mainScreen.findObject(x, y, 1651136, 4, colorSetting(2, 0.34, 1.76), mainScreen.getCenterPoint(), 50, 25, 40, ['melt']); | |
writeDebug('Found and clicked furnace'); | |
wait(600 + random(700)); | |
inc(furnaceAttempts); | |
until (productionScreen.isOpen() or (furnaceAttempts > 9)); | |
if (furnaceAttempts > 9) then | |
writeError('Failed to open furnace after 9 tries'); | |
if (productionScreen.clickStart()) then | |
begin | |
writeDebug('Started smelting, waiting and antibanning'); | |
antiBan(); | |
wait(66000 + random(5600)); | |
incEx(barsmade, 28); | |
end; | |
end else | |
writeError('Failed to find furnace icon'); | |
end; | |
procedure proggy(); | |
var | |
time: String; | |
xpGained: Extended; | |
begin | |
clearDebug(); | |
xpGained := barsMade * 56.2; | |
writeLn('/////////////////////////////////////'); | |
writeLn('Edgeville Gold Bar Forger Version 2.0'); | |
writeLn('Bars forged: ' + tostring(barsMade) + '.'); | |
writeLn('Experience gained: ' + tostring(xpGained) + '.'); | |
writeLn('Time running: ' + toString(timeRunning()) + '.'); | |
writeLn('/////////////////////////////////////'); | |
end; | |
begin | |
clearDebug(); | |
setupSRL(); | |
addonTerminate('mouseOffClient'); | |
declarePlayers; | |
setUpPlayer(); | |
repeat | |
bank(); | |
smith(); | |
proggy(); | |
inc(tripnumber); | |
until(TRIPS_TO_DO < tripnumber); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment