Results 1 to 7 of 7

Thread: WaitNPCCHat

  1. #1
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default WaitNPCCHat

    I wasn't sure if there was anything like this, I couldn't find any, so I modified one of the other functions to wait, pretty simple, but it'd be easier if there was one already in the SRL function. From function "FindNPCChatText"

    Simba Code:
    function WaitOnText(txt: TStringArray; action: fnct_ActionOptions; time:Integer): boolean; //Gotten from SRL includes, just decided to change it around
    var
      x, y, finaltime: integer;
      chars: TStringArray;
    begin
      chars := [UpChars, CharsNPC];
      finaltime := GetSystemTime + Time;
      while(finaltime > GetSystemTime) do
      begin
        if (findTextEx(x, y, txt, chars, MCX1, MCY1, MCX2, MCY2)) then
        begin
          case action of
            Move: MMouse(x, y, 6, 3);
            ClickLeft: Mouse(x, y, 6, 3, mouse_Left);
            ClickRight: Mouse(x, y, 6, 3, mouse_Right);
          end;

          result := true;
          exit;
        end;
      end;
    end;

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

    Default

    You should just put action as an integer, then do this:

    Simba Code:
    function WaitOnText(txt: TStringArray; action, time : Integer): boolean; //Gotten from SRL includes, just decided to change it around
    var
      x, y, finaltime: integer;
      chars: TStringArray;
    begin
      chars := [UpChars, CharsNPC];
      finaltime := GetSystemTime + Time;
      while(finaltime > GetSystemTime) do
      begin
        if (findTextEx(x, y, txt, chars, MCX1, MCY1, MCX2, MCY2)) then
        begin
          Mouse(x, y, 6, 3, Action);
          Result := true;
          exit;
        end;
      end;
    end;

    Though tbh why don't you just do:
    Simba Code:
    While(not AreTalking)do
        Wait(200+Random(200));

      ///findTextEx etc etc...

  3. #3
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Simba Code:
    case action of
            Move: MMouse(x, y, 6, 3);
            ClickLeft: Mouse(x, y, 6, 3, mouse_Left);
            ClickRight: Mouse(x, y, 6, 3, mouse_Right);
          end;

    Wouldn't that move the mouse to x and y with a randomness of (6, 3), then left click with another randomness of (6 ,3) and then right-click with yet another randomness of (6, 3)?

    Thus resulting in weird, buggy mouse movements?

  4. #4
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    No.
    You type action in when you call it.

    So you type

    Simba Code:
    Move
    Clickleft
    Clickright
    And it uses the one you picked.

  5. #5
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    I believe I made this a while back.
    It's in my Firemaker.

  6. #6
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Oh. It was suggested already?

    My bad.

  7. #7
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    No.
    You type action in when you call it.

    So you type

    Simba Code:
    Move
    Clickleft
    Clickright
    And it uses the one you picked.
    Oh right now sure how I missed that

    Quote Originally Posted by NKN View Post
    Oh. It was suggested already?

    My bad.
    I don't think he suggested it, just made one in his script.

    Correct me if I'm wrong.

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
  •