Results 1 to 7 of 7

Thread: [OGL] ActionOnAction

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

    Default [OGL] ActionOnAction

    Needed something to use item on item, this could be used for item on object too. Takes two tPoints and selects it if mouseOverText is "Use" and if not it'll right click use and use it on tPoint #2 . Found it useful for bones on altar. Should work.

    This can shorten length of code needed and it's simple but yet quite powerful.

    About the 10th edit on this (improving it as I was testing, should of tested before posting but oh well)
    Simba Code:
    function tMouse.ActionOnAction(funcPoint, funcPoint2: TPoint; funcRange, funcTime: integer): boolean;
    var
      funcTimeout: tCountDown;
      funcTooltip: string;
    begin
      moveMouse(funcPoint.x, funcPoint.y);
      funcTimeout.setTime(random(1000, 1500));
      repeat
        funcTooltip:=mouse.getTooltip()
      until (funcTooltip <> '') or (funcTimeout.isFinished());

      if (funcTooltip = 'Use') then
        clickMouse(normalRandom(funcPoint.x, funcPoint.y), normalRandom(funcPoint.x+funcRange, funcPoint.y+funcRange), 1)
      else
        begin
          mouse.rightClickOption(funcPoint, 'Use');
        end;
        wait(funcTime);
        clickMouse(normalRandom(funcPoint2.x, funcPoint2.y), normalRandom(funcPoint2.x+funcRange, funcPoint2.y+funcRange), 1);
        result:=true;
    end;

    usage :
    Simba Code:
    mouse.ActionOnAction(point(x, y), point(x, y), range, funcTime);

    example :
    Simba Code:
    procedure example;
    var
      point1, point2: TPoint;
    begin
      point1:=ogl.getModels(3432408932)[0].toPoint();
      point2:=ogl.getModels(2868382833)[0].toPoint();
      mouse.ActionOnAction(point1, point2, 5, random(750, 1000));
    end;
    example 2 :
    Simba Code:
    procedure example;
    var
      point1, point2: TPoint;
    begin
      point1:=Inventory.getItem(119085).toPoint();
      point1:=ogl.getModels(423423)[0].toPoint();
      mouse.ActionOnAction(point1, point2, 7, 300);
    end;
    Last edited by Lucidity; 07-06-2015 at 08:52 PM.
    Tsunami

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

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

    Default

    Quote Originally Posted by The Mayor View Post
    You may want to edit it so it doesn't always return false
    Ooops, sorry! Didn't notice, added that at the last second
    Tsunami

  4. #4
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Bly View Post
    Ooops, sorry! Didn't notice, added that at the last second
    You could also remove 8 lines by have an 'else' condition on the overText check instead

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

    Default

    Quote Originally Posted by The Mayor View Post
    You could also remove 8 lines by have an 'else' condition on the overText check instead
    Haha, yeah. Shortened it up on main post. Thanks for the tips
    Tsunami

  6. #6
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Bly View Post
    Haha, yeah. Shortened it up on main post. Thanks for the tips
    Those 3 lines are still repeated twice:, so you could literally go

    Simba Code:
    if 'use' then
      leftClick..
    else
      rightClick...

    //then those 3 lines (wait, click, result)

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

    Default

    Quote Originally Posted by The Mayor View Post
    Those 3 lines are still repeated twice:, so you could literally go

    Simba Code:
    if 'use' then
      leftClick..
    else
      rightClick...

    //then those 3 lines (wait, click, result)
    Edit : nevermind i was misunderstanding what you meant!
    Last edited by Lucidity; 07-02-2015 at 02:39 PM.
    Tsunami

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
  •