Leaderboard
Popular Content
Showing content with the highest reputation on 07/02/2015 in all areas
-
mLipok, that doesn't stop the script's speaking when I run it. It keeps speaking the first text, then afterwards plays the next queued text. Using 3 instead of 1 will cause it to be asynchronous, meaning it will return immediately after the text is queued, and it will purge any data in the buffer. You can't use just 2 or 1 by itself because even though it might return immediately using 1, the buffer will still be speaking. Also, if you use just 2 by itself, then it will empty the buffer before the next message gets queued, but because it doesn't return immediately the function will keep talking until the buffer is empty, and then it returns so 2 wouldn't help at that point because the buffer is already empty.2 points
-
Like Request for node.js or Requests for python, Request UDF is a powerful and easy-to-use HTTP client for AutoIt. It is based on my Curl.au3 and Json.au3 (not included). The Features: Request target can be a string (single url), an array (urls), an object (single url + options or url array + options), an object array (urls + different options), or a json string (decode to array or object automatically), etc.Easy to setup post data, cookies, agent, refer, timeout, proxy, etc.Easy to setup the default options before a series of requests.Use BinaryToString() to decode the returned data according to content type automatically. Use curl multi interface by default. It means all requests will transfer simultaneously and won't block the GUI event.Use callback function to recieve the data and information for every url before main function finished.Supports https and ftp protocols.Example: #Include "Json.au3" #Include "Curl.au3" #Include "Request.au3" RequestDefault('{refer: "http://www.autoitscript.com", agent: "AutoIt/Request", callback: "MyCallback"}') Local $Data = Request("http://httpbin.org/get") ConsoleWrite($Data & @LF) Request('["http://www.google.com", "http://wikipedia.org"]') Request('{url: "http://www.google.com", agent: "AutoIt/Request"}') Request('{url: ["http://www.google.com", "http://wikipedia.org"], agent: "AutoIt/Request"}') Local $Array[] = ["http://www.google.com", "http://wikipedia.org"] Request($Array) Request("http://httpbin.org/post", "key=Post%20can%20be%20the%20raw%20data") Request("http://httpbin.org/post", '{key: "Post can be a json object string"}') Request('{url: "http://httpbin.org/post", post:{key: "Post can be set as second paramemtr or \"post\" option"}}') Local $Obj Json_Put($Obj, ".key", "Post can be an object") Local $Json = Request("http://httpbin.org/post", $Obj) Func MyCallback($Obj) Local $Data = Json_ObjGet($Obj, "Data") Local $EffectiveUrl = Json_ObjGet($Obj, "EffectiveUrl") ConsoleWrite("Callback: " & $EffectiveUrl & " download size: " & StringLen($Data) & @LF) EndFunc More examples are in the archive. Request.zip1 point
-
stackoverflow, AutoIt & Voting
argumentum reacted to trancexx for a topic
Let me rephrase then. "Like" button, in essence, likes content (post) and not user. I would click like for the other part of your post. But I'm afraid you'd think I actually like you, and not what you wrote.1 point -
Didn't your initial post started with " doing a bit of coding" and you say now you don't have any exact case? I hate all this word playing around here when its about "i Need to find this fucking pixel/image". One day i will come up with that automated 7x7 that will hit your heads when using this topic. jos1 point
-
Welcome Renderer!! You should post in the "Help and Support" section. Straight from the help file... ; Trap COM errors so that 'Back' and 'Forward' ; outside of history bounds does not abort script ; (expect COM errors to be sent to the console) #include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 40, 600, 360) Local $idButton_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) Local $idButton_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) Local $idButton_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) Local $idButton_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) Global $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") _IEAction($oIE, "stop") ; Waiting for user to close the window While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop Case $iMsg = $idButton_Home _IENavigate($oIE, "http://www.autoitscript.com") _IEAction($oIE, "stop") _IEAction($oIE, "back") CheckError("Home", @error, @extended) Case $iMsg = $idButton_Back _IEAction($oIE, "back") CheckError("Back", @error, @extended) Case $iMsg = $idButton_Forward _IEAction($oIE, "forward") CheckError("Forward", @error, @extended) Case $iMsg = $idButton_Stop _IEAction($oIE, "stop") CheckError("Stop", @error, @extended) EndSelect WEnd GUIDelete() Exit Func CheckError($sMsg, $iError, $iExtended) If $iError Then $sMsg = "Error using " & $sMsg & " button (" & $iExtended & ")" Else $sMsg = "" EndIf GUICtrlSetData($g_idError_Message, $sMsg) EndFunc ;==>CheckError good luck.. 8)1 point
-
Is this accurate enough? #include <Date.au3> $exampleADTimeStamp = "130793861794571914" ConsoleWrite(_DateAdd("s", StringTrimRight($exampleADTimeStamp, 7), "1601/01/01 00:00:00") & @CRLF)1 point
-
As he was talking about a function I gave him a function1 point
-
GUICTRLGET-LEFT, TOP, WIDTH AND HEIGHT
argumentum reacted to UEZ for a topic
rizaado, thanks for your contributions but it would fit better in AutoIt Snippets rather than in Example Scripts.1 point -
It's dead in terms of taking the current forums and turning the option On for them because they were ordered as discussions and would break. But there's no problem in leaving the current forums in a general discussion mode and creating a new support forum that is Q&A from the start. I can see the code where there is an error where you can't remove your vote which I've reported and can probably fix myself in the short term.1 point
-
How about this: #include <Array.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "_Excel_Open Error", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\namen und emails.xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Reading of Excel File Failed", "Error opening workbook" & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf $aValues = _Excel_RangeRead($oWorkbook, "Tabelle1", "A2:A789") For $iIndex = 0 To UBound($aValues) - 1 $aSplit = StringSplit($aValues[$iIndex], ",") If @error = 0 Then _Excel_RangeWrite($oWorkbook, "Tabelle1", $aSplit[1], "A" & $iIndex + 1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error while using _Excel_RangeWrite." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $iIndex = $iIndex + 1 _Excel_RangeWrite($oWorkbook, "Tabelle1", $aSplit[2], "A" & $iIndex + 1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error while using _Excel_RangeWrite." & @CRLF & "@error = " & @error & ", @extended = " & @extended) EndIf Next MsgBox(64, "Success", "All values fixed.")1 point
-
How to stop SAPI.SpVoice in function
drquochoai reacted to mLipok for a topic
https://msdn.microsoft.com/en-us/library/ms723609(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/ms720892(v=vs.85).aspx HotKeySet('^t', '_Translate') $oSp = ObjCreate("SAPI.SpVoice") While 1 Sleep(200) WEnd Func _Translate() $oldClip = ClipGet(); get the data that is currently in the clipboard Send('^c'); copy the selected text to the clipboard $phrase = ClipGet(); get the data from the clipboard (which is now the selected word) ClipPut($oldClip); put the old data back in the clipboard ToolTip($phrase, 0, 0) ; now phrase is the word or phrase you want to translate $oSp.Speak($phrase,1) MsgBox(0, 'Testing', 111) EndFunc ;==>_Translate1 point -
How to stop SAPI.SpVoice in function
drquochoai reacted to BrewManNH for a topic
Try this: HotKeySet('^t', '_Translate') $oSp = ObjCreate("SAPI.SpVoice") While 1 Sleep(200) WEnd Func _Translate() $oldClip = ClipGet(); get the data that is currently in the clipboard Send('^c'); copy the selected text to the clipboard $phrase = ClipGet(); get the data from the clipboard (which is now the selected word) ClipPut($oldClip); put the old data back in the clipboard ToolTip($phrase, 0, 0) ; now phrase is the word or phrase you want to translate $oSp.Speak($phrase, 3) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndFunc ;==>_Translate1 point -
A few questions - Ein paar Fragen. Why do you call _Excel_RangeRead twice - Warum rufst Du _Excel_RangeRead zwei Mal auf? What is the While/WEnd loop for? - Wofür ist die While/WEnd Schleife gut? And how do you exit the loop - Und wie willst Du die Schleife jemals verlassen? Why didn't _Excel_RangeWrite work - Warum funktioniert _Excel_RangeWrite nicht? What is the value of @error after _Excel_RangeWrite - Welchen Wert aht @error nach _Excel_RangeWrite?1 point
-
Hi, A number of recent threads have degenerated into discussions between no doubt well-meaning members over the legality of the question asked - such spats are both unseemly and unnecessary. If you have not already noticed, there is a Moderation team charged by the site owner with keeping the site running smoothly in accordance with his wishes - so please leave the decisions to them. If the question is obviously illegal, then perhaps the first responder might point at the Forum rules as well as reporting the thread so that normal moderation action can be taken. But if there is any doubt, please still report the thread, but do NOT get involved in pointless discussions as to whether or not it is allowable - the Moderation team will make the final decision and will not be swayed by any other opinions, so save the wear on typing fingers and keyboards. In particular, if a Moderation team member has already posted permitting the thread to continue, it is completely out of order for a third party to post again questioning the decision - from now on this will be regarded as an unfriendly act and is likely to attract sanctions upon the wannabee-Mod. If there is really a burning need to discuss the matter further, please do so by PM - the Moderation team do not bite and are open to reasoned debate. M231 point
-
bobbintb, This is Valuater's function for icon & text on a button: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $mywin = GUICreate("Images amd Text on Buttons", 210, 240) $btn1 = IconButton("Test 1 - Test 1", 30, 30, 150, 64, 16, "M:\Program\Au3 Scripts\BMP\Icons\BMP_Main.ico") $btn2 = IconButton("Test 2 - Test 2", 30, 110, 150, 64, 32, "M:\Program\Au3 Scripts\BMP\Icons\BMP_Main.ico") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit WEnd GUIDelete() Exit ; Valuater's UDF Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconSize, $BIDLL, $BIconNum = -1) GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - $BIconSize) / 2), $BIconSize, $BIconSize) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc I hope this is what you are looking for. M231 point