i dani Posted December 16, 2012 Share Posted December 16, 2012 (edited) Is it possible to run SCAR in the background without use of the mouse? If not, it would be nice if it was implemented Also, what happened to DTM and Bitmap. Is there any new function for finding a small area in a screen, and then clicking it? Right now I'm working with colors. Edited December 16, 2012 by i dani Quote Link to comment Share on other sites More sharing options...
LordJashin Posted December 16, 2012 Share Posted December 16, 2012 No its not possible. There is FindBitmap, and FindDTM. You can find FindBitmap documented at wiki.scar-divi.com Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 16, 2012 Share Posted December 16, 2012 You could launch SCAR using the command line with arguments to start a script running. Might do what you want? http://forums.scar-divi.com/showthread.php?2-Commandline-Parameters As for the other part sounds like you want FindBitmap as LordJashin suggested. Quote Link to comment Share on other sites More sharing options...
i dani Posted December 16, 2012 Author Share Posted December 16, 2012 (edited) You could launch SCAR using the command line with arguments to start a script running. Might do what you want? http://forums.scar-divi.com/showthread.php?2-Commandline-Parameters As for the other part sounds like you want FindBitmap as LordJashin suggested. Care to elaborate on that? Also, if I do that do I not need to select the window where its ran? Does this mean it runs in the background without using my mouse? Edited December 16, 2012 by i dani Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 Care to elaborate on that? Also, if I do that do I not need to select the window where its ran? Does this mean it runs in the background without using my mouse? No.You could use Virtual Machine, if you want/need to run SCAR without it using your mouse/keyboard. Quote Link to comment Share on other sites More sharing options...
i dani Posted December 16, 2012 Author Share Posted December 16, 2012 I am using a virtual machine, but it takes RAM. So you guys were never planning on an update like this? Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 Adding this feature in SCAR is not as easy as you would think.. :\ If it would be, this would added in already. Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 16, 2012 Share Posted December 16, 2012 I am using a virtual machine, but it takes RAM. So you guys were never planning on an update like this? If you used a slimmed down version of Windows XP, like TinyXP or MicroXP, you can easily run several VMs on a modern machine. Quote Link to comment Share on other sites More sharing options...
i dani Posted December 16, 2012 Author Share Posted December 16, 2012 Side note: How do methods work on here (I think they are refered to as procedures?) I know Java, and this is a little different although I think it has objects? How do I create a method that takes parameters and returns a value, say a boolean? Making everything in one big main method is very tedious. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 function Test(YESorNO: string): Boolean; begin Result := (Lowercase(YESorNO) = 'yes'); end; begin if Test('YES') then WriteLn('Yes!') else WriteLn('NO... '); end. Depends what kind of parameters you want to use. Quote Link to comment Share on other sites More sharing options...
i dani Posted December 16, 2012 Author Share Posted December 16, 2012 (edited) function Test(YESorNO: string): Boolean; begin Result := (Lowercase(YESorNO) = 'yes'); end; begin if Test('YES') then WriteLn('Yes!') else WriteLn('NO... '); end. Depends what kind of parameters you want to use. For now I am using an if statement. If (FindColor(params here) && FindColor(params here) { //do this } How is this in Scar language? Also, if I want to use a Timer for a repeated task i.e If(GetTimeRunning % 5000 = 0) //do something How can I do this in Scar/Pascal? Edit: Found out that remainder(%) is MOD in Pascal. So 10 MOD 2 = 0 was what I needed, thanks Edited December 16, 2012 by i dani Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 16, 2012 Share Posted December 16, 2012 For now I am using an if statement. If (FindColor(params here) && FindColor(params here) { //do this } How is this in Scar language? Also, if I want to use a Timer for a repeated task i.e If(GetTimeRunning % 5000 = 0) //do something How can I do this in Scar/Pascal? Edit: Found out that remainder(%) is MOD in Pascal. So 10 MOD 2 = 0 was what I needed, thanks Is that first one asking OR or AND? Would have to be something like this: var X, Y: Integer; begin if not (FindColor(X, Y, 255, 0, 0, 999, 999) and FindColor(X, Y, 16711680, 0, 0, 999, 999)) then begin if (FindColor(X, Y, 255, 0, 0, 999, 999) or FindColor(X, Y, 16711680, 0, 0, 999, 999)) then WriteLn('RED [255] or BLUE [16711680] found in area 0, 0, 999, 999 (0, 0 = X-Start, Y-Start and 999, 999 = X-End, Y-End)') else WriteLn(' RED or BLUE was not found in area 0, 0, 999, 999! '); end else WriteLn('RED [255] or BLUE [16711680] found in area 0, 0, 999, 999 (0, 0 = X-Start, Y-Start and 999, 999 = X-End, Y-End)'); end. So basically... With OR: (FindColor(X, Y, 255, 0, 0, 999, 999) or FindColor(X, Y, 16711680, 0, 0, 999, 999)) ..and with AND: (FindColor(X, Y, 255, 0, 0, 999, 999) and FindColor(X, Y, 16711680, 0, 0, 999, 999)) Not sure about that timer one, that wont work at least, it would rarely return true with exactly 0. :\ I think better way would be with GetSystemTime + time marking. Like: var tm: Integer; begin repeat if ((GetSystemTime - tm) > 5000) then begin WriteLn('5000 sec WriteLn! '); tm := GetSystemTime; end; until False; end. There may be better ways to do these, but yeah... Quote Link to comment Share on other sites More sharing options...