Results 1 to 5 of 5

Thread: aerolib chooseoption

  1. #1
    Join Date
    Oct 2017
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    13 Post(s)

    Default aerolib chooseoption

    so when i run my script it opens the right click menu for player like it should but it doesn't find option Attack and it just exits the menu. im trying to make so my script clicks the attack option on opponent.

    heres the script

    program new;
    {$I AeroLib/AeroLib.simba}

    procedure attack();
    var
    x,y :integer
    begin
    FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
    MoveMouse(x, y);
    wait(500);
    ClickMouse(x, y, mouse_right);
    wait(500);
    if WaitOption('Attack', 5000) then
    ChooseOption('Attack');
    wait(500);
    end;
    function FindPlayer(): boolean;
    var
    x, y :integer;
    begin
    result := FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
    end



    begin
    while (true) do
    begin
    if (FindPlayer()) then
    begin
    attack();
    end;
    end;
    end.

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

    Default

    Quote Originally Posted by rishula View Post
    so when i run my script it opens the right click menu for player like it should but it doesn't find option Attack and it just exits the menu. im trying to make so my script clicks the attack option on opponent.
    In the future, use SIMBA tags so your posted code is easier to read, like so:

    Simba Code:
    program new;
    {$I AeroLib/AeroLib.simba}

    procedure attack();
    var
      x,y :integer
    begin
      FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
      MoveMouse(x, y);
      wait(500);
      ClickMouse(x, y, mouse_right);
      wait(500);
      if WaitOption('Attack', 5000) then
        ChooseOption('Attack');
      wait(500);
    end;

    function FindPlayer(): boolean;
    var
      x, y :integer;
    begin
      result := FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
    end

    begin
      while (true) do
      begin
        if (FindPlayer()) then
        begin
          attack();
        end;
      end;
    end.

    In your code, you use waitOption, and then after that chooseOption, which is redundant, because chooseOption is already part of waitOption. Regarding the failure to click the option, try debugging getOptions() in a never-ending loop to see what it returns when right-clicking anywhere.

    Simba Code:
    //Debugging Code Example
    repeat
      writeln(getOptions());
      wait(50);
    until false;

    Run that and test out what is printed to Simba's debug console when right clicking. Ensure OSRS is selected as Simba's target and feel free to post any screenshots of what is happening.

  3. #3
    Join Date
    Oct 2017
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    In the future, use SIMBA tags so your posted code is easier to read, like so:

    Simba Code:
    program new;
    {$I AeroLib/AeroLib.simba}

    procedure attack();
    var
      x,y :integer
    begin
      FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
      MoveMouse(x, y);
      wait(500);
      ClickMouse(x, y, mouse_right);
      wait(500);
      if WaitOption('Attack', 5000) then
        ChooseOption('Attack');
      wait(500);
    end;

    function FindPlayer(): boolean;
    var
      x, y :integer;
    begin
      result := FindColoredArea(x, y,3161919 , 6, 8, 507, 326, 0);
    end

    begin
      while (true) do
      begin
        if (FindPlayer()) then
        begin
          attack();
        end;
      end;
    end.

    In your code, you use waitOption, and then after that chooseOption, which is redundant, because chooseOption is already part of waitOption. Regarding the failure to click the option, try debugging getOptions() in a never-ending loop to see what it returns when right-clicking anywhere.

    Simba Code:
    //Debugging Code Example
    repeat
      writeln(getOptions());
      wait(50);
    until false;

    Run that and test out what is printed to Simba's debug console when right clicking. Ensure OSRS is selected as Simba's target and feel free to post any screenshots of what is happening.
    it gave me this message [{STR = AIIack Blackman52 (leveli IZB), BOUNDS = {X1 = 74, Y1 = 218, X2 = 320, Y2 = 230}

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

    Default

    Quote Originally Posted by rishula View Post
    it gave me this message [{STR = AIIack Blackman52 (leveli IZB), BOUNDS = {X1 = 74, Y1 = 218, X2 = 320, Y2 = 230}
    Okay, so it's clearly incorrectly reading the text for the Attack option, leading to no action by the waitOption call. I'm not sure what text recognition is specifically happening in AeroLib but you could change the option in your code temporarily to something like 'ack' instead of 'Attack'. This is less specific and would lead to a match, but it is not the ideal solution, maybe something is off in your setup.

  5. #5
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by rishula View Post
    it gave me this message [{STR = AIIack Blackman52 (leveli IZB), BOUNDS = {X1 = 74, Y1 = 218, X2 = 320, Y2 = 230}
    You could use:
    Simba Code:
    WaitOptionMulti(['Attack', 'Att', 'ack', 'ttac'], 500)
    Then have the mouse statically move down on a certain Y axis to the bar, as they are generally static location within the menu.

    The other option is to use what Aerolib is reading and go:
    Simba Code:
    ChooseOptionMulti(['Attack', 'Att', 'ack', 'ttac']);

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
  •