SRL Archive - Reflection Discussion

Reflection finding gas


Baked0420

2009-01-18 10:41:23

Does anyone know if they can find gas with reflection? if so can you write it out for me, or teach me how to find gas using reflection if it is possible, I'd assume it would be though. I just wanna make a quick iron powerminer to get my mining level up, this script wouldn't be posted. So if anyone can help me please do, thanks.

Method

2009-01-18 11:09:02

Store the tile of the rock you're mining (as well as the ID), and continuously use GetObjectAt on the rock's tile to see if the ID has changed. If so, you know you have either mined the rock or it's a gaseous rock, and you need to switch rocks anyways.

almost

2009-01-18 13:35:43

If you make your miner find rocks by their ID, it will be impossible to start mining a rock with gas. (the ID will be different from a normal rock)
You can still get gas AFTER you click on a rock, and that is where what Method mentioned comes in.

Widget

2009-01-18 19:59:29

Really all someone with a reflection miner has to do is get the IDs of a rock with gas (debug it out and post it here). If we can get the IDs of the rocks, and the gas IDs of two different rocks, then we should be able to figure out the gas IDs for most of them.

Method

2009-01-18 20:03:15

From: Widget
Really all someone with a reflection miner has to do is get the IDs of a rock with gas (debug it out and post it here). If we can get the IDs of the rocks, and the gas IDs of two different rocks, then we should be able to figure out the gas IDs for most of them.


You don't even need the IDs of the gaseous rocks because you only need to check that the ID has changed to know that you need to switch rocks.

Baked0420

2009-01-18 20:04:55

if you tell me how I can debug it out I'll do it, I just don't know how to make the debug show the ID w/o already knowing the ID.

almost

2009-01-20 14:55:22

Yup my miner doesn't use any IDs for gas rocks.
To get the IDs for objects look in the reflection folder then in the objects folder.
I believe it is GetObjectAt?
Im at school atm so I can't look.

Simtoon

2009-01-20 21:34:32

From: Baked0420
if you tell me how I can debug it out I'll do it, I just don't know how to make the debug show the ID w/o already knowing the ID.


cant u like use rsbot with the debug on while mining and when the gas comes the id will show up?

Blumblebee

2009-01-20 21:42:05

From: Baked0420
if you tell me how I can debug it out I'll do it, I just don't know how to make the debug show the ID w/o already knowing the ID.


heres some help,

function ObjExists(Tile : TPoint): Boolean;
var
O: UID;
begin
O := GetObjectAt(Tile.x, Tile.y);
Result := InIntArray(UpIDs, O.ObjType);
end;

UpIds of course is a TIntegerArray (a global var) for the ids of the rocks.

use it in conjection with your object finding ex.

if FindObject(p, 0) then
if ObjExists then Result := True;
if Result then DoRestOfScript;

something along those lines? I hope that helps you understand why you dont need to have the ids of the gas, as your looking for when the id is not the rock id, instead of looking for the gas id.