SRL Archive - RS3 Outdated / Broken Scripts

Crafting Guild Miner and Smelter


cause

2012-01-08 03:56:47

Hello folks, for my second script ever I present:

CraftyMiner
(oooo…..ahhhh)


Requirements:
Can smelt gold and silver
Can access crafting guild (40 crafting)
Brown Apron (worn)
Rune Pick (wielded or not)

BASICALLY you start it in the crafting guild right by the gold rocks and let er rip. It mines gold and silver, using objectDTM's to for locating between the two. After a full inventory is achieved, it then locates itself to the centre of the guild, rests, opens the door (thanks flight for the code), walks to the furnace using SPS, smelts (my favourite function :P), banks, walks, repeats! She ain't flawless and I don't have a report (yet), but seems fairly stable. Anything you see you don't like please leave a comment!
Also, you need the objectDTM include. (props to euphphuhpusiusm)

program craftyminer;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{$i sps/sps.simba} // has to be included after SRL
const
GOLDCOLOUR = 5296637;
SILVERCOLOUR = 15593208;
GOLDWAIT = 7000;
SILVERWAIT = 5000;
var
miningcolour, location, waiter, goldoreDTM, silveroreDTM, goldbarDTM, silverbarDTM, loadz: Integer;
PathThere, PathBack: TStringArray;
GuildtoSmelt, SmelttoBank, BanktoGuild: TPointArray;

procedure Antiban; //idea taken from Coh3n's tutorial.
begin
if not (LoggedIn) then
Exit;
begin
case Random(80) of
10: RandomMovement;
20: PickUpMouse;
30: RandomMovement;
40: BoredHuman;
50: RandomMovement;
60: BoredHuman;
69: ExamineInv;
end;
end;
end;

procedure RestUp;
begin
if not (LoggedIn) then
Exit;
begin
SetRest;
while not RunEnergy(95) do
begin
Antiban;
Wait(Random(1000));
end;
end;
end;

procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '337';
Players[0].Pin := '';
Players[0].Active := true;
end;

Function ChatCheck(s: string): Boolean;
var
i, l : Integer;
b : Boolean;
begin
if (Pos(s, GetBlackChatMessage) > 0)then
begin
Writeln('Checked Black Chat Message');
Result:=True;
end;
end;

Procedure SetupPaths;
begin
SmelttoBank := [ Point(3752, 3161), Point(3791, 3170), Point(3827, 3195),
Point(3863, 3204), Point(3888, 3229)];

GuildtoSmelt := [Point(3569, 3503), Point(3606, 3473), Point(3652, 3481),
Point(3698, 3497), Point(3744, 3518), Point(3782, 3499),
Point(3799, 3458), Point(3829, 3428), Point(3856, 3388),
Point(3861, 3339), Point(3864, 3293), Point(3865, 3244),
Point(3843, 3223), Point(3825, 3192), Point(3790, 3170),
Point(3757, 3162), Point(3734, 3179)];

BanktoGuild := [ Point(3859, 3219), Point(3861, 3262), Point(3866, 3310),
Point(3864, 3352), Point(3852, 3397), Point(3828, 3439),
Point(3795, 3466), Point(3779, 3507), Point(3734, 3520),
Point(3690, 3516), Point(3652, 3496), Point(3614, 3484),
Point(3570, 3497)];
goldoreDTM := DTMFromString('mlwAAAHicY2dgYFjCxsCwFIjXAvE8IJ4DxFOhbA5GBgZmIOYDYjEg5gJiJiD+D9S3a4oUkGTCio0YcANGPBgKAHYPB4I=');
silveroreDTM := DTMFromString('mrAAAAHic42BgYFBiZ2BQBWIdIFYAYiEolgRiDZA4IwODGhBrA7ExEJsCsToQKwGxCRBPmjQDaAoTTmzEgB8wEsAwAAAwKASn');
goldbarDTM := DTMFromString('mlwAAAHicY2dgYBAEYlYGCOAAYjEglgViASgfJM8NxMxQNexALALE11aBVDFhxUYMuAEjHgwFAPSzAo0=');
silverbarDTM := DTMFromString('mlwAAAHicY2dgYHBkZWBwAmJ/IPaDso2A2ByIjzAyMFwA4sNAvA+IdwHxCSA+C8Tz5y8D6mbCio0YcANGPBgKAAi9CYo=');
end;

procedure Terminator;
begin
FreeDTM(goldoreDTM);
FreeDTM(silveroreDTM);
FreeDTM(goldbarDTM);
FreeDTM(silverbarDTM);
TerminateScript;
end;

Function Smelt: boolean;
var
x, y, counter: integer;
begin
counter := 0;
if FindObjCustom(x, y, ['ace'], [3815997], 5) then
begin
wait(100 + random(250));
Mouse(x, y, 1, 1, true);
if FindDTM(goldoreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
wait(4000 + random(2500));
if FindDTM(goldbarDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 1, 1, true);
while ((counter<50) and not (FindNormalRandoms)) do
begin
if not FindDTM(goldoreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
wait(1000);
counter := counter + 1;
end;
end;
if FindObjCustom(x, y, ['ace'], [3815997], 5) then
begin
wait(100 + random(250));
Mouse(x, y, 1, 1, true);
wait(2000 + random(2500));
if FindDTM(silverbarDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 1, 1, true);
counter := 0;
while ((counter<50) and not (FindNormalRandoms)) do
begin
if not FindDTM(silveroreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
wait(1000);
counter := counter + 1;
end;
Result := true;
end
end
else
begin
WriteLn('Couldn''t find initial goldoreDTM');
Terminator;
end
end
end
else
begin
WriteLn('Couldn''t find furnace');
Terminator;
end
end;



Function MineOre: boolean;
var
x, y: integer;
begin
if FindObjCustom(x, y, ['ine', 'ocks'], [miningcolour], 5) then
begin
wait(100 + random(250));
Mouse(x, y, 1, 1, true);
wait(waiter + random(4500));
Result := true;
WriteLn('found a rock');
end
else
begin
Result := false;
WriteLn('couldn''t find ore');
end
end;

Procedure LocateSilver;
begin
if ObjDTMWalk('632:42:4:1:7:622:103:1:7:653:86:1:7:645:105:1:7:646:61', 0, 100, 80, True) then
begin
wait(500 + random(250));
MakeCompass('n');
WriteLn('location is now silver')
end
else WriteLn('could not locate silver');
end;

Procedure LocateSelfToDoor;
begin
if ObjDTMWalk('651:94:6:1:7:642:73:1:7:606:73:1:7:594:81:1:7:630:48:1:7:666:69:1:7:598:53', 0, 100, 80, True) then
begin
wait(500 + random(250));
MakeCompass('n');
WriteLn('located self to door')
end
else WriteLn('could not locate to door');
end;

Procedure LocateGold;
begin
if ObjDTMWalk('617:128:4:1:7:641:93:1:7:619:65:1:7:637:111:1:7:607:62', 0, 100, 80, True) then
begin
wait(500 + random(250));
MakeCompass('s');
WriteLn('location is now gold')
end
else WriteLn('could not locate gold');
end;

Procedure ChangeLocation;
begin
if (location=0) then
begin
LocateSilver;
location := 1;
waiter := SILVERWAIT;
miningcolour := SILVERCOLOUR;
wait(500 + random(250));
Exit;
end;
if (location=1) then
begin
LocateGold;
location := 0;
waiter := GOLDWAIT;
miningcolour := GOLDCOLOUR;
wait(500 + random(250));
end
else
WriteLn('location wasn''t valid');
end;

Procedure Mining;
begin
miningcolour := GOLDCOLOUR;
location := 0;
waiter := GOLDWAIT;
repeat
if not MineOre then
begin
ChangeLocation;
wait(500 + random(250));
end;
if MineOre then Continue
else
WriteLn('MineOre returned true');
until(InvFull);
end;

Procedure OpenTheDoor; //newer door opener, thanks Flight
var
x, y, COUNTER: integer;
begin
If FindObj(x,y,'pen', 2117737, 5) then //2581379
Begin
WriteLn('Opening Door...');
ClickMouse2(True);
COUNTER := 0;
if not DidRedClick and (COUNTER<20) then //If we missed, then exit so we can try again
begin
OpenTheDoor;
inc(COUNTER);
end;
While IsMoving do
Wait(100);
//Maybe wait a little longer?
end else if FindObj(x,y,'lose', 2117737, 5) then //The door is already open, so let's exit
Exit;
end;

Procedure RelocateToCenter;
begin
if ObjDTMWalk('585:65:4:1:7:635:76:1:7:643:102:1:7:639:56:1:7:659:90', 0, 100, 80, True) then
begin
wait(500 + random(250));
MakeCompass('n');
WriteLn('location is now guild centre');
RestUntil(RandomRange(90,100));
//RestUp;
end
else
begin
WriteLn('could not relocate to centre');
Terminator;
end;
end;



Procedure WalkToGold;
begin
if ObjDTMWalk('657:124:4:1:7:618:56:1:7:642:52:1:7:655:55:1:7:675:105', 0, 100, 80, True) then
begin
wait(500 + random(250));
MakeCompass('s');
WriteLn('walked to gold from centre')
end
else WriteLn('could not relocate to gold from centre');

end;

procedure Report;//Starts procedure off
begin
Writeln('[]------------------Crafting Guild Miner Smelter-------------------------[]');//Do any style you want
Writeln('Worked For : ' + TimeRunning)//Displays how long it worked for
Writeln('Mined/Dropped '+ IntToStr(loadz) + ' Loads');
Writeln('[]--------------------------------------------[]');
end;


Procedure Bank;
begin
if ObjDTMWalk('631:91:4:1:7:595:89:1:7:595:73:1:7:603:50:1:7:580:77', 0, 100, 80, True)
then
begin
wait(500 + random(250));
WriteLn('made it to bank, banking...');
if OpenBank('feb', false, false)
then
begin
WriteLn('opened bank');
wait(500 + random(550));
if DepositAll then
begin
WriteLn('deposited all');
CloseBank;
inc(loadz);
//RestUntil(RandomRange(90,100));
RestUp;
SetRun(true);
end
end
else
begin
WriteLn('Couldn''t bank');
Terminator; //Instead of TerminateScript, this is another procedure i have which
end //frees my DTM's
end
else WriteLn('didn''t make it to the bank');
end;

begin
smart_server := 1;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
clearDebug();
setupSRL();
DeclarePlayers;
if not LoggedIn then LogInPlayer;
ObjDTM_Setup;
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup(RUNESCAPE_SURFACE, ['8_8','9_8','9_7']);
SetupPaths;
repeat
Mining;
Report;
RelocateToCenter;
wait(2500 + random(2500));
OpenTheDoor;
if not SPS_WalkPath(GuildtoSmelt) then //SPS walking
begin
WriteLn('Couldn''t make it to the smelter');
Terminator;
end;
wait(7500 + random(2500));
if not Smelt then
begin
WriteLn('Couldn''t smelt');
end;
//WalkToBank; //objectDTM walking
wait(1500 + random(2500));
if not SPS_WalkPath(SmelttoBank) then //SPS walking
begin
WriteLn('Couldn''t make it to the bank');
Terminator;
end;
wait(1500 + random(2500));
Bank;
if not SPS_WalkPath(BanktoGuild) then //SPS walking
begin
WriteLn('Couldn''t make it to the guild');
Terminator;
end;
//WalkToGuild; //objectDTM walking
wait(3500 + random(2500));
LocateSelfToDoor;
wait(2500 + random(2500));
OpenTheDoor;
wait(2500 + random(2500));
WalkToGold;
Report;
until(Players[CurrentPlayer].Active=false);
end.
First Report!
[]------------------Crafting Guild Miner Smelter-------------------------[]
Worked For : 1 Hours, 43 Minutes and 11 Seconds
Mined/Dropped 8 Loads
[]--------------------------------------------[]

GoF

2012-01-08 03:58:49

I might try this soon. Also first.

Flight

2012-01-08 04:16:22

Very neat, cause. :)

nokkasiili

2012-01-08 04:45:03

Nice script havent tried it yet thought.

Kyle Undefined

2012-01-09 06:06:51

Ahh so this is the script you were bugging me about on IRC huh? :p Nice release! :)

cause

2012-01-09 11:50:59

lol yes this is it, unsurprisingly, it's not that popular.

Omar

2012-01-09 13:13:41

Nice script! It's pretty cool I shall post a proggy in the morning also do you have any idea what the profit per hour is?

BTW- What it the DTM include? is that something we need to manually add?

Kyle Undefined

2012-01-09 13:27:37

You can download it from here.

catbat78

2012-01-10 22:12:35

Look's very promising! :) Good luck on perfecting it! :thumbsup:

SlayerSteve

2012-01-22 13:36:07

Awsome Idea just looked it over havnt tested it but its along the lines of something I wanted to make for my first script so awsome I have a basic outline to work around =P

Wetish

2012-02-11 21:43:33

Looks good. Im going to test it on my Pure/Skiller soon. Ill post a proggy if i end up using it. :)

Sytherix

2012-02-24 13:11:27

I'll test this out when I reach 40 crafting? (I think that's what I need to be? :O)

laakerules

2012-02-25 19:20:17

Lol sweet cause. You did the stuff my craftguilder didnt! :P i might have to try this out! :)

superbuster4

2012-02-27 15:25:42

somewhat works it has a terrible time opennig doors and banking. also sometimes fails to find the rocks.

hoopla

2012-03-17 22:55:47

WIll post a pr soon. Thank you kindly for keeping things fresh!!

Here is my experience:

Worked pretty flawlessly, noticed has slight bias towards silver at a rate of 2.

Ran to smelting point but stayed at DTM location too long - only smelted Silver ore.

Ran to bank and sketched for almost a minute, banked and just kept rotating camera.

Very nice start. I commend you for putting this all together! Keep it up!

kinkose

2012-03-27 17:55:51

hey can someone tell me how to change this to skip the smithing part? Would I have to rewrite the entire script or just delete some parts or what? I've never written a script before and I really don't know python at all…. Just wondering how hard it would be and if it would be manageable. Thanks!

x0Rz

2012-04-03 07:02:03

What are the xp/hour rates?

lukas76

2012-04-06 12:37:08

Looks great, i tried making something similar with kbot but failed at finding and opening the door :/

Will run the script tonight and let you know how it goes! :D

catanado15

2012-04-08 15:51:56

anyone have tried ?

MIner99

2012-04-11 12:45:14

I will be trying this soon. I will tell you how it works :)

chosen357

2012-05-07 20:07:09

sorry to be annoying but how do i download this? im new.

Elmeri233

2012-05-08 10:24:50

From: chosen357
sorry to be annoying but how do i download this? im new.


Are you serious?

cause

2012-05-08 16:58:48

Hey guys, I haven't really updated this at all! I think I'll update it in a week or so, probably use SPS walking.

worglers2

2012-05-10 17:57:15

From: cause
Hey guys, I haven't really updated this at all! I think I'll update it in a week or so, probably use SPS walking.


Please do my good sir :)
Thinking about using this to 99 mining/smithing
2 birds in one stone

cause

2012-05-12 14:30:01

Lol that would probably take awhile haha. I haven't quite moved into my house yet so this still is in the todo pile.

worglers2

2012-05-19 15:32:31

From: cause
Lol that would probably take awhile haha. I haven't quite moved into my house yet so this still is in the todo pile.


Take your time :)
I will occupy with other skills. I think it would be cool to get a 99 with this script you made :)

otaman

2012-05-20 14:11:38

First- thanks a ton for your script- this is something I've wanted for a while without even realizing it :D
EDIT: Not been able to get it to work, getting compiling errors- I'm guessing due to recent release of the updated bot. If you don't think it is related to the update and you'd like the errors just let me know and I'll dig them up and post them for ya.

From: kinkose
hey can someone tell me how to change this to skip the smithing part? Would I have to rewrite the entire script or just delete some parts or what? I've never written a script before and I really don't know python at all…. Just wondering how hard it would be and if it would be manageable. Thanks!


Why would you waste time doing this? The entire reason this exists (aside from the creator maybe curious/testing something/what have you) is that it mines AND smelts… There are a ton of other miners, at least two specifically for (or at least working pretty well in) the crafting guild. Even the msi has a crafting guild miner with selectable options, and it works pretty well in my experience. I've not used the other long enough/recent enough to fairly judge them. It is possible to edit this script to not bank, and it may be as simple as removing some select lines, rearranging a few, and probably editing some, but I don't think simple omission will work- that'd probably leave a lot of dead-ends in the script causing it to break. Practice for your own scripts I can understand- my bad if thats all you wanted to know for, but it just seemed a total waste to me. Didn't mean any of this rudely- not sure how my tone came across- I'm quite tired and somewhat ill.

The_Dude

2012-05-20 18:04:30

Might try this later, this could prob bank well with a clan vex and the ring of kinship.

YesMan

2012-05-30 11:44:08

How do I use this?
I have to Run ODTM, then the program?
This appears:
[Error] (182:6): Unknown identifier 'ObjDTMWalk' at line 181

Help me please

YesMan

2012-08-04 09:01:39

Is this still safe to use?

boonjian

2012-10-20 12:45:34

guys can help me?
Exception in Script: Unable to find file 'ObjectDTM\ObjDTMInclude.simba' used from ''


where go i solve this

Nebula

2012-10-20 12:49:44

You need to download the ODTM include

http://villavu.com/forum/showthread.php?t=68112