SRL Archive - News and General

Nvm


elementalelf

2007-09-11 05:50:22

ok, the object of this scripting competition is to take the procedure that WT-Fawaki has provided in the 2nd post, and make it work so that it will find the closest fire to the player.

the best one gets a copy of the completed tutorial island runner script(usually an SRL members only script)

WT-Fakawi

2007-09-11 05:56:24

//----------------------------------------------------------------------------//

Function ThereIsFire(var WhereX,WhereY:integer):boolean;
var
acc,ref : Extended;
var
XT, YT,times,tol, Fire : Integer;
begin
Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');

ref:=0.8; tol:=1;
for times:=1 to 4 do
begin
FindDeformedBitmapToleranceIn(Fire, XT, YT, MSCX-(25*times),MSCY-(25*times),MSCX+(25*times),MSCY+(25*times), tol, 2, True, acc);
if (acc >= ref) then
begin
WhereX:=XT;
WhereY:=YT;
Result := True;
FreeBitMap(Fire);
Exit;
end;
ref := ref - 0.1;
tol:=tol+10;
wait(1);
end;
Result:=False;
FreeBitMap(Fire);

end;

Finds it, returns the coords in WhereX and WhereY.

EDIT: sry, didnt see it was for non members :)

elementalelf

2007-09-11 07:04:13

From: WT-Fakawi
//----------------------------------------------------------------------------//

Function ThereIsFire(var WhereX,WhereY:integer):boolean;
var
acc,ref : Extended;
var
XT, YT,times,tol, Fire : Integer;
begin
Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');

ref:=0.8; tol:=1;
for times:=1 to 4 do
begin
FindDeformedBitmapToleranceIn(Fire, XT, YT, MSCX-(25*times),MSCY-(25*times),MSCX+(25*times),MSCY+(25*times), tol, 2, True, acc);
if (acc >= ref) then
begin
WhereX:=XT;
WhereY:=YT;
Result := True;
FreeBitMap(Fire);
Exit;
end;
ref := ref - 0.1;
tol:=tol+10;
wait(1);
end;
Result:=False;
FreeBitMap(Fire);

end;

Finds it, returns the coords in WhereX and WhereY.

EDIT: sry, didnt see it was for non members :)


1. this thread has already been deleted, i know forum admins can see deleted posts, but i thought you would be able to tell the difference :)

2. hmm, you do realise you can see my script anyway?

3. thank you very much man, i will use this.

4. script should be completed within the next 24 hours.
edit:
btw this was the one i was working on, but it didnt work, i thin i mixed up the begin/end nesting.


procedure cookshrimp;
var countr:integer;
begin
repeat
if(countr=8)then
begin
logout;
writeln('sorry mate, got stuck at the fire');
terminatescript;
end else
begin
if(findcolortolerance(lulx,luly,360275,msx1,msy1,msx2,msy2,10))then
begin
mouse(705, 229, 1, 1, true);
wait(50);
if(findobj(lulx, luly, 'Fire', 3650275, 10))then
begin
mouse(lulx, luly, 1, 1, true);
flag;
wait(5000);
end;
if(findnpcchattext('right cli')) then
begin
cookshrimp;
exit;
end;
end;
end;
countr:=countr+1;
until(findnpcchattext('urnt'));
end;

edit: just thought of something to make this stilll a valid competition with a decent prize… see top post for details

Starblaster100

2007-09-11 07:07:01

This thread hasn't been deleted, otherwise you wouldn't even be able to see it.

It is still available for all to see

mat_de_b

2007-09-11 11:57:59

I can see it :D