Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/22/2022 in all areas

  1. Uploaded an update that should fix those 2..... and probably broke 25 other things.
    2 points
  2. Or save yourself the headache and convert the vbscript into AutoIt, since they are so similar. Always, always, always choose the single-language route unless there is some insurmountable hurdle to doing so.
    1 point
  3. Jos

    error: yacc stack overflow

    Yes please .... and tell me the version of au3check to to be sure.
    1 point
  4. Gianni

    _IsPressed

    ... or _IsPressed(Hex(Asc("R"), 2), $hDLL) as well ...
    1 point
  5. You should also scan: https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3
    1 point
  6. Yes ! Here the script with a longer text : #include "Json.au3" ; (by @AspirinJunkie) Global $sRead1 = 'This text will be translated into another language. ' & _ 'The Moderation team will do their best to act in fair and reasonable manner. Sanctions will ' & _ 'only be applied as a last resort and any action taken will be explained in the relevant thread. ' & _ 'If you feel that you have been unfairly moderated then contact the Moderator concerned - ' & _ 'using a PM or the "Report" button is preferable to opening a new thread (although new members ' & _ 'may have to do this). But do be aware that the Moderation team has the final word - the rules ' & _ 'are set out by the site owner and you are only welcome here if you respect his wishes.' ConsoleWrite("+ >> ORIGINAL: " & $sRead1 & @CRLF) ConsoleWrite("+ ------------------------------------------------------------------------------ " & @CRLF) ConsoleWrite("> >> EN->DE : " & _GoogleAPITranslate($sRead1, "en", "de") & @CRLF) ConsoleWrite("> >> EN->FR : " & _GoogleAPITranslate($sRead1, "en", "fr") & @CRLF) ConsoleWrite("> >> EN->ES : " & _GoogleAPITranslate($sRead1, "en", "es") & @CRLF) ; ------------ Function : --------------- Func _GoogleAPITranslate($sMytext, $sFrom, $sTo) Local $sUrl, $oHTTP, $sResponse, $JSONData, $sOutput = "", $aData $sUrl = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=" & $sFrom & "&tl=" & $sTo & "&dt=t&q=" & $sMytext $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("POST", $sUrl, False) $oHTTP.Send() $sResponse = $oHTTP.ResponseText $JSONData = _JSON_Parse($sResponse) If VarGetType($JSONData) = 'Array' Then $aData = $JSONData[0] If VarGetType($aData) = 'Array' Then For $i = 0 To UBound($aData) -1 Step 1 $sOutput &= ($aData[$i])[0] ;*** & @CRLF Next EndIf EndIf Return $sOutput EndFunc ;==>_GoogleAPITranslate Result :
    1 point
  7. Here is a way to do it without using any external command (just use COM objects) #RequireAdmin ; Needed _NetSetCategory("LAN", 1) ; Sets the Private category to the network connection called "LAN" ; #FUNCTION# ==================================================================================================================== ; Name...........: _NetSetCategory ; Description....: Sets the category of a network. Changes made take effect immediately ; Syntax.........: _NetSetCategory($sNetworkId, $iNetCategory) ; Parameters.....: $sNetworkId - Name of the network connection ; $iNetCategory - New category of the network. Can be one of : ; 0 : Public ; 1 : Private ; 2 : Domain ; Return values..: Success - 1 ; Failure - 0 and sets the @error flag to non-zero ; Remarks........: The function requires administrator privileges ; =============================================================================================================================== Func _NetSetCategory($sNetworkId, $iNetCategory) Local $iRet = 1, $iNetFound = 0, $oNetwork, $oNetConnection If Not IsAdmin() Then Return SetError(4, 0, 0) If Not IsInt($iNetCategory) Or $iNetCategory < 0 Or $iNetCategory > 2 Then Return SetError(5, 0, 0) Local $INetListManager = ObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}") If Not IsObj($INetListManager) Then Return SetError($iRet, 0, 0) Local $oNetConnections = $INetListManager.GetNetworkConnections() If IsObj($oNetConnections) Then For $oNetConnection In $oNetConnections $oNetwork = $oNetConnection.GetNetwork If $oNetwork.GetName = $sNetworkId Then $iNetFound = 1 Execute("$oNetwork.SetCategory($iNetCategory)") $iRet = (@error ? 2 : 0) EndIf Next If Not $iNetFound Then $iRet = 3 EndIf $INetListManager = 0 If $iRet Then Return SetError($iRet, 0, 0) Return 1 EndFunc ; ===> _NetSetCategory Inspired from @Danyfirex code (thanks)
    1 point
×
×
  • Create New...