Leaderboard
Popular Content
Showing content with the highest reputation on 12/29/2013 in all areas
-
I'm surprised nobody is complaining it is taking up to much room on their floppies. visual gag added.2 points
-
autoit 3.3.10.0 is HUGE
FlashpointBlack and one other reacted to jchd for a topic
I also carry something that gets bigger and bigger and no woman complains about it (yet). Seriously, Win 7 is significantly bigger than Win 3.11 as well.2 points -
_FileGetShortcutEx This UDF will return shortcut (.LNK) file information for more advanced shortcuts that AutoIt's built-in FileGetShortcut() chokes on. The following types of shortcuts can be retrieved using this function: MSI Advertised Shortcuts URL (website) Shortcuts that are embedded (rather than put in a .URL file) Special GUID Shell Item Shortcuts. This is only one level deep at the moment, so it will only read the base Folder GUID (For example: shortcuts to 'My Computer', 'Recycle Bin' return fine) UNC Shortcuts ("PCNAME"). This is also only one level deep currently, so "PCNAMEFolder" shortcuts will fail (as well as regular shortcuts, of course) Operation is simple: call '_FileGetShortcutEx("filename")' to get an array that is arranged the same as FileGetShortcut(). Included in the ZIP are two examples of shortcuts that AutoIt will fail on, but this function will work on. I don't have any MSI Advertised shortcut examples, but I believe Microsoft Office and ACDSee shortcuts both use these shortcuts types which return wonky results using AutoIt's function. Thanks go out to Prog@ndy for the original '_FileGetShortcutEx' function and MSI shortcut code (which I converted for Unicode). See my original post here for his code. *Shortcut Key retrieval* This was requested on the Help board, and I thought it was a good idea to include it here. If you need to grab a shortcut's associated Shortcut Key, you can use the below code, assuming you already know beforehand that the file is a shortcut file: $sShortcutFile = "C:\MyShortcut.lnk" $nShortcutKey = Number(StringToBinary(StringMid(FileRead($sShortcutFile, 68), 65, 4))) ConsoleWrite("Shortcut key = " & $nShortcutKey & @CRLF) The format of the key is described under IShellLink::GetHotkey, and I've included code that converts most key combos in >this post. *Special note on 'Normal' Internet shortcuts: While this UDF only looks at .LNK shortcuts (what you use FileGetShortcut() with), some confuse .URL Internet shortcuts with these types, so I decided I'd put a solution for those interested on how to get a URL Internet shortcut. It's actually so simple it can be done in one line, so here it is (note the .URL extension): $sURL=IniRead(@UserProfileDir&"\Favorites\Google.URL","InternetShortcut","URL","") Ascend4nt's AutoIT Code License agreement: no license - just be a good person and credit other people for their work, yeh? Download the ZIP from my site1 point
-
_ArrayDelete
jaberwacky reacted to Mat for a topic
Look at the code again. $iUBound = UBound(...) - 11 point -
autoit 3.3.10.0 is HUGE
DatMCEyeBall reacted to guinness for a topic
The only thing HUGE in AutoIt, is the large community of appreciative users. *drops the mic and walks off stage.*1 point -
Global $Previous, $Current ; create these variables to begin with While 1 ; Do this forever $Current = MouseGetPos(0) & 'x' & MouseGetPos(1) ; Put the current mouse coordinates into the $Current variable If $Previous = $Current Then ; If the $Previous recorded location matches the current one then... MouseMove((@DesktopWidth / 2), (@DesktopHeight / 2) + 20, 2) ; Move the mouse to the middle of the screen, 20 pixle down MouseMove((@DesktopWidth / 2), (@DesktopHeight / 2), 2) ; Move the mouse to the middle of the screen. ConsoleWrite('Moved the mouse due to inactivity' & @CRLF) ; Write to the console view at the bottom of Scite editor when it moves the mouse. EndIf $Previous = MouseGetPos(0) & 'x' & MouseGetPos(1) ; Set the previous mouse to what it is after it was moved by the program. Sleep(5000) ; 5 seconds (5000 milliseconds)to wait before checking WEnd1 point
-
I personnally wouldn't bet my life on rolling a dice once and getting 5. However I know some people tend to live more dangerously than I do.1 point
-
Neither do I, or AZJIO or mlipok or Melba23 or any of the MVPs or anyone actually apart from Jon, but submitting bug reports, making suggestions and just being a positive user is how you can contribute to AutoIt. Shame really.1 point
-
Oh boy, the only thing worse than an uninformed person is a half-informed one.1 point
-
legend, that's what we call an include file aka UDF, it's in no way in-built into the AutoIt3.exe executable. Seriously, what is the issue with file size when we live in a world where data storage is cheap and Internet connections are faster than the old 56k modems. Have you not been around when Jon, Valik and trancexx were uploading beta releases? If you're not happy with the bug fixes and new features, then stick to v3.3.8.1 and leave this for the rest of us who enjoy coding.1 point
-
google translator
baoquocphan reacted to Celtic88 for a topic
updat : :support any language "arabic right characters " and read a long string Opt("GUIONEVENTMODE", 1) Global $link = "http://translate.google.com/" Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") Global $TITEL = "Google Translate" Global $SCRIPTGUI = GUICreate($TITEL, 841, 448, -1, -1, -2133983232) GUISetOnEvent(-3, "__EXIT") Global $EDIT1 = GUICtrlCreateEdit("", 0, 0, 841, 156) GUICtrlSetResizing(-1, 774) Global $Edit2 = GUICtrlCreateEdit("", 0, 160, 841, 260) GUICtrlSetFont(-1, 15, 400, 0, "Arial") GUICtrlSetResizing(-1, 870) Global $Label1 = GUICtrlCreateLabel("Detec lang : ", 23, 425, 180, 17) GUICtrlSetResizing(-1, 834) GUICtrlCreateLabel("translate to ", 155, 425, 59, 17) GUICtrlSetResizing(-1, 834) Global $COMBO1 = GUICtrlCreateCombo("", 215, 423, 127, 25, 2097155) GUICtrlSetOnEvent($COMBO1, "__GOTRAN") GUICtrlSetData($COMBO1, __lGUI()) GUICtrlSetResizing(-1, 834) Global $BUTTON1 = GUICtrlCreateButton("Speak", 352, 421, 75, 25) GUICtrlSetOnEvent($BUTTON1, "__GOSPEAK") GUICtrlSetResizing(-1, 834) GUISetState() While True Sleep(1000) WEnd Func __GOSPEAK() Local $readtxt $readtxt = GUICtrlRead($Edit2) If $readtxt = "" Then Return WinSetTitle($SCRIPTGUI, "", "WAIT DOWNLOAD DATA...") __GOOGLESPEEK($readtxt) WinSetTitle($SCRIPTGUI, "", $TITEL) EndFunc ;==>__GOSPEAK Func __GOTRAN() Local $readtxt = GUICtrlRead($EDIT1) If $readtxt = "" Then Return WinSetTitle($SCRIPTGUI, "", "WAIT DOWNLOAD DATA...") __GOOGLETRANS($readtxt) WinSetTitle($SCRIPTGUI, "", $TITEL) EndFunc ;==>__GOTRAN Func __GOOGLETRANS($TEXTTOTRANS) Local $TXT, $STEXT1, $STEXT, $STEXT2, $STEXT3, $STEXT4, $STEXT5, $Autodetlang $Autodetlang = __DETLANG(StringLeft(StringRegExpReplace($TEXTTOTRANS, "\r\n|\r|\n", Chr(32)), 33)) $Autodetlang = __SLANG($Autodetlang) GUICtrlSetData($Label1, "Detec lang : " & $Autodetlang) $Gettrnlang = __SLANG(GUICtrlRead($COMBO1), 1) If StringInStr("ar fa iw ur yi", $Gettrnlang) > 0 Then GUICtrlSetStyle($Edit2, 3152064 + 2) Else GUICtrlSetStyle($Edit2, 3152064 + 0) EndIf GUICtrlSetData($Edit2, "") $STEXT = StringSplit($TEXTTOTRANS, @CRLF, 1) For $i = 1 To $STEXT[0] $STEXT1 = StringSplit($STEXT[$i], Chr(32), 1) For $O = 1 To $STEXT1[0] $TXT &= $STEXT1[$O] & Chr(32) If StringLen($TXT) > 90 Or $O = $STEXT1[0] Then $STEXT2 = StringSplit($TXT, ".") For $z = 1 To $STEXT2[0] $STEXT3 = StringSplit($STEXT2[$z], '"') For $L = 1 To $STEXT3[0] $STEXT4 = StringSplit($STEXT3[$L], '?') For $M = 1 To $STEXT4[0] $STEXT5 = StringSplit($STEXT4[$M], '!') For $S = 1 To $STEXT5[0] if StringIsSpace($STEXT5[$S]) Then ContinueLoop _Guisetdata(__TRANTXT($STEXT5[$S], $Gettrnlang)) $TXT = "" If $S <> $STEXT5[0] Then _Guisetdata('!') Next If $M <> $STEXT4[0] Then _Guisetdata('?') Next If $L <> $STEXT3[0] Then _Guisetdata('"') Next If $z <> $STEXT2[0] Then _Guisetdata(".") Next EndIf Next If $i <> $STEXT[0] Then _Guisetdata(@CRLF) Next EndFunc ;==>__GOOGLETRANS Func __SLANG($LANGG, $OOPT = 2) Local $OPT = 2 Local $SLIS = StringSplit(__LISLll(), ";") For $i = 1 To $SLIS[0] Local $GETl = StringSplit($SLIS[$i], "|") If StringInStr($GETl[$OOPT], $LANGG, 2) Then If $OOPT = 2 Then $OPT = 1 Return $GETl[$OPT] EndIf Next EndFunc ;==>__SLANG Func __TRANTXT($TXT, $tto) Local $ENCODESSTRING, $READ, $DATA $ENCODESSTRING = __URIENCODE($TXT) $READ = __DOWN($link & "translate_a/t?client=t&sl=auto&text=" & $ENCODESSTRING & "&tl=" & $tto) $DATA = StringSplit($READ, '"') Return $DATA[2] EndFunc ;==>__TRANTXT Func REV($TXT) Local $split, $LOL $split = StringSplit($TXT, " ", 1) For $i = $split[0] To 1 Step -1 $LOL &= $split[$i] & " " Next Return $LOL EndFunc ;==>REV Func _Guisetdata($text) GUICtrlSetData($Edit2, GUICtrlRead($Edit2) & $text & " ") EndFunc ;==>_Guisetdata Func __GOOGLESPEEK($TEXTTOSPEEK) Local $TXT, $OPEN, $STEXT1, $READ = "", $ENCODESSTRING, $RESTRING, $LANG, _ $MPFIL = FileGetShortName(@ScriptDir) & "\" & GUICtrlRead($COMBO1) & "__" & Random(1, 99, 1) & ".MP3" $RESTRING = StringRegExpReplace($TEXTTOSPEEK, "\r\n|\r|\n", " ") $LANG = __DETLANG(StringLeft($RESTRING, 33)) $OPEN = FileOpen($MPFIL, 18) $STEXT1 = StringSplit($RESTRING, " ", 1) For $O = 1 To $STEXT1[0] $TXT &= $STEXT1[$O] & " " If StringLen($TXT) > 90 Or $O = $STEXT1[0] Then $ENCODESSTRING = __URIENCODE($TXT) FileWrite($OPEN, InetRead($link & "translate_tts?ie=UTF-8&tl=" & $LANG & "&q=" & $ENCODESSTRING, 1)) $TXT = "" EndIf Next FileClose($OPEN) SoundPlay($MPFIL) EndFunc ;==>__GOOGLESPEEK Func __DETLANG($STRI) Local $TST, $LANGGG $STRI = __URIENCODE($STRI) $TST = __DOWN($link & "translate_a/t?client=t&sl=auto&text=" & $STRI) $LANGGG = StringLeft(StringTrimLeft($TST, StringInStr($TST, '[["', 0, -1) + 2), 2) Return $LANGGG EndFunc ;==>__DETLANG Func __DOWN($URL) $oHTTP.Open("GET", $URL, False) $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1") $oHTTP.Send("") $oReceived = $oHTTP.ResponseText Return $oReceived EndFunc ;==>__DOWN Func __URIENCODE($SDATA) Local $ADATA = StringSplit(BinaryToString(StringToBinary($SDATA, 4), 1), "") Local $NCHAR $SDATA = "" For $i = 1 To $ADATA[0] $NCHAR = Asc($ADATA[$i]) Switch $NCHAR Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $SDATA &= $ADATA[$i] Case 32 $SDATA &= "+" Case Else $SDATA &= "%" & Hex($NCHAR, 2) EndSwitch Next Return $SDATA EndFunc ;==>__URIENCODE Func __lGUI() Local $llol, $SLIS $SLIS = StringSplit(__LISLll(), ";") For $i = 1 To $SLIS[0] $llol &= StringLeft($SLIS[$i], StringInStr($SLIS[$i], "|")) Next Return $llol EndFunc ;==>__lGUI Func LISL() Local $langlis = "Arabic|ar;English|en;French|fr" Return $langlis EndFunc ;==>LISL Func __LISLll() Local $langlist = "Afrikaans|af;Albanian|sq;Arabic|ar;Armenian|hy;Azerbaijani|az;Basque|eu;Belarusian|be;Bengali|bn;Bulgarian|bg;Catalan|ca;Chinese|zh-CN;Croatian|hr;Czech|cs;Danish|da;Dutch|nl;English|en;Esperanto|eo;" & _ "Estonian|et;Filipino|tl;Finnish|fi;French|fr;Galician|gl;Georgian|ka;German|de;Greek|el;Gujarati|gu;Haitian Creole|ht;Hebrew|iw;Hindi|hi;Hungarian|hu;Icelandic|is;Indonesian|id;Irish|ga;Italian|it;" & _ "Japanese|ja;Kannada|kn;Khmer|km;Korean|ko;Lao|lo;Latin|la;Latvian|lv;Lithuanian|lt;Macedonian|mk;Malay|ms;Maltese|mt;Norwegian|no;Persian|fa;Polish|pl;Portuguese|pt;Romanian|ro;Russian|ru;" & _ "Serbian|sr;Slovak|sk;Slovenian|sl;Spanish|es;Swahili|sw;Swedish|sv;Tamil|ta;Telugu|te;Thai|th;Turkish|tr;Ukrainian|uk;Urdu|ur;Vietnamese|vi;Welsh|cy;Yiddish|yi" Return $langlist EndFunc ;==>__LISLll Func __EXIT() Exit EndFunc ;==>__EXIT1 point