Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. the "Allow the service to interact with the desktop" feature has been deprecated since Windows Server 2008 (and Windows Vista for desktop systems). here is a nicely-written blog post describing the issues it caused. the official approach is not to have the service interact with the desktop, but to communicate with a client application that runs under the user context. search the forum and wiki for "IPC" (Inter-Process Communication) for details on how to implement this.
  3. Hey, I found a better website that allows game automation. It also allows donald duck to mix meth with viagra.
  4. https://www.autoitscript.com/autoit3/docs/functions/ObjEvent.htm
  5. So from my very limited knowledge of COM errors and COM in general is that this is happening when autoit is trying to interact with a program and something about the DLL file is missing? I am trying to do research on the topic but am struggling to find anything to do with it related to AutoIt. Ive been running a few scripts and cannot figure out a rhyme or reason to when they occur or what they mean when they occur. I can run a script 5 times in a row without changing it or the environment and get 3 of them crashing to COM errors. If someone could explain why they are occurring and what exactly can be done to prevent them or even just a nice way to log them to see why they are occurring, that would be great. I've gotten a bunch of different errors like 'Access Denied' but the one I am dealing with right now is 'Class Not Registered'. I've run it about 10 times now and on the third one or so, no COM error occurred. The program completed but of course I had to make more changes after it completed and on the next 7 runs... COM errors every time right at the beginning. Any info would be greatly appreciated.
  6. Today
  7. Another flavour, if you want to keep the corresponding element in the 1st column #Include <Array.au3> Local $array = [["name 0", "Peter"], ["name 1", "Paul"], ["name 2", "Mary"], ["name 3", "Mary"], ["name 4", "Charles"], _ ["name 5", "Elizabeth"], ["name 6", "Victoria"], ["name 7", "Mary"], ["name 8", "Tom"], ["name 9", "Paul"]] Local $sd = ObjCreate("Scripting.Dictionary") For $i = 0 to UBound($array)-1 $sd.add($array[$i][1], $array[$i][0]) Next Local $aOut[$sd.count][2] For $i = 0 to $sd.count-1 $aOut[$i][0] = $sd.Items[$i] $aOut[$i][1] = $sd.Keys[$i] Next _ArrayDisplay($aOut)
  8. perfect. took a while to understand but perfect. i had tried with _ArrayUnique but did not get it done somehow. thanks a lot
  9. So? HAve you done what I told you to do when posting here? Jos PS: DO not PM me with support questions unless it is something not for the public forum.
  10. you're right, these wrists are generated by a note acceptor that sends out wrists when a ballot is placed.
  11. Ah! I think I have it- Case $Button1 $DataFromUser = GUICtrlRead($Input1) & "_" & GUICtrlRead($Input2) & "_" & GUICtrlRead($Input3) & "_" & GUICtrlRead($Input4)& "_" & GUICtrlRead($Input5) WinWaitActive("Save As") Sleep(1000) Send($DataFromUser)
  12. The key pressed are not done by a human, right ? Those are generated by a machine. Anyway, if that doesn't work I would probably go with a callback approach...
  13. @BrewManNH as incredible as it seems I can not get all pulses using loop because they are very fast and the interval between them is also very small, I can only get all pulses using hotkeyset but if the key is stuck the count does not stop so I need to call the function only once until the button is released but only using hotkeyset. @Nine deactivating hotkey and using _Ispressed I had already tried and for this I mentioned in the first post I need to do without using _IsPressed or _WinAPI_GetAsyncKeyState
  14. @BrewManNH Thank you for all your help! Do you mind showing me how that ControlSend script would look like? The script I'm writing in this help post will be activating another script using a "run" function which that other script will in turn create a "Save As" window at some point and I want this this script to send the data to the file name input box on the "Save As" window.
  15. have you tested my code, cause I do think it does what you want...unless I don't understand
  16. Use Send or better ControlSend instead of FileWrite.
  17. What's New in Version 0.2019.04.18 added: TaskSched. entries for OnDemand(UAC bypass) or OnLogon added: Elevate / DeElevate When running within 60 sec. of login, the script will start as /Tray, as is assumed that is running "OnLogon".
  18. Are your reaction times quicker than the delay in that loop? Seriously doubt it.
  19. Thanks BrewManNH! This has created the workaround scenario I was wanting as a last resort. What if I wanted to just skip the whole writing to a text document and have the script store the data and then send it as soon as a "Save As" window pops up?
  20. @Nine are very short pulses and with small interval between them so I can not use _IsPressed or _WinAPI_GetAsyncKeyState to know when the key was released, what I want is to use hotkeyset () but only count one pulse for as long as the key was pressed, I searched the hotkeyset () function documentation to see if I could make changes to it but could not find it. EDITED: when I use _IsPressed or _WinAPI_GetAsyncKeyState some pulses are not counted and when I use only hotkeyset I get all the pulses but when the key happens to get stuck it will count infinitely because hotkeyset calls the function all the time the key is pressed.
  21. Hi Everyone, I have a question about how shoud my function look to return hex bytes from com port. At this moment it returns number of bytes that have been read but where they go ? How to access them ? It would be perfect if they were returned as a hex string. I'm sending data like "0xBCFD0101000000AE" It should return "0xBCFD02000000FFAE" <- i want this to be returned as a result of function Func SendAndRead($data, $numBytesToRead, $readType = 1) $bBinData = Binary($data) $iNumbytes = BinaryLen($bBinData) $tBinData = DllStructCreate("byte["&$iNumbytes&"]") DllStructSetData($tBinData, 1, $bBinData) $iRet = _CommSendByteArray(DllStructGetPtr($tBinData),$iNumbytes,1) If (@error Or $iRet = -1) And $Initialized = 1 Then MsgBox($MB_SYSTEMMODAL, "Error while sending", "!Error: " & @error, 1) $iRet = _CommReadByteArray(DllStructGetPtr($tBinData),$numBytesToRead,$readType) If (@error Or $iRet = -1) And $Initialized = 1 Then MsgBox($MB_SYSTEMMODAL, "Error while reading", "!Error: " & @error, 1) Finalize() EndIf Return $iRet EndFunc Anyone can help ? Thanks !
  22. Here's one way: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region $Form1_1 = GUICreate("Testing", 278, 218, 230, 181) $Input1 = GUICtrlCreateInput("", 56, 40, 185, 21) $Input2 = GUICtrlCreateInput("", 56, 64, 185, 21) $Input3 = GUICtrlCreateInput("", 56, 88, 185, 21) $Input4 = GUICtrlCreateInput("", 56, 112, 185, 21) $Label1 = GUICtrlCreateLabel("TEST#", 16, 43, 39, 17) $Label2 = GUICtrlCreateLabel("TEMP", 16, 68, 34, 17) $Label3 = GUICtrlCreateLabel("PSI", 24, 92, 21, 17) $Label4 = GUICtrlCreateLabel("DWELL", 8, 115, 42, 17) $Button1 = GUICtrlCreateButton("START TEST", 56, 144, 75, 25) GUICtrlSetBkColor(-1, 0x008000) $Button2 = GUICtrlCreateButton("STOP TEST", 168, 144, 75, 25) GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xFF0000) $Input5 = GUICtrlCreateInput(@MON & "/" & @MDAY & "/" & @YEAR, 56, 16, 185, 21) $DATE = GUICtrlCreateLabel("DATE", 16, 20, 33, 17) $Label5 = GUICtrlCreateLabel("Created by Me", 8, 200, 150, 17) GUISetState(@SW_SHOW) #EndRegion While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $DataFromUser = GUICtrlRead($Input1) & "_" & GUICtrlRead($Input2) & "_" & GUICtrlRead($Input3) & "_" & GUICtrlRead($Input4) & $SaveLocation = FileSaveDialog('Save File', @ScriptDir, 'Text Files (*.txt)', 16) FileWrite($SaveLocation, $DataFromUser)  EndSwitch WEnd
  23. #include <Misc.au3> HotKeySet("{F1}", "_Func") HotKeySet("{ESC}", "_Exit") While 1 Sleep(100) WEnd Func _Func() HotKeySet("{F1}") ConsoleWrite ("HotKey Only going to work once!" & @CRLF) While _IsPressed ("70") Sleep (10) WEnd ; do your stuff here HotKeySet("{F1}", "_Func") EndFunc Func _Exit() Exit EndFunc Maybe this ?
  24. Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Moderation Team
  25. Would that fit your needs? Local $array = [["name 0", "Peter"], ["name 1", "Paul"], ["name 2", "Mary"], ["name 3", "Mary"], ["name 4", "Charles"], _ ["name 5", "Elizabeth"], ["name 6", "Victoria"], ["name 7", "Mary"], ["name 8", "Tom"], ["name 9", "Paul"]] Local $aTmp = _ArrayUnique($array, 1, 0, 0, 0, 0) Local $aOut[UBound($aTmp)][UBound($array, 2)] For $i = 0 To UBound($aOut) - 1 $aOut[$i][0] = "name " & $i $aOut[$i][1] = $aTmp[$i] Next $aTmp = 0 _ArrayDisplay($aOut)
  26. I have already configured the "Allow the service to interact with the desktop" option in the Logon tab in Windows Services. but the error continues. Tks. Blois
  27. Sorry @ Melba23 I was not clear, I want to call the function only when the hotkey is no longer pressed but I do not want to disable the hotkey, I will use this function for counting pulses and can not count more than once for as long as the key was pressed.
  1. Load more activity
×
×
  • Create New...