SRL Archive - OSR Outdated / Broken Scripts

Swimdude's Port Phasmatys Smelter v1.0


swimdude

2013-04-25 18:17:54

Hey guys,

Swimdude here with another simple bot. It's not the best bot but it does the repetitive work for you while you watch Netflix etc. Let me know if you find any bugs/errors.

Program:
  • Swimdude's Port Phasmatys Smelter v1.1

Description:
  • Script will smelt iron ore in Port Phasmatys. The script also uses rings of forgings.
  • This version will only do iron bars at the moment. Adding other bars in the near future.

How To Use:
  1. Put iron ore in first slot of bank
  2. Put iron bars in the second slot of bank
  3. Put rings of forging in the third slot of bank
  4. Equip a 100% capacity ring of forging (aka 140 smelts left)
  5. Adjust script to allow rings of forging or not and how many bars you want to make
  6. Start script with inventory empty and bankscreen up :)

Changelog:
  • v1.0 - Initial Release
  • v1.1 - Code has been rewritten to allow for more failsafes

Features:
  • Uses rings of forging to make iron bars 100% of the time
  • Uses closed door detection and will open the door when it is closed
  • Has backups in case it gets stuck

Note(s):
  • Does not have random's support because it's buggy. Babysit this bot like every other bot

Picture Proof:
[ATTACH=CONFIG]20925[/ATTACH]

Video:
[YOUTUBE]5TrMWOpDs8E[/YOUTUBE]

Code:

program Swimdudes_Port_Phasmatys_Smelter;

// Swimdude's Port Phasmatys Smelter v1.1 \\

{$DEFINE SMART8}
{$I SRL-OSR/SRL.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL-OSR/SRL/Misc/SmartGraphics.Simba}

var
x, y: integer;
forges: integer;
ironBarDTM, ironOreDTM: integer;
barsMade: integer;
doorOpen: boolean;

const
// *** DO NOT CHANGE THESE *** \\
bankcolour1 = 5204065;
bankcolour2 = 4479573;
maxForges = 140;

// *** YOU CAN CHANGE THESE *** \\
useForgingRing = true; // Use forging rings?
barsToMake = 6357; // How many bars are you making?

Procedure DeclarePlayer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username goes here
Players[0].Pass := ''; //Password goes here
Players[0].Nick := ''; //Character name goes here (used for anti
Players[0].Active := True; //-randoms)
end;
//////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//---------------------------^User Config ends here^-------------------------\\
//////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

procedure declarevariables;
begin
ironBarDTM := DTMFromString('m6wAAAHicjcxBCkBAHEbxbzYWHAcrEUVzB7Obiyg2bJQS1/VqNpb/V7/tKySdWfLiwYEVCzbsuHCjdZJHhxoVGvQYMaHEgBhm7s4klz3bMfn1AZsQCjU=');
ironOreDTM := DTMFromString('mPwEAAHic42dgYEgAYn8ojoDiOCBOBOIQIM4E4hwgzgPibCDOgIqlALEfFIdCcRQQRwNxMBC7A7ELELsCsScQ+0LtAMmFAbGPnhKQZCQLczGQD8izEYLRAAANBAsj');
end;

Procedure randomWaitTime;
begin
case random(1000) of
1..800: Wait(RandomRange(300, 700));
801..960: Wait(RandomRange(400, 900));
961..1000: Wait(RandomRange(500, 1000));
end;
end;

Procedure antiBan;
begin
//writeln('antiban debug!');
Case Random(130) Of
1: HoverSkill(skill_smithing, false);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: PickUpMouse;
6: RandomMovement;
7: RandomRClick;
8: MakeCompass('random');
end;
end;

procedure openScreen;
begin
if(FindObjCustom(x, y, ['Bank', 'ank', 'booth', 'ooth'], [bankcolour1, bankcolour2], 5)) then repeat
begin
if(FindObjCustom(x, y, ['Bank', 'ank', 'booth', 'ooth'], [bankcolour1, bankcolour2], 5)) then
begin
writeln('Trying to open the bank.');
mmouse(x, y, 2, 2);
wait(RandomRange(300, 600));
ClickMouse2(mouse_right);
wait(RandomRange(500, 700));
ChooseOptionMulti(['Bank']);
Flag;
wait(RandomRange(1000, 2000));
end;
end;
until(bankscreen);
end;

procedure openDoor;
begin
if(WaitUptext('Open', randomRange(300, 600))) then
begin
repeat
Writeln('Door is closed!');
mmouse(x, y, 1, 1);
wait(RandomRange(300, 600));
ClickMouse2(mouse_left);
wait(RandomRange(300, 600));
Flag;
wait(RandomRange(1000, 2000));
until(not(WaitUptext('Open', randomRange(300, 600))));
doorOpen := true;
end
else if(WaitUptext('Close', randomRange(300, 600))) then
begin
writeln('Door is open!');
doorOpen := true;
end
else
begin
writeln('Could not find the door!');
doorOpen := true;
end;
end;

procedure customlevelup;
var
x, y: integer;

begin
if(levelup) then
begin
clickcontinue(true);
sleep(randomrange(1000, 1500));
clickcontinue(true);
sleep(randomrange(2300, 2700));
if(not(finddtm(ironBarDTM, x, y, 686, 430, 732, 471))) then
begin
if(FindObjEx(x, y, ['urnace'], [4013378, 3421241, 4276549], 20, 50, MSX1, MSY1 + 50, MSCX, MSY2)) then
begin
mmouse(x, y, 3, 3);
if(waituptextmulti(['Smelt', 'furnace', 'urnace'], (100 + (randomrange(100, 200))))) then
begin
clickmouse2(mouse_left);
sleep(randomrange(900, 1000));
if(findcolorspiraltolerance(x, y, 12151401, 0, 343, 515, 476, 10)) then repeat
begin
writeln('Smelting bars');
mmouse(153, 409, 3, 3);
wait(RandomRange(300, 500));
ClickMouse2(mouse_right);
wait(RandomRange(300, 500));
chooseOptionMulti(['X']);
wait(RandomRange(1200, 1500));
TypeSend('33');
wait(RandomRange(2000, 3000));
end
until(not(findcolorspiraltolerance(x, y, 12151401, 0, 343, 515, 476, 10)))
end;
end;
end;
end;
end;

procedure withdrawOre;
begin
makecompass(180.0);
if(bankscreen) then
begin
if(useForgingRing) then
begin
if((forges = maxForges)) then
begin
writeln('Replacing Forging Ring');
forges := 0;
DepositAll;
mmouse(185, 75, 3, 3);
wait(RandomRange(500, 800));
ClickMouse2(mouse_left);
wait(RandomRange(500, 800));
CloseBank;
wait(RandomRange(700, 900));
if(not(GameTab(tab_Inv))) then
begin
GameTab(tab_Inv);
end;
wait(RandomRange(300, 600));
repeat
mmouse(575, 230, 1, 1);
ClickMouse2(mouse_left);
wait(RandomRange(500, 800));
until(not(InvEmpty));
withdrawOre;
end;
end;

if(InvFull and (finddtm(ironBarDTM, x, y, 686, 430, 732, 471))) then
begin
writeln('Banking Inventory');
DepositAll;
randomWaitTime;
end;

mmouse(97, 77, 3, 3);
wait(RandomRange(300, 600));
ClickMouse2(mouse_right);
wait(RandomRange(300, 600));
ChooseOptionMulti(['All']);
wait(RandomRange(1000, 1500));
end
else
begin
openScreen;
end;
end;


procedure walkToFurnace;
begin
if(InvFull and (finddtm(ironOreDTM, x, y, 686, 430, 732, 471))) then
begin
if(FindColor(x, y, 11843261, 565, 120, 665, 160)) then
begin
writeln('Inventory Full. Running to furnace');
mmouse(x + 5, y, 3, 3);
ClickMouse2(mouse_left);
Flag;
wait(RandomRange(500, 1000));
end
else
begin
writeln('Could not find color');
end;
end
else
begin
writeln('CANT FIND THE ORE');
withdrawOre;
end;
end;

procedure findSmelter;
var
i: integer;
furnaceFound: boolean;

begin
doorOpen := false;
furnaceFound := false
makecompass(180.0);
writeln('Checking if door is open');
if(FindObj(x, y, 'oor', 596760, 20)) then repeat
begin
openDoor;
inc(i);
end
until(doorOpen);
writeln('i is: ' + IntToStr(i));
writeln('Finding furnace');
if(FindObjEx(x, y, ['urnace'], [4013378, 3421241, 4276549], 20, 50, MSX1, MSY1 + 50, MSCX, MSY2)) then
begin
furnaceFound := true;
mmouse(x, y, 3, 3);
wait(RandomRange(300, 600));
ClickMouse2(mouse_left);
Flag;
wait(RandomRange(1000, 1500));
end;
if(not(furnaceFound)) then
begin
writeln('Furnace not found.');
if(FindColor(x, y, 11843261, 577, 1, 650, 57)) then
begin
mmouse(x, y, 3, 3);
wait(RandomRange(300, 600));
ClickMouse2(mouse_left);
wait(RandomRange(300, 600));
Flag;
findSmelter;
end;
end;
end;

procedure smeltOre;
begin
if(findcolorspiraltolerance(x, y, 12151401, 0, 343, 515, 476, 10)) then repeat
begin
writeln('Smelting bars');
mmouse(153, 409, 3, 3);
wait(RandomRange(300, 500));
ClickMouse2(mouse_right);
wait(RandomRange(300, 500));
chooseOptionMulti(['X']);
wait(RandomRange(1200, 1500));
TypeSend('33');
wait(RandomRange(2000, 3000));
end
until(not(findcolorspiraltolerance(x, y, 12151401, 0, 343, 515, 476, 10)));

// REPEAT UNTIL IRON BARS ARE MADE \\
repeat
antiBan;
customlevelup;
Wait(RandomRange(1074, 3142));
if(not(GameTab(tab_Inv))) then
begin
GameTab(tab_Inv);
end;
until(finddtm(ironBarDTM, x, y, 686, 430, 732, 471));

makecompass(180.0);
writeln('Done smelting');

barsMade := barsMade + 28;
forges := forges + 28;

end;

procedure walkFromFurnace;
begin
if(FindObj(x, y, 'oor', 596760, 20)) then repeat
begin
openDoor;
end
until(doorOpen);

if(FindColor(x, y, 11843261, 577, 1, 650, 57)) then
begin
wait(RandomRange(500, 700));
mmouse(x, y, 3, 3);
wait(RandomRange(500, 700));
ClickMouse2(mouse_left);
Flag;
end;
end;



//////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//-----------------------------v|Main Method|v-------------------------------\\
//////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
begin
DeclarePlayer;
SetupSRL();
declarevariables;
ClearDebug;
if(not LoggedIn) then
begin
LogInPlayer;
wait(750);
end;
repeat
clearDebug;
writeln('================================');
writeln('Bars Made: ' + IntToStr(barsMade));
writeln('Forging Ring Status: ' + IntToStr(forges) + '/' + IntToStr(maxForges));
writeln('================================');
declarevariables;
withdrawOre;
walkToFurnace;
findSmelter;
smeltOre;
walkFromFurnace;
openScreen;
freedtm(ironBarDTM);
freedtm(ironOreDTM);
until(barsMade > barsToMake);
end.

cruelty1345

2013-04-26 09:39:10

Very nice man, been waiting for a furnace smelter. Will try it out later tonight and post proggy. Thanks!

Clasic1

2013-04-26 11:42:25

nice! i will for sure use this bot. iron bars are really not my thing tho so i won't use it for a long time. Would it be possible for you to add the ability to smith Cannonballs in the near future?

swimdude

2013-04-26 12:42:28

From: Clasic1
nice! i will for sure use this bot. iron bars are really not my thing tho so i won't use it for a long time. Would it be possible for you to add the ability to smith Cannonballs in the near future?


Yeah, I will be adding in other ores. Great idea on cannonballs. Didn't think of those until you mentioned them.

Physic

2013-04-26 13:28:12

Would love to see mith or steel bar support. Tired of tribot xd

qyouwei

2013-04-26 13:40:30

cannonballs support would be great too

bins69

2013-04-27 10:31:39

withdraws iron and just sits there

Gannon

2013-04-28 12:24:17

================================
Bars Made: 0
Forging Ring Status: 0/140
================================
Could not find color
Checking if door is open
Successfully executed.
The following DTMs were not freed: [2, 3, 4, 5]


Every time i start it it takes out all the iron ore then just moves the mouse randomly around my bank window.

shwobo

2013-04-28 16:35:50

Is it possible to make this work in Al-Kharid?

ilovegali201

2013-04-28 23:49:33

This script looks good, but I think you flip the order around on purpose because it just open the bank, take out ore then look for the door and it does not click. I just looked at your post and video carefully, the script you posted and the one you had on video is two different scripts. Thank you for your time making this script and I hope you can fix it as soon as possible.

Unkeep

2013-04-30 01:44:08

Reckon you could add Gold Bars too? Cause that'd be great. :P

eastside

2013-04-30 15:09:46

this script would be very helpful and one of a kind. i've tried it out and i've noticed a few bugs that it doesn't know how to close my bank display nor was it able to find the bank. these bugs are minor and should be fixed with small tweeks. thankyou :)

SirWobblez

2013-05-01 18:38:31

Would love to see more of this. I plan to be using it. Will post progress using it.

beastmode92

2013-05-06 16:56:31

would be awesome if you could add molten glass to the list

pcelite11

2013-05-18 22:04:44

Does this script still work? Anyone whos used this post a proggy please.

bigblacknerd

2013-05-18 22:14:05

From: pcelite11
Does this script still work? Anyone whos used this post a proggy please.


why dont you try it?

pcelite11

2013-05-18 23:57:27

From: bigblacknerd
why dont you try it?


If you have nothing productive to say, don't say it.

pelaaja123

2013-05-28 09:54:36

Not working

Karkki Markku

2013-06-19 16:54:28

Looks nice, it takes the iron from the bank correctly, then just says "Checking if door is open
i is: 0
Finding furnace
Furnace not found." And can't go out of the bank screen.

Wu-Tang Clan

2013-06-19 17:01:37

Its nice that you made a script, but superheating beats the hell out of smelting. Doing rune bars I make 1.4M a day and I get about 500k xp Smith and 600k Magic for a total of 1.1M xp all day.
Smithing at a furnace is like 20K/hr

sal man

2013-06-19 23:39:52

Good script, I will continue to use it to smelt steel bars. Thanks

Bel002

2013-06-23 08:27:02

add gold ore too, please.. :)

Gallium

2013-06-27 00:41:06

This inspired me to make a Port Phastmatys Cball maker. I've also been considering writing a script that would do any kind of bar you just set your bar type but not sure if I will yet.

its a secret

2013-07-17 14:17:15

Whenever i run the script it manages to withdraw the iron ore, but the script for some reason can't find the close button on the bank window and the cursor just darts around the bank window.

lorenzo

2013-07-24 10:58:24

could u make a script that super heat iron bars? :P

eggyd

2013-08-03 11:47:55

same thing here

Breggin123

2013-08-15 18:07:48

This script does not work.

tzaro

2013-11-19 23:55:14

let's get a cannonball smelter!!

diohelrivwsp

2013-11-21 19:07:08

Exception in Script: File "SRL/SRL/Misc/Debug.Simba" not found at line 7, column 5


I don't know what is going on here.