Simba Code:
program ArtisanSmelter;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'Username';
password := 'password';
isActive := true;
isMember := true;
world := -0; //Leave at -0 for random world.
end
currentPlayer := 0;
end;
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~//
////////////////////////////////////////////////////////////////////////////////
///////////////////Everything below here is Script Settings!////////////////////
///////////////////Only Edit if you know what you're doing!!////////////////////
////////////////////////////////////////////////////////////////////////////////
// //
////Credit to "The Mayor" and for his work in providing a great tutorial!!!!////
// //
// //
// Contributers: meep152 for removal of tboxes / adding in color recognition //
// Contributers: MasterXehanort - will use his script for future DTM addition//
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~//
var
loadsDone: integer; XP, XPH, startingExperience: extended;
timer: TTimeMarker;
procedure withdrawIngots();
var
x, y, i: integer;
count: integer;
begin
count = 0;
if not isLoggedIn() then
exit;
writeLn ('Finding "Withdraw-Ingots" Option')
repeat
mainscreen.findObject(x, y, 8162405, 11, colorSetting(2, 0.04, 0.23),mainscreen.playerPoint,20,30,7,['ithdraw-ingots'], MOUSE_LEFT); //Find purple-ish bar to click on to pull up production screen
wait(randomRange(1300, 2000));
inc(count);
if(count > 10) then
TerminateScript(); //If script fails to find withdraw option 10 times, it will terminate
until productionScreen.isOpen;
if productionScreen.isOpen then
productionScreen.clickStart();
end;
procedure findAnvil();
var
x, y, i: integer;
count: integer;
begin
count = 0;
if not isLoggedIn() then
exit;
writeLn ('Searching for Anvil')
repeat
mainscreen.findObject(x, y, 4742750, 10, colorSetting(2, 0.39, 0.09),mainscreen.playerPoint,20,30,7,['nvil'], MOUSE_LEFT); //looks for white outline on the western edge of North Anvil
wait(randomRange(3000, 4000));
inc(count);
if(count > 10) then
TerminateScript(); //If script fails to find an anvil 10 times, it will terminate
until productionScreen.isOpen;
if productionScreen.isOpen then
begin
repeat
productionScreen.clickStart();
wait(randomRange(3000, 4000));
until not (productionScreen.isOpen);
end;
end;
procedure waitToSmith();
begin
writeLn('Waiting for progress screen to close!');
repeat
wait(7000);
until (not progressScreen.isOpen()); //Repeats 7 second wait until progress screen closes
end;
procedure depositArmour();
var
x, y : integer;
count: integer;
begin
count = 0;
repeat
mainscreen.findObject(x, y, 1118482, 2, colorSetting(0, 0, 0), mainscreen.playerPoint, 25, 15, 30, ['eposit-armour'], MOUSE_LEFT);
wait(randomRange(2000,3000));
until tabBackpack.count() < 10;
inc(LoadsDone);
inc(count);
if(count > 10) then
TerminateScript(); //Terminates script if fail to find deposit chute 10 times
end;
//Ashaman Progress Report - modified from Taric's Cosher Script
procedure progressReport();
var
ingotsSmithed, xp, XPH: integer;
begin
ClearDebug;
ingotsSmithed := (LoadsDone * 28);
XP := (ChatBox.getXPBar - Round(StartingExperience));
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
writeLn('=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-=');
writeLn('==== Artisan Smelter Conglomeration ');
writeLn('=== Time Ran: ' + timeRunning );
writeLn('== Ingots Smithed: ' + intToStr(ingotsSmithed));
writeLn('== Loads Done: ' + intToStr(loadsDone));
writeLn('=== Smithing Experience Gained: ' + intToStr(xp));
writeLn('==== Smithing Experience Per Hour: ' + intToStr(XPH));
writeLn('=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-=');
end;
begin //main loop
clearDebug(); // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers(); // Set up your username/pass
repeat
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitTreasure(); // Exit treasure hunter
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
withdrawIngots();
findAnvil();
waitToSmith();
depositArmour();
progressReport();
until(false);
end