This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ExecScript( Script, Params="", AhkPath="" ) | |
| { | |
| AhkPath := !AhkPath ? A_AhkPath : AhkPath | |
| Loop % ( 2, Pipe := [], Name := "AHK_" A_TickCount ) | |
| Pipe[A_Index] := DllCall( "CreateNamedPipe", "Str", "\\.\pipe\" name, "UInt", 2, "UInt", 0 | |
| , "UInt", 255, "UInt", 0, "UInt", 0, "UPtr", 0, "UPtr", 0, "UPtr" ) | |
| if !FileExist( AhkPath ) | |
| throw Exception( "AutoHotkey runtime not found: " AhkPath ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gen( len ) | |
| { | |
| loop % (122, d="~") | |
| cStr .= chr( (i:=a_index)>32&&i<60 ? i : i>59&&i<91 ? i : i>93&&i<125 ? i : "" ) d | |
| cStr:=regexreplace(cStr, d d) | |
| while ( strlen(nStr)<len ) | |
| { | |
| sort, cStr, % "Random D" d | |
| nStr .= ((v:=substr(regexreplace(cStr,d),1,20))~="\d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msgbox % ShortGitURL( "https://github.com/blog/category/ship" ) ; example long git url | |
| ShortGitURL( gitURL ) | |
| { | |
| hReq := ComObjCreate("Microsoft.XMLHTTP") | |
| hReq.Open("GET", "https://git.io", False), hReq.Send("url=" gitURL) | |
| Return hReq.getResponseHeader("Location") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; API call https://msdn.microsoft.com/en-us/library/windows/desktop/ms633554(v=vs.85).aspx | |
| Window_Tile(Monitor=""){ | |
| ; Required constants: MDITILE_VERTICAL | |
| ; SM_CMONITORS | |
| ; WS_CAPTION | |
| ; WS_MAXIMIZEBOX | |
| ; WS_MINIMIZE | |
| ; WS_VISIBLE | |
| ; WS_EX_TOOLWINDOW | |
| wHow:=MDITILE_VERTICAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msgbox % eval("2*4*23") " <> " (2*4*23) "`n" eval("Math.pow(3,7)") " <> " (3**7) "`n" eval( "5*9*poo" ) | |
| eval( exp ) | |
| { | |
| return InStr([(o:=ComObjCreate("HTMLfile")).Write(".<script>document.body.innerHTML=eval('" exp "')</script>"),r:=o.body.innerHTML][2],"<")?"Error":r | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new RunChrome( "https://autohotkey.com", [ 0, 0, 1000, 500 ] ) | |
| return | |
| Esc::ExitApp | |
| class RunChrome | |
| { | |
| __New( url, coords ) | |
| { | |
| this.arr := this.EnumWindows(), this.ShellHookWindow( 1 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GetSamples( bin, ppq, tmpo, srate = 44.1, debug = 0 ) | |
| { | |
| ; credit: just me >> https://autohotkey.com/boards/viewtopic.php?f=5&t=15637 | |
| Loop | |
| r := ( (!r?r!!:r) << 7 ) + ( ( h := "0x" . SubStr( bin, ( a_index * 2) - 1, 2 ) ) & 0x7F ) | |
| Until ( h <= 0x80 ) | |
| Return debug ? r : Round( r * ( 60000 / ( ( 60000000 / tmpo ) * ppq ) ) * srate ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetTimer, WatchWindow, 100 | |
| xOfs := 189, yOfs := 30, GuiCnt := 0 | |
| WatchWindow: | |
| ControlGet, PlgHwnd, Hwnd,, eXTVSTiwin1, ahk_class TPluginForm | |
| if ( WinExist( "ahk_id " PlgHwnd ) && GuiCnt = 0 ) | |
| { | |
| Gui Font, s7 CA0E6E6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rand( min = 0, max = 10000 ) { | |
| random, rand, % min, % max | |
| return rand | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ClickCoords( x, y, wT, ctrl = "", btn := "left" ) | |
| { | |
| For Each, Msg in ( btn = "left" ? ( l := [ 1, 0, 2 ] ) : btn = "right" ? [ 4, 0, 5 ] : l ) | |
| PostMessage, % 0x20 Msg, 0x1, % x|y<<16, % ctrl, % wT | |
| } |