Boreas
2007-01-09 23:54:25
This may turn into:
something you run your players on to get ready for another script
something you run noobs on fresh off tutorial island
something that trains multiple skills around lumby
Current situation:
This function is for finding doors on minimap in the checkered room on the first floor of lumby castle. Stick a player in the checkered room and run the script, press F12 after it gets to 1st door, F11 after next, F12 after next. Try it on a couple worlds and tell me how it works please.
Don't worry about the lag. It's looking for up to about 350 bitmaps, doing upto 1600 setpixels. I already have a fix for this that will cut it down to 7 and 32 respectively, but will have a small chance of a false positive. So I will have it try the faster method first, and if it fails it will do the laggier but guaranteed to work version. But first I need to make sure this is guaranteed to work, which is why I need you to test this.
program TestForFindLumbyDoor1st;
{start in middle of checkered room in first floor lumby castle (or outside
if door is open)
should click west, then you press f12
then it click south, then you press f11
then it click east then you press f12
then it click north door
}
{.include SRL/SRL.scar}
{*******************************************************************************
function FindLumbyDoor1st(Direction:string):boolean;
By: Boreas
Description: Sets x,y to the location of one of the 4 doors in lumbridge
castle 1st floor foyer (the chessboard room)
Direction: 'north','east','south','west'
*******************************************************************************}
function FindLumbyDoor1st(Direction:string):boolean;
var
xAddToBmp,yAddToBmp:integer;
bmpLD:array [1..7] of integer;
i,dacolor:integer;
daboolean:boolean;
begin
case Direction of
'north':
begin
xAddToBmp:=9+random(4);
yAddToBmp:=1;
end;
'east':
begin
xAddToBmp:=17;
yAddToBmp:=25+random(8);
end;
'south':
begin
xAddToBmp:=10+random(4);
yAddToBmp:=58;
end;
'west':
begin
xAddToBmp:=1;
yAddToBmp:=13+random(8);
end;
end;
bmpLD[1] := BitmapFromString(18, 59, 'z78DAEDD7310D00000803304B5' +
'3817F49BC9CBC90D6C0921D902537D4100018DFE15F16807BAB73' +
'0000B04136EBA0014E51AF1D');
bmpLD[2] := BitmapFromString(13, 59, 'z78DAEDD8210100000803B04A4' +
'F41FF48D86B14628BB1E48B2901000000E0A48F65014901611E');
bmpLD[3] := BitmapFromString(18, 30, 'z78DA33301805A360148C82513' +
'00A862A700383E167D7281805A360148C96B700863461AF');
bmpLD[4] := BitmapFromString(12, 18, 'z78DA33301878E086040C46C12' +
'81805230C502BEF536E0E00CC34F511');
bmpLD[5] := BitmapFromString(18, 59, 'z78DAEDD7310900000800C14AA' +
'6B07F24C100E2287257E0E78F0000009864FBD70200002E3FC8E6' +
'0E0ADEDDAD0D');
bmpLD[6] := BitmapFromString(18, 30, 'z78DA3330181AC00D09188C825' +
'1300A46C1281805A360148C8251300AE8DE1AA7A75D000A2561AF' +
'');
bmpLD[7] := BitmapFromString(13, 59, 'z78DAEDD7410900000800B14AA' +
'6B07F24413308225B80FB5F04C067D96ED6000000F63E6814A4B6' +
'611E');
dacolor:=200;
repeat
dacolor:=dacolor+1;
if not(((dacolor=206)or(dacolor=217)or(dacolor=233)or(dacolor=241)))then
begin
i:=0;
repeat
i:=i+1;
case i of
1:
begin
FastSetPixel(bmpLD[i],10,1,dacolor);
FastSetPixel(bmpLD[i],11,1,dacolor);
FastSetPixel(bmpLD[i],1,16,dacolor);
FastSetPixel(bmpLD[i],1,17,dacolor);
FastSetPixel(bmpLD[i],17,28,dacolor);
FastSetPixel(bmpLD[i],17,29,dacolor);
FastSetPixel(bmpLD[i],11,58,dacolor);
FastSetPixel(bmpLD[i],12,58,dacolor);
end;
2:
begin
FastSetPixel(bmpLD[i],10,1,dacolor);
FastSetPixel(bmpLD[i],11,1,dacolor);
FastSetPixel(bmpLD[i],11,58,dacolor);
FastSetPixel(bmpLD[i],12,58,dacolor);
end;
3:
begin
FastSetPixel(bmpLD[i],1,16,dacolor);
FastSetPixel(bmpLD[i],1,17,dacolor);
FastSetPixel(bmpLD[i],17,28,dacolor);
FastSetPixel(bmpLD[i],17,29,dacolor);
end;
4:
begin
FastSetPixel(bmpLD[i],10,1,dacolor);
FastSetPixel(bmpLD[i],11,1,dacolor);
FastSetPixel(bmpLD[i],1,16,dacolor);
FastSetPixel(bmpLD[i],1,17,dacolor);
end;
5:
begin
FastSetPixel(bmpLD[i],17,28,dacolor);
FastSetPixel(bmpLD[i],17,29,dacolor);
FastSetPixel(bmpLD[i],11,58,dacolor);
FastSetPixel(bmpLD[i],12,58,dacolor);
end;
6:
begin
FastSetPixel(bmpLD[i],10,1,dacolor);
FastSetPixel(bmpLD[i],11,1,dacolor);;
FastSetPixel(bmpLD[i],17,28,dacolor);
FastSetPixel(bmpLD[i],17,29,dacolor);
end;
7:
begin
FastSetPixel(bmpLD[i],1,16,dacolor);
FastSetPixel(bmpLD[i],1,17,dacolor);
FastSetPixel(bmpLD[i],11,58,dacolor);
FastSetPixel(bmpLD[i],12,58,dacolor);
end;
end;
daboolean:=FindBitmapIn(bmpLD[i],x,y,mmx1,mmy1,mmx2,mmy2);
until ((i=7) or (daboolean));
end;
until ((dacolor=254) or (daboolean));
i:=0;
repeat
i:=i+1;
FreeBitmap(bmpLD[i]);
until i=7;
x:=x+xAddToBmp;
y:=y+yAddToBmp;
result:=daboolean;
end;
begin
SetupSRL;
activateclient;
makecompass('n');
FindLumbyDoor1st('west');
mouse(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(12);
FindLumbyDoor1st('south');
mouse(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(11);
FindLumbyDoor1st('east');
mouse(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(12);
FindLumbyDoor1st('north');
mouse(x,y,0,0,true);
end.
