SRL Archive - SRL Archives

Procedure SpotGas;


Ejjman

2006-05-13 20:55:13

const
Gas1 = 10793660; //Gas Color DON'T CHANGE
Gas2 = 9216424; //Gas Color DON'T CHANGE
Gas3 = 10072761; //Gas Color DON'T CHANGE
Gas4 = 8163232; //Gas Color DON'T CHANGE
Gas5 = 10726577; //Gas Color DON'T CHANGE
Gas6 = 7111560; //Gas Color DON'T CHANGE
Gas7 = 9083806; //Gas Color DON'T CHANGE
Gas8 = 10463923; //Gas Color DON'T CHANGE
Gas9 = 9346470; //Gas Color DON'T CHANGE
OreCol1 = 4615832; //Gas Color DON'T CHANGE
OreCol2 = 4351628; //Gas Color DON'T CHANGE

procedure SpotGas; //Spots gas in RS client and then will wait if finds it.
begin
if(FindColorSpiralTolerance(x, y, Gas1, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas2, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas3, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas4, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas5, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas6, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas7, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas8, 0, 0, 507, 326, 10)) or
(FindColorSpiralTolerance(x, y, Gas9, 0, 0, 507, 326, 10)) then
begin
BenMouse:=False;
Mouse(647, 84, 8, 8, True);
BenMouse:=True;
Wait(10000);
end;
end;

I actually got a video of the gas playing and tested it and it works great. I was wondering if I could get it put into SRL\SRL\skill\mining.scar . Thanks for taking a look! Post feedback.

phantombmx

2006-05-13 21:16:20

try making it into two seperate functions.. FindGas, HandleGas.. also try to use locals as much as possible.. dont use x and y.. heres the split up code..

function FindGas:Boolean; //Returns true if gas is found.
var cx, cy:integer;
begin
if(FindColorSpiralTolerance(cx, cy, 10793660, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9216424 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10072761, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 8163232 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10726577, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 7111560 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9083806 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10463923, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9346470 , 0, 0, 507, 326, 10))then
Result:=True;
end;

function HandleGas:Boolean; //Returns true if found and handled.
begin
if(FindGas)then
begin
Mouse(647, 84, 8, 8, true);
repeat
Wait(50+random(50));
until(not(FindGas))
Result:=True;
end;
end;

Dankness

2006-05-13 21:43:49

[php]
var Gas : Array [ 1.. 9 ] of Integer;
OreColor1,OreColor2 : Integer;

procedure SetGasColors;
begin
Gas[1] := 10793660; //Gas Color DON'T CHANGE
Gas[2] := 9216424; //Gas Color DON'T CHANGE
Gas[3] := 10072761; //Gas Color DON'T CHANGE
Gas[4] := 8163232; //Gas Color DON'T CHANGE
Gas[5] := 10726577; //Gas Color DON'T CHANGE
Gas[6] := 7111560; //Gas Color DON'T CHANGE
Gas[7] := 9083806; //Gas Color DON'T CHANGE
Gas[8] := 10463923; //Gas Color DON'T CHANGE
Gas[9] := 9346470; //Gas Color DON'T CHANGE
OreCol1 = 4615832; //Gas Color DON'T CHANGE
OreCol2 = 4351628; //Gas Color DON'T CHANGE
end;

procedure SpotGas; //Spots gas in RS client and then will wait if finds it.
var CX, CY, I : Integer;
begin
for I := 1 to 9 do
begin
if Gas = 0 then
SetGasColors;

if ( FindColorSpiralTolerance ( CX, CY, Gas, MSX1, MSY1, MSX2, MSY2, 10 )) then
begin
BenMouse:=False;
Mouse(647, 84, 8, 8, True);
BenMouse:=True;
Wait(10000);
end;
end;
[/php]

thats cleaner…

Dark_Sniper

2006-05-13 21:45:07

yes use locals… and phantom use result to its fullest so remeber to put in result:= false;…

function FindGas:Boolean; //Returns true if gas is found.
var cx, cy:integer;
begin
Result:= False;
if(FindColorSpiralTolerance(cx, cy, 10793660, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9216424 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10072761, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 8163232 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10726577, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 7111560 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9083806 , 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 10463923, 0, 0, 507, 326, 10))or
(FindColorSpiralTolerance(cx, cy, 9346470 , 0, 0, 507, 326, 10))then
Result:=True;
end;

function HandleGas:Boolean; //Returns true if found and handled.
begin
if(FindGas)then
begin
Mouse(647, 84, 8, 8, true);
repeat
Wait(50+random(50));
until(not(FindGas))
Result:=True;
end else
Result:= False;
end;

but this should work.

phantombmx

2006-05-13 21:49:39

boolean is automatically false.. so no need for result:=false ;)

Renax

2006-05-13 23:05:46

just color isn't good for gas… and phantom why shouldn't we use x and y ?

WhiteShadow

2006-05-13 23:25:17

From: Renax
just color isn't good for gas… and phantom why shouldn't we use x and y ?


Maybe Phantom didn't want it to interfer with the older stored integers, for x, and y?

phantombmx

2006-05-13 23:39:15

From: WhiteShadow
Maybe Phantom didn't want it to interfer with the older stored integers, for x, and y?


exactly ;)

if we used x and y.. it would mess up a script.. think about it

procedure Mine;
begin
if(FindOre)then
Mouse(x, y);
HandleGas;
Mouse(x,y);
end;

this may work out, but its just safer to stay away from using too many globals..

XxKanexX

2006-05-14 00:39:46

Major lag. Since it's all "or's" it will still look for all the colors.

Dank was correct on what he did, but there should be an exit in there. Because it will still look for the rest if found ;)


var Gas : Array [ 1.. 9 ] of Integer;
OreColor1,OreColor2 : Integer;

procedure SetGasColors;
begin
Gas[1] := 10793660; //Gas Color DON'T CHANGE
Gas[2] := 9216424; //Gas Color DON'T CHANGE
Gas[3] := 10072761; //Gas Color DON'T CHANGE
Gas[4] := 8163232; //Gas Color DON'T CHANGE
Gas[5] := 10726577; //Gas Color DON'T CHANGE
Gas[6] := 7111560; //Gas Color DON'T CHANGE
Gas[7] := 9083806; //Gas Color DON'T CHANGE
Gas[8] := 10463923; //Gas Color DON'T CHANGE
Gas[9] := 9346470; //Gas Color DON'T CHANGE
OreCol1 = 4615832; //Gas Color DON'T CHANGE
OreCol2 = 4351628; //Gas Color DON'T CHANGE
end;

procedure SpotGas; //Spots gas in RS client and then will wait if finds it.
var CX, CY, I : Integer;
begin
for I := 1 to 9 do
begin
if Gas[i] = 0 then
SetGasColors;

if ( FindColorSpiralTolerance ( CX, CY, Gas[i], MSX1, MSY1, MSX2, MSY2, 10 )) then
begin
BenMouse:=False;
Mouse(647, 84, 8, 8, True);
BenMouse:=True;
Wait(10000);
[b]Exit;[/b]
end;
end;

Ejjman

2006-05-14 00:42:28

Ok, this procedure was fast, and I just tested and made. So, forget it, and I don't think I can make it.

Wizzup?

2006-05-14 03:04:11

From: Renax
just color isn't good for gas… and phantom why shouldn't we use x and y ?


True, gas color is too common in runescape.

WT-Fakawi

2006-05-14 03:32:10

Pivs gaschecker is still the BEST checker around. It scans for changes in the "background" by continiously comparing bitmaps of the screen. You might want to experiment with that and lower the threshold. That will work. It will stop mining tooo when someone walks "through" you. but at least it wont pounder on a gasrock like a fool. Allthough SRL will say " oo dam" and "wasnt paying attention" stuff like that, to excuse itself:)

c0de

2006-05-14 04:57:52

I think jagex updated something and it won't let low lvls to mine gas rocks :S atleast it didn't let my char :|

What I used:

Lvl: 3
Mining: 7-10
Pick: Bronze
Rock: Copper

The Un-Named

2006-05-14 05:16:30

From: phantombmx
boolean is automatically false.. so no need for result:=false ;)


I've said it before and will say it again, sometimes you get errors if you don't set booleans/integers, this could be caused because the script goes too fat and wonders why there's no begining result set.

Anyways, using too many colors can lag. ^^