Results 1 to 2 of 2

Thread: How to get compass to move only when there are no matches?

  1. #1
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default How to get compass to move only when there are no matches?

    Simba Code:
    procedure cutTree();
    var
      x, y: integer;
      begin
        if mainscreen.findObject(x,y,color,tolerance,colorSetting(2, hue, saturation),mainScreen.getCenterPoint(),width,height,count,['ree'],mouse_right) then
          begin
            writeLn('Clicked Tree');
            chooseOption.select(['hop down']);
            tabBackpack.waitForShift(20000);
          end;

        if not mainscreen.findObject(x,y,color,tolerance,colorSetting(2, hue, saturation),mainScreen.getCenterPoint(),width,height,count,['ree'],mouse_right) then
          begin
            writeLn('No colors matched at angle North, setting to East!');
            minimap.setAngle(MM_DIRECTION_EAST);
          end;

        if not mainscreen.findObject(x,y,color,tolerance,colorSetting(2, hue, saturation),mainScreen.getCenterPoint(),width,height,count,['ree'],mouse_right) then
          begin
            writeLn('No colors matched at angle East, setting to South!');
            minimap.setAngle(MM_DIRECTION_SOUTH);
          end;

        if not mainscreen.findObject(x,y,color,tolerance,colorSetting(2, hue, saturation),mainScreen.getCenterPoint(),width,height,count,['ree'],mouse_right) then
          begin
            writeLn('No colors matched at angle South, setting to West!');
            minimap.setAngle(MM_DIRECTION_WEST);
          end;

        if not mainscreen.findObject(x,y,color,tolerance,colorSetting(2, hue, saturation),mainScreen.getCenterPoint(),width,height,count,['ree'],mouse_right) then
          begin
            writeLn('No colors matched at angle West, setting to North!');
            minimap.setAngle(MM_DIRECTION_NORTH);
          end;
    end;

    I'm running this as a barebones part of my script just to get back into the swing of things but what this does is right clicks, leaves the option open, then clicks on another tree and proceeds to move the camera through north, east, south, and west. then only clicks when it's north. Like I said I am relearning quite a bit and hope to understand TPAs soon but is there a better and easier way to do this?
    You have permission to steal anything I've ever made...

  2. #2
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post

    I'm running this as a barebones part of my script just to get back into the swing of things but what this does is right clicks, leaves the option open, then clicks on another tree and proceeds to move the camera through north, east, south, and west. then only clicks when it's north. Like I said I am relearning quite a bit and hope to understand TPAs soon but is there a better and easier way to do this?
    I suspect it right clicks on a tree, leaves the chooseOption menu open, and proceeds rotates the camera around...because you tell it to. Your ms.findObject function only right clicks, and the only time you actually do anything with the chooseOption menu is in the first block: chooseOption.select(['hop down'])

    If you wanted to shorten the whole thing, you could throw it into some sort of loop like:

    Simba Code:
    repeat

      if mainScreen.findObject(...) then
      begin
        writeLn('Clicked Tree');
        if chooseOption.select(['hop']) then
          tabBackpack.waitForShift(20000);
      end else
        minimap.setAngle(round(minimap.getAngleDegrees() + 90));

    until x;

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
  •