Nemesis3X
02-23-2012, 04:30 AM
Hello Everyone, so I got a new Fresh Working Script, but it got only one problem that I am going to Explain and Need Help to Fix since I can't figure out How to Fix it. Basicaly, I am Walking to Zamorak the Mage to Teleport To Abyss. This NPC Move a Lot and My First Problem was that sometime, when I was Reaching him, He wasn't in my Screen and The function was Ignored, so I was Stuck. I came with the Idea to make My character move if it doesn't find any array, but if I get a Miss Click after Moving, The function won't loop and Try again to Click and Teleport to Abyss Even When I have my FailSafe to Force Repeating it until my FailSafe is no more visible on Minimap. Can someone Tell me What's going wrong in My Code, Thanks
Procedure MovingToFindMage;
var WhereToClick : integer;
begin
case random(2) of
0 : WhereToClick := 1;
1 : WhereToClick := 2;
end
if (WhereToClick = 1) then
begin
if FindDTMRotated(Path6, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
Wait(2000 + random(1000));
end;
end;
if (WhereToClick = 2) then
begin
if FindDTMRotated(Path7, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
Wait(2000 + random(1000));
end;
end;
end;
function TalkingToMages: boolean; // 2
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i, Tries: Integer;
begin
x := MSCx;
y := MSCy;
FindColorsSpiralTolerance(x, y, MyTPA, 2304113, MSx1, MSy1, MSx2, MSy2, 18);
if Length(MyTPA) = 0 then FindColorsSpiralTolerance(MSCx, MSCy, MyTPA, 1185082, MSX1, MSY1, MSX2, MSY2, 13);
for i := 0 to High(MyTPA) do
begin
inc(Tries);
Writeln('Trying to find Mage');
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 0, 0);
if (IsUpTextMultiCustom(['alk', 'orak'])) then
begin
GetMousePos(x, y);
mouse(x,y,0,0,false);
wait(300 + random(250));
ChooseOption('ele');
wait(5000 + random(1000));
FindNormalRandoms;
Result := true;
break;
end;
if (Tries = 5) then
begin
Writeln('We are Not Inside');
MovingToFindMage;
TalkingToMages;
end;
Wait(100 + random(50));
end;
end;
Procedure TalkToMages;
begin
TalkingToMages;
if FindDTMRotated(FailSafe, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Writeln('We are not inside');
MovingToFindMage;
TalkingToMages;
end;
end;
Procedure MovingToFindMage;
var WhereToClick : integer;
begin
case random(2) of
0 : WhereToClick := 1;
1 : WhereToClick := 2;
end
if (WhereToClick = 1) then
begin
if FindDTMRotated(Path6, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
Wait(2000 + random(1000));
end;
end;
if (WhereToClick = 2) then
begin
if FindDTMRotated(Path7, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
Wait(2000 + random(1000));
end;
end;
end;
function TalkingToMages: boolean; // 2
var
MyTPA : TPointArray;
MyPoint : TPoint;
x, y, i, Tries: Integer;
begin
x := MSCx;
y := MSCy;
FindColorsSpiralTolerance(x, y, MyTPA, 2304113, MSx1, MSy1, MSx2, MSy2, 18);
if Length(MyTPA) = 0 then FindColorsSpiralTolerance(MSCx, MSCy, MyTPA, 1185082, MSX1, MSY1, MSX2, MSY2, 13);
for i := 0 to High(MyTPA) do
begin
inc(Tries);
Writeln('Trying to find Mage');
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 0, 0);
if (IsUpTextMultiCustom(['alk', 'orak'])) then
begin
GetMousePos(x, y);
mouse(x,y,0,0,false);
wait(300 + random(250));
ChooseOption('ele');
wait(5000 + random(1000));
FindNormalRandoms;
Result := true;
break;
end;
if (Tries = 5) then
begin
Writeln('We are Not Inside');
MovingToFindMage;
TalkingToMages;
end;
Wait(100 + random(50));
end;
end;
Procedure TalkToMages;
begin
TalkingToMages;
if FindDTMRotated(FailSafe, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Writeln('We are not inside');
MovingToFindMage;
TalkingToMages;
end;
end;