bääm Posted December 16, 2012 Share Posted December 16, 2012 Hello, after long time, I try to write a little script with FindBitmapTol-functions. I pick the bitmaps, rename it, write the name as a var at the top of the script. Then I write: if FindBitmapTol(arrowup, x, y, 20) then begin as i do it 2 years ago... Then the output said 'Invalid number of parameters'. I use the search-function in this forum, but I found nothing that help me... So I hope some of the pro's in this forum can give me some tipps about what I make wrong. Sorry for my bad english Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 You need to use XS, YS, XE, YE coordinates aswell. XS = X-Start YS = Y-Start XE = X-End YE = Y-End So add in the area aswell. Example: FindBitmapTol(x, y, BMP, 0, 0, 1000, 1000, 5) Quote Link to comment Share on other sites More sharing options...
bääm Posted December 16, 2012 Author Share Posted December 16, 2012 (edited) do this 4 var's declare the search area? and I forget: a big thanks^^ Edited December 16, 2012 by bääm forget thanks Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 Yep! That's correct mate. Search area. 0, 0 = X-Start, Y-Start 1000, 1000 = X-End, Y-End Quote Link to comment Share on other sites More sharing options...
bääm Posted February 10, 2013 Author Share Posted February 10, 2013 hi me again same output, other problem... i have an old script, that works very good on 3.34, now i am trying to change it to 3.38.... a problem is the old function "GetClientSize"... i change this to "GetWindowSize"... then came the output "invalid number of parameters" I use the search-function again an found that i forget something call "Wnd"... is this the head-text of the window and should i write it in '...' ? thanks Quote Link to comment Share on other sites More sharing options...
wundertüte Posted February 10, 2013 Share Posted February 10, 2013 you forgot the boolean at the end -> if (FindBitmapTol(x, y, BMP, 0, 0, 1000, 1000, 5)=true) then Quote Link to comment Share on other sites More sharing options...
bääm Posted February 11, 2013 Author Share Posted February 11, 2013 hey wundertüte nice to read you^^ i'm just trying to update a bm-bot to 3.38, it could be yours. its very tricky cause i'm not a pro-coder... the bitmap-problem is fixed, im trying to get the client size... Quote Link to comment Share on other sites More sharing options...
Janilabo Posted February 11, 2013 Share Posted February 11, 2013 Here is the old GetClientDimensions (in SCAR Divi 3.35+), if you are looking after it: procedure GetClientDimensions(var Width, Height: Integer); begin GetBoxSize(GetClient.ImageArea, Width, Height); end; var W, H: Integer; begin GetClientDimensions(W, H); WriteLn(IntToStr(W) + 'x' + IntToStr(H)); end. Quote Link to comment Share on other sites More sharing options...
bääm Posted February 12, 2013 Author Share Posted February 12, 2013 thanks, i try it but it says again "invalid number of parameters" i write: GetClientDimensions(resolution_x, resolution_y); Writeln('Bildschirmauflösung: '+inttostr(resolution_x)+'x '+inttostr(resolution_y)); with the procedure GetClientDimensions above Quote Link to comment Share on other sites More sharing options...
Janilabo Posted February 12, 2013 Share Posted February 12, 2013 Are resolution_x and resolution_y declared as Integer variables in your script? Also, does my code work for you, like did you try running it? Because, I really can't tell whats wrong, not with only that part from your script - the error must be pointing somewhere else. Quote Link to comment Share on other sites More sharing options...
bääm Posted February 12, 2013 Author Share Posted February 12, 2013 yes, the resolution_x and resolution_y are declared at the top of the script... cant it be that some var is missing in this line? this old script only gets the size of the client to set some fixed points... and this points are importent for the mouse-action... Quote Link to comment Share on other sites More sharing options...
Janilabo Posted February 12, 2013 Share Posted February 12, 2013 Basically the error means, that you are using invalid parameters (variables) in some procedure/function.. That could be FindBitmap() function, which contains more parameters now in 3.35+ (its now the same as FindBitmapIn was). Check out the messages-tab (in SCAR Divi) and double click that error message, doing that will bring you to the problematic line, so you then can see which function/procedure it is pointing to. -Jani Quote Link to comment Share on other sites More sharing options...
bääm Posted February 13, 2013 Author Share Posted February 13, 2013 i check the output and double click the error message and it takes me to the line with the GetClientDimension-procedure... and it is for sure the nothing but the width and the hight is importent in this line? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted February 13, 2013 Share Posted February 13, 2013 Can you show me your script? You can always PM it, if you want to keep it private. It is really hard to tell what could be wrong with it. Does it work without this procedure? Keep the procedure like this: procedure GetClientDimensions(var Width, Height: Integer); begin GetBoxSize(GetClient.ImageArea, Width, Height); end; So, don't remove or replace anything with the procedure itself. Then use your custom variables with it in your script (resolution_x and resolution_y). Example: procedure GetClientDimensions(var Width, Height: Integer); begin GetBoxSize(GetClient.ImageArea, Width, Height); end; var resolution_x, resolution_y: Integer; begin GetClientDimensions(resolution_x, resolution_y); WriteLn(IntToStr(resolution_x) + 'x' + IntToStr(resolution_y)); end. Quote Link to comment Share on other sites More sharing options...