SRL Archive - Discussions and Debates

Piv's Gascheck...


ub3r |<1||3r*1337*

2006-06-12 20:35:35

Ok. I have noticed, that most people, only put this for gas checking in their script.[php]Gascheck(x, y)[/php] and it will find the gas, BUT, it wont click the minimap to stop it from mining. so, I simply added a click mouse thing (with failsafe. copied from gasfound; ) and i changed the range of the detector, so it would be able to pick up more.

this is Piv's gascheck edited by me. (i'm only trying to make it better)

[php]{*******************************************************************************
function GasCheck(gx, gy: integer): Boolean;
By: piv
Description: Pivs GasChecker.
*******************************************************************************}
function GasCheck(gx, gy: integer): Boolean;
var
clientcanvas,gascanvas1,gascanvas2:tcanvas;
xG,yG,count:integer;
pic1, pic2: integer;
Failsafe:integer;
begin
if(FindColortolerance(xG,yG,8296866,gx-30,gy-30,gx+30,gy+30,20))then
begin
pic1 := bitmapfromstring(40,40,'');
pic2 := bitmapfromstring(40,40,'');
gascanvas1:=getbitmapcanvas(pic1);
gascanvas2:=getbitmapcanvas(pic2);
clientcanvas:=getclientcanvas;
copycanvas(clientcanvas,gascanvas1,gx-30,gy-30,gx+30,gy+30,0,0,40,40);
wait(100);
copycanvas(clientcanvas,gascanvas2,gx-30,gy-30,gx+30,gy+30,0,0,40,40);
count:=0;
for yG:=1 to 40 do
for xG:=1 to 40 do
if((gascanvas1.pixels[xG,yG])<>(gascanvas2.pixels[xG,yG]))then
count:=count+1;
writeln(inttostr(trunc(((count)/1024)*100))+'% change.');
if(count>150)then //if more than 15% change
begin
result:=true;
MouseFlag(648,84,2,2);
repeat
FailSafe := FailSafe+1;
Wait(250);
until(FailSafe>=25)
end;
FreeBitmap(pic1);
FreeBitmap(pic2);
end;
end;
[/php]

Test it out! the chances of getting a gas found have increased by a lot, and it is easier to set up, so you dont have to put in[php]Gascheck(x, y);
if (Gascheck(x, y) = True) then
begin
Mouse(gx, gy, 2, 2, True);
WriteLn('Gas Found!')
end;[/php] mostly for lazy scripters:p

Wizzup?

2006-06-13 07:44:59

Hm…it is fine as it is. :)

A note would be usefull though.