SRL Archive - OSR Help

Detecting exploding gas? no reflection?


Cage

2014-06-19 02:25:20

Hello all I am having issues detecting exploding gas with my mining script. Is there any method of implementing this detection using color?

Any advice would be greatly appreciated!

KeepBotting

2014-06-19 08:41:30

FindNormalRandoms;
? Not sure. Can't remember.

Frement

2014-06-19 09:57:08

function DetectGas(X, Y: Integer): Boolean;
var
tmpCTS, ColorCount: Integer;
tmpHue, tmpSat: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
GetColorSpeed2Modifiers(tmpHue, tmpSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.31, 0.35);

SMART_DrawBoxEx(True, False, IntToBox(X - 10, Y - 10, X + 10, Y + 10), clRed);

ColorCount := CountColorTolerance(8097941, X - 10, Y - 10, X + 10, Y + 20, 13);

Result := (ColorCount > 10);

SetColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(tmpHue, tmpSat);
end;

You feed the function the center coordinates of the rock you are mining.

Cage

2014-06-20 15:54:10

Thanks mate. I appreciate it. :)