SRL Archive - SRL Archives

RunGas (Ore : Integer) : Boolean;


ub3r |<1||3r*1337*

2006-05-14 13:43:01

Its all what you've people have been waiting for! A Perfect Gas finder! it checks for the ore you've made it look for, and it will look for it! Driger helped a lot with the function! Thanks driger!

Post any other bugs here!!

1 = Copper

2 = Tin

3 = Iron

thats all i have for now. Need more vids for the other ores.

[php]Function RunGas (Ore : Integer) : boolean;
var
ghx, ghy, color1, color2, color3:integer;
begin
case ore of
1 : begin
color1 := 7441057;
color2 := 8164779;
color3 := 7769505;
end;
2 : begin
color1 := 11185328;
color2 := 10857131;
color3 := 10001567;
end;
3 : begin
color1 := 9016474;
color2 := 8687006;
color3 := 6516605;
end;
end;
if(findcolortolerance(ghx, ghy, color1, MSX1, MSY1, MSX2, MSY2, 10)) and
(findcolortolerance(ghx, ghy, color2, MSX1, MSY1, MSX2, MSY2, 10)) and
(findcolortolerance(ghx, ghy, color3, MSX1, MSY1, MSX2, MSY2, 10)) then
begin
WriteLn('Gas Found! Running Away!')
SetRun(True);
RunAwayDirection('N');
RunBack;
end else
begin
ClearDebug;
WriteLn('No Gas was Found')
end;
end;[/php]

Ejjman

2006-05-14 13:43:59

Ha, you kickass Ub3r. Great job, and I knew you could do it!

driger1592

2006-05-14 14:13:51

There's a better way to do this. Make variables for the colors, and have them set via cases, then you can just run the main loop in the procedure once at the end ;) Many, many less lines :p
Function RunGas (Ore : Integer) : boolean;
var
ghx, ghy, color1, color2, color3:integer;
begin
case ore of
1 : begin
color1 := 7441057;
color2 := 8164779;
color3 := 7769505;
end;
2 : begin
color1 := 11185328;
color2 := 10857131;
color3 := 10001567;
end;
3 : begin
color1 := 9016474;
color2 := 8687006;
color3 := 6516605;
end;
end;
if(findcolortolerance(ghx, ghy, color1, MSX1, MSY1, MSX2, MSY2, 10)) and
(findcolortolerance(ghx, ghy, color2, MSX1, MSY1, MSX2, MSY2, 10)) and
(findcolortolerance(ghx, ghy, color3, MSX1, MSY1, MSX2, MSY2, 10)) then
begin
WriteLn('Gas Found! Running Away!')
SetRun(True);
RunAwayDirection('N');
RunBack;
end else
begin
ClearDebug;
WriteLn('No Gas was Found')
end;
end;
There ya go ;)

ub3r |<1||3r*1337*

2006-05-14 14:41:03

Thanks! I Greatly reward you!!
I was working on it but couldnt figure out how to put it…
Thank you Driger!

driger1592

2006-05-14 14:44:27

If you ever need help, feel free to ask over MSN :p

WT-Fakawi

2006-05-14 14:46:52

but: my guess is: it will almost continiously run off. Many Players actually wear Gas colored Clothes. I once tried to solve gas that way, (Looking for colors) but after one night at rimmington and 100 ores and very very odd behaviour, I realised it wasnt the way to go.

Try experimenting with Piv's GasCheck, really the ultimate checker that is!

Ejjman

2006-05-14 15:04:24

Agh, I don't know how to properly use Piv's gascheck though!

It's confusing!

ub3r |<1||3r*1337*

2006-05-14 16:40:55

ok… I tested my gas finder… and it though there was gas… oh well… I guess this is out of the question.