Results 1 to 6 of 6

Thread: [OGL] Click Action

  1. #1
    Join Date
    May 2006
    Location
    Belgium
    Posts
    36
    Mentioned
    10 Post(s)
    Quoted
    10 Post(s)

    Default [OGL] Click Action

    This function moves the mouse to a given TPoint and left-clicks if the tooltip contains the given action string. If the tooltip doesn't contain the action string because another model is overlapping the model you want to click, it will right-click using the rightClickOption procedure. If no tooltip is found it won't click.

    Returns true if a click occured, false if not.

    Simba Code:
    function tMouse.clickAction(funcClickPoint: tPoint; funcAction: string): boolean
    var
      funcTimeout: tCountDown;
      funcTooltip: string;
    begin
      moveMouse(funcClickPoint.x, funcClickPoint.y);

      funcTimeout.setTime(1000);
      repeat
        funcTooltip := mouse.getTooltip()
      until (funcTooltip <> '') or (funcTimeout.isFinished());

      if (funcTooltip <> '') then
      begin
        if (pos(funcAction, funcTooltip) <> 0) then
        begin
          mouse.click(funcClickPoint);
          result := true;
        end
        else
          result := mouse.rightClickOption(funcClickPoint, funcAction);

        exit(result);
      end;

      exit(false);
    end;
    Last edited by Chaos-Energy; 07-02-2015 at 03:05 PM. Reason: tCountDown update

  2. #2
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Would rep again if I could. Great work!




    Skype: obscuritySRL@outlook.com

  3. #3
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

  4. #4
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Thanks for this, I'll be using it in my divination script. I've commented credits on the code. Cheers!
    Tsunami

  5. #5
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Mind if I include a version of this in the next ogLib update? .




    Skype: obscuritySRL@outlook.com

  6. #6
    Join Date
    May 2006
    Location
    Belgium
    Posts
    36
    Mentioned
    10 Post(s)
    Quoted
    10 Post(s)

    Default

    Sure, go ahead.

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
  •