SRL Archive - Help and Support

How do I use key with door?


_ChArMz

2006-05-06 21:13:58

I need to use a brass key with a door for my superfighter, anyone have any idea how to do this?

Thank You

~ChArMz

Whatyouknow13

2006-05-06 21:22:28

UseItem(invslot)
If(FindObj(X,Y,'Use Brass key with Door',Colorofdoor,15))Then
Mouse(X,Y,2,2,True)

_ChArMz

2006-05-06 21:24:22

thank you, ill try that, and do you have anything for climbing ladders?

EDIT: Set It up like this?

Program UseKeyWithDoor;
{.include SRL/SRL.SCAR}

Const
DoorColor=0;

Begin
Procedure UseItem(invslot1);
If(FindObj(X,Y,'Brass Key',DoorColor,15))Then
Mouse(X,Y,2,2,True)
End;

Begin
SetupSRL;
UseItem;
End.

c0de

2006-05-07 11:47:16


Program UseKeyWithDoor;
{.include SRL/SRL.SCAR}

Const
DoorColor=0;

Procedure UseItem(invslot1);
[B]Begin[/B]
If(FindObj(X,Y,'Brass Key',DoorColor,15))Then
Mouse(X,Y,2,2,True)
End;

Begin
SetupSRL;
UseItem;
End.

More like this :p

maxzzz

2006-05-08 03:42:13

For the ladder you can use something like this I think:


Program ClimbLadder;
{.include SRL/SRL.SCAR}

Const
LadderColor=0;

Procedure ClimLadder;
var
X, Y : Integer // Again a non global variable,, HOW DO YOU CALL THAT ANYWAYS?
Begin
If(FindObj(X,Y,'Climb Ladder',LadderColor,15))Then
Mouse(X,Y,2,2,True);
wait(200+random(1000)); // wait time for less detection
End;

Begin
SetupSRL;
ClimbLadder;
End.

I see a big error :p in that piece of code for the door opening.


Program UseKeyWithDoor;
{.include SRL/SRL.SCAR}

Const
DoorColor=0;

Procedure OpenDoor; // Don't use UseItem as procedure name, you will get a error: Duplicated Identifier blablabla..
var
X, Y : Integer; // Again a non global variable,, HOW DO YOU CALL THAT ANYWAYS?
Begin
GameTab(4); // Open inventory if it's not opened
wait(200+random(2000)); // wait time for less detection
UseItem(Invslot1);
If(FindObj(X,Y,'Brass Key',DoorColor,15))Then
Mouse(X,Y,2,2,True); // need to close it with a ; lol, HOW IS THAT NAMED? a ;
End;

Begin
SetupSRL;
OpenDoor;
End.
There were some errors but I hope I took them out. (A)

Brown

2006-05-08 07:48:12

Mouse(X,Y,2,2,True); // need to close it with a ; lol, HOW IS THAT NAMED? a ;

Semicolin :p

phantombmx

2006-05-08 17:43:44

also, a non-global variable is called a Local variable.. ;)

maxzzz

2006-05-09 02:45:29

Yep, I couldn't get it but now I remember, at least I know the principles :D