drfreshtacular
2012-02-21 22:13:53
Simply equip your pickaxe, and start at either Shilo Village bank or gem mines.
Features
- Working banking and pin entry
- Paths to and from mine
- Customizable extensive antiban procedures
- Calculates XP/HR and PROFIT/HR
- Downloads GE pricing for all gems
- Can make upwards of 300k/HR
- Average Profit/HR is around 150-200k though ;)
This is my first script and I plan to be as active as I can in the community :)
Known Bugs
- Occasional slow banking
- Paths fail occasionally
- If Prices arent received properly comment out 'GetPrices' on line 468
Changelog
Version 1.2 - Completely re-optimized. Cleaner code. Fixed the bug that breaks the script if GE prices aren't
received. Now left clicks to seem more human like. Slightly different timing on Anti ban procedures. New
Report with a list of gem quantities. SRL stats are working a bit better (still not completely functional for
some reason. Still working on that). More reliable in general. Thanks to MasterBB for the help :).
Version 1.1 - Cleaned up a few unused variables, banking doesn't run back to mine if it fails before retrying.
Also took my username and password out of the field (Thank you Fat Cookies haha)
Version 1.0 - OG!
program ShiloGemtacular;
{.DEFINE SMART}
{.DEFINE SRL5}
{.include srl/srl.simba}
{.include sps/sps.simba}
// ------------------------------------------------------------------------ //
// _________.__ .__.__ //
// / _____/| |__ |__| | ____ Shilo Gemtacular //
// \_____ \ | | \| | | / _ \ //
// / \| Y \ | |_( <_> ) //
// /_______ /|___| /__|____/\____/ A DrFreshtacular Script //
// \/ \/ (with help from masterBB) //
// ________ __ .__ //
// / _____/ ____ ______/ |______ ____ __ __| | _____ _______ //
// / \ ____/ __ \ / \ __\__ \ _/ ___\| | \ | \__ \\_ __ \ //
// \ \_\ \ ___/| Y Y \ | / __ \\ \___| | / |__/ __ \| | \/ //
// \______ /\___ >__|_| /__| (____ /\___ >____/|____(____ /__| //
// \/ \/ \/ \/ \/ \/ //
// //
// Version: 1.2 //
// ------------------------------------------------------------------------- //
// //
// ENTER PREFERENCES BELOW //
// //
const
Trips = 10; // How many trips would you like to make before logging out?
LampXp = 'Prayer'; // What skill should XP lamps default to?
LevelOfAntiBan = 3; // (1 being a ton of antiban, 5 being hardly any)
MiniBreaks = 'Yes'; // Random 10-60 second breaks (Yes or No)
SRLStats_Username = ''; // SRL Stats username
SRLStats_Password = ''; // SRL Stats password
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from ingame username;
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Bank Pin
end;
//--------------------------------------------------------------------------//
// //
// !!! TOUCH NOTHING UNDER HERE !!! //
// (unless you're Bart...you can touch me) //
//--------------------------------------------------------------------------//
var
xph, mineXp, profit, profith, sMineXP, lMineXp, sProfit, lProfit :Integer;
bitmaps, gems, prices, sGems, lgems:Array of Integer;
gemNames:Array of String;
//--------------------------------------------------------------------------//
// GetPrices - Grabs grand exchange prices from GlowBotting //
// by ID #. Also converts diamond value to a //
// rounded yet usable integer //
//--------------------------------------------------------------------------//
procedure GetPrices;
var
url, strPrice : String;
i:Integer;
ids:Array of Integer;
begin
ids := [1625,1627,1629,1623,1621,1619,1617];
for i:=0 to high(ids) do
begin
try
url := 'http://glowbotting.x10.mx/GEPriceChecker.php?id='+IntToStr(ids[i]);
strPrice := Trim(GetPage(url));
strPrice := Replace(strPrice,'k','00');
strPrice := Replace(strPrice,'.','');
prices[i] := StrToInt(strPrice);
Writeln(gemNames[i] + ': ' + IntToStr(prices[i]));
except
Writeln('GE prices were not recieved. The server is either down or busy.');
Writeln('Using estimated prices for profit calculations.');
prices := [55,130,272,1293,2304,4562,20400];
Exit;
end;
end;
end;
//------------------------------------------------------------------------------//
// PerHourCalculations - Uses standard hourly rate formulas on profit and xp //
//------------------------------------------------------------------------------//
Procedure PerHourCalculations;
Begin
XPH := Round((MINEXP * 3600) / (GetTimeRunning / 1000));
PROFITH := Round((PROFIT * 3600) / (GetTimeRunning / 1000));
End;
//--------------------------------------------------------------------------//
// CalculateStats - Grabs the values for gems collected and //
// total profit to display in a report later //
//--------------------------------------------------------------------------//
procedure CalculateStats; //Bart: cleaned and added the arrays
var
i:Integer;
begin
profit := 0;
for i := 0 to High(gems) do
profit := profit + gems[i] * prices[i];
mineXp := 65 * SumIntegerArray(gems);
PerHourCalculations;
end;
//--------------------------------------------------------------------------//
// LoadBitmaps - Loads bitmaps for counting gems //
//--------------------------------------------------------------------------//
procedure LoadBitmaps; //Bart: This wasn't a function!
begin
setLength(bitmaps,7);
bitmaps[0]:= BitmapFromString(5, 5, 'meJwram5OKy2Nz80FooDY2KLmZiCa' + //opal
'vWVLTm0tnAtEyUVFwQkJxa1tEBSenALhAhlpZeUJ+flALgALFSFV');
bitmaps[1]:= BitmapFromString(5, 5, 'meJxLLspMLsqMzUmGoPzGUjg3IDYU' + //jade
'yAWiGRsWZFUXwLlAlFSUEZwQXtRcAUHhKdFALgC0CR/j');
bitmaps[2]:= BitmapFromString(5, 5, 'meJzzFKr3FKp3FSiHoGCRCXCuFV8a' + //topaz
'kAtEhdKH/YQ74Fwg8hCsteHLCBGZBEH2/LlALgAy/xXM');
bitmaps[3] := BitmapFromString(5, 5, 'meJzLF+JPEeCL5ecBogAe7nwhfiCa' + //sapphire
'JiGaKcgP5wJRIj9vIC93kRA/BIXx8UC4QEaaAF8cWBYA+LAMzw==');
bitmaps[4]:= BitmapFromString(5, 5, 'meJzjj+bhDYEiHg9O/mgEG4gE0vjE' + //emerald
'eoT5E3nhXCDii+Th8eYCIsEMPiDi8eOGcAGjLAsH');
bitmaps[5]:= BitmapFromString(5, 5, 'meJzjEQzj4vfl5HMDIg4eGx7BMCDi' + //ruby
'Fy/hFgiEc3lAarw5eOx4hMIhiJPXCcIFMrj5/Tj5PYBcAIFuCh8=');
bitmaps[6] := BitmapFromString(6, 6, 'meJyrrm6sRkVr127BFIGgqqp6CIJw' + //diamond
'O7smABGmCEQQTQSIAHrXPBc=');
end;
//--------------------------------------------------------------------------//
// CountGems - Goes through each slot in the inventory and compares with //
// loaded bitmaps for each gem. Then logs each gem //
//--------------------------------------------------------------------------//
procedure CountGems;
var
currentSlot : TBox;
i, j, x, y : Integer;
begin
LoadBitMaps;
For i := 1 to 28 Do
Begin
currentSlot := InvBox(i);
for j := 0 to High(gems) do
If FindBitmapToleranceIn(bitmaps[j], x, y, currentSlot.X1, currentSlot.Y1, currentSlot.X2, currentSlot.Y2, 15) then
Inc(gems[j]);
end;
CalculateStats;
for i := 0 to high(bitmaps) do
FreeBitmap(bitmaps[i]);
end;
//--------------------------------------------------------------------------//
// SubmitStats - Submits stats to SRL Stats //
//--------------------------------------------------------------------------//
procedure SubmitStats;
var
i : Integer;
begin
sMineXP := (mineXp - lMineXp);
sProfit := (profit - lProfit);
for i:=0 to High(gems) do
begin
sGems[i] := (gems[i] - lgems[i]);
end;
stats_IncVariable('Gems (Mined)', SumIntegerArray(sGems));
stats_IncVariable('Sapphires (Mined)', sgems[3]);
stats_IncVariable('Emeralds (Mined)', sgems[4]);
stats_IncVariable('Rubies (Mined)', sgems[5]);
stats_IncVariable('Diamonds (Mined)', sgems[6]);
stats_IncVariable('Mining EXP (Gained)', sMineXP);
stats_IncVariable('Profit Gained', sprofit);
Stats_Commit;
lMineXp := mineXp;
lprofit := profit;
for i:=0 to high(gems) do
begin
lgems[i] := gems[i];
end;
end;
//--------------------------------------------------------------------------//
// Searches for Random Events and sets the lamp skill value to your choice //
//--------------------------------------------------------------------------//
procedure AntiRandom;
begin
FindNormalRandoms;
LampSkill := (LampXp);
LevelUp;
end;
//--------------------------------------------------------------------------//
// Antiban - Extensive antiban procedures (calls antirandom) //
//--------------------------------------------------------------------------//
procedure Antiban;
begin
case Random(75 * LevelOfAntiBan) of
1: begin
RandomRClick;
end;
2: begin
HoverSkill('Mining', False);
end;
3: begin
PickUpMouse;
end;
4: begin
RandomMovement;
end;
5: begin
BoredHuman;
end;
6: begin
ExamineInv;
end;
7: begin
HoverSkill('random', False);
end;
end;
if (MiniBreaks = 'Yes') then
Begin
Case Random (750 * LevelOfAntiBan) Of
1: begin
Writeln('[' + TimeRunning + '] ~13 Second Mini Break');
Wait(11111 + random(2000));
end;
2: begin
Writeln('[' + TimeRunning + '] 20-30 Second Mini Break');
Wait(21212 + random(8000));
end;
3: begin
Writeln('[' + TimeRunning + '] 30-40 Second Mini Break');
Wait(32323 + random(8000));
end;
4: begin
Writeln('[' + TimeRunning + '] 45-50 Second Mini Break');
Wait(43434 + random(8000));
end;
5: begin
Writeln('[' + TimeRunning + '] 55-60 Second Mini Break');
Wait(54545 + random(8000));
end;
end;
end;
AntiRandom;
end;
//--------------------------------------------------------------------------//
// WalkToGemMine - Basic SPS path from bank to the mine //
//--------------------------------------------------------------------------//
function WalkToGemMine:Boolean;
Var
myPath:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['8_12','8_11','7_11']);
myPath := [Point(3242, 4847), Point(3241, 4833), Point(3236, 4820),
Point(3223, 4806), Point(3209, 4798), Point(3189, 4794), Point(3172, 4796),
Point(3163, 4794), Point(3163, 4782), Point(3163, 4766), Point(3156, 4743),
Point(3150, 4727), Point(3151, 4705), Point(3150, 4688), Point(3136, 4679),
Point(3132, 4668)];
SPS_WalkPath(myPath);
Result := True;
end;
//--------------------------------------------------------------------------//
// WalkToBank - Basic SPS path from the mine to bank //
//--------------------------------------------------------------------------//
function WalkToBank:boolean;
Var
myPath:TPointArray;
begin
Writeln('[' + TimeRunning + '] Walking to Bank');
SPS_Setup(RUNESCAPE_SURFACE,['7_11','8_11','8_12']);
myPath := [Point(3141, 4674), Point(3133, 4681), Point(3123, 4685),
Point(3135, 4694), Point(3151, 4711), Point(3156, 4761), Point(3165, 4762),
Point(3159, 4765), Point(3166, 4769), Point(3162, 4788), Point(3190, 4792),
Point(3196, 4795), Point(3200, 4799), Point(3204, 4794), Point(3219, 4795),
Point(3226, 4807), Point(3234, 4820), Point(3242, 4833), Point(3244, 4850),
Point(3248, 4857)];
SPS_WalkPath(myPath);
end;
//--------------------------------------------------------------------------//
// Mining - Checks to see if player is currently mining //
//--------------------------------------------------------------------------//
Function Mining: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 550);
end;
//--------------------------------------------------------------------------//
// BankGems - Walks to the bank, searches for banker, enters PIN if needed //
// deposits all gems, Walks back to gem mine. Failsafes include //
// checking for pinscreen multiple times, checking to see if //
// inventory is still full at the end and repeating if so. //
// MILDY BUGGY as of V0.1 //
//--------------------------------------------------------------------------//
function BankGems: boolean;
var
x, y : Integer;
foundBanker : boolean;
begin
Result := false;
Antiban;
WalktoBank;
repeat
MakeCompass('rand');
Writeln('[' + TimeRunning + '] Searching For Banker...');
if FindObj(x, y, 'anker', 16445433, 30) then
begin
MMouse(x, y, 5, 5);
if isUpText('anker') then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('ank Banker');
Wait(800+random(500));
foundBanker := true;
Wait(800+random(200));
DepositAll;
Wait(600+random(300));
CloseBank;
end;
if (PinScreen) or (BankScreen) then
begin
wait(500+random(200));
if PinScreen then
begin
Writeln('[' + TimeRunning + '] Entering Pin.');
InPin(Players[CurrentPlayer].Pin);
end;
Wait(800+random(200));
DepositAll;
Wait(600+random(400));
CloseBank;
if (InvFull) then
BankGems
else
Result := True;
Writeln('[' + TimeRunning + '] Banking Complete.');
end;
end;
wait(800+random(200));
until foundBanker;
Writeln('[' + TimeRunning + '] Walking to Gem Mine.');
WalkToGemMine;
end;
//--------------------------------------------------------------------------//
// Report - Simple ASCII report to track progress //
//--------------------------------------------------------------------------//
procedure Report;
var
i:Integer;
begin
Writeln('|---------------------------------------------------------------|');
Writeln('| SHILO GEMTACULAR V1.2 REPORT | (' + TimeRunning + ') |');
Writeln('|---------------------------------------------------------------|');
Writeln('| Mining XP: ' + IntToStr(mineXP) + ' ' + SRLStats_Username);
Writeln('| Mining XP/HR: ' + IntToStr(xph));
Writeln('| Total Profit: ' + IntToStr(profit));
Writeln('| Profit/HR: ' + IntToStr(profith));
Writeln('|---------------------------------------------------------------|');
Writeln('| OTHER INFO |');
Writeln('|---------------------------------------------------------------| ');
Writeln('| Gem | Profit |');
Writeln('|---------------------------------------------------------------| ');
for i := 0 to High(gems) do
begin
Writeln('| ' + gemNames[i] + ' ' + IntToStr(gems[i]) + ' ' + IntToStr(gems[i] * prices[i]));
end;
Writeln('|---------------------------------------------------------------| ');
SubmitStats;
Writeln('Stats were commited!');
end;
function SearchAndClickGems:Boolean;
var
x, y : integer;
begin
if (FindObj(x, y, 'ine', 13578450, 30)) or (FindObj(x, y, 'ine', 6364771, 30)) then
begin
Mouse(x, y, 6, 6, true);
Writeln('[' + TimeRunning + '] Mining gem.');
end;
end;
//--------------------------------------------------------------------------//
// MineGems - If inventory isnt full, and not currently mining, searches //
// for gems, mines them using left and right clicks randomly //
//--------------------------------------------------------------------------//
procedure MineGems;
begin
if not (InvFull) then
begin
WalkToGemMine;
Writeln('[' + TimeRunning + '] Arrived at mine. Searching for gems.');
repeat;
Antiban;
while (Mining) do
begin
Wait(10);
end;
SearchAndClickGems;
Wait(200+random(200));
until(InvFull);
CountGems;
Report;
BankGems;
end;
end;
//--------------------------------------------------------------------------//
// Loop - Main loop of the script //
//--------------------------------------------------------------------------//
procedure Loop;
var
i : Integer;
begin
for i := 0 to Trips do
begin
AntiBan;
if (InvFull) then
BankGems
else
MineGems;
end;
end;
//--------------------------------------------------------------------------//
// StartRunescape - Starts runescape with typical client settings //
//--------------------------------------------------------------------------//
procedure StartRunescape;
begin
Smart_Server := 53;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
MouseSpeed := 10;
SetupSRLStats(789, SRLStats_Username, SRLStats_Password);
ClearDebug;
DeclarePlayers;
setLength(prices,7);
setLength(gems,7);
setLength(sGems,7);
setLength(lgems,7);
gemNames := ['opal','jade','red topaz','sapphire','emerald','ruby','diamond'];
end;
begin
StartRunescape;
GetPrices;
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
Loop;
CountGems;
Report;
end.
Fat Cookies (2-22-12)
|----------------------------------------------------------------------------------------|
| SHILO GEMTACULAR V1.0 REPORT | (3 Hours, 41 Minutes and 43 Seconds) |
|----------------------------------------------------------------------------------------|
| Mining XP | Mining XP/Hour | Total Profit | Gold/Hour |
|----------------------------------------------------------------------------------------|
| 47320 12805 623505 154126 |
|----------------------------------------------------------------------------------------|