rotchy1
03-12-2012, 02:44 AM
can someone please tell me the best way (easiest for someone new) to detect and open a gate and tell whether or not it is open or closed to prevent geting stuck?
i was thinking maybe 3d dtm? im not sure...
thanks!
Nemesis3X
03-12-2012, 02:55 AM
can someone please tell me the best way (easiest for someone new) to detect and open a gate and tell whether or not it is open or closed to prevent geting stuck?
i was thinking maybe 3d dtm? im not sure...
thanks!
The best way would be to use TPA. First, you would use a TPA that try to find the Uptext Door closed, If it doesn't find it after 5 try, it means the door is open and if it find it, it means the door is closed and you need to open it.
this can also be done with DTM like a did for My ectoworship with the Trap door.
procedure OpenTrapDoor; //Procedure pour ouvrir la Trap
var OpenTrap : integer;
begin
Repeat
inc(OpenTrap);
Wait(100 + random(50));
if FindDTMRotated(CloseTrap, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
MMouse(x, y, 5, 5);
until (IsUpTextMultiCustom(['Open'])) or (OpenTrap > 3);
if IsUpText('Open')then
begin
ClickMouse2(True);
sleep(500 + random(500));
repeat
wait(50 + random(25));
until (IsMoving = false);
wait(500 + random (500));
FindNormalRandoms;
Makecompass('s');
end;
end;
Basically, what this procedure do. It looks for the Dtm I made for when the Trapdoor is closed. The procedure Repeat until 3 try. If the Uptext isn't Open, This procedure will be ignored and move right away to my second Function which is entering the Trapdoor.
procedure EnterTrapDoor; //Procedure pour ouvrir la Trap
var EnterTraps : integer;
begin
Repeat
inc(EnterTraps);
Wait(100 + random(50));
until (FindDTMRotated(OpenTrap, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) or (EnterTraps > 3));
MMouse(x, y, 3, 3);
wait(500 + random(100));
if IsUpText('own')then
begin
ClickMouse2(True);
sleep(1000+random(1000));
repeat
wait(50 + random(25));
until (IsMoving = false);
wait(500 + random (500));
FindNormalRandoms;
Makecompass('s');
end else
begin
Stuck := 1;
end;
end;
As you see, I added a Failsafe for the unique case where I couldn't find the Trapdoor opened, Which lead my script to repeat a specific part in my script to be able to enter the door.
rotchy1
03-12-2012, 02:58 AM
i see, thank you very much! i will definitely try this!
Nemesis3X
03-12-2012, 03:05 AM
No problem. If you want to look how I managed to Match these 2 Procedure into one single procedure. Here is the total code of the procedure using these 2 procedures showed on my last post.
procedure TrapDoor; //Procedure pour ouvrir la Trap
begin
openTrapdoor;
EnterTrapDoor;
end;
That is the procedure used for finding the Trapdoor open or closed and entering it.
That my big procedure using this procedure and using the Variable Stuck := 1 if we are stuck.
Procedure GoingToPool;
begin
TrapDoor;
If (Stuck = 1) then
begin
Stuck := 0 ;
Writeln('We Are not Inside');
WalkToTrap;
TrapDoor;
end;
... // The rest of the procedure have been erased since it was not related to your question.
rotchy1
03-12-2012, 03:17 AM
ok, ill have to use this as well...thanks so much for the help! i appreciate it!
Nemesis3X
03-12-2012, 03:39 AM
If you do get more problem, you can send me a Pm, I will answer it!
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.