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.
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.