PDA

View Full Version : [Smithing] [SRL-6] Lemonstars Lummy Smelter



Lemon star
05-15-2016, 07:30 PM
http://vignette3.wikia.nocookie.net/runescape2/images/8/84/Smithing.png/revision/latest?cb=20120119045447Lemonstar's Lummy Smelter, V 2.94

Features
Start anywhere 100% Color Antiban Failsafes Breaking Coal bag support Presets with the ability to customize them Item DTM Look for moderators SRL Player forms Progress report Auto update - Thanks to Ashaman88

Instructions
Make sure your graphics/interface settings follow this guide (https://villavu.com/forum/showthread.php?t=47714). Setup your preset with ore to smelt Setup in-game character to work with srl6, (SRL --> Player Manager) Add bar-type at line 37 Run the script

Make sure to babysit this script atm because it does not have a check for out of ores. Replaced by failsafe.
Upcoming features in 3.0

More bank locations Bars price support Customization like, break times, anti ban rate etc Whatever you guys suggest:) More fail safes


1.0

release

2.0

-Breaking support
-Coalbag
-More failsafes

2.6

- Breaking time support
- Look for moderators
- BarTypes, will now calculate how many bars you make per hour.* It will count the DTM's depending on barType.

2.7

-Updated the DTMs as they got outdated
-Added ore DTMs to check when to quit the 'makeBars procedure'
-Xp per hour

2.9
-Updated the DTMs once again
-Better breaking
-Will check if it's out of ore before going to bank
-Auto update to the script
-Deleted useless things

2.94
-Added tolerance when walking to the smith and the bank
-Added option to choose chance of clicking make bars/pressing space bar
-Cleaned up a lot of code example being wait(gaussrangeint(4000,4200)); made to wait(gaussrangeint(4000, 4200));
-Started to work on AD-HD mode;D

acow
05-15-2016, 07:36 PM
Features
Failsafes Failsafes

wow so many failsafes (and antiban) you had to list em twice, this better be as flawless as you said it is on skype.

Lemon star
05-15-2016, 07:39 PM
wow so many failsafes (and antiban) you had to list em twice, this better be as flawless as you said it is on skype.

Oh, edited topic. thanks

EDIT: updated main thread as it had my email in it. silly me

Laquisha
05-15-2016, 09:26 PM
Nice script Lemon star ;)

I took a look through, and I have some suggestions:


Is there a reason why you use your own bitmaps for the minimap symbols? Can't you use the ones in SRL-6, for example:


if minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) then // etc.


I notice you manually sendkeys for the bank preset buttons. Using the built-in method has a number of advantages, such as returning true when bank closes, and using the mouse as a back-up:


if bankscreen.open(BANK_CHEST_LUMBRIDGE) then
if bankScreen.clickButton(BANK_BUTTON_PRESET_1) then // Returns true if bank closes
begin
writeln('Successfully completed banking');
// etc.
end else
failCount += 1;


When waiting for an interface to open, like this:


repeat
wait(gaussrangeint(50,333));//waits until productionscreen is open. If you lagg this is great.
until (productionScreen.isOpen = true);


You can use the timer option applicable to all .isOpen() methods:


if productionScreen.isOpen(5000) then // Waits up to 5s for it to open
begin
// etc.
end;


Also:


keyDown(32);
repeat
wait(gaussrangeint(333,999));
writeln('waiting until production screen is gone');
until productionScreen.isOpen = false;
keyUp(32);


Can be replaced by:


if productionScreen.clickStart() then // etc.


As this returns true when the screen closes, and uses the mouse as a backup (similar to the bank buttons).

Last one, there is no need to check open tabs before opening them:


if (not gameTabs.isTabActive(TAB_BACKPACK)) then
gameTabs.openTab(TAB_BACKPACK);


As the first thing gameTab.openTab(...) does is check to see whether it's already the active tab (also same thing for minimap.toggleRun)

Lemon star
05-17-2016, 08:48 PM
Updated to 2.0, New updates are.

-Breaking support
-Coalbag
-More failsafes

In 3.0 we will be adding a lot

I took a look through, and I have some suggestions:


Nice script Lemon star ;)

Is there a reason why you use your own bitmaps for the minimap symbols? Can't you use the ones in SRL-6, for example:


if minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) then // etc.


I notice you manually sendkeys for the bank preset buttons. Using the built-in method has a number of advantages, such as returning true when bank closes, and using the mouse as a back-up:


if bankscreen.open(BANK_CHEST_LUMBRIDGE) then
if bankScreen.clickButton(BANK_BUTTON_PRESET_1) then // Returns true if bank closes
begin
writeln('Successfully completed banking');
// etc.
end else
failCount += 1;


When waiting for an interface to open, like this:


repeat
wait(gaussrangeint(50,333));//waits until productionscreen is open. If you lagg this is great.
until (productionScreen.isOpen = true);


You can use the timer option applicable to all .isOpen() methods:


if productionScreen.isOpen(5000) then // Waits up to 5s for it to open
begin
// etc.
end;


Also:


keyDown(32);
repeat
wait(gaussrangeint(333,999));
writeln('waiting until production screen is gone');
until productionScreen.isOpen = false;
keyUp(32);


Can be replaced by:


if productionScreen.clickStart() then // etc.


As this returns true when the screen closes, and uses the mouse as a backup (similar to the bank buttons).

Last one, there is no need to check open tabs before opening them:


if (not gameTabs.isTabActive(TAB_BACKPACK)) then
gameTabs.openTab(TAB_BACKPACK);


As the first thing gameTab.openTab(...) does is check to see whether it's already the active tab (also same thing for minimap.toggleRun)


I will take your suggestions in on the next update

Lemon star
05-25-2016, 06:10 PM
Updated to 2.6, New updates are

- Breaking time support
- Look for moderators
- BarTypes, will now calculate how many bars you make per hour.* It will count the DTM's depending on barType.

var barTypexp will be used in 3.0

Those are the main features.

scob
05-25-2016, 06:51 PM
Nice script, gratz on release :D

Lemon star
05-27-2016, 05:42 PM
Nice script, gratz on release :D

Thanks,

Updated to 2,7

-Updated the DTMs as they got outdated
-Added ore DTMs to check when to quit the makeBars procedure
-Xp per hour

My plans was to make everything look nicer and delete useless things but the DTMs got updated so I had to release this:P
Anyways next time ill delete useless vars, fix the failsafes and go through everything.

Heres the very first short proggy:

__________________________________________________ _______________
_________________________PROGRESS REPORT_________________________
138 Bars made in 7 Minutes and 57 Seconds
1040 Bars per hour
963 XP Gained(7255)
__________________________________________________ _______________

Feel free to report anything if something isn't right.

Lemon star
06-04-2016, 08:03 AM
Updated to 2,9

-Updated the DTMs once again
-Better breaking
-Will check if it's out of ore before going to bank
-Auto update to the script
-Deleted useless things

Thanks to all 28 people who have downloaded this!

GTFO_Jagex
06-16-2016, 08:36 PM
not sur why it keeps clicking on the minimap and never reaches the bank

Lemon star
06-16-2016, 09:10 PM
not sur why it keeps clicking on the minimap and never reaches the bank

What do you mean with 'never reaches bank'. I'm not sure whats wrong, it works just fine for me.
Make sure to have the default botting settings


https://www.youtube.com/watch?v=l-DJIjOgY3E&feature=youtu.be

EDIT: Updated

Lemon star
06-16-2016, 09:17 PM
Ops, refreshed the page and it posted 2 times, Sorry!

GTFO_Jagex
06-18-2016, 08:06 AM
What do you mean with 'never reaches bank'. I'm not sure whats wrong, it works just fine for me.
Make sure to have the default botting settings


https://www.youtube.com/watch?v=l-DJIjOgY3E&feature=youtu.be

EDIT: Updated
well this is my settings http://imgur.com/a/sb5q2
i think the bot cannot find the bank symbol for me

Lemon star
06-18-2016, 12:57 PM
well this is my settings http://imgur.com/a/sb5q2
i think the bot cannot find the bank symbol for me

I tried all your settings. DirectX and openGL. It still works for me.
I sent you a message:)

meagainstyou
06-25-2016, 11:03 PM
Yeah my dude also can't find bank. Takes off and keeps going north. Not sure how to fix.

Lemon star
06-29-2016, 05:13 AM
Yeah my dude also can't find bank. Takes off and keeps going north. Not sure how to fix.

Updated the script to 2.94 and added tolerance to the smith and the bank bitmaps. Let me know if it's working:)


yes it working now :D
Confirmed working

heggs
06-29-2016, 06:41 AM
Using this, super smooth dude!

siimiks
07-15-2016, 05:45 AM
So this is my experience:
I really couldn't figure out how it would use my coal bag. So I gave up on that(Maybe I just can't read or something, dunno).

At some point it just ran north and stopped and just stood there - the script ended. So far this has happened twice. Will update accordingly.

Had to set mouse click rate % to 100 because it would get the ore, run to the furnace and be stuck at the "Smelt" prompt. Guess it presses space too early? I don't really know, scripts are like rocket science to me.

Also just noticed my guy runs north of the smelting building(just outside the building, not far). But not always. Just an odd detour.

"nothing happend for 80 secounds (probably out of ores), terminating script." - Just didn't press "Smelt", ores were in inventory.

Lemon star
07-16-2016, 10:38 AM
So this is my experience:
I really couldn't figure out how it would use my coal bag. So I gave up on that(Maybe I just can't read or something, dunno).

At some point it just ran north and stopped and just stood there - the script ended. So far this has happened twice. Will update accordingly.

Had to set mouse click rate % to 100 because it would get the ore, run to the furnace and be stuck at the "Smelt" prompt. Guess it presses space too early? I don't really know, scripts are like rocket science to me.

Also just noticed my guy runs north of the smelting building(just outside the building, not far). But not always. Just an odd detour.

"nothing happend for 80 secounds (probably out of ores), terminating script." - Just didn't press "Smelt", ores were in inventory.


Hey, thanks for your 'review'.

The coalbag is suppost to be in the 27nd slot in your inventory.

I added tolerance to the symbols so I'm not sure why it's running off. I will add some kind of fail safe here in the future. It could restart the script, teleport to the load stone and walk to the bank again.

About the mouse click rate. I haven't updated this script in a while even though I have an update on my end. You said that the script is running outside the building. That's due to the random mouse click. I could change it if you want. With this update the script should press smelt no matter what.
{
Instructions:
• This is a 600 line script, so treat it well

• Setup your preset with ore to smelt
• Setup in-game character to work with srl6, (SRL --> Player Manager). More information on Villavu forms.
• Select what bartype you would like to use at line 36 (optional).
• Run Lemons Script
• Best of luck from @Lemonstar
}

program LemonStarsBarMaker;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
{$i SPS/lib/SPS-RS3.Simba}

var
runTime, breakTime, barTypeXp, barDTM, defaultXp, playerModBMP,
jagexModBMP, bankSymbol, smithSymbol, oreDTM, mouseClickRate: Integer;
myTotalTimeRunning, failSafeTimer, breakTimer: TTimeMarker;
coalBag, breakOption, lookForMods, smartPaint, startAnywhere: Boolean;
presetKey: String;

const

RUNITE = 1;
ADAMANITE = 2;
MITHRIL = 3;
STEEL = 4;
IRON = 5;
GOLD = 6;
SILVER = 7;
BRONZE = 8;

barType = GOLD;

SCRIPT_VERSION = '2.95';

{--- Your done filling things out here ---
Stop here unless you know what you are doing}

// CREDIT: This is Claritys way of making the code look nice and easy to find.
// Not sure if I should credit this or not, anyways nice work!

//EXAMPLE:
{PROCEDURE --
Purpose:
Comments: }


procedure declarePlayers();
var
i: Integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]);
integers[1] := strToInt(playerForm.players[i].settings[1]);
integers[2] := strToInt(playerForm.players[i].settings[2]);
integers[3] := strToInt(playerForm.players[i].settings[3]);

booleans[0] := strToBool(playerForm.players[i].settings[4]);
booleans[1] := strToBool(playerForm.players[i].settings[5]);
booleans[2] := strToBool(playerForm.players[i].settings[6]);
booleans[3] := strToBool(playerForm.players[i].settings[7]);
booleans[4] := strToBool(playerForm.players[i].settings[8]);

strings[0] := playerForm.players[i].settings[9];

world := integers[0];
runTime := integers[1];
breakTime := integers[2];
mouseClickRate := integers[3];
coalBag := booleans[0];
breakOption := booleans[1];
lookForMods := booleans[2];
smartPaint := booleans[3];
startAnywhere := booleans[4];
case strings[0] of
'Preset 1': presetKey := '1';
'Preset 2': presetKey := '2';
end;
players[i].isActive := true;
writeLn('Logging in...');
end;
begin
if (not players[currentPlayer].login()) then
exit;
writeLn('Just logged in, waiting a bit...');
wait(randomRange(3000, 5000));
exitTreasure();
writeLn('Setup complete - player is logged in.');
end;
end;

procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Lemonstar''s Lumby smithy 2.95';
scriptHelpThread := 'https://villavu.com/forum/showthread.php?t=116193';

editBoxLabels := ['World', 'Run Timer', 'Min Break In', 'Mouse click rate %'];
editBoxDefaults := ['-1', '240', '240', '5'];
editBoxHints := ['Enter your favorite world, -1 is random best connection world.',
'How long do you want to run this script for (In minutes)? Default is 240 minutes',
'In how many minutes would you like to break?',
'Type in %. This is how big of a chance it would click Make Bars intead of pressing spacebar'];

checkBoxLabels := ['Use CoalBag','Use Breaking', 'Look For Mods', 'Show Smart Paint', 'Start anywhere'];
checkBoxDefaults := ['False', 'True', 'True', 'True'];

checkBoxHints := ['Do you want to use a coalbag during your adventures? Notice that your coalbag must be in your 27nd inventory slot',
'Do you want to take breaks?',
'Do you want the script to keep an eye out for moderators?',
'Show smart paint, THIS IS FOR THE FUTURE. This has no meaning atm.',
'Start anywhere? This will teleport you to lumbridge and walk to the bank.'];

comboBoxLabels := ['Bank Preset'];
comboBoxDefaults := ['Preset 1'];

setLength(comboBoxItems, length(comboBoxLabels));
comboBoxItems[0] := ['Preset 1', 'Preset 2'];
end;
end;

{PROCEDURE -- autoUpdateMe
Purpose: Autoupdates Script.
Comments:
By: Shuttleu
Edited By: Ashaman88.}
procedure autoUpdateMe;
var
Neifile: Integer;
OnlineVersion, NewScript, NeiFeilNennen: String;
begin
writeln('Checking for script updates...');
OnlineVersion := GetPage('http://pastebin.com/raw/fQFZRLGG');
writeln('Online Version: '+ToStr(OnlineVersion));
writeln('Local Version: '+ToStr(SCRIPT_VERSION));
if (trim(OnlineVersion) > SCRIPT_VERSION) then
begin
writeLn('Newer script version online!');
writeLn('Autoupdating to newer version.');
NewScript := GetPage('http://pastebin.com/raw/ZNbrD48c');
NeiFeilNennen := ScriptPath+ 'Lemonstars Lumby Smither V'+OnlineVersion+'.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
WriteLn('Fatal error writing to '+NeiFeilNennen+'!!');
Terminatescript;
end;
end;
CloseFile(Neifile);
writeLn('New script downloaded to '+NeiFeilNennen+'!! Please use this one!!');
terminateScript;
end else
writeLn('You have the latest version of the script!');
end;

{PROCEDURE -- loadMemory
Purpose: Loads our memory.
Comments: None.}
procedure loadMemory;
begin
oreDTM := DTMFromString('mggAAAHicY2NgYDBlhWAPKK0NxJpAzMTEwM AJxF8ZGRjeAPE3IP4PxAEOukBdTBj4PwN2wIgDQwAAauAHFQ== ');

playerModBMP := BitmapFromString (11, 6, 'meJy7e+XK/GnTcKHJXV13CSkQFeSAqGFkYAAiZAZQVlVeUJSfHa4AjQQq4Od i4uNkxKNAiJdNiIcZyMCF5KQEABnjWTQ=');
jagexModBMP := BitmapFromString (10, 7, 'meJzj+/9RY9lJZSmerv8/+f5/hCCgiIIYJ1AEWRAT4ZeVFmKBKGBkYAAiZAayjXApOAmURdaLKQ vUCyRxIQCH7WsV');
bankSymbol := BitmapFromString(7, 7, 'meJwBkwBs/wYVNB9ylCynzCy13B5v' +
'kAkgPwQLKyOGrDO64y+w2i613jG23yugyQwoSC6r1SqZxBBPc RmYw' +
'hphhR1rkQYTMy+v3iiTvhFFZimmzwUPLgcVNQQLKyqZyTO78C mk1B' +
'WRvAQPLwUMLAcOLw4lSiuYxjK58jW++C+u3xM2XAkSNQkQMwg SMRm' +
'GsiOFsjSy7y2e0w8qUBF9Nis=');
smithSymbol := BitmapFromString(7, 7, 'meJwriPKTkxJjZ2dDRpb6mlxcnGjI' +
'Qk9j+7qVOzesBqJdMGShq54SF9VWW75w+oRlc6YC0dJZk22Nt EVFR' +
'XQ01QszU+ZO6pk9obOzvsLOWFdERBiIvNycpna1tFSXWJoZ25 voSU' +
'tJqSkrFeWk97TUNJQXeLk4AgCrLy34');
end;

{PROCEDURE -- failSafeProcedure
Purpose: Checks if its time for failsafes, will be used more in the future(i have plans heheh).
Comments: None.}
procedure failSafeProcedure();
begin
if (failSafeTimer.getTime > 80000) then
begin
writeln('nothing happend for 80 secounds (probably out of ores), terminating script.');
terminateScript;
end;
end;

{PROCEDURE -- barTypeDTM
Purpose: Sets the right barDTM for the bar that you are using, depending on what bar you took in the setup.
Comments: None.}
function barTypeDTM : integer;
begin
case(barType) of
1: barDTM := DTMFromString('mbQAAAHicY2VgYHjOysDwAohfAfEtIP4KxH MYGRjWAfFMIF4MxPOB2NrdB6iaCQVLMmACRiwYDADw3gjF');
2: barDTM := DTMFromString('mbQAAAHicY2VgYOhlY2BwAGJ9ILYCYncgvs bIwMDKxMDwF0h/AuKvQGzpZAlUzYSCRRgwASMWDAYA8JYGOw==');
3: barDTM := DTMFromString('mbQAAAHicY2VgYMhgY2BwAGJ9ILYCYncgvs jIwMDKxMDwF0h/AuKvQGxq6gdUzYSCuRgwASMWDAYA3uUGCw==');
4: barDTM := DTMFromString('mbQAAAHicY2VgYBBiY2BwAGJ9ILYCYncg/sbIwMDKxMDwF0h/AuKvQJySkABUzYSCJRkwASMWDAYA5agGVQ==');
5: barDTM := DTMFromString('mbQAAAHicY2VgYBBkY2BwAGJ9ILYCYncgvs rIwMDKxMDwF0h/AuKvQOxkbw9UzYSC+RkwASMWDAYAv4cFxQ==');
6: barDTM := DTMFromString('mggAAAHicY2NgYIhjZWCIBeJMIE4C4ggg9g diBiYGBkEgZgPiP4wMDP+AmB3IXtQoDpFEw0YM2AEjDgwBADdD BfA=');
7: barDTM := DTMFromString('mbQAAAHicY2VgYLBhY2BwAGJ9ILYCYncg/sHIwMDKxMDwF0h/AuKvQNzU1AFUzYSC5RgwASMWDAYAEnIG7g==');
8: barDTM := DTMFromString('mbQAAAHicY2VgYHjJysDwCYg/APFjIH4KxJcYGRhuA/F5IL4IxI+A2FZPGqiaCQVrMGACRiwYDAA2GAmh');
else
writeLn('Invalid choice of bars.');
end;
end;

{PROCEDURE -- initPlayer
Purpose: Makes sure everything is setup.
Comments: None.}
procedure initPlayer();
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

mainScreen.setAngle(MS_ANGLE_HIGH);
writeLn('Setting run.');
if not (minimap.isRunEnabled()) then
minimap.toggleRun(true);
writeLn('Setting gametab.');
if (not gameTabs.isTabActive(TAB_BACKPACK)) then
gameTabs.openTab(TAB_BACKPACK);
writeLn('Clicking compass.');
minimap.clickCompass;
myTotalTimeRunning.start;
defaultXp := chatBox.getXPBar;
end;

{PROCEDURE -- progressReport
Purpose: Shows a report over your progress.
Comments: None.}
procedure progressReport();
var
xpCounter, madePerHour, xpPerHour, hourTime, amount :Integer;
begin
amount := (amount + tabBackpack.countDTM(barDTM));
xpCounter := (chatBox.getXPBar - defaultXp);
madePerHour := round(amount/myTotalTimeRunning.getTime*3600000);
xpPerHour := round(xpCounter/myTotalTimeRunning.getTime*3600000);

writeln('_________________________________________ ________________________');
writeln('_________________________PROGRESS REPORT_________________________');
writeln(amount, ' Bars made in ', msToTime(myTotalTimeRunning.getTime, TIME_FORMAL));
writeln(madePerHour, ' Bars per hour');
writeln(xpCounter,' XP gained(Per hour:',xpPerHour, ')');
writeln('_________________________________________ ________________________');

if smartPaint then
begin
//for the future, not.
end;
end;

{PROCEDURE -- takeABreak
Purpose: Checks if it's time for break, if so it will afk.
Comments: Figured ill make my own breaking procedure, so I did!}
procedure takeABreak();
var
I, breakTimeTimer: Integer;
breakDuration: TTimeMarker;
begin
I := Random(250);
case I Of
1..50: breakTimeTimer = I * Random(3420, 3660);
51..150: breakTimeTimer = I * Random(420, 660);
151..250: breakTimeTimer = I * Random(220, 260);
end;

begin
players[currentPlayer].exitToLobby();
breakDuration.start();
writeln('We are taking a lovely break');
end;

repeat
wait(gaussRangeInt(20000, 30000));
until breakDuration.getTime() > breakTimeTimer;
end;

{PROCEDURE -- antiBan
Purpose: The more random antibans.
Comments: None.}
procedure antiBan;
var
I: Integer;
begin
I := Random(500);
case I Of
1..7:
begin
hoverSkill(SKILL_SMITHING);
Wait(GaussRangeInt(1000, 6500));
TabBackpack.Open;
end;
8..20: mouseMovingObject;
21..100: SleepAndMoveMouse(GaussRangeInt(150, 1500));
101..200: Wait(GaussRangeInt(0, 750));
201..495: mouseOffClient(OFF_CLIENT_RANDOM);
496..500:
begin
hoverSkill(SKILL_SMITHING);
Wait(GaussRangeInt(1000, 6500));
if (breakTimer.getTime() > breakTime * 60000) and breakOption then
takeABreak;
end;
end;
end;

{PROCEDURE -- walkToBank
Purpose: Walks to the bank and reset failsafecount.
Comments: Claritys, edited by LemonStar}
procedure walkToBank;
var
x, y: Integer;
walkPoint: TPoint;
p: TPoint;
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

writeln('Walking to the bank.');
repeat
if findBitmapToleranceIn(BankSymbol, x, y, minimap.getBounds(), 30) then break;
walkPoint := Point(minimap.cx - 35 + random(-7, 7), minimap.cy + -70 + random(-7, 7));
mouse(walkPoint, MOUSE_MOVE, MOUSE_HUMAN);
fastClick(MOUSE_LEFT);
wait(gaussRangeInt(500, 800));
minimap.waitPlayerMoving();
until findBitmapToleranceIn(BankSymbol, x, y, minimap.getBounds(), 30);
mouse(point(x + random(-7, 7), y + 5 + random(-2, 7)), MOUSE_MOVE, MOUSE_HUMAN);
fastClick(MOUSE_LEFT);
wait(gaussRangeInt(300, 400));
minimap.waitPlayerMoving();
end;

{PROCEDURE -- walkToSmith
Purpose: walks to the furness.
Comments: None}
procedure walkToSmith;
var
x, y: Integer;
walkPoint: TPoint;
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

writeln('Walking to the smelter.');
findBitmapToleranceIn(SmithSymbol, x, y, minimap.getBounds(), 20);
mouse(point(x + random(-3, 5), y + 10 + random(-1, 5)), MOUSE_MOVE, MOUSE_HUMAN);
fastClick(MOUSE_LEFT);
wait(gaussRangeInt(500, 700));
minimap.waitPlayerMoving();
end;

{PROCEDURE -- teleportToBank
Purpose: Teleports and calls function WalktoBank if failsafes from bank chest.
Comments: None}
procedure teleportToBank ();
begin
if lodestoneScreen.teleportTo(LOCATION_LUMBRIDGE) then
begin
wait(gaussrangeint(950, 1060));
MouseOffClient(Random(4));
wait(gaussrangeint(15000, 16000));
end else
begin
writeln('Script terminating, failed to teleport. Probably due to heavy lag.');
terminateScript;
end;
end;

{PROCEDURE -- doBanking
Purpose: Opens bank and takes out resources.
Comments: Credit to @Sin for coalbag code}
procedure doBanking();
var
failCount: Integer;
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

wait(gaussrangeint(1000, 2000));
progressReport;
repeat
bankscreen.open(11);
writeln('Trying to open bank.');
failCount + 1;
until bankscreen.isopen(1000) or failCount = 4;
if failcount = 4 then
begin
writeln('Failed to open bank, color.');
terminateScript;
end;

if bankscreen.isOpen and coalBag = false then
begin
writeln('Bank screen is open.');
repeat
typeSend(presetKey, false);
wait(gaussrangeint(300, 1200));
until bankscreen.isOpen = false;
end else
begin
writeln('Bank screen is open, filling up coalbag.');
repeat //start of credit
MouseBox(bankScreen.getPackSlotBox(27), MOUSE_RIGHT);
chooseOption.select(['Fill C', 'l C'], 500);
mouseBox(IntToBox(589,401,614,421) , MOUSE_move);//end of credit
typeSend(presetKey, false);
wait(gaussrangeint(300, 1200));
until bankscreen.isOpen = false;
end;
writeln('done banking, closing bank');
failCount = 0;
end;

{PROCEDURE -- findSmelter
Purpose: Finds the smelter and clicks it.
Comments: Credit to shield, I made my own but I might aswell use this. Had to change colors though.}
procedure findSmelter();
var
x,y,i : Integer;
bTPA, ladTPA : TPointArray;
ladATPA : T2DPointArray;
furnessTPoint : TPoint;
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

findColorsSpiralTolerance(x, y, bTPA, 1122239, mainScreen.getBounds(), 3, colorSetting(2, 0.07, 0.27));
if (Length(bTPA) < 1) then //makes sure that you are clicking the furness
begin
writeLn('Failed to find furnace colors, please report this');
exit;
end;
furnessTPoint := middleTPA(bTPA);
findColorsSpiralTolerance(x,y, ladTPA, 1254843, mainScreen.getBounds(), 5, colorSetting(2, 0.29, 1.46));
if (Length(ladTPA) < 1) then
begin
writeLn('Failed to find furnace colors, please report this');
exit;
end;
ladATPA := ladTPA.toATPA(25,30);
ladATPA.sortFromMidPoint(furnessTPoint);

for i := 0 to high(ladATPA) do
begin
mouse(middleTPA(ladATPA[i]), MOUSE_MOVE);
if isMouseOverText(['melt']) then
begin
writeLn('Found colors, clicking furnace!');
fastClick(MOUSE_LEFT);
wait(gaussrangeint(4000, 4200));
exit;
end;
end;
end;

{PROCEDURE -- makeBars
Purpose: Make the bars and waits.
Comments: None}
procedure makeBars();
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

if mouseClickRate >= random(100) then
begin
writeLn('Clicking!');
wait(gaussRangeInt(300, 700));
productionScreen.clickStart(false);//space: boolean = false
end else
begin
writeLn('space baring!');
productionScreen.clickStart();
end;

failSafeTimer.start;
repeat
writeln('Waiting until interface is gone');
wait(gaussRangeInt(2000, 4000));// not spamming writeln
until productionScreen.isOpen = false or (failSafeTimer.getTime > 80000);
writeln('Interface is gone');
failSafeProcedure;
antiBan;

repeat
wait(gaussRangeInt(3000, 5000));
failSafeProcedure;
until (tabBackpack.countDTM(oreDTM)) = false;// waits until done
end;

{PROCEDURE -- findMod
Purpose: Looks in chat for mod crown.
Comments: Credits to Justin for this!}
procedure findMod();
var
x, y: Integer;
begin
if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;
end;

if (findBitmapToleranceIn(playerModBMP, x, y, IntToBox(1, 508, 604, 590), 50)) or (findBitmapToleranceIn(jagexModBMP, x, y, IntToBox(1, 508, 604, 590), 50)) then
begin
writeln('Jagex/Player mod found, hopping');
takeScreenshot(ToStr(random(10000)) + '_mod.png');
players[currentPlayer].exitToLobby();

lobbyWorlds.selectRandomWorld(true);
players[currentPlayer].login();
sleep(randomRange(2458, 5497));
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
exitTreasure();
end;
end;

{PROCEDURE -- freeMemory
Purpose: Makes sure we don't get any memory leaks.
Comments: None}
procedure freeMemory;
begin
FreeBitmap(jagexModBMP);
FreeBitmap(PlayerModBMP);
FreeBitmap(bankSymbol);
FreeBitmap(smithSymbol);

FreeDTM(barDTM); //good thing about this is that it frees the barDTM on the current bar, not all of them, no need.
FreeDTM(oreDTM);
end;

{PROCEDURE -- mainLoop
Purpose: Loop procedures.
Comments: None}
procedure mainLoop;
begin
walkToBank();
doBanking();
walkToSmith();
findSmelter();
makeBars();
if lookForMods then
findMod();
end;

begin
autoUpdateMe;
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
exit;

loadMemory();
addOnTerminate('freeMemory');
setupSRL();
declarePlayers();
InitPlayer();
breakTimer.start;
if startAnywhere then
teleportToBank;
repeat
if not isLoggedIn() then
begin
DeclarePlayers();
InitPlayer();
end;
mainLoop();
writeln(myTotalTimeRunning.getTime);
until myTotalTimeRunning.getTime() > (runTime * 60000);//60000 is one minute, run time in minutes
end.
Thanks

plinkus
08-09-2016, 01:12 AM
I've been using this script for a while and I keep running into the same issues. After about 45 minutes or so I will usually end up running north while it writes "walking to bank". Usually it stops around the Draynor Manor but a few times I've gone all the way to Edgeville and been stopped by the wilderness ditch. All it says is "waiting while the player is moving." I can't see any reason in the code that it would do this, but it does it whenever I leave it on for an extended period of time.

I also have my click rate at 100% but I'm not sure if it's helping or not. I tried the code you pasted in above and it didn't work at all. It just sat at the Smelt interface and never clicked. I changed the click rate to 100 because it would time out at the smelting interface sometimes. Once it a while it will still time out. It just spams "Waiting until the interface is gone" and eventually it'll stop after 80 seconds. This does not happen as often as the running away to the north bug. Once in a while I'll also get a "Error, gaussian (156, -18) failed" while the smelt interface is open. It usually seems to correct itself and click smelt though. Just some things I've noticed from using it. I'd like to use it more but since it times out so often I really can't without babysitting it.

panpetter111
03-11-2017, 08:54 PM
Cant find bank or furnace

topop125
04-04-2017, 11:26 PM
I just downloaded this script and it seems that it can't open the bank nor can it click on the furnace. Is there a file that I haven't downloaded to configure Simba properly?

TealThunder
05-04-2017, 03:25 AM
Not working for me, may be fixable with some color updates but I don't feel like going through that work