catsrback321
2014-06-14 18:45:07
Hey everyone, I would like to post my edge-ville crafter. it seems to be fairly stable with a few fail-safes and a bit of anti-ban here and there so it should be okay to be ran while babysitting, It does have issues with finding the furnace if people are wearing the came color but it has worked well enough for me.
sorry about the format I understand that it is generally a VERY ugly script, there are many parts that probably don't need to be in there or other parts that just make things worse :D
I have had a lot of help from members of the community, much of this is based from what I have learned from the mayors guide, and I have had much advice from the mayor, ashaman88, footballjds and I have used parts from Nexus Crux's crafter (with his permission) so.. here it is..
sorry about the format I understand that it is generally a VERY ugly script, there are many parts that probably don't need to be in there or other parts that just make things worse :D
I have had a lot of help from members of the community, much of this is based from what I have learned from the mayors guide, and I have had much advice from the mayor, ashaman88, footballjds and I have used parts from Nexus Crux's crafter (with his permission) so.. here it is..
program The_Complicated_Solution_To_A_Simple_Task;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
loadsdone:integer;
FailsafesDone:integer;
// Ring Neck Brace Ammy
// Gold: 1 2 3 4
// Sapphire: 5 6 7 8
// Emerald: 9 10 11 12 From Nexus Crux's crafter
// Ruby: 13 14 15 16
// Diamond: 17 18 19 20
// Dragon: 21 22 23 24
// Onyx: 25 26 27 28
const
Jewellery_Type = 7; //change this to select your jewellry
//don't the numbers below.
banker =5843008;
sapphire = 8262930;
Gold = 2009299;
Furnace = 1121979;
Procedure declarePlayers();
begin
setLength(players, 1); // how many players to use
currentPlayer := 0;
with players[0] do
begin
loginName := 'UserName'; //Your login name here.
displayName := 'Display Name'; //Your display name here.
password := 'Password'; //Your password here.
isActive := true;
isMember := true;
bankPin := 'Pin'; //Your pin here.
world := -1; // -1 will just click the play button
integers[0] := 50;
integers[1] := 25;
booleans[0] := true;
end;
end;
Procedure FindNormalRandoms;
Begin
ExitTreasure;
ClaimSpinTicket;
End;
Function Antiban: Boolean;
Var
I: Integer;
Begin
I := Random(70000);
Case I Of
51..100:randomMouseSpeed(3, 10, 20);
401..500:mouseMovingObject();
601..700:randomCameraAngle(MS_ANGLE_HIGH);
701..760:randomRClickItem();
761..800:boredHuman();
end;
End;
Procedure TeleToBank;
var
I:integer;
pathToBankStart: TPointArray;
begin
lodestoneScreen.teleportTo(13);
wait(randomrange(20000,25000))
begin
if not isLoggedIn() then
exit;
Begin
I := Random(1000);
Case I Of
1..867:pathToBankStart := [Point(115, 94), Point(142, 104), Point(174, 111), Point(214, 114), Point(224, 131)];
868..878:pathToBankStart := [Point(113, 88), Point(145, 104), Point(168, 114), Point(192, 137), Point(198, 158), Point(220, 158)];
879..989:pathToBankStart := [Point(115, 92), Point(140, 108), Point(166, 108), Point(199, 107), Point(230, 106), Point(255, 122), Point(231, 137)];
990..1000:pathToBankStart := [Point(113, 87), Point(88, 94), Point(97, 120), Point(117, 135), Point(143, 123), Point(174, 108), Point(199, 101), Point(217, 111), Point(217, 146)];
end;
if SPS.walkPath(pathToBankStart) then
minimap.waitPlayerMoving()
end;
end;
end;
Procedure TeleToFurnace;
var
I:integer;
pathToBankStart: TPointArray;
begin
lodestoneScreen.teleportTo(13);
wait(randomrange(17000,18000))
begin
if not isLoggedIn() then
exit;
Begin
WriteLn('Teleport Failsafe');
I := Random(1000);
Case I Of
1..867:pathToBankStart := [Point(113, 90), Point(159, 109), Point(222, 114), Point(277, 121)];
868..878:pathToBankStart := [Point(113, 88), Point(134, 109), Point(166, 123), Point(190, 151), Point(208, 172), Point(242, 181), Point(262, 157), Point(262, 125), Point(283, 122)];
879..989:pathToBankStart := [Point(113, 88), Point(112, 86), Point(132, 104), Point(168, 117), Point(193, 144), Point(208, 159), Point(223, 157), Point(221, 142), Point(239, 128), Point(284, 120)];
end;
if SPS.walkPath(pathToBankStart) then
minimap.waitPlayerMoving();
inc(FailsafesDone);
end;
end;
end;
Procedure IsBankOpen;
begin
if not bankscreen.isopen then
bankscreen.open(BANK_NPC_BLUE);
PinScreen.Enter(players[currentPlayer].BankPin);
end;
procedure Withdraw;
var
x,y,Open:integer;
begin
if not isloggedin() then
exit;
repeat
inc(open);
bankscreen.open(BANK_NPC_BLUE);
wait(randomrange(500,1000));
PinScreen.Enter(players[currentPlayer].BankPin);
until bankscreen.isopen or (open >= 5)
begin
If bankscreen.isopen then
Begin;
writeln('trying to open bank');
wait(randomrange(500,1000));
if BankScreen.isOpen then
wait(randomrange(700,1400));
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
end
end;
end;
Procedure Setup;
begin
FindNormalRandoms;
Mainscreen.setAngle(MS_ANGLE_HIGH);
Teletobank;
Withdraw;
end;
Procedure CheckInv;
var
x, y, Count: integer;
begin
if not isloggedin() then
exit;
begin
if not tabBackpack.open() then
tabBackpack.open();
wait(randomrange(1400,1600));
if (tabBackpack.isItemInSlot(15)) then
end;
if not(tabBackpack.isItemInSlot(15)) then
repeat
writeln('NOTHING IN INVENTORY');
inc(Count);
withdraw;
until (tabBackpack.isItemInSlot(15)) or (Count >= 5);
end;
Procedure Symbolclicktofurnace;
var
x,y,Map:integer;
p: Tpoint;
begin
If Not IsLoggedIn Then
exit;
begin
Map := DTMFromString('mlwAAAHicfcmxCkBgAEXhKyLkoSWrkcFKIv3xCBZlMBvNLB6BM1i59d3leJJch4ODEBF82OhIPSrUMBgx4D5T5WZXOx0y86Ws2RQXi5JyVUD/Yv149wDSABRs');
if (minimap.findDTM(Map, x, y)) then
writeln('Found DTM');
Mouse(x,y,Mouse_move);
Fastclick(Mouse_left);
wait(500 + random(500));
minimap.waitPlayerMoving();
if not (minimap.findDTM(Map, x, y)) then
teletofurnace;
freedtm(map);
end;
end;
Procedure NearFurnace;
var
x,y:integer;
p: Tpoint;
begin
If Not IsLoggedIn Then
exit;
writeln('Looking For Furnace');
if not FindColorTolerance(x,y, furnace, 0 , 0, 571, 383, 10) then
begin
symbolclicktofurnace
end;
end;
Procedure WalkToFurnace;
var
I:integer;
pathToFurnace: TPointArray;
begin
if not isLoggedIn() then
exit;
Begin
I := Random(100);
Case I Of
1..24:pathToFurnace := [Point(224, 148), Point(281, 123)];
25..49:pathToFurnace := [Point(222, 149), Point(229, 132), Point(279, 122)];
50..74:pathToFurnace := [Point(224, 128), Point(279, 117)];
75..100:pathToFurnace := [Point(227, 135), Point(278, 126)];
end;
writeln('Walking To Furnace');
if SPS.walkPath(pathToFurnace) then
minimap.waitPlayerMoving();
nearfurnace;
end;
end;
Procedure FindFurnace;
var
x,y,counter:integer;
begin
If Not IsLoggedIn Then
exit;
if not (productionScreen.isOpen()) then
wait(randomrange(1000,2000));
repeat
inc(counter);
if FindColorTolerance(x,y, furnace, 5 , 5, 571, 383, 10) then
Writeln('Clicking Furnace');
Mouse(x,y,Mouse_move);
Fastclick(Mouse_right);
if (chooseOption.select(['Smelt', 'elt'], 500)) then
wait(randomrange(1700,2000));
until (productionScreen.isOpen())or (Counter >= 5);
if not (productionScreen.isOpen()) then
NearFurnace;
if FindColorSpiralTolerance(x,y, 3559528, 5 , 5, 571, 383, 10) then
Writeln('Clicking Furnace');
Mouse(x,y,Mouse_move);
Fastclick(Mouse_right);
if (chooseOption.select(['Smelt', 'elt'], 500)) then
wait(randomrange(1700,2000));
if not (productionScreen.isOpen()) then
NearFurnace;
end;
procedure Cantban;
var
I:integer;
Begin
I := Random(500000);
Case I Of
41..50:mouseMovingObject();
61..70:randomCameraAngle(MS_ANGLE_HIGH);
77..80:boredHuman();
end;
End;
procedure arewefinished;
begin
repeat
wait (randomrange(50,100));
Cantban;
progressScreen.isopen;
until not progressScreen.isopen
end;
function AreWeCrafting:boolean;
var
x,y:integer;
timer: TTimeMarker;
begin
If Not IsLoggedIn Then
exit;
begin
if not progressScreen.isopen then
writeln('we are not crafting, trying again,sorry for the inconvenience');
end;
end;
Procedure CraftBrace;
var
x,y,Tries:integer
begin
If Not IsLoggedIn Then
exit;
if (productionScreen.isOpen()) then
begin
if not (productionScreen._getSelectedBox(Jewellery_Type)) then
repeat
productionScreen.selectBox(Jewellery_Type);
productionScreen.clickStart();
wait(randomrange(250,600));
inc (Tries);
until AreWeCrafting or (Tries >= 5);
arewefinished;
//wait(randomrange(25000,26000));
writeln('Should be done')
end;
end;
Procedure CheckInv2;
var
x,y,Brace:integer
begin
If Not IsLoggedIn Then
Exit;
begin
writeln('Checking Inventory');
if not tabBackpack.open() then
tabBackpack.open();
begin
Brace := DTMFromString('mrAAAAHic42BgYLjIxMBwEohPAPEFID4NxDeB+AqU/gFU8wuI/wIxByMDAyMU/wHyOYG0hMwahmmNogwzW0QZLm2VZTi5VoahIU+Ioa1YGKiCkYELSPLjwFxgFfgxDAAAFZETlQ==');
if Not FindDTM ( Brace,x,y,tabbackpack.getbounds()) then
findfurnace;
end;
end;
end;
Procedure WalkTobank;
var
I:integer;
pathToBank: TPointArray;
begin
if not isLoggedIn() then
exit;
begin
I := Random(100);
Case I Of
1..24:pathToBank := [Point(286, 122), Point(233, 138)];
25..49:pathToBank := [Point(285, 124), Point(229, 142)];
50..74:pathToBank := [Point(283, 124), Point(249, 131), Point(224, 146)];
75..100:pathToBank := [Point(279, 118), Point(230, 129)];
end;
writeln('Walking To Bank');
if SPS.walkPath(pathToBank) then
minimap.waitPlayerMoving();
inc(LoadsDone);
end;
end;
Procedure AreWeAtBank;
var
x,y:integer;
timer: TTimeMarker;
begin
If Not IsLoggedIn Then
exit;
if not FindColorTolerance(x,y, 6170944, 0 , 0, 571, 383, 10) then
begin
teleToBank;
end;
end;
Procedure ProgressReport();
var
BraceletsCrafted,FailSafesCompleted, Profit, ProfitPerHour,CraftedPerHour,ExpPerHour: Integer;
Begin
cleardebug;
If Not IsLoggedIn Then
exit;
cleardebug;
BraceletsCrafted := LoadsDone * 14;
Profit := (BraceletsCrafted * 60);
ProfitPerHour := Round((Profit * 60) / (GetTimeRunning() / 60000));
CraftedPerHour := Round((BraceletsCrafted * 60) / (GetTimeRunning() / 60000));
ExpPerHour:=Round((CraftedPerHour * 60));
FailSafesCompleted:=FailsafesDone;
WriteLn('=================From The Mayors Guide=================');
WriteLn(' The Complicated Solution To A Simple Task');
WriteLn(' Time Run:' + timeRunning);
WriteLn(' Bracelets Crafted: ' + intToStr(BraceletsCrafted));
WriteLn(' Loads Done: ' + intToStr(loadsDone));
WriteLn(' Profit Made: ' + intToStr(profit));
WriteLn(' Profit Per Hour: ' + intToStr(profitPerHour));
Writeln(' Crafted Per Hour: ' +intToStr(craftedPerHour));
Writeln(' Exp Per Hour:' +intToStr(ExpPerHour));
Writeln(' Teleport FailSafes Completed:' +intToStr(FailSafesCompleted));
Writeln('=======================================================');
End;
procedure FirstRun;
Begin;
Setup;
withdraw;
CheckInv;
WalkToFurnace;
FindFurnace;
CraftBrace;
CheckInv2;
WalkToBank;
Progressreport;
end;
procedure MainLoop;
begin
withdraw;
checkinv;
WalkToFurnace;
FindFurnace;
Craftbrace;
checkinv2;
WalkToBank;
progressreport;
end;
Begin
SmartPlugins := ['d3d9.dll']; // For OpenGl add // to the start of this line
SetupSRL();
DeclarePlayers;
players[currentPlayer].login();
sps.setup('Edge_map', RUNESCAPE_OTHER);
FirstRun;
repeat
mainloop;
until (False);
progressreport;
end.
To get this running you need to have your preset number 2 filled with 14 gems of your choice and 14 gold bars, you need to have the correct crafting level for the jewelery.
Make sure your zoomed all the way out.
you SHOULD be able to just click start anywhere.
if you do use this please post progress reports and any of the many bugs you find :p
any criticism or advice is welcome, gotta learn sometime :)
Make sure your zoomed all the way out.
you SHOULD be able to just click start anywhere.
if you do use this please post progress reports and any of the many bugs you find :p
any criticism or advice is welcome, gotta learn sometime :)
Known Bugs:
It sometimes walks towards the wilderness and not towards the furnace, not sure why but it should be able to make it's way to the furnace, just see what it does if it happens to you
It gets players in dragon or red confused with the furnace sometimes some different methods of detection are in there but if it helps or hinders I'm not too sure.
The profit in the progress report may not be accurate at the time of use. prices vary.
Proggys:
=================From The Mayors Guide=================
The Complicated Solution To A Simple Task (crafting)
Time Run:57 Minutes and 13 Seconds
Bracelets Crafted: 756
Loads Done: 54
Profit Made: 45360
Profit Per Hour: 47562
Crafted Per Hour: 793
Exp Per Hour:47580
Teleport FailSafes Completed:0
=======================================================
[ATTACH=CONFIG]23396[/ATTACH]