SRL Archive - Test corner

Test this lumby thing plz


Boreas

2007-01-09 00:05:35

Stand in checkered room in lumby castle and tell me if this works, thanks!
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.

Lorax

2007-01-09 04:36:26

very interesting work you have done there, can't immediately see why you do the setpixels.. there will be a lot of bitmap searches, if you go from 200 till 250..
The only thing that I have against this script is that you don't use capitalization..
for example makecompass('n') should be MakeCompass('N'); and your variables dacolor should be DaColor, also try renaming your variable names, they're if I'm allowed to say quite unmature..
Not sure if you care and not sure if anybody does the same, but when I use integers for - a "for" loop fx. I name them Count, or something like that I think it gives more sence than i - it's more hardcore programming to use "i".. try to make it as understandable as possible, add comments - nice script anyway..

Boreas

2007-01-09 11:44:12

Here's a version for Lorax to READ
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
xadDtIbmP,yadDtObmP:integer;
bmpLD:array [1..7] of integer;
iwonderwhatthisdoes,BumFlap:integer;
JustForLorax: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');


BumFlap:=200;
repeat
BumFlap:=BumFlap+1;
if not(((BumFlap=206)or(BumFlap=217)or(BumFlap=233)or(BumFlap=241)))then
begin
iwonderwhatthisdoes:=0;
repeat
iwonderwhatthisdoes:=iwonderwhatthisdoes+1;
case iwonderwhatthisdoes of
1:
begin
fasTseTpixeL(bmpLD[i],10,1,BumFlap);
fasTseTpixeL(bmpLD[i],11,1,BumFlap);
fasTseTpixeL(bmpLD[i],1,16,BumFlap);
fasTseTpixeL(bmpLD[i],1,17,BumFlap);
fasTseTpixeL(bmpLD[i],17,28,BumFlap);
fasTseTpixeL(bmpLD[i],17,29,BumFlap);
fasTseTpixeL(bmpLD[i],11,58,BumFlap);
fasTseTpixeL(bmpLD[i],12,58,BumFlap);
end;
2:
begin
fasTseTpixeL(bmpLD[i],10,1,BumFlap);
fasTseTpixeL(bmpLD[i],11,1,BumFlap);
fasTseTpixeL(bmpLD[i],11,58,BumFlap);
fasTseTpixeL(bmpLD[i],12,58,BumFlap);
end;
3:
begin
fasTseTpixeL(bmpLD[i],1,16,BumFlap);
fasTseTpixeL(bmpLD[i],1,17,BumFlap);
fasTseTpixeL(bmpLD[i],17,28,BumFlap);
fasTseTpixeL(bmpLD[i],17,29,BumFlap);
end;
4:
begin
fasTseTpixeL(bmpLD[i],10,1,BumFlap);
fasTseTpixeL(bmpLD[i],11,1,BumFlap);
fasTseTpixeL(bmpLD[i],1,16,BumFlap);
fasTseTpixeL(bmpLD[i],1,17,BumFlap);
end;
5:
begin
fasTseTpixeL(bmpLD[i],17,28,BumFlap);
fasTseTpixeL(bmpLD[i],17,29,BumFlap);
fasTseTpixeL(bmpLD[i],11,58,BumFlap);
fasTseTpixeL(bmpLD[i],12,58,BumFlap);
end;
6:
begin
fasTseTpixeL(bmpLD[i],10,1,BumFlap);
fasTseTpixeL(bmpLD[i],11,1,BumFlap);;
fasTseTpixeL(bmpLD[i],17,28,BumFlap);
fasTseTpixeL(bmpLD[i],17,29,BumFlap);
end;
7:
begin
fasTseTpixeL(bmpLD[i],1,16,BumFlap);
fasTseTpixeL(bmpLD[i],1,17,BumFlap);
fasTseTpixeL(bmpLD[i],11,58,BumFlap);
fasTseTpixeL(bmpLD[i],12,58,BumFlap);
end;
end;
JustForLorax:=FindBitmapIn(bmpLD[iwonderwhatthisdoes],x,y,mmx1,mmy1,mmx2,mmy2);
until ((iwonderwhatthisdoes=7) or (JustForLorax));
end;
until ((BumFlap=254) or (JustForLorax));
iwonderwhatthisdoes:=0;
repeat
iwonderwhatthisdoes:=iwonderwhatthisdoes+1;
freEbitmaP(bmpLD[iwonderwhatthisdoes]);
until iwonderwhatthisdoes=7;
x:=x+xadDtObmP;
y:=y+yadDtObmP;
result:=JustForLorax;
end;

begin
SEtuPSrl;
AcTiVaTeClIeNt;
mAkEcOmPaSs('n');
finDlumbYdooR1sT('west');
m{izz}ouse{in the hizzouse}(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(12);
finDlumbYdooR1sT('south');
m{izz}ouse{in the hizzouse}(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(11);
finDlumbYdooR1sT('east');
m{izz}ouse{in the hizzouse}(x,y,0,0,true);
repeat
wait(30);
until isfkeydown(12);
finDlumbYdooR1sT('north');
m{izz}ouse{in the hizzouse}(x,y,0,0,true);
end.

Now can someone RUN the damn script please?

Special Ed

2007-03-12 16:30:01

Yeah I'll test np… just one question what are you planning on using this for?

EDIT: So you just want it to click north in a general direction or is it supposed to click on a door… cause when I ran it it click west,south,east,north but didn't click or the door or anything really specific… that I could tell at least.

Boreas

2007-03-13 00:29:25

Hehe I forgot about this. It was for my Lumbridge script. It was supposed to click the doors on the minimap, to navigate around lumby castle. I have now solved this problem with a different method, because these bitmaps don't allow for as much coverage by dots or compass rotation. My new way pwns :p. Thanks for testing anyway though.

Special Ed

2007-03-13 16:20:04

Ehh oh well I was bored so i thought I'd help out.