Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Several compile errors when I "test compiled" the udf: Local $FrameRate = GUICtrlRead($FrameInput) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(559,23) : warning: $hGUI: possibly used before declaration. WinSetTitle($hGUI, ~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(593,33) : warning: $UserDLL: possibly used before declaration. While _IsPressed("01", $UserDLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(241,46) : error: $FrameInput: undeclared global variable. Local $FrameRate = GUICtrlRead($FrameInput) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(559,23) : error: $hGUI: undeclared global variable. WinSetTitle($hGUI, ~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(593,33) : error: $UserDLL: undeclared global variable. While _IsPressed("01", $UserDLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\Users\whiggs\Downloads\WebcamDS_UDF.au3"(593,33) : error: _IsPressed(): undefined function. While _IsPressed("01", $UserDLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ I mention this because, when I run the example script in the original post, while I am able to hear the input from the microphone, there is no video, which I assume their should be since my integrated webcam light turns on. Attempting to change the codec results in the whole application crashing. But when I do exit the example udf (I have been launching it directly from Scite for autoit), scite will automatically open the "WebcamDS_UDF.au3" file and immediately reference these compile errors. Great start, but not usable.
  3. Hi! Is there any good version of this UDF? This version is missing the function: __MemoryModule_ModuleRecord
  4. Today
  5. Trying to guess the possible issues and using the provided infos, may I suggest this pattern '<span class="price">\s*([^<]+)'
  6. Neither the 32bit or the 64bit version can be renamed for obvious common sense reasons. Think about the door opened if you could change the name of system files with a simple AutoIt script. You need to think of a better way to accomplish what you're after, as this is not something we are going to support.
  7. I want to slowly banish Internet Explorer from my system. However, I have many links that point directly to the Internet Explorer and do not use my default browser "Google Chome". That's why I wrote the following scipt and wanted to rename "iexplore.exe" to "iexploreOrg.exe". But neither the 32 bit version nor the 64 bit version can be renamed. Does anyone has a solution for my problem? #include <MsgBoxConstants.au3> $rc = MsgBox($MB_YESNO + $MB_ICONQUESTION + $MB_TOPMOST, Default, "Do you want to start Internet Explorer?" , 20) If $rc = $IDNO Then Exit $rc = ShellExecute("iexploreOrg.exe", ($CmdLine[0]=0 ? "" : $CmdLine[1]))
  8. No, I would prefer you simply post an script that shows the issue so we can help you.
  9. sorry @Jos you can remove my post ?? thankz P.S. habits die hard sorry
  10. @faustf, You've been here this long and are still not posting a runnable script to simulate your issue which people can test with. Wonder whether you will ever learn? Jos
  11. hi guys i have this pageweb with this code <li class="list-inline-item"> <span class="price"> 400.000</span> <span class="price">€</span> </li> </ul> i try to match 400.000 with this code but i dont know why in regexpbuddy work but in autoit not Local $aLPrezzi = StringRegExp($sLHtmlPage, '<span class="price">\r\n(.*?)\/span', $STR_REGEXPARRAYGLOBALMATCH) anyone can helpme?? thankz
  12. Look at FAQ 31. It discusses many ways for browser automation that are far better Then static mouse clicks
  13. I have recently experienced Windows Defender identifying Inet includes (downloaders) as a variety of trojans. Just saying.
  14. If instead of just sending simple messages to the server you also want to interact with it, then you need to set a way to allow the client and server to establish a two-way dialogue, the simple example I posted above is unidirectional so it is only part of this process. to make the process two-way we should improve the tcp communication part. Here is a quick and rough example of a possible way to proceed. save the three sample files NotificationsClient.au3, NotificationsServer.au3, MultiClientsExample.au3 and also notifications.udf in the same folder and then run the MultiClientsExample script. p.s. don't forget to quit the server when you are done. save this as NotificationsClient.au3 TCPStartup() ; connect to the Notifications server Global $Socket = TCPConnect(@IPAddress1, 1018) If @error Then ; check for connection error ; try to run the server If FileExists(".\NotificationsServer.au3") Then Run(@AutoItExe & " .\NotificationsServer.au3") ElseIf FileExists(".\NotificationsServer.exe") Then Run(".\NotificationsServer.exe") Else Exit EndIf ; give time to server to start Sleep(1500) ; try connecting again $Socket = TCPConnect(@IPAddress1, 1018) If @error Then Exit EndIf Global $FeedBack = _waitAck() _ExampleClient() Func _ExampleClient() SRandom(@MSEC) ; a random color to identify this client's notifications on the messages stack Local $MyColor = Random(0x0f0f0f, 0xffffff, 1) ; create a simple gui to 'comunicate' with the server GUICreate("Notifications Client-Server demo. [" & $FeedBack & "]", 450, 160, Random(10, @DesktopWidth / 2 - 440, 1), Random(10, @DesktopHeight / 2 - 170, 1)) ; create some controls on the GUI $hMessage = GUICtrlCreateInput('', 10, 10, 430, 20) $hButtonSend = GUICtrlCreateButton("Send notification", 10, 40, 430, 50) GUICtrlSetBkColor(-1, $MyColor) $hButtonCheck = GUICtrlCreateButton("Check pending", 10, 110, 130, 40) $hButtonClose = GUICtrlCreateButton("Close all", 160, 110, 130, 40) $hButtonQuit = GUICtrlCreateButton("Quit client", 310, 110, 130, 40) GUISetState() ; main loop While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $hButtonSend ; sice the server executes notifications.au3 raw commands ; we send a _Notifications_Create() command with parameters, ; parameters MUST be expressed in plain text (sending a variables is not allowed of course) $sCommad = '_Notifications_Create("' & $FeedBack & '", "' & GUICtrlRead($hMessage) & '")' ; ask server to set BackColor for next message TCPSend($Socket, '_Notifications_SetBkColor(' & $MyColor & ')') _waitAck() ; send notification TCPSend($Socket, $sCommad) _waitAck() ; reset the input field GUICtrlSetData($hMessage, '') ControlFocus('', '', $hMessage) Case $idMsg = $hButtonCheck ; a new castom notification command implemented on the server TCPSend($Socket, '_Notifications_GetPending()') ; wait a response from server $iPending = _waitAck() MsgBox(0, "Pending", $iPending & ' pending messages') Case $idMsg = $hButtonClose ; ask server to close all my pending messages TCPSend($Socket, '_Notifications_CloseAll()') _waitAck() Case $idMsg = $hButtonQuit ; close all pending messages belonging to this client and quit this client TCPSend($Socket, '_Notifications_CloseAll()') _waitAck() TCPSend($Socket, '_Notifications_Shutdown()') _waitAck() ExitLoop EndSelect WEnd GUIDelete() EndFunc ;==>_ExampleClient ; wait a confirm from server Func _waitAck() Local $sAck Do $sAck = TCPRecv($Socket, 1000000) Until $sAck Return $sAck EndFunc ;==>_waitAck save this as NotificationsServer.au3 #include <Notifications.au3> #include <Array.au3> #include <misc.au3> _Singleton('NotificationsServer', 0) Opt("GUIOnEventMode", 1) _Notifications_Startup() ; we add a new 'column' in the $__notificationList array used by the notifications udf ; so to make room to store also info related to the client's socket that required a notification. Local $iSockColumn = UBound($__notificationList, 2) + 1 ReDim $__notificationList[0][$iSockColumn] $iSockColumn -= 1 TCPStartup() Global $Socket_Data[1] ; a buffer to stack connected clients reference $Socket_Data[0] = 0 ; wait for clients on this port $Listen = TCPListen(@IPAddress1, 1018, 500) If @error Then ConsoleWrite('!--> TCPListen error number ( ' & @error & ' )' & @CRLF) Exit EndIf ; main loop While 1 ; scan all connected client to check for incoming commands For $x = $Socket_Data[0] To 1 Step -1 $Recv = TCPRecv($Socket_Data[$x], 1000000) If $Recv Then ; 1) search position of the open parenthesis $iopen_parenthesis_position = StringInStr($Recv, '(') ; 2) get the command on the left of the parenthesis $sRecvCommand = StringLeft($Recv, $iopen_parenthesis_position - 1) ; 3) parse and execute the received command Select Case $sRecvCommand = "_Notifications_GetPending" $iPending = 0 For $iCallerNotifications = 0 To UBound($__notificationList) - 1 $iPending += $__notificationList[$iCallerNotifications][$iSockColumn] = $Socket_Data[$x] Next TCPSend($Socket_Data[$x], String($iPending)) Case $sRecvCommand = "_Notifications_Create" ; MsgBox(0,0, $Recv) Execute($Recv) ; keep track of incoming messages's socket $__notificationList[UBound($__notificationList) - 1][$iSockColumn] = $Socket_Data[$x] TCPSend($Socket_Data[$x], "created") ; send an ack to client Case $sRecvCommand = "_Notifications_CloseAll" ; here we close all the caller's notifications For $iCallerNotifications = UBound($__notificationList) - 1 To 0 Step -1 If $__notificationList[$iCallerNotifications][$iSockColumn] = $Socket_Data[$x] Then _Notifications_Close($iCallerNotifications) Next TCPSend($Socket_Data[$x], "closed") ; send an ack to client Case $sRecvCommand = "_Notifications_Shutdown" ; what this function is intended for? ; here we disconnect caller from the server TCPSend($Socket_Data[$x], "bye") ; send an ack to client TCPCloseSocket($Socket_Data[$x]) _ArrayDelete($Socket_Data, $x) $Socket_Data[0] -= 1 ExitLoop Case Else Execute($Recv) TCPSend($Socket_Data[$x], "done") ; send an ack to client EndSelect EndIf Next _Accept() ; check for new clients connection requests WEnd ; check for new clients connection requests Func _Accept() Local $Accept = TCPAccept($Listen) If $Accept <> -1 Then _ArrayAdd($Socket_Data, $Accept) $Socket_Data[0] += 1 ; send a feedback to the new client (his sock number) TCPSend($Accept, String($Accept)) EndIf EndFunc ;==>_Accept save this as MultiClientsExample.au3 (this simply runs 3 clients) ; just run 3 clients to test For $i = 1 to 3 Run(@AutoItExe & " NotificationsClient.au3") Next
  15. Uiawrappers also have index, instance and indexrelative. So if simplespy highlights the object you just have to tweak description to identify object. Make sure to use latest version from uiawrappers.
  16. Moved to the appropriate forum. Moderation Team
  17. Hi Guys im just wondering if how can i focus my MouseMove and MouseClick on 1 application for example i Open the Browser and i just use MouseMove or Click to move and click into that position my problem is some times other pc have difference spec or difference resolution of desktop so the problem will be Exist there MouseMove/Click wont Click i right position if other pc use in to other resolution so im just wodering how can still click the same positon that i need or can autoit get only the application size and then what ever size of that applican autoit will do the same or any new way to still make it sorry for bad explanation but i hope i will get Some Help here newbie only
  18. For $i = 0 To UBound($Checkbox) - 1 If GUICtrlRead($Checkbox[$i]) = $GUI_CHECKED Then ConsoleWrite(GUICtrlRead($Checkbox[$i], 1) & @CRLF) Next
  19. May I suggest to read this page of the help file to "associate a gui button with a key"
  20. @youtuber Create a two-dimension array; in the first column, you store the ControlID of the checkbox, and in the second column you store its label, so when you use GUICtrlRead() in a For...Next loop, you just need to use For $i = 0 To UBound($arrCheckBoxes) - 1 Step 1   If GUICtrlRead($arrCheckBoxes[$i][0]) = $GUI_CHECKED Then ConsoleWrite($arrCheckBoxes[$i][1] & @CRLF)    Next to retrieve the information about the label of the checked checkbox(es)
  21. I want to get extensions from checkbox names #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 195, 125) $Button1 = GUICtrlCreateButton("ok", 86, 64, 75, 34) Dim $Checkbox[3] $Checkbox[0] = GUICtrlCreateCheckbox(".JPG", 14, 32, 49, 17) $Checkbox[1] = GUICtrlCreateCheckbox(".PNG", 68, 32, 49, 17) $Checkbox[2] = GUICtrlCreateCheckbox(".GIF", 127, 32, 49, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 For $i = 0 To UBound($Checkbox) - 1 If GUICtrlRead($Checkbox[$i]) = $GUI_CHECKED Then ConsoleWrite($Checkbox[$i] & @CRLF) Next EndSwitch WEnd
  22. With HotKeySet you can't use parameters in the function call, all parameters are ignored. You shouldn't use HotKeys that are used frequently by other programs like F1, so use something like Ctrl+F1, see example code below: nb: Not sure why but your default "Untitle - Notepad" is "Untitled - Notepad" on my system, so you may need to change it. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("^{F1}", "_SendDate") Global $g_vCurrentDate GUICreate("Example", 250, 170, 192, 124) Global $g_idDateInput = GUICtrlCreateInput("", 110, 50, 105, 21) GUICtrlSetData(-1, "aaaa-mm-dd", "") GUICtrlSetState($g_idDateInput, $GUI_DISABLE) Global $g_idSendButton = GUICtrlCreateButton("(F1) Send", 90, 90, 75, 24) GUICtrlCreateLabel("Date1", 60, 53, 33, 17) Global $g_idRadio1 = GUICtrlCreateRadio("Auto", 60, 17, 78, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $g_idRadio2 = GUICtrlCreateRadio("Manual", 140, 17, 113, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $g_idSendButton Select Case GUICtrlRead($g_idRadio2) = 1 $g_vCurrentDate = GUICtrlRead($g_idDateInput) _SendDate () Case GUICtrlRead($g_idRadio1) = 1 $g_vCurrentDate = GUICtrlRead($g_idDateInput) _SendDate () EndSelect Case $g_idRadio1 If GUICtrlRead($g_idRadio1) = $GUI_CHECKED Then GUICtrlSetState($g_idDateInput, $GUI_DISABLE) EndIf Case $g_idRadio2 If GUICtrlRead($g_idRadio2) = $GUI_CHECKED Then GUICtrlSetState($g_idDateInput, $GUI_ENABLE) EndIf EndSwitch WEnd Func _SendDate () If $g_vCurrentDate = "" Then $g_vCurrentDate = "(F1) Send" $g_vCurrentDate = $g_vCurrentDate = "(F1) Send" ? StringRight(@Year, 4) & ("-") & StringFormat("%02u-%02u", @MON, @MDAY) : $g_vCurrentDate WinActivate ("Untitled - Notepad", "") WinWaitActive ("Untitled - Notepad", "", 0) Send ($g_vCurrentDate) Send("{ENTER}") $g_vCurrentDate = "" ;~ Reset the variable to blank EndFunc
  23. ok so, I have this this scrip for my work already finished but I cant find the way to press the button "send " with a key, it's annoying to have to maximize the gui every time I need to use it; hotkeyset and & ยบ are the ways that I found but, they dont work me at all, there is another way to do it? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{F1}", "_SendDate" ) Local $vCurrentDate Local $_vCurrentDate #Region ### START Koda GUI section ### Form= Local $Form1 = GUICreate("Form1", 250, 170, 192, 124) Local $Input1 = GUICtrlCreateInput("", 110, 50, 105, 21) GUICtrlSetData(-1, "aaaa-mm-dd", "") GUICtrlSetState($input1, $GUI_DISABLE) Local $Button2 = GUICtrlCreateButton("(F1) Send", 90, 90, 75, 24) ;; Or ;~ Local $Button2 = GUICtrlCreateButton("$º Send", 90, 120, 75, 24) Local $Label1 = GUICtrlCreateLabel("Date1", 60, 53, 33, 17) Local $Radio1 = GUICtrlCreateRadio("Auto", 60, 17, 78, 17) GUICtrlSetState(-1, $GUI_CHECKED) Local $Radio2 = GUICtrlCreateRadio("Manual", 140, 17, 113, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Switch $nMsg Case $Button2 Select Case GUICtrlRead($Radio2) = 1 _SendDate (GUICtrlRead($Input1)) Case GUICtrlRead($Radio1) = 1 _SendDate () EndSelect Case $Radio1 if GUICtrlRead($Radio1) = $GUI_CHECKED Then GUICtrlSetState($input1, $GUI_DISABLE) EndIf Case $Radio2 if GUICtrlRead($Radio2) = $GUI_CHECKED Then GUICtrlSetState($input1, $GUI_ENABLE) EndIf EndSwitch WEnd Func _SendDate ($_vCurrentDate = "(F1) Send") Local $vCurrentDate = $_vCurrentDate = "(F1) Send" ? StringRight(@Year, 4) & ("-") & StringFormat("%02u-%02u", @MON, @MDAY) : $_vCurrentDate WinActivate ("Untitle - Notepad", "") WinWaitActive ("Untitle - Notepad", "", 0) Send ($vCurrentDate) Send("{ENTER}") EndFunc
  24. Yesterday
  25. I dont make scripts for people who dont properly sanitize their input, its gross
  26. @iamtheky Not foolproof, see aditional blank In customer Global $A = "Customer Name: John Smith, Address: 1234 Main Street, Chicago, IL, Customer Rec#: 123457, PHone Number#: 555-555-1212" msgbox(0, '' , StringLeft((stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1)) , (StringInStr(stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1) , ",") - 1)),2) ;~ Not foolproof, see aditional blank In customer ---------------------------------v Global $A = "Customer Name: John Smith, Address: 1234 Main Street, Chicago, IL, Cus tomer Rec#: 123457, PHone Number#: 555-555-1212" msgbox(0, '' , StringLeft((stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1)) , (StringInStr(stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1) , ",") - 1)))
  27. moar stringops! Global $A = "Customer Name: John Smith, Address: 1234 Main Street, Chicago, IL, Customer Rec#: 123457, PHone Number#: 555-555-1212" msgbox(0, '' , StringLeft((stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1)) , (StringInStr(stringmid($A , StringInStr($A , "Customer Rec#: ") + StringLen("Customer Rec#: ") - 1) , ",") - 1)))
  1. Load more activity
×
×
  • Create New...