Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. hi guys , i try to use pixelsearch for first time i have created a script for delimited area ,for search , i want search a gray pixel color , #464F57 inside at this page web ,https://www.casa.it/vendita-residenziale/in-lucca/mappa-1 in practical when i select a left ad and point over map becomes gray i want match this is a script #include <GUIConstants.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "_Bye") HotKeySet("{SPACE}", "_FERMA") HotKeySet("{+}", "_ZoomPiu") HotKeySet("{-}", "_ZoomMeno") HotKeySet("!q", "_Quadrato") HotKeySet("!c", "_Cerchio") Global $iGFerma = 0, $iGCtrlFerma = 0, $iGQuadrato = 0, $iGCerchio = 0, $lokasi Global $iCircleR = 150 ; <=== Edit this for different circle radius (in pixels) $iCircleD = $iCircleR * 2 $pt = MouseGetPos() Global $GUI = GUICreate("test", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xFF0000) ;Global $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) Global $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) Global $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4)) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) GUISetState() GUISetState(@SW_DISABLE) While 1 Sleep(10) If $iGFerma = 0 Then $pt = MouseGetPos() If Not @error Then WinMove($GUI, "", $pt[0] - $iCircleR, $pt[1] - $iCircleR) Else $lokasi = PixelSearch( $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, 0x464F57) If IsArray($lokasi) Then MsgBox(0,'','trovato gray') MouseMove($lokasi[0], $lokasi[1], 0) EndIf EndIf WEnd Func _Quadrato() $iGQuadrato = 1 $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) EndFunc ;==>_Quadrato Func _Cerchio() $iGQuadrato = 0 $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4)) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) EndFunc ;==>_Cerchio Func _ZoomPiu() $iCircleD += 5 If $iGQuadrato = 1 Then $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) Else $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4)) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) EndIf EndFunc ;==>_ZoomPiu Func _ZoomMeno() $iCircleD -= 5 If $iGQuadrato = 1 Then $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) Else $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4)) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) EndIf EndFunc ;==>_ZoomMeno Func _FERMA() If $iGCtrlFerma = 0 Then $iGCtrlFerma = 1 $iGFerma = 1 Else $iGCtrlFerma = 0 $iGFerma = 0 EndIf EndFunc ;==>_FERMA Func _CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc ;==>_CreateRoundRectRgn Func _CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc ;==>_CombineRgn Func _SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>_SetWindowRgn Func _bye() Exit EndFunc ;==>_bye but not work someone can help me?? thankz
  3. Today
  4. Headless is nothing but no gui. Which means no windows . Am confused how to wait for window in this case
  5. Dynamic Variable Creations?

    Good morning @Burgs Yes, you can dinamically create variables and use them in your script. The Assign() functions needs to create the variable and assign a value to it. You can see the example in the Help file, that, in my honest opinion, is one of the most intuitive and complete helps I've ever seen for a programming language. To retrive the value of the variable, you need to use Eval(). Take a look at the example below: Local $strVariables = "intVariable:fltVariable:strVariable", _ ; In your case $arrVariables ; Split variables and assign them to the $arrVariables array $arrVariables = StringSplit($strVariables, ":", $STR_NOCOUNT) For $i = 0 To UBound($arrVariables) - 1 Switch $i Case 0 ; $ASSIGN_CREATE is set by default from the function, so you can easily omit that parameter If Assign($arrVariables[$i], 5, $ASSIGN_CREATE) Then ConsoleWrite("Variable " & $arrVariables[$i] & " successfully created." & @CRLF) Else ConsoleWrite("Errore during the creation of the Variable " & $arrVariables[$i] & @CRLF) EndIf Case 1 If Assign($arrVariables[$i], 10.5, $ASSIGN_CREATE) Then ConsoleWrite("Variable " & $arrVariables[$i] & " successfully created." & @CRLF) Else ConsoleWrite("Errore during the creation of the Variable " & $arrVariables[$i] & @CRLF) EndIf Case 2 If Assign($arrVariables[$i], "This is a string", $ASSIGN_CREATE) Then ConsoleWrite("Variable " & $arrVariables[$i] & " successfully created." & @CRLF) Else ConsoleWrite("Errore during the creation of the Variable " & $arrVariables[$i] & @CRLF) EndIf EndSwitch Next MsgBox($MB_ICONINFORMATION, "", "Integer Variable Value: " & Eval($arrVariables[0]) & @CRLF & _ "Floating Variable Value: " & Eval($arrVariables[1]) & @CRLF & _ "String Variable Value: " & Eval($arrVariables[2])) So, please, pay attention when read the Help file Best Regards.
  6. Hello, I'd like to be able to create variables 'on the fly' by reading in some data from an SQLite database. Using this data i'd like to create variables. The data would be separated by colons (":")...'colon delimited'. I would perform a 'StringSplit' on the data to create arrays holding each colon separated value. Ideally I could then use these strings to create variables from them...possible? I know it cannot be done just piecing a string together such as "var = "$_" & 'some string'"... I think it might work using the 'Assign' command...and there is an 'Opt' option to 'ExpandVarStrings' which seems to indicate it is possible to include a "$" within a string...however the documentation is a bit spotty on that. Can anybody confirm that these might be the best practices to create variables dynamically? ...Perhaps there is another method I'm not thinking of...? I thank you in advance. Regards.
  7. _WD_Option('Driver', 'D:\AUTOIT\WebDriver UDF\WebDriver-0.1.0.10\WebDriver-0.1.0.10\chromedriver.exe') _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') _WD_Option('Port', 9515) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "http://google.com") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@class='gb_P']") ;"Images" link at the upper right $sValue = _WD_ElementAction($sSession, $sElement, 'text') ;gets the text content of the node/element ConsoleWrite('$sValue = ' & $sValue & @CRLF) ;"Images" MsgBox(0,0,$sSession) help me
  8. I do not know how to let it work, Who can help me
  9. Hi All, I am new to autoit. I am trying to run some simple unix commands through java and return some value from unix to java program . Here is the overall flow: 1> Java (CallPutty.java ) is opening the putty application and login with Username & password. 2> I am calling an autoit script (PuttyCommand.exe) . 3>autoit script is passing & running commands in putty. I am taking the count of files in a specific folder and I want to pass the count o into the java program. I know , the code written in italic & underlined font , will not work.This is just for reference and I need help to build the logic with correct code . Code snippet from CallPutty.java public static void main (String args[]) throws AWTException, IOException, InterruptedException { CallPutty c=new CallPutty(); Runtime r = Runtime.getRuntime(); Process p; String username = "Userid"; String password = "Password"; String serverString = "Server"; String s = "C:\\Program Files (x86)\\Simon Tatham\\PuTTY\\putty.exe -ssh -l "+username+" -pw "+password+" "+serverString+""; try { //open the putty session with the above given username, password and server p = r.exec(s); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } //calling the autoit script to run unix command int count = Runtime.getRuntime().exec("C:\\Users\\workspace\\HelloWorld\\AutoIt_Script\\PuttyCommand.exe"); try { Thread.sleep(2000); } catch (Exception e) { } } Code Snippet from PuttyCommand.exe ControlFocus("auq4094l.unix.anz - PuTTY","","") WinSetState("auq4094l.unix.anz - PuTTY","",@SW_MAXIMIZE) Sleep(1000) Send( "cd /data/out/GCR/NZ/new" & "{ENTER}" ) Sleep(3000) $count = Send( "ls | wc -l " & "{ENTER}" ) return $count
  10. Which programming language deserves to be learned?

    Good morning guys! Thanks again for your "support" @matwachich So, do you think is a good idea involve AutoIt and SQLite UDF on a "Management" project? Probably, the database file will be on our company server, and sometimes, a maximum of 3 people could query the database ( to retrieve information, so, no new records or updates ). @jchd Do you think SQLite fits well in a project like this? I'd like to have your opinion too, just because, since I am here, I've always seen you talking about databases and, mainly, SQLite Thanks again guys! Best Regards.
  11. According to the help file FileReadToArray doesn't put the number of elements read in the array but in the @extended which you use but you seem to also expect it in the array which may be why you are confused. Hope this helps.
  12. Printers Management UDF

    @jguinch Excellent UDF, I was using PrintUi previously but prefer using this method as it can be run silently. Just a couple of things I found which I thought I'd mention is that when using the functions with network printers, found I needed to either double up the backslashes for server/print paths, otherwise functions like _Printmgr_PrinterExists wouldn't work, for example: $bPrinterExists = _Printmgr_PrinterExists("\\server.fqdn.com\PrinterName") ;~ Doesn't work $bPrinterExists = _Printmgr_PrinterExists("\\\\server.fqdn.com\\PrinterName") ;~ Works $bPrinterExists = _Printmgr_PrinterExists("%server.fqdn.com%PrinterName") ;~ Also works So I ended up putting in a StringReplace($sPrinterName, "\", "\\") within the function, although actually thinking of using "%" aka StringReplace($sPrinterName, "\", "%") Also noticed a number of the functions are missing the appending "%" and "%" suffix after the "Like" operator, not sure if that was intended or not, but thought I'd mention it, example below. Thanks again for the UDF though very helpful, just used it along with @Melba23 Toast to migrate staff printers from one Server with 100+ printers to new Windows Server 2016 print server. Local $oPrinters = $oWMIService.ExecQuery ("Select * from Win32_Printer Where DeviceID like '" & $sPrinterName & "'", "WQL", $wbemFlagReturnImmediately
  13. Constants for _WinAPI_GetSystemMetrics()

    Thanks for sharing. Might I suggest appending SM_ to the constants?
  14. read value

    @JLogan3o13 The code is working fine for me. I think error would be the UIWrappers. The code needs to be in the same directory with the wrapper package in order for you to run the code without errors. These are the packages #RequireAdmin #include <IE.au3> #include <MsgBoxConstants.au3> #include <GuiSlider.au3> #include <GUIConstants.au3> #include "UISpy\UIAWrappers\UIAWrappers.au3"
  15. Yesterday
  16. I find it Local $hWnd = WinGetHandle("---") WinActivate($hWnd, "") WinSetState($hWnd, "", @SW_HIDE)
  17. Local $hWnd = WinGetHandle("[CLASS:WindowsForms10.Window.8.app.0.378734a]") ; WinActivate("[CLASS:WindowsForms10.Window.8.app.0.378734a]", "") WinSetState($hWnd, "", @SW_HIDE) It doesn't work either ...
  18. Even with this (WinMinimizeAll()) doesn't work, let anone the @SW_HIDE, WinSetState etc Example() #include <Array.au3> #include <WinAPIProc.au3> #Include <WinAPIEx.au3> Func Example() ; Run PointerFocus. Local $iPID_PointerFocus = Run("C:\Users\Documents\Apps\PointerFocus\PointerFocus.exe", "C:\Users\Documents\Apps\PointerFocus\", "", @SW_HIDE) Do Sleep(200) Until $iPID_PointerFocus <> 0 ;============== WinMinimizeAll() ;============== Sleep(1000) ; rest of the code EndFunc ;==>Example
  19. Run PointerFocus program minimized

    So how about posting all the different ways you have tried
  20. Restart script from with in

    @Aleksandar, You are really a bit thick aren't you, reporting a post and lock of thread by a moderator? ... and yes... you can't answer which probably is for the best anyway as you don't seem to have much to say which has any substance. Jos
  21. How can I run PointerFocus ( www.pointerfocus.com) minimized ? I've tried any possible way but no luck ... any suggestions ?
  22. Restart script from with in

    I see in that site's code of conduct that any user can be banned for "posting same-type information, flooding, spamming" which sounds like what you are attempting to do. Therefore this is not something we are prepared to support.
  23. Restart script from with in

    @JLogan3o13 You there, bro ?
  24. Restart script from with in

    and with this program i can just chillax and not do a thing while this program dose everything for me ...
  25. Restart script from with in

    xD ... what ... why do i need to answer that ??? .... well anyway ... what am i doing is that i bet on this app ... and I'm using Mardigay strategy ... long story shot ... i place bet of 1e or $ and if i loss i bet twice as mush and bit more so i can earn up to 0.15 cent ... and i do this every 60 sec ... on every day i can earn up to 150 e ... and so on ... i can explain it better if we could make some sort of call cuz it's difficult this way ...
  26. Restart script from with in

    I'm quite chill "bro" (geez, that just sounds childish to type). However, this is the exact same thing you asked for help with before, and you never answered the question: Since you are on and active, you can now answer just what you're going to be doing to earn yourself €5000 pm. This time if you fail to provide an answer you will receive an all expense paid vacation from the forum for a duration of my choosing. Clock is ticking.
  27. Restart script from with in

    Chill bro
  28. Restart script from with in

    You don't know how to take a screenshot?
  1. Load more activity
×