Skip to content

Instantly share code, notes, and snippets.

@TLMcode
TLMcode / gist:6058346
Last active December 20, 2015 02:39 — forked from anonymous/gist:6058330
#InstallKeybdHook
#IfWinActive ahk_class ArenaNet_Dx_Window_Class
SetKeyDelay, 50, 50
MouseGetPos, xpos, ypos
SetTimer, KeyLog, 20
KeyLog:
If (A_priorkey != "RControl" && A_priorkey != "LButton")
d := A_PriorKey
@TLMcode
TLMcode / IPToInt().ahk
Last active December 20, 2015 02:48
IP to Integer (Hex, Decimal formats)
msgbox % IPToInt("64.190.207.31", "H")
; params ip >> format (Hex, Decimal)
msgbox % 1+1
IPToInt(ip, fmt)
{
RegExMatch(ip,"(\d+)\D+(\d+)\D+(\d+)\D+(\d+)",oct_)
SetFormat, Integer, % fmt
Int:=(oct_1*(256**3))+(oct_2*(256**2))+(oct_3*256)+oct_4
@TLMcode
TLMcode / Wait().ahk
Last active December 20, 2015 02:49
IE DOM Wait()
Wait(pwb) ; example call
Wait(_obj,_int=100) {
While(!Instr(rs,4)||StrLen(rs)<_int)
rs.=_obj.ReadyState
}
@TLMcode
TLMcode / BasicScriptStarter.ahk
Created July 25, 2013 03:45
Basic Script Starter
CoordMode, ToolTip, Screen
reStart:
InputBox, scriptName, Name of New Script, % "Current AHK version is: AHK"
. ( InStr( A_AhkVersion, "1.0." ) ? "Basic " : InStr( A_AhkVersion, "1.1." )
? "_L " : "Unknown " ) A_AhkVersion,,, 130
If ( ErrorLevel )
ExitApp
Else If ( !scriptName ) {
MsgBox, You Didn't Enter A Name!
GoSub, reStart
@TLMcode
TLMcode / Wait().ahk
Last active December 20, 2015 07:29
Wait() for IE client objects.Watch this Gist for updates.
Wait( obj, len=300 )
{
While (obj.ReadyState=4)
continue
While (StrLen(rs)<len)
rs.=((_:=obj.ReadyState)=4?_:)
}
@TLMcode
TLMcode / IEGet2().ahk
Created July 31, 2013 05:03
IEGet2()
IEGet2(name="") {
for obj in ComObjCreate("Shell.Application").Windows
if !obj.AddressBar && (obj.document.title==RegExReplace(name,".*\K\h-.*"))
break
return obj
}
@TLMcode
TLMcode / findevents.ahk
Last active December 20, 2015 14:48
test event
IEObj := ComObjCreate("InternetExplorer.Application"), IEObj.Visible := 1
ComObjConnect(IEObj, new Events_Class)
Return
class Events_Class
{
__Call(event, p*)
{
ToolTip, %event%
@TLMcode
TLMcode / inkocx.ahk
Created August 10, 2013 02:59
Testing ink OCX control object
; ink.Enabled := True ; enables/disables the control
; ink.RecognitionTimeout := 100 ; speed of refresh when the mouse is lifted
; ink.BackColor := 200*256*256+250*256+250 ; background color
Gui Add, Text,, Draw in the picture box below or hand write text below that.
Gui Add, ActiveX, xm w600 h300 vss, msinkaut.InkPicture.1
Gui Add, ActiveX, xm w300 h100 vink, InkEd.InkEdit.1
(ink.UseMouseForInput := True), ink.InkInsertMode := 0
Gui, Show
Return
@TLMcode
TLMcode / GenRndStr().ahk
Last active December 20, 2015 21:39
GenRndStr()
F1::MsgBox % GenRndStr( 10 )
Return
GenRndStr( 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 )
Gui Add, ActiveX, xm w600 h300 vSysMon, Sysmon.3
SysMon.ShowValueBar := "True"
SysMon.Counters.Add("\Process(*)\% Processor Time")
; SysMon.GraphTitle := "System Performance Overview"
; SysMon.Counters.Item(1).Width := 8
Gui Show
Return
GuiClose:
ExitApp