SRL Archive - OSR Help

Few questions about smelter


trojan

2011-02-05 14:58:32

I am currently making an Al Kharid Steel Bar Smelter.

1. What's the best method of finding the furnace, TPA?, changing camera angle and looking for the fire colour?
2. What's the best method of finding the furnace building? All of the buildings on the minimap have pretty much the same colour flooring

So far I have got it to walk to the halfway point, rest, walk back to the halfway point, walk to the bank, Bank and withdraw… all I need is to sort the furnace out.
Please help people :D thanks

**BANNED The Man

2011-02-05 15:04:41

1. I think the problem with AK has always been that there are always the same colours on the screen.
I would:
Findcolour(x) and findcolour(y), if distance between points is less than a certain amount thwn you have found your furnace/object.

Awkwardsaw

2011-02-05 15:05:37

to find the building, learn DDTMs, as for the furnace, learn about ATPAs to get the grey furnace color. :)

TomTuff

2011-02-05 15:17:09

1. I would do a TPA. The opening of the furnace faces eastwards, so as long as the compass is between 45° and 135°, you should be able to make a TPA of the red color of the furnace. If the compass is not in this range (use rs_GetCompassAngleDegrees), rotate it to this range (MakeCompass(45 + Random(90)).
2. I would use a (D)DTM. Take a point from the center of the furnace building, and take the other points from the white outline of the furnace building (I would definitely get the 4 corners, and some in between).

**BANNED The Man

2011-02-05 15:22:04

From: TomTuff
1. I would do a TPA. The opening of the furnace faces eastwards, so as long as the compass is between 45° and 135°, you should be able to make a TPA of the red color of the furnace. If the compass is not in this range (use rs_GetCompassAngleDegrees), rotate it to this range (MakeCompass(45 + Random(90)).
2. I would use a (D)DTM. Take a point from the center of the furnace building, and take the other points from the white outline of the furnace building (I would definitely get the 4 corners, and some in between).


But AFAIK, if you face the furnace, you can see the Cooking (range?) next door.

Awkwardsaw

2011-02-05 15:24:48

From: Dynamite
But AFAIK, if you face the furnace, you can see the Cooking (range?) next door.


which is why you need an ATPA, to sort through the TPA sizes. also you can do sorttpa(tpa, point(mscx, mscy)) which will sort the tpas in a spiral that is closest to that point, so if your standing next to the furnace, the red furnace color will always be the first tpas in the array

**BANNED The Man

2011-02-05 15:25:59

From: Awkwardsaw
which is why you need an ATPA, to sort through the TPA sizes. also you can do sorttpa(tpa, point(mscx, mscy)) which will sort the tpas in a spiral that is closest to that point, so if your standing next to the furnace, the red furnace color will always be the first tpas in the array


Agreed, which is why I quoted his post not yours xD

-Boom

trojan

2011-02-05 15:37:35

I have learnt ATPA's and DDTM's, I just wasn't sure whether they would work for this.
I tried using the other smelter and it seemed to be clicking all over the place and getting lost all the time, that's why I decided to make a new one.

So should I create a DDTM for the walking to the furnace with MP in the middle of the building an 4 SP's on each corner. For finding the furnace make the compass slightly east or west whichever way it is and make an ATPA?

Awkwardsaw

2011-02-05 15:42:52

From: trojan
I have learnt ATPA's and DDTM's, I just wasn't sure whether they would work for this.
I tried using the other smelter and it seemed to be clicking all over the place and getting lost all the time, that's why I decided to make a new one.

So should I create a DDTM for the walking to the furnace with MP in the middle of the building an 4 SP's on each corner. For finding the furnace make the compass slightly east or west whichever way it is and make an ATPA?


exactly, :)

or for walking, i also highly suggest using this tutorial: http://villavu.com/forum/showthread.php?p=775269#post775269

it's actually very, very easy and stable to use

trojan

2011-02-05 17:06:58

From: Awkwardsaw
exactly, :)

or for walking, i also highly suggest using this tutorial: http://villavu.com/forum/showthread.php?p=775269#post775269

it's actually very, very easy and stable to use


I've been learning from Coh3n's All in one scripting tutorial
http://villavu.com/forum/showthread.php?p=618676
but he only mentioned using DDTM's, Radial and Symbols for walking. Is this outdated?

like for my walking to the halfway point I have a (D)DTM, then a failsafe of Radial then Symbols. Would I be better off using this TPA walking and have DDTM, Radial and Symbols as a failsafe? or keep what I have and just use TPA walking for the furnace?

Awkwardsaw

2011-02-05 17:49:48

i would do DDTM first, then tpa, radial, and then symbols for a failsafe, in that order.

trojan

2011-02-05 17:58:31

Okay thanks mate, you have been a big help I'll credit you in my script :)

Edit: The DDTM for walking to the furnace didn't work, you can't set the main point in the middle because the symbol moves around and that messes up the colours :'(

smurg

2011-02-05 22:18:50

FurnaceTile := Point(x, y);

Click it.

trojan

2011-02-06 05:30:21

I understand nothing atall about Tiles are there any guides of them?

KingKong

2011-02-06 06:56:57

Tiles are basically just that-tiles, you should be able to see different tiles on the rs mainmap, and each tile has something on it, and if you have the tile, you can just mouse(tile.x, tile.y, rx, ry, true)

Awkwardsaw

2011-02-06 07:52:32

what if he doesnt want to use reflection?

trojan

2011-02-06 11:52:32

I'm using reflection anyway for the "Until not (characteranimating)" function to tell when I have stopped smithing. I have already proven that I can use DDTMs, TPA's, Radial and Symbol finding to walk. If reflection will make it more reliable then I am willing to use it.

3Garrett3

2011-02-06 13:00:10

Why would you need reflection to wait while smelting? You should have a function that checks for whether or not there is any ore left in the inventory, and if not then you have finished. The only other thing that would stop it is leveling up, which you can check for (I think if you ClickToContinue then it will restart smelting by its own)

You should check out my Baby Melter script, it's out of date and wouldn't compile now, but I used colour for everything except banking. It made it much more accurate and smart than what SRL was (still is) capable of (which isn't much in terms of counting stacked objects iirc).

trojan

2011-02-06 13:23:32

there is an ore in the inventory though cos you withdraw 10 iron and 18 coal that leaves 1 iron at the end, I have a level up check in, and I just need to add the ClickFurnace function now then It's ready for testing

3Garrett3

2011-02-06 13:30:04

From: trojan
there is an ore in the inventory though cos you withdraw 10 iron and 18 coal that leaves 1 iron at the end, I have a level up check in, and I just need to add the ClickFurnace function now then It's ready for testing


In my script I just had it type in the 'Withdraw X' once because then RS saves that value and you can choose the option 'Withdraw 9' after that. It's much easier, just takes the extra time once.

E:

Either way, you can say 'If OresLeft < X then DoneSmelting', you just have to decide the X value (I'd say 1, but I guess you could do more.

Awkwardsaw

2011-02-06 13:36:52

what you can do is something of this nature:


const
bar_Bronze = 0;
bar_Iron = 1;
bar_Steel = 2;
bar_Mith = 3;
bar_Addy = 4;
bar_Rune = 5;
bar_Cannon = 6;

blackline_Ore = 0; //what ever the black line count of ore is
blackline_Bar = 0; //what ever the black line count of bars are

function oreleft(bar : integer) : integer;
begin
case bar of
0, 1, 3, 5, 6 : result := 0;
2, 4 : result := 1;
end;
end;

begin
repeat
wait(100);
until CountItemsBlackLine(blackline_Ore, 10) <= oreleft(bar_Steel);
end.

smurg

2011-02-06 15:52:30

From: trojan
I understand nothing atall about Tiles are there any guides of them?


Cstrike's tutorial:
http://villavu.com/forum/showthread.php?t=59400

From: Awkwardsaw
what if he doesnt want to use reflection?


What if he doesn't want to use color?

Why is everyone so hostile about reflection here?

trojan

2011-02-07 10:07:26

From: 3Garrett3
In my script I just had it type in the 'Withdraw X' once because then RS saves that value and you can choose the option 'Withdraw 9' after that. It's much easier, just takes the extra time once.

E:

Either way, you can say 'If OresLeft < X then DoneSmelting', you just have to decide the X value (I'd say 1, but I guess you could do more.


well if you did withdraw x, you would have to do withdraw 9 for iron then withdraw 18 for coal, wouldn't it just save the 18? I was trying to make it more human like as thats what I do when I'm smithing anyway just withdraw 10 iron then withdraw all coal.

And I understand that if I use reflection for walking there is a good chance I will get turned down for members.

3Garrett3

2011-02-07 11:36:23

From: trojan
well if you did withdraw x, you would have to do withdraw 9 for iron then withdraw 18 for coal, wouldn't it just save the 18? I was trying to make it more human like as thats what I do when I'm smithing anyway just withdraw 10 iron then withdraw all coal.

And I understand that if I use reflection for walking there is a good chance I will get turned down for members.


For something so simple, yes. I used TPA walks, and it was very simple. Two steps is something you should be able to do well with colour. As always, feel free to look at my script, as well as any other AK smelters, and you will have tons of new ideas :)

Awkwardsaw

2011-02-07 21:43:30

From: smurg

What if he doesn't want to use color?

Why is everyone so hostile about reflection here?


I wasn't aware he was using reflection when i posted, so i assumed he was just using color :p

and how did i seem hostile torwards reflection?