PDA

View Full Version : Rob's iron autosmelter [Falador]



Robbiej
05-13-2007, 08:06 PM
Hey,
this is my first script...
I haven't really tested it, since my smithing lvl isn't lvl 15 because i got hacked...

Instructions:
- Be in East falador bank with full load of iron ores.
- Run the script.
- Go watch TV.

Any errors?
- Please reply to this topic

The script:

program Autosmelter;
{.include SRL\SRL.scar}

//This program is created by Robbiej.
//Master of the secret society of xD².

var
Banked: integer;

const
Ores= 56; //Change this to your number of ores.
IronOreColor= 2503507; //You can change this if it doesn't work.
BankIconColor= 6543871; //You can change this if it doesn't work.
BankerColor= 195836; //You can change this if it doesn't work.
BankBoothColor= 7570836; //You can change this if it doesn't work.
FurnaceIconColor= 3504639; //You can change this if it doesn't work.
FurnaceColor= 2763308; //You can change this if it doesn't work.
IronBarColor= 3158069; //You can change this if it doesn't work.
House1Color= 6443873; //You can change this if it doesn't work.
House2Color= 3695784; //You can change this if it doesn't work.
CloseBankBoothColor= 7308433; //You can change this if it doesn't work.

procedure Grab;
begin
Writeln('Opening bank account...');
Writeln('Searching iron ore to grab...');
if(FindColorTolerance(x,y,IronOreColor,0,0,400,400 ,50)) then
begin
Writeln('Iron ore found!');
Mouse(x,y,2,2,false);
Wait(500+random(200));
Mouse(x,y+65,2,2,true);
end else
begin
Writeln('Iron ore not found!');
end
end;

procedure BankIronOre;
begin
Writeln('Opening bank account...');
if(FindColorTolerance(x,y,BankBoothColor,0,0,600,6 00,50)) then
begin
Writeln('Bank booth opened!');
Wait(5000+random(500));
Mouse(x,y,2,2,false);
Wait(500+random(200));
Mouse(x,y+40,2,2,true);
Wait(1000+random(300));
Writeln('Searching iron bar to bank...');
if(FindColorTolerance(x,y,IronBarColor,300,300,600 ,600,50)) then
begin
Writeln('Iron bar found!');
Mouse(x,y,2,2,false);
Wait(500+random(100));
Mouse(x,y+65,2,2,true);
Banked:= Banked+1;
Grab;
if(FindColorTolerance(x,y,CloseBankBoothColor,0,0, 600,600,50)) then
begin
Writeln('Closing bank booth...');
Mouse(x,y,2,2,true);
Writeln('Bank booth closed!');
end else
begin
Writeln('Bank booth close not found!');
end
end else
begin
Writeln('Iron bar not found!');
end
end else
begin
Writeln('Bank booth not found!');
end
end;

procedure FindBanker;
begin
Writeln('Searching for banker...');
if(FindColorTolerance(x,y,BankerColor,0,50,700,700 ,50)) then
begin
Writeln('Banker found!');
Mouse(x,y-10,2,2,true);
Wait(6000+random(400));
BankIronOre;
end else
begin
Writeln('Banker not found!');
end
end;

procedure MoveToBank;
begin
Writeln('Searching for bank...');
if(FindColorTolerance(x,y,BankIconColor,0,0,720,72 0,50)) then
begin
Writeln('Bank found!');
Mouse(x,y,2,2,true);
Wait(6000+random(400));
FindBanker;
end else
begin
Writeln('Bank not found!');
end
end;

procedure FurnaceToBank;
begin
Writeln('Moving to house 1...');
if(FindColorTolerance(x,y,House1Color,0,0,700,700, 50)) then
begin
Writeln('House 1 found!');
Mouse(x+50,y+50,2,0,true);
Writeln('Moving to house 2...');
Wait(7000+random(450));
if(FindColorTolerance(x,y,House2Color,0,0,700,700, 50)) then
begin
Writeln('House 2 found!');
Mouse(x,y-30,2,2,true);
Writeln('Moving to halfway bank...');
Wait(8000+random(550));
Writeln('Halfway bank found!');
Mouse(700,117,2,2,true);
Wait(10000+random(700));
MoveToBank;
end else
begin
Writeln('House 2 not found!');
end
end else
begin
Writeln('House 1 not found!');
end
end;

procedure Smelt;
begin
Writeln('Searching furnace...');
if(FindColorTolerance(x,y,FurnaceColor,0,0,600,600 ,50)) then
begin
Writeln('Furnace found!');;
Mouse(x,y,2,2,true);
Writeln('Smelting iron bars...');
Wait(3000+random(300));
if(FindColorTolerance(x,y,IronBarColor,0,400,700,7 00,50)) then
begin
Writeln('Iron bar found!');
Mouse(x,y,2,2,false);
Wait(500+random(100));
Mouse(x,y+30,2,2,true);
Wait(800+random(150));
SendKeys('28'+chr(13));
Wait(40000+random(1000));
FurnaceToBank;
end else
begin
Writeln('Iron bar not found!');
end
end else
begin
Writeln('Furnace not found!');
end
end;

procedure FindFurnace;
begin
Writeln('Searching furnace icon...');
if(FindColorTolerance(x,y,FurnaceIconColor,0,0,700 ,700,50)) then
begin
Writeln('Furnace icon found!');
Mouse(x,y,2,2,true);
Wait(10000+random(700));
Smelt;
end else
Writeln('Furnace icon not found!');
end;

procedure BankToFurnace;
begin
Writeln('Moving to halfway bank...');
Writeln('Halfway bank found!');
Mouse(583,52,2,2,true);
Writeln('Moving to house 1...');
Wait(10000+random(750));
if(FindColorTolerance(x,y,House1Color,0,0,700,700, 50)) then
begin
Writeln('House 1 found!');
Mouse(x,y,2,2,true);
Wait(7000+random(750));
FindFurnace;
end else
begin
Writeln('House 1 not found!');
end
end;

begin
Wait(1000+random(100));
repeat
SetupSRL;
BankToFurnace;
until(Banked = Ores/28)
Writeln('--------------------');
Writeln('Autosmelter results:');
Writeln('--------------------');
Writeln('Banked:');
Writeln(IntToStr(Banked));
Writeln('--------------------');
end.

Edited.

Please post progress report.

Tyvm,
Rob

3Garrett3
05-13-2007, 08:37 PM
it wont work, you need tolerance in there, so instead of findcolor, use findcolortolerance. then it will work i think.

JAD
05-14-2007, 01:27 AM
Why don't you have it repeat doing that? Smelting and banking.

And you should definately use a DTM for the ores/bars, and as said above, use Tolerance.

MoveMouse, MoveMouseSmoothEx, MoveMouseSmooth and ClickMouse Will All Get You Banned! Use MMouse and Mouse. To read about those, check out my tutorial (links in sig) things the beginner tuts don't teach you.

And as far as standards go, check out my tutorial learning the things to become a SRL member (links also in sig for that). That also has DTM/Bitmap explanation and how to use, and a lot more.

Not sure if it'd be to advanced for you to read all of that tut, but you should definately read about standards and possibly DTMs in it.

Good try for your first script, but this will get you banned, and wouldn't be very reliable.

kooldude
05-14-2007, 02:15 AM
its not bad for your first script, Change the clickmouse, to Mouse, or mmouse. lso u can make it bank more than 1 time, just make it repeat in main loop

dark evil
05-14-2007, 02:05 PM
hi, you need to change the clickmouse and turn it to mmouse as kool said
and i also have thes proplems when i make my first script
thes script is good for first script.
best wishes for all
dark evil

Robbiej
05-14-2007, 03:01 PM
Why don't you have it repeat doing that? Smelting and banking.

[..]



And it only does 1 load from bank to bank since I haven't made that yet...

Thanks for your comments :) I'll try MMouse and FindCOlorTolerance

Ehm... i changed all MoveMouseSmooth(x,y); to MMouse(x,y,0,0); and got the following error:
Line 30: [Error] (30:1): Unknown identifier 'MMouse' in script

3Garrett3
05-14-2007, 10:12 PM
you need

{.include SRL/SRL.scar}


right under the program name part.

and add


SetupSRL;


to the beggining of your main loop.

Robbiej
05-20-2007, 11:05 AM
I edited the script. Now it should work, but it still doesn't

Robbiej
05-20-2007, 11:08 AM
It comes up with this error:


Failed when compiling
Line 9: [Error] (17344:1): Duplicate identifier 'x' in script

JAD
05-20-2007, 03:07 PM
It comes up with this error:

x,y are already variables automatically, without needing to be declared if you are including SRL in a script. So you don't need a var x,y: Integer;, because its already in the SRL include, and it will give you an error if you try to like you did.

I was confused about that a few months ago when I just started too ;)

Robbiej
05-20-2007, 03:19 PM
Ah ok, thanks!

Now it's done to be tested..

JAD
05-20-2007, 03:35 PM
Ah ok, thanks!

Now it's done to be tested..

Just so you know, Mouse(x,y,0,0,true) does the exact same thing as

MMouse(x,y,0,0)
Mouse(x,y,0,0,true)

because mouse moves the mouse to the spot and clicks, MMouse just moves it there.

Whenever you do waits though (for the most part) You should always have a randomness to it or its very detectable. So

Wait(500) Should be Wait(500+random(200));

You should add random parameters to your mousing though or Jagex will notice your clicking on the same color over and over.

Mouse(x,y,2,2,true) or Mouse(x,y,3,3,true) Would be good enough.

Robbiej
05-20-2007, 06:08 PM
Rofl, lots of just security mistakes..

All fixed...

Please post progress reports