Page 1 of 1

open door help

Posted: Sat Sep 18, 2004 8:16 am
by wolfbaby
this code is i learn from advpath,i change it a little

Code: Select all

Sub opendoor
    /echo Trying to Open a Door ~~~
:OpenDoor 
/doortarget
/delay 5
/face fast nolook
/delay 5 
/if (${String[${Switch.Open}].Find["FALSE"]}>0) { 
   /if (${Target.Name.Find["door"]} && ${Target.Distance}<=12) { 
       /echo Opening Door. . . 
/delay 5
       /face fast nolook
/delay 5
       /keypress USE HOLD 
       /keypress USE 
       /delay 4s 
       /if (${Target.Name.Find["door"]} && ${String[${Switch.Open}].Find["TRUE"]}>0) /return 
   } 
} Else { 
   /if (${Target.Name.Find["door"]} && ${Target.Distance}<=12) { 
       /face fast nolook
/delay 5
       /keypress USE HOLD 
       /keypress USE 
       /delay 4s 
   } 
} 
/if (${Target.Distance}>12) { 
/face fast nolook 
/look 0 
/delay 2 
/keypress forward hold 
/delay 1 
/keypress forward 
/delay 5 
} 
/goto :OpenDoor 

/return
But if some corpse (npc or player) just lay right at door,i mean when the USE key press it always get the corpse as a target,so the door will never open. any good idea to fix it?

Posted: Sat Sep 18, 2004 4:02 pm
by dont_know_at_all
Try changing

Code: Select all

 /face fast nolook 
to

Code: Select all

 /face fast
so that you are looking at the door.

Posted: Sun Sep 19, 2004 3:10 am
by hiipii
You should change

Code: Select all

/if (${String[${Switch.Open}].Find["FALSE"]}>0)
to

Code: Select all

/if (${Switch.Open})
no need to change it to a string.

Posted: Wed Nov 17, 2004 5:38 am
by wolfbaby
when i target a door use /doortarget
i see mq2 says
Door 69 'Door1" targeted

But can i use it to tatget a special door.
Target the door whit the range , door id or name i want?

Posted: Wed Nov 17, 2004 5:47 am
by wolfbaby
find it myself
/doortarget id 123
yea,it works