PDA

View Full Version : Swimdude's Port Phasmatys Smelter v1.0



swimdude
04-25-2013, 10:17 PM
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:

Put iron ore in first slot of bank
Put iron bars in the second slot of bank
Put rings of forging in the third slot of bank
Equip a 100% capacity ring of forging (aka 140 smelts left)
Adjust script to allow rings of forging or not and how many bars you want to make
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:
20925

Video:
5TrMWOpDs8E

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('m6wAAAHicjcxBCkBAHEbxbzYWHAcrEUVzB7 Obiyg2bJQS1/VqNpb/V7/tKySdWfLiwYEVCzbsuHCjdZJHhxoVGvQYMaHEgBhm7s4klz3bM fn1AZsQCjU=');
ironOreDTM := DTMFromString('mPwEAAHic42dgYEgAYn8ojoDiOCBOBOIQIM 4E4hwgzgPibCDOgIqlALEfFIdCcRQQRwNxMBC7A7ELELsCsScQ +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
04-26-2013, 01:39 PM
Very nice man, been waiting for a furnace smelter. Will try it out later tonight and post proggy. Thanks!

Clasic1
04-26-2013, 03:42 PM
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
04-26-2013, 04:42 PM
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
04-26-2013, 05:28 PM
Would love to see mith or steel bar support. Tired of tribot xd

qyouwei
04-26-2013, 05:40 PM
cannonballs support would be great too

bins69
04-27-2013, 02:31 PM
withdraws iron and just sits there

Gannon
04-28-2013, 04:24 PM
================================
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
04-28-2013, 08:35 PM
Is it possible to make this work in Al-Kharid?

ilovegali201
04-29-2013, 03:49 AM
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
04-30-2013, 05:44 AM
Reckon you could add Gold Bars too? Cause that'd be great. :P

eastside
04-30-2013, 07:09 PM
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
05-01-2013, 10:38 PM
Would love to see more of this. I plan to be using it. Will post progress using it.

beastmode92
05-06-2013, 08:56 PM
would be awesome if you could add molten glass to the list

pcelite11
05-19-2013, 02:04 AM
Does this script still work? Anyone whos used this post a proggy please.

bigblacknerd
05-19-2013, 02:14 AM
Does this script still work? Anyone whos used this post a proggy please.

why dont you try it?

pcelite11
05-19-2013, 03:57 AM
why dont you try it?

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

pelaaja123
05-28-2013, 01:54 PM
Not working

Karkki Markku
06-19-2013, 08:54 PM
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
06-19-2013, 09:01 PM
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
06-20-2013, 03:39 AM
Good script, I will continue to use it to smelt steel bars. Thanks

Bel002
06-23-2013, 12:27 PM
add gold ore too, please.. :)

Gallium
06-27-2013, 04:41 AM
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
07-17-2013, 06:17 PM
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
07-24-2013, 02:58 PM
could u make a script that super heat iron bars? :P

eggyd
08-03-2013, 03:47 PM
same thing here

Breggin123
08-15-2013, 10:07 PM
This script does not work.

tzaro
11-20-2013, 04:55 AM
let's get a cannonball smelter!!

diohelrivwsp
11-22-2013, 12:07 AM
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.