Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Oops, didn't notice that line Then in that case : Or use MessageLoop mode for more of other available options Deye
  3. Did you try to correct those errors so it could be used? That UDF was created in 2008, probably it has variables that are already part of AutoIt that have been added in the last 11 years.
  4. He's using OnEvent mode to call those functions, he'd have to rewrite the script to use MessageLoop mode, but it can be done.
  5. Excuse me, but you said using the insert solution in Windows Startup is not effective for me. I downloaded the UDF v4 from this link and even trying to just run the example it already displays error about the const variables in SecurityConstants.au3. Then I created the service with another Services.au3 that I found and it worked, however when starting the service I created it returns error 1053. My service installation code: include <Services_1.au3> If @OSArch = "X64" Then $path = "c:\Program Files (x86)\teste" DirCreate($path) Else $path = "c:\Program Files\teste" DirCreate($path) EndIf Global $retorno = _Service_Create("Agente.Teste", _ "Agente - Teste", _ $SERVICE_WIN32_OWN_PROCESS, _ $SERVICE_AUTO_START, _ $SERVICE_ERROR_IGNORE, _ $path & "\Agente.Teste.exe") MsgBox(0, "$retorno", $retorno) MsgBox(0, "@error", @error) My Code Agente.Teste.exe #include <Misc.au3> #NoTrayIcon _Singleton("Agente.Teste.exe") ;Única instância na máquina Global $path If @OSArch = "X64" Then $path = "c:\Program Files (x86)\teste" DirCreate($path) Else $path = "c:\Program Files\teste" DirCreate($path) EndIf While 1 If Not ProcessExists("Teste.exe") Then Run($path & "\Teste.exe") EndIf Sleep(30000) WEnd The service I created starts Agent.teste.exe Can I explain it better?
  6. Yes, you can use nested\functions & parameters sent from your main loop Gui_P1_Close($GUI_Window) Func Gui_P1_Close($hGUI_close = "") GUIDelete($hGUI_close) Exit EndFunc ;==>Gui_P1_Close Modify($GUI_Label) Func Modify($GUI_Label = "")  ConsoleWrite(@CRLF & ">Move") GUICtrlSetPos($GUI_Label, Random(25, 250, 1), Random(25, 250, 1)) ConsoleWrite(@CRLF & ">Rewrite") GUICtrlSetData($GUI_Label, "Number: " & Random(0, 99, 1)) EndFunc ;==>Modify
  7. The only way to access local is to pass them between the functions. If you're not calling the other function directly from within the first function, make the variables Global, that's the point of using Global variables, so they can be accessed anywhere in the script in any function. Also, if you're declaring them as Global, do not declare them inside the functions, declare them at the start of the script. Because you're using OnEvent mode, you could call one of the functions using the global before you called the function they might be declared in.
  8. Byref parameters or return from functions to variables and pass those to other functions. or don't use local for variables needed globally
  9. EnableExplicit Global Procedure_Error = 0 Global Procedure_Extended = 0 Procedure.s DriveGetType(Drive$) Procedure_Error = 0 Procedure_Extended = 0 Select GetDriveType_(Drive$) Case #DRIVE_UNKNOWN ProcedureReturn "UNKNOWN" Case #DRIVE_REMOVABLE ProcedureReturn "REMOVABLE" Case #DRIVE_FIXED ProcedureReturn "FIXED" Case #DRIVE_REMOTE ProcedureReturn "REMOTE" Case #DRIVE_CDROM ProcedureReturn "CDROM" Case #DRIVE_RAMDISK ProcedureReturn "RAMDISK" Default Procedure_Error = 1 ProcedureReturn "" EndSelect EndProcedure MessageRequester("Disc type", DriveGetType("C:\")) Procedure.s DriveGetLabel(Drive$) Protected Label$, Size.l If Not GetVolumeInformation_(Drive$,#Null,@Size,0,0,0,0,0) Procedure_Error = 1 ProcedureReturn "" EndIf Label$=Space(Size) If Not GetVolumeInformation_(Drive$,Label$,@Size,0,0,0,0,0) Procedure_Error = 1 ProcedureReturn "" EndIf ProcedureReturn Label$ EndProcedure MessageRequester("Disk label", DriveGetLabel("C:\")) Procedure.s DriveGetSerial(Drive$) Protected Serial.l If Not GetVolumeInformation_(Drive$,0,0,@Serial,0,0,0,0) Procedure_Error = 1 ProcedureReturn "" EndIf ProcedureReturn Str(Serial & $FFFFFFFF) EndProcedure MessageRequester("Disk Serial", DriveGetSerial("C:\")) Procedure.s DriveSpaceFree(Drive$) Protected.q free_bytes If GetDiskFreeSpaceEx_(Drive$, 0, 0, @free_bytes) ; ProcedureReturn Str(free_bytes) ; Bytes ; ProcedureReturn Str(free_bytes/1024.0) ; Kb ProcedureReturn StrF(free_bytes/1048576.0, 4) ; Mb ; ProcedureReturn StrF(free_bytes/1073741824.0, 3) ; Gb Else Procedure_Error = 1 ProcedureReturn "0" EndIf EndProcedure MessageRequester("Free on drive", DriveSpaceFree("C:\")) Procedure.s DriveSpaceTotal(Drive$) Protected.q total_bytes If GetDiskFreeSpaceEx_(Drive$, 0, @total_bytes, 0) ; ProcedureReturn Str(total_bytes) ; Bytes ; ProcedureReturn Str(total_bytes/1024.0) ; Kb ProcedureReturn StrF(total_bytes/1048576.0, 4) ; Mb ; ProcedureReturn StrF(total_bytes/1073741824.0, 3) ; Gb Else Procedure_Error = 1 ProcedureReturn "0" EndIf EndProcedure MessageRequester("Disk size", DriveSpaceTotal("C:\")) Procedure.s DriveGetFileSystem(Drive$) Protected FileSystem$, Size.l If Not GetVolumeInformation_(Drive$,0,0,0,0,0,#Null,@Size) Procedure_Error = 1 ProcedureReturn "1" EndIf FileSystem$=Space(Size) If GetVolumeInformation_(Drive$,0,0,0,0,0,@FileSystem$,@Size) ProcedureReturn FileSystem$ Else Procedure_Error = 1 ProcedureReturn "1" EndIf EndProcedure MessageRequester("File system type", DriveGetFileSystem("C:\"))
  10. How I can access a Local Scope from outside Is there a better way except creating Globals ? #include <GUIConstants.au3> #cs Global $GUI_Window Global $GUI_Label #ce Opt("GUIOnEventMode", 1) Gui_P1() While 1 Sleep(100) WEnd Func Gui_P1() $GUI_Window = GUICreate("P1", 1050, 720, -1, -1) $GUI_Label = GUICtrlCreateLabel("<Nothing>", 25, 20) Local $GUI_Button = GUICtrlCreateButton("Modify",25,300,100) GUICtrlSetOnEvent($GUI_Button, "Modify") GUISetOnEvent($GUI_EVENT_CLOSE, "Gui_P1_Close") GUISetState(@SW_SHOW, $GUI_Window) EndFunc Func Gui_P1_Close() GUIDelete($GUI_Window) Exit EndFunc Func Modify() ConsoleWrite(@CRLF & ">Move") GUICtrlSetPos($GUI_Label, Random(25,250,1), Random(25,250,1)) ConsoleWrite(@CRLF & ">Rewrite") GUICtrlSetData($GUI_Label,"Number: " & Random(0,99,1)) EndFunc
  11. Today
  12. How are you calling that function? If using a hotkey or an OnEvent trigger, it won't work. Those types of function calls don't use the parameters in the function, so the variables are undeclared.
  13. I think you are located directly into autoit folder, which is protected against all modifications. So you need to create one folder in your personal folders for all your autoit scripts. In Windows File Explorer, use right mouse key to open and run your scripts. To create a new script use right mouse with new...
  14. I'm trying to automate the java process, although I'm having error below are you helping me?
  15. AndroidZero, Look at AdlibRegister in the Help file. M23
  16. Is there a way to create a Event Function that runs every x miliseconds while I can interact in another While Loop ? For example opening a GUI working inside it, calling functions etc .. and during all the time my script checks for receiving UDP data
  17. @Amar2801 you do realize this is an AutoIt forum, not Python, correct?
  18. A Excel workbook can be accessed like a database using ADO (example). This allows to bypass all Excel limitations.
  19. Are there any up to date gui designers / builders for Python preferably built for Tkinter? If not what would you guys recommend as a good gui framework to use today considering Tkinter is quite old and doesn't look very modern.
  20. Thanks for help! This code tip worked for me😀☺️😜
  21. I have a positive experience about AutoIt GUI, so you found a great option for yourself:)
  22. I just installed the latest version of SciTE editor and now it won't run or compile scripts and the Save function doesn't work. The output window just shows "Access is denied". I can save using "Save as..." with navigation. I can compile by executing AutoIt3Wrapper.exe directly and navigating to the .au3 file to be compiled. I can run a .au3 file by double clicking it, but I can't run a script in the window. I unsintalled and reinstalled - no change. Eset AV is off, in case that's a problem. Any ideas what I'm doing wrong here?
  23. It's almost the same; only the way you get the 2-Dimension array changes. You need to read the whole sheet in an array, then make a comparsion of a value to extract the data in separate files. One of the easiest way yo do that is using _Excel_RangeRead() with the parameter $bForceFunc set to true as @water suggested, so you'll have the array with all the values, and then you can do whatever you want. But, you could think to use an SQLite database either, which could save you for sure some time. You can find Excel to SQLite converter(s) online, and manage all the SQLite stuffs using _SQLite_* functions in AutoIt
  24. Can you disable keyb/mouse integration with the host? I do find it interesting that running a script within the guest manipulates the host. Does it do it if the VM is minimized or the console closed?
  25. Sorry,the code is not complete ..i didn't revise it 🤒 Also, there is no (Edit) Button 🙄 Here it is : #NoTrayIcon #AutoIt3Wrapper_UseX64=NO #include <imageSearchEX.au3> Global $imageSearchEX = imageSearchEX Global $_Check_Image = _Check_Image $Your_Window = "";your window $Your_Control = "";your Control $Your_Image = "";your Image While 1 $Coords = $_Check_Image($Your_Window,$Your_Control,$Your_Image) If $Coords <> 0 Then ;Do Something ExitLoop EndIf Sleep(10000) ;Sleep 10 Seconds WEnd Func _Check_Image($Window, $Control, $Image) $Hwnd = WinGetHandle($Window) $Control_Pos = ControlGetPos($Hwnd,$Control) $Coords = $imageSearchEX($Hwnd,$Image) $Result = $Coords If $Coords <> 0 Then Local $Image_Pos[] = [ $Coords[0] - $Control_Pos[0], $Coords[1] - $Control_Pos[1] ] $Result = $Image_Pos EndIf Return $Result EndFunc
  26. You are lucky that I have seen your topic ! ======= First of all, you shouldn't use the ordinary image search function...as it is not good because it requires that the image appears on the screen, so you can't do any other thing while the script is running ,so you need the ~:{:}{ImageSearchEX}{:}:~ function by it,you can search for the image in a specific window...and the function don't require that the image appears on the screen >> only it should appear on the window ,so this function run in the background ======= Image Search EX Topic : https://www.autoitscript.com/forum/topic/196542-image-search-inactive-window-but-not-minimized/ ======= note that : 1 : This function doesn't run on X64 bit ,so you have to make the script run on 32 bit by using : #AutoIt3Wrapper_UseX64=NO 2 : This function requires the window to be shown ,not minimized or hidden. ,so if you want to hide the window : just move it to (-X , -Y) Position that is out of the screen ====== Eventually : Here is the code you need : #NoTrayIcon #AutoIt3Wrapper_UseX64=NO #include <imageSearchEX.au3> Global $imageSearchEX = imageSearchEX Global $_Check_Image = _Check_Image $Your_Window = "";your window $Your_Control = "";your Control $Your_Image = "";your Image While 1 $Coords = $_Check_Image($Your_Window,$Your_Control,$Your_Image) If $Coords <> 0 Then ;Do Something ExitLoop EndIf Sleep(10000) ;Sleep 10 Seconds WEnd Func _Check_Image($Window, $Control, $Image) $Hwnd = WinGetHandle($Window) $Control_Pos = ControlGetPos($Hwnd,$Control) $Coords = $imageSearchEX($Hwnd,$Image) Return $Coords EndFunc
  1. Load more activity
  • Create New...