PDA

View Full Version : Need help with script method overriding



Anivagg
06-06-2016, 06:55 PM
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:

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



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.

Turpinator
06-06-2016, 07:04 PM
You have 3 different options for functions to call...
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.

acow
06-06-2016, 09:02 PM
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

YoHoJo
06-06-2016, 09:25 PM
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.
http://i.imgur.com/hsXFXe8.gif

Laquisha
06-06-2016, 11:10 PM
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

http://puu.sh/pjnC9/73167857e6.png

Anivagg
06-07-2016, 02:10 AM
Omg! soo much help I am amazed. I was able to figure out this issue and make it work! thank you so much1