Results 1 to 3 of 3

Thread: Help with bypassing door if it is opened

  1. #1
    Join Date
    Oct 2015
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Help with bypassing door if it is opened

    Hello, I'm working on my first script and everything is going smoothly except for this.

    I want to open the door when it is closed, and when it is open, I want my script to continue on with the other procedures. I have searched for a few hours now and I cannot come up with anything. Your help is greatly appreciated.

    I'm assuming it has something to do with if...then? If door is open, then continue. If door is closed, then open. I'm thinking "isMouseOverText" will play a part? I just can't figure out how to implement everything.

    Here is what I have (not much);


    Code:
    Procedure OpenDoor();
    begin
    if not isLoggedIn() then
        exit;
    
          FindObject(0.282, 2.93, 5, 5, 272431, 1, MOUSE_LEFT, ['oor'], ['']); //Opens the door when closed
    
          FindObject(0.11, 0.35, 5, 5, 5734537, 2, MOUSE_MOVE, ['lose'], ['']) //Moves the mouse to the door when opened
    
    
        end;
    I hate to ask for help, but I'm stumped.


    EDIT:
    So I think I got it. I now just need to stop the first findobject from searching a million times if it doesn't find the open door.
    Code:
    Procedure OpenDoor();
    var
    x, y, i: integer;
    begin
    if not isLoggedIn() then
        exit;
         Repeat
          FindObject(0.11, 0.35, 5, 5, 5734537, 2, MOUSE_MOVE, ['lose'], ['']); //Looks for open door
          wait(randomRange(1000,2000));
          inc(i);
         Until isMouseOverText(['lose', ''], 500) or (I>= 1);
          If not isMouseOverText(['lose', ''], 500) then
            FindObject(0.282, 2.93, 5, 5, 272431, 1, MOUSE_LEFT, ['oor'], ['']) //Opens door
         else
    
        end;
    Last edited by ltacom1s; 12-05-2015 at 08:09 PM.

  2. #2
    Join Date
    Nov 2015
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Im not the best scripter in town but i belive this might work.

    Simba Code:
    if not FindObject(0.11, 0.35, 5, 5, 5734537, 2, MOUSE_MOVE, ['lose'], ['']) then
    exit;
    etc...

  3. #3
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Doors are always very tricky. This will help, but is still relatively challenging to complete: https://villavu.com/forum/showthread.php?t=110546

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •