Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/03/2018 in all areas

  1. Utter is a free ware windows API automation script.It can do most of the sapi dll functions."SAPI" stands for Windows Speech Reconition API,SAPI.dll is the file which manages the speech recognition of windows Utter utilises most of the SAPI functions making use of the best potential of SAPI.dll,You can include speech recognition to your project by using utter. Utter zipped and updated (new version with examples) Modified ......: 12/04/2017 Version .......: 3.0.0.1 Author ........: Surya I am new to autoit it sounds great and i love it while i am getting used to it so i want to write my own UDF in autoit first of all i thank all the forum members because i couldnt do it without research,So i wrote UTTER ,Its is a UDF that uses most of the SAPI dll function or in simple words it can do many functions relating to the computers speech recognition if you have any doubt in the code or have any bugs please notify me freely I will be always there to help its my first UDF so please notify me if you found any error Thank you! Utter has been recently updated ,examples included.The zip can be downloaded here at the download section of autoit : Download utter !! CAUTION !! REMEMBER TO SHUTDOWN THE INSTANCE OF CREATED RECOGNITION ENGINE BEFORE STARTING ANOTHER INSTANCE IF YOU START ANOTHER WITHOUT SHUTTING THE PREVIOUS ONE DOWN IT WILL LEAD TO AN ERROR! REMEMBER THAT "|" IS THE DEFAULT GUIDataSeparatorChar CHANGE IT ACCORDING TO YOUR NEEDS AND GRAMMAR DELIMITER IS GUIDataSeparatorChar IF NO GUIDataSeparatorChar IS FOUND IN THE INPUT STRING THEN THE ENTIRE STRING WOULD BE CONSIDERED AS ONE WORD! DO NOT CALL THE INTERNAL FUNCTIONS THEY ARE TO BE CALLED INSIDE THE FUNCTION AND DO NOT CHANGE THE VALUE OF VARIABLES USED IN THE FUNCTION! THE RECIEVING FUNCTIONS SHOULD HAVE ATLEAST ONE PARAMETER TO ACCEPT THE SPEECH COMMANDS FROM THE _Utter_Speech_GrammarRecognize() FUNCTION please report if you have any bugs/complaints
    1 point
  2. robertocm

    POP3.au3 UDF

    Just to report that i've made a new test with the 'low cost tech' and WORKING! through stunnel I've read this from hevoxer, 2012: He also explains very well how to install stunnel and configure it in this post, see his example of 'Configuration file for stunnel for POP3.' Following this instructions i've edited the example stunnel.conf file in the config folder. All lines comented except: ; ************************************************************************** ; * Service defaults may also be specified in individual service sections * ; ************************************************************************** ; Certificate/key is needed in server mode and optional in client mode cert = stunnel.pem ;... ; Disable support for insecure SSLv2 protocol options = NO_SSLv2 ;... ; ************************************************************************** ; * Service definitions (at least one service has to be defined) * ; ************************************************************************** ; ***************************************** Example TLS client mode services ; Example SSL client mode services [pop3] client = yes ;This means that stunnel works in client mode accept = 127.0.0.1:110 ;Port number on our machine on which stunnel will be listen to incoming non-ciphered connection. By default if POP3 is non secured 110 is the port on which it works. That could be any other free port. connect = my.emailserver.com:995 ;on this server and port, stunnel redirect connection incoming on localhost 110 but now it will be ssl secured. And that's it! CHANGE SERVER NAME TO YOUR OWN!!! And finally, just changed a line in POP3_Example.au3: ;comented this ;Global $sPOP3_MyPopServer = "my.emailserver.com" ;replaced for this Global $sPOP3_MyPopServer = "127.0.0.1" And gets connection: POP3.au3 UDF v.2.0.1 @AutoItVersion=3.3.14.2 ! [ 9 / 0 ] _POP3_IsConnected: $POP3_ERR_NOT_CONNECTED _POP3_ServerConnect: connecting to: 127.0.0.1 - using port: 110 < S: +OK Dovecot ready. > C: USER myusername@emailserver.com < S: +OK > C: PASS XXXXXXXX < S: +OK Logged in. Note: execute the stunnel installer from a path without spaces (the installer doesn't seems to like paths with spaces, at least in my case, i needed to move the installer to another path without spaces)
    1 point
  3. Ascer

    google OCR with Autoit

    @lordsocke Im not sure if this code will works since to enable OCR interface you have to pay for it Anyway this code represent: vision.images.annotate ; Enter your api key here. Local $GOOGLE_API_KEY = "XXXXXX-XXXXXXXXXXX_XXXXXXXXXXX" ; Enter path to image. Image like white background and black text example. Local $IMAGE_PATH = @ScriptDir & "\OCR.png" ; Create Object for out/in comming connections. Local $oHttp = ObjCreate("winhttp.winhttprequest.5.1") ; Check if some error durinig creation object. If Not IsObj($oHttp) Then ConsoleWrite("+++ Error 1. Failed to create object." & @CRLF) Exit EndIf ; Create POST request to google OCR Local $sRequest = "https://vision.googleapis.com/v1/images:annotate?key=" & $GOOGLE_API_KEY ; Open request. $oHttp.Open("POST", $sRequest , False) ; Set request header - we want received packets in json format $oHTTP.SetRequestHeader("Content-Type", "application/json") ; Load image and read. Local $sImage = FileOpen(FileRead($IMAGE_PATH)) ; Check for errors. If @error Then ConsoleWrite("+++ Error 2. Failed to load image. Make sure about valid path." & @CRLF) Exit EndIf ; Convert image to base64 IMPORTANT! If not works try this way: base64($sImage, True, True) $sImage = base64($sImage) ; Check for errors. If @error or $sImage = "" Then ConsoleWrite("+++ Error 3. Failed convert image to base 64." & @CRLF) Exit EndIf ; Create structure in JSON format Local $sJson $sJson &= "{" $sJson &= '"requests": [' $sJson &= "{" $sJson &= '"image": {' $sJson &= '"content": "' & $sImage & '"' $sJson &= '},' $sJson &= '"features": [' $sJson &= "{" $sJson &= '"type": "TEXT_DETECTION"' $sJson &= "}" $sJson &= "]" $sJson &= "}" $sJson &= "]" $sJson &= "}" ConsoleWrite("Sending request please wait..." & @CRLF) ; Send our request $oHttp.Send($sJson) ;======================= ; Sending process... ; AutoIt freeze now. ; Wait until finish ;======================= ; Get request back status and output text Local $iStatus = $oHttp.Status Local $sOutput = $oHttp.ResponseText ; Check respond status If $iStatus <> 200 Then ConsoleWrite("+++ Error 4. Invaild respond status: " & $iStatus & @CRLF) Else ConsoleWrite("++ Successfully send request." & @CRLF) EndIf ConsoleWrite("OUTPUT:" & @CRLF & $sOutput & @CRLF) ;============================================================================================================================== ; Function: base64($vCode [, $bEncode = True [, $bUrl = False]]) ; ; Description: Decode or Encode $vData using Microsoft.XMLDOM to Base64Binary or Base64Url. ; IMPORTANT! Encoded base64url is without @LF after 72 lines. Some websites may require this. ; ; Parameter(s): $vData - string or integer | Data to encode or decode. ; $bEncode - boolean | True - encode, False - decode. ; $bUrl - boolean | True - output is will decoded or encoded using base64url shema. ; ; Return Value(s): On Success - Returns output data ; On Failure - Returns 1 - Failed to create object. ; ; Author (s): (Ghads on Wordpress.com), Ascer ;=============================================================================================================================== Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"),"/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64
    1 point
  4. For the fun $sReg = StringRegExpReplace($url, '(.*?/){3}[^/]+\K.*', "") But the usual way is more understandable/accurate/secure $aReg = StringRegExp($url, 'https?://[^/]+/[^/]*', 1)
    1 point
  5. I haven't noticed anything like that maybe you should try something like If Not IsArray($aArray) Then Msgbox(0,"","Not Array") just prior to the _ArrayDisplay() call
    1 point
  6. oh outputs: https://autoit.com/test1 http://autoet.com/test5 ftp://autovt.com/test7
    1 point
  7. Took me 5 and its more flexible $url = "https://autoit.com/test1/test2/test3/test4, http://autoet.com/test5/test6/, ftp://autovt.com/test7/test8/ " $Reg = StringRegExp($url, '(?i).*?(..?tp.?://[^/]*.?[^/]*)', 3) ; (?i) caseless matching ; .*? 0 or more characters but doesn't keep them ; ( start a capturing group ; . any character 'f or h' ; .? 0 or 1 char 't or `none`' ; tp literally tp ; .? 0 or 1 char 'http>S<' ; : literal colon ; // literal slashes ;[^/]* all characters till a slash ;.? or or 1 character ;[^/]* all characters till a slash (again) ;) end capturing group ConsoleWrite($Reg[0] & @CRLF & $Reg[1] & @CRLF& $Reg[2] & @CRLF)
    1 point
  8. Much simpler than straining with a regex. Took me 2 minutes and I know it's accurate. Local $url = 'https://autoit.com/test1/test2/' Local $str = StringLeft($url, StringInStr($url, '/', 0, 4) - 1) MsgBox(0, '', $str)
    1 point
×
×
  • Create New...