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);
I hate to ask for help, but I'm stumped.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;
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;


Reply With Quote
