SRL Archive - OSR Help

How to tell when ore mined?


Syntax

2012-06-09 04:23:05

Just wondering I use waits which are bad if there is competition around (and a bit more detectable) what should i use to detect when the ore is mined? And then move ont o the next one.

Thanks.

YoHoJo

2012-06-09 04:26:47

My powerminer uses inventory count checks, and a timer (set by user).
If inventory count increases, ore is mined.
If there is competition and someone gets ore before, once timer elapses it will move on to another ore. Ideally user sets timer to appx how long it takes them to mine an ore so not very much time is wasted if someone beats you to the ore.
Also ideally there is no competition so inventory count just always works.

Syntax

2012-06-09 05:14:27

From: YoHoJo
My powerminer uses inventory count checks, and a timer (set by user).
If inventory count increases, ore is mined.
If there is competition and someone gets ore before, once timer elapses it will move on to another ore. Ideally user sets timer to appx how long it takes them to mine an ore so not very much time is wasted if someone beats you to the ore.
Also ideally there is no competition so inventory count just always works.


Sounds like a good idea thanks :)

Velvet Glam

2012-06-09 13:16:48

The hands down best way is to track the ore color and if it disappears the rock has been mined

the other suggested methods can be backups

putonajonny

2012-06-09 13:20:39

Just before I click I normally do:
FTab(Tab_Inv);//So that it doesn't move the mouse away from the rock to click
StoredInvCount := InvCount;

After you click the rock do:
GetMousePos(x, y);
StoredPoint := Point(x, y);
Then do:
MarkTime(Time);
While(CountColorTolerance(RockColour, StoredPoint.x1 - 10, StoredPoint.y1 - 10, StoredPoint.x1 + 10, StoredPoint.y1 + 10, 10) > 5)do
begin
if(StoredInvCount <> InvCount)then
break;
if(TimeFromMark(Time) > 10000)then
break;
Wait(50+Random(50));
end;

YoHoJo

2012-06-09 15:51:48

Nice way to track the rock, only reason I don't use that is because it only works if the rock is adjacent to you. If your player moves at all after the click/point store then the storepoint will be wrong :(.

Velvet Glam

2012-06-09 17:02:08

From: YoHoJo
Nice way to track the rock, only reason I don't use that is because it only works if the rock is adjacent to you. If your player moves at all after the click/point store then the storepoint will be wrong :(.


What do you mean?

1) Click rock
2) Begin tracking rock and updating coords while you move to that rock
3) Once you have stopped moving, store your final coord
4) Create a box around that final coord to check if it is gone/still there

I cant think of any reasons why your character would move?…after those steps

YoHoJo

2012-06-09 17:11:22

I was referring to putonajonny's post, your method is fine code would be nice ::))

putonajonny

2012-06-09 18:08:00

From: YoHoJo
Nice way to track the rock, only reason I don't use that is because it only works if the rock is adjacent to you. If your player moves at all after the click/point store then the storepoint will be wrong :(.


Yeah that was the code from a script I wrote that only mined the rocks next to you, tracking wouldnt be too hard

Syntax

2012-06-12 09:28:15

Tried both methods, is using objectdtms better? Someone said to use these in a PM.