Results 1 to 5 of 5

Thread: Need TPA help

  1. #1
    Join Date
    Nov 2011
    Location
    United States
    Posts
    815
    Mentioned
    6 Post(s)
    Quoted
    284 Post(s)

    Default Need TPA help

    Im trying to make a script that buys Beer from the bartender in yanille. It Finds the bartender perfect the first time, But halfway through the dialogue to buy the beer the mouse spazes out and starts examining random things and never finds him again to buy another beer :c Any help would be much appreciated

    Thank you guys
    Last edited by Itankbots; 11-06-2012 at 09:45 PM. Reason: Problem solved

  2. #2
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    I would make one function that handles the identifying of the beertender and the clicking all in one. He could move which could result in misclicking.

    Simba Code:
    function FindBartender: boolean;
    var
      i : Integer;
      TPA  : TPointArray;
      ATPA : T2DPointArray;
      MP   : TPoint;
      Box  : TBox;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.07, 0.10);

      if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2365496, MSX1, MSY1, MSX2, MSY2, 3) then
      begin
        ATPA := TPAtoATPAEx(TPA, 15, 15);
        SortATPASize(ATPA, True);
        for i := 0 to High(ATPA) do
        begin
          MP := MiddleTPA(ATPA[i]);
          Box := IntToBox((MP.X - 20), (MP.Y - 20), (MP.X + 20), (MP.Y + 20));
          MMouse(MP.X, MP.Y, 4, 4);
          if(WaitUptext('artender', 750))then
          begin
            ClickMouse2(0);
            if WaitOption('alk-to', 500) then
            begin
              Result := True;
              Break;
            end;
          end;
        end;
      end;
    end;

    procedure buybeer;
    var
      Attempts: Integer;

    begin
      while not(InvFull) do
      begin
        if FindBartender then
        begin
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
          TypeSendEx(' ', false);
          Wait(RandomRange(300, 600));
        end else
          Inc(Attempts);
        if Attempts > 5 then
          break;
      end;
    end;

    Script source code available here: Github

  3. #3
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    For TPA's try Footy?

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  4. #4
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If he is finding the bartender flawlessly, then that doesn't appear to be the problem. The problem is the chat. Check out the include, I believe we have some pretty nifty functions that are chat related.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  5. #5
    Join Date
    Nov 2011
    Location
    United States
    Posts
    815
    Mentioned
    6 Post(s)
    Quoted
    284 Post(s)

    Default

    Thanks guys helped alot

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
  •