Results 1 to 11 of 11

Thread: LodeStoneTeleport Failing [Fix]

  1. #1
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default LodeStoneTeleport Failing [Fix]

    Hey I have fixed and modified these.
    ( I didn't know where to Post Sorry!)
    Simba Code:
    (*
    LodestoneScreen
    ~~~~~~~~~~~~~~~

    .. code-block:: pascal

        function BankScreen: Boolean;

    Finds LodestoneScreen. Returns true if Found.

    .. note::

        Author: Home /Updated Mat

    Example:

    .. code-block:: pascal

        If LodestoneScreen then
          WriteLn('Lodestone Network screen is open!');
    *)

    function LodestoneScreen: Boolean;
    begin
      Result := CountColorTolerance(10269641,185, 171-50, 240, 200-50,15) > 500;
    end;


    (*
    LodestoneTeleport
    ~~~~~~~~~~~~~~~~~

    .. code-block:: pascal

        function LodestoneTeleport(Where: String): Boolean;

    Teleports you to chosen location via Lodestone teleport.

    .. note::

        Author: Home / Update Mat

    Example:

    .. code-block:: pascal

        If CastHomeTeleport then
          Lodestoneteleport('Lumbridge');
    *)

    function LodestoneTeleport(Where: String): Boolean;
    var
      TPA: TPointArray;
      TSA: TStringArray;
      CTS, I: Integer;
    begin
      If not LoggedIn then Exit;
      If not LodestoneScreen then Exit;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);

      TSA := ['Lunar Isle', 'Yanille', 'Ardougne', 'Seers Village', 'Catherby', 'Taverley',
              'Burthorpe', 'Edgeville', 'Falador', 'Port Sarim', 'Draynor Village', 'Lumbridge',
              'Varrock', 'Al Kharid', 'Bandit Camp'];

      TPA := [Point(45, 78), Point(160, 262), Point(167, 211), Point(192, 158), Point(223, 181),
              Point(253, 180), Point(251, 145), Point(293, 160), Point(278, 206), Point(276, 249), Point(308, 211),
              Point(327, 243), Point(345, 182), Point(362, 229), Point(326, 297)];

      for I := 0 to 14 do
        if Capitalize(Where) = TSA[I] then
        begin
          MMouse(TPA[I].X, TPA[I].Y, 2, 2);

          if (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) then
          begin
            ClickMouse2(Mouse_Left);
            Result := true;
          end else
          begin
            ClickMouse2(Mouse_Right);
            if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
              Result := true;
          end;
        end;

      ColorToleranceSpeed(CTS);
    end;
    On LodestoneScreen I added a Tolerance and change where it searched.
    On LodestoneTeleport I added a fail safe to Right click and choose Option if it can't read the up text.
    Thanks
    Mat



    ^^

  2. #2
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Simba Code:
    if (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) then
          begin
            ClickMouse2(Mouse_Left);
            Result := true;
          end else
          begin
            ClickMouse2(Mouse_Left);
            if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
              Result := true;
          end;

    Shouldn't the second ClickMouse2 be a right click?

  3. #3
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Ow My Bad
    Yea I changed it :P
    Thank
    Mat



    ^^

  4. #4
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    if (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))then
              Result := true;
    Could just be:
    Simba Code:
    Result := WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400);

  5. #5
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    I just did what Home did but for the else.
    But yea you could
    Mat



    ^^

  6. #6
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Well if you wanted to get really picky you could just completely shorten it all to this:

    Simba Code:
    result := (((WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) and (ClickMouse2(true))) or ((ClickMouse2(Mouse_Right)) and (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))));

    There's probably a parentheses issue in there somewhere but yeah haha. Just shows how condensed stuff can get.
    Last edited by Nebula; 08-09-2012 at 12:32 AM.

  7. #7
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    And Messy stuff can get.
    Mat



    ^^

  8. #8
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    And Messy stuff can get.
    Mat
    Not messy complex

  9. #9
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Messy...
    That Looks Messy.
    Let, stop..
    All I did was fix it and add a fail safe, I not going to change stuff, just because you can.
    Mat



    ^^

  10. #10
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    Well if you wanted to get really picky you could just completely shorten it all to this:

    Simba Code:
    result := (((WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400)) and (ClickMouse2(true))) or ((ClickMouse2(Mouse_Right)) and (WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'],400))));

    There's probably a parentheses issue in there somewhere but yeah haha. Just shows how condensed stuff can get.
    I don't think ClickMouse2() is a function, so this wouldn't work... :/

    If it is it would be:
    Simba Code:
    result := (WaitUptextMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400) and ClickMouse2(true)) or (ClickMouse2(Mouse_Right) and WaitOptionMulti(['Teleport', 'ele', 'ort', 'lepo', 'epor'], 400));

  11. #11
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    ClickMouse2(True);
    Click's Left and False Right.
    But you also can use Mouse_*
    Mat
    *but no I don't thing it returns anything. I miss read



    ^^

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
  •