Results 1 to 6 of 6

Thread: Need help with script method overriding

  1. #1
    Join Date
    Jun 2016
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help with script method overriding

    Hello,

    I am trying to write a script that simply hoovers over a screen if it finds the color and then left clicks on that color. Currently, the script is faililng at compile time.


    Please help.

    Error:
    Code:
    Error: Don't know which overloaded method to call with params (Int32, Int32, Int32, Int32, Int32, Int32, Int32) at line 7
    Compiling failed.

    Code:

    Code:
    {$I srl-6/srl.simba}
    Procedure getPlank;
    var
      X,Y:Integer;
    begin
      if FindColorTolerance(X, Y, 874871, 15, 68, 502, 0) then
      begin
        mouse(x, y,5,5);
        wait(250);
        ClickMouse(X, Y, mouse_Left)
      end;
    end;
    Begin
    SetupSRL;
    getPlank;
    end.

  2. #2
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    You have 3 different options for functions to call...
    Simba Code:
    function findColorTolerance(var x, y: Integer; color: integer; searchBox: TBox; tol: Integer; settings: TColorSettings): boolean;
    function findColorTolerance(var x, y: integer; color: integer; searchBox: TBox; tolerance: integer): boolean;
    function findColorTolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;

    None of those match what you have written.

  3. #3
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    like turp is saying ^ you need to be filling out the parameters properly, check out the mayor's guide if you haven't https://villavu.com/forum/showthread.php?t=107757, you can see him using a findColor function there & explaining what exactly is going in

    & your line: ClickMouse(X, Y, mouse_Left)
    needs a semicolon

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    If you press ctrl + space when typing a method, Simba will autocomplete a list of available methods.
    If you press enter on the one you'd like to use, Simba will show you the parameters needed as you type them.

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

    Default

    Quote Originally Posted by YoHoJo View Post
    If you press ctrl + space when typing a method, Simba will autocomplete a list of available methods.
    If you press enter on the one you'd like to use, Simba will show you the parameters needed as you type them.
    You need them overload codehints son


  6. #6
    Join Date
    Jun 2016
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Omg! soo much help I am amazed. I was able to figure out this issue and make it work! thank you so much1

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
  •