Skip to content

Instantly share code, notes, and snippets.

#Requires AutoHotkey v2.0
#Warn all, off
Persistent
mcWindow := "ahk_class GLFW30" ; Minecraft Window
healButton := "F13"
healCommand := "heal"
Pinging google.com [10.10.10.10] with 32 bytes of data:
Request timed out.
Ping statistics for 10.10.10.10:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
Tracing route to google.com [10.10.10.10]
over a maximum of 30 hops:
#Persistent
#SingleInstance force
localIP := "192.168.0.1"
remoteIP := "8.8.8.8"
refresh := 60*5 ; Seconds
icon_connected := 102
icon_disconnected := 101
#SingleInstance, Force
SetBatchLines, -1 ; Make the operation run at maximum speed.
lastFileModified := GetLastModified(A_MyDocuments,"")
FormatTime, OutputVar, %lastFileModified%
msgbox %outputVar%
GetLastModified(file, ByRef _lastModified) {
;msgbox Looping %file%
@grayatrox
grayatrox / gist:8c8dcd81208a0463049e
Last active August 29, 2015 14:24
GTA V Anti-AFK
toggle := 0 ; boolean, false : var to toggle the afk loop
sleepTime := 10 ; (In Seconds) We don't need to be constantly moving. Even once every 10 seconds is very quick. (A fast loop will also make the script unreliable)
SetTimer, afkLoop, % sleepTime * 1000
Settimer, afkLoop, Off
; We could probably detect when the user has gone afk, and starts the timer before the game kicks them. I don't know how long the game waits before kicking someone however.
^1::
IfWinExist ahk_id %MyGuiHwnd%
{
gosub move_GUI
return
}
Gui +HwndMyGuiHwnd
initSecs := 10
Gui, +AlwaysOnTop
Gui, font,s10 bold,Verdana
@grayatrox
grayatrox / gist:6138210
Created August 2, 2013 08:00
logic/pesudo code for rebuilding "iTunes Music Library.xml"
another program rearranged my music library, so I need to rebuild the itunes xml
without loosing playlists, so I can finish migrating to another media program
list files from xml that don't exist in listed posiston, including name, artist and album
find all files with old filename from xml (I want to keep duplicate songs from different albums)
if id3 matches xml, update file location (already written id3 function. It exctacts all meta data from id3 into an array)
fileselectfile any files that don't get automatically matched (most likely from missing id3)
results := search("notepad","C:\Windows") ; This is something I know everyone will have
for result in results
msgbox Result: %result%
Return
search(searchTerm, searchDirectory = "C:", filePattern = "*.*", recursive = 1) {
results := {}
SplitPath, searchTerm , OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
if (!OutExtension)
@grayatrox
grayatrox / password.ahk
Created October 1, 2012 13:51
PasswordBox
EN_UPDATE := 0x0400
OnMessage(EN_UPDATE, "EN_UPDATE")
Gui, Main:+OwnDialogs
Gui, Main: Add, Button,gChangePassword,Change Password
Gui, Main: Show
Return
MainGuiClose:
ExitApp
@grayatrox
grayatrox / movieInfo.ahk
Created September 30, 2012 07:44
MovieInfo
;#include lib\movies.ahk
; Please take heed with this warning. This script modifies files, and data it gets from IMDB isn't always accurate.
; I have taken as many steps as I can to make sure you don't corrupt your filenames (loss of files is unlikely)
Msgbox, 16, Warning!, Warning!`nThis script not smart!`n`nIt WILL occasionally get it wrong!
; This script is designed to get the correct movie dates and titles.
; For this to work, each movie has to be in its own folder
; folder formating is movietitle[release date]
; it may possibly work with just the folder named as a movietitle
Gui, +OwnDialogs