autohotkey 快速撰写快捷方式或全局撰写电子邮件热键/快捷方式

快速撰写快捷方式或全局撰写电子邮件热键/快捷方式

quick-compose-email-hotkey.ahk
; CTRL + ` - Compose Email
^`::
    Run mailto:
    Return

; This is a simple and generic example of an AutoHotkey script to compose an
; email using default email program when you press a keyboard shortcut. WIN + R
; to run command and type shell:startup than paste .ahk into startup folder

; [1]: http://www.autohotkey.com/docs/Hotkeys.htm
; [2]: https://gist.github.com/davejamesmiller/1965863

autohotkey AutoHotkey的

Windows热键

autohotkey.ahk
#SingleInstance force

#t::
	Run "C:\Users\nowhe\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Telegram Desktop\Telegram.lnk"
	return

#g::
	Run "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ABBYY Lingvo x6\ABBYY Lingvo x6.lnk"
	return

#c::
	Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
	return

#s::
	Run "C:\Program Files (x86)\SVP 4\SVPManager.exe"
	return

#a::
	Run "shell:Appsfolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App"
	return

:*:nwm@::nowhereman1965@gmail.com
:*:vgr@::v.grabovets@gmail.com

^Escape::
	WinClose, A
	return

^SPACE::
	WinSet, AlwaysOnTop, Toggle, A
	return

autohotkey s_t_a_r_t_1

s_t_a_r_t_1
sleep, 900000
run, "C:\Users\Administrator\Desktop\shortcut\06_start_1.bat"

sleep, 180000
close1("BaseGui")
sleep, 1000
close1("JTKWnd") ;关闭360wifi的界面

sleep, 1000
hide_exe1("cacher.exe")
sleep,1000
hide_exe1("excel.exe")

sleep, 15000
#IfWinNotActive ahk_class QQBrowser_WidgetWin_1
a := hyf_getMainIDOfProcess("Ahk_class QQBrowser_WidgetWin_1")
;msgbox %a%
WinActivate Ahk_id %a%
#IfWinNotActive

;func------------------------

close1(Win1){
#IfWinNotActive ahk_class Win1 
a := hyf_getMainIDOfProcess("Ahk_class "Win1)
;msgbox %a%
WinActivate Ahk_id %a%
sleep, 500
send, {altdown}{f4}{altup}
#IfWinNotActive
}


hide_exe1(a1){
WinActivate ahk_exe %a1%
; WinWaitActive ahk_exe n
#ifwinactive ahk_exe a1
send, #+z
#ifwinactive
}


hyf_getMainIDOfProcess(Win) ;获取类似chrome等多进程的主程序ID {{{3
{ ;Win为完整类名, v为判断的值,tp为v的类型
    DetectHiddenWindows, On
    If InStr(Win, "Ahk_class")
        RegExMatch(Win, "i)Ahk_class\s\S+", WinTitle)
    Else If InStr(Win, "Ahk_exe")
        RegExMatch(Win, "i)Ahk_exe\s\S+", WinTitle)
    If !(Win ~= "i)^ahk_")
        RegExMatch(Win, "i)\S+", TitleMatch)
    WinGet, Arr, List, %WinTitle%
    ;str := ",Default IME,MSCTFIME UI,关闭标签页,nsAppShell:EventWindow" ;排除标题列表 todo 待完善
    Loop,% Arr
    {
        n := Arr%A_Index%
        ;If (hyf_winGet("MinMax", "Ahk_id " . n) = 0) ;跳过不是最大化也不是最小化的
        WinGetTitle, TitleLoop, Ahk_id %n%
        If (TitleLoop = "") || (TitleMatch && (TitleLoop != TitleMatch))
            Continue
        Return n
    }
    Return 0
}

autohotkey change_word

change_word
#ifWinactive ahk_class wndclass_desked_gsk
:*:(::{shift}[]{left}
:*:[::(){left}
:*:)::{shift}]
:*:]::)

:*:"::""{left}
; :*:'::''{left}
:*:<::<>{space}
; :*:《::《》{left}
:*:{::{{}{}}{left}
:*b0:``::{``}{left}

;Ins::_
;PgUp::&
F7::_
F8::&
; CapsLock::ctrl
; ctrl::CapsLock
#ifWinactive

autohotkey hide_exe1

hide_exe1
hide_exe1("cacher.exe")

hide_exe1(a1){
WinActivate ahk_exe %a1%
#ifwinactive ahk_exe a1
send, #+z
#ifwinactive
}

autohotkey close_class1

close_class1
close_class1("BaseGui") ;关闭百度云的界面
sleep, 1000
close1_class1("JTKWnd") ;关闭360wifi的界面

close_class1(Win1){
#IfWinNotActive ahk_class Win1 
a := hyf_getMainIDOfProcess("Ahk_class "Win1)
;msgbox %a%
WinActivate Ahk_id %a%
sleep, 500
send, {altdown}{f4}{altup}
#IfWinNotActive
}

sleep, 15000
#IfWinNotActive ahk_class QQBrowser_WidgetWin_1 ;激活某个类
a := hyf_getMainIDOfProcess("Ahk_class QQBrowser_WidgetWin_1")
;msgbox %a%
WinActivate Ahk_id %a%
#IfWinNotActive

hyf_getMainIDOfProcess(Win) ;获取类似chrome等多进程的主程序ID {{{3
{ ;Win为完整类名, v为判断的值,tp为v的类型
    DetectHiddenWindows, On
    If InStr(Win, "Ahk_class")
        RegExMatch(Win, "i)Ahk_class\s\S+", WinTitle)
    Else If InStr(Win, "Ahk_exe")
        RegExMatch(Win, "i)Ahk_exe\s\S+", WinTitle)
    If !(Win ~= "i)^ahk_")
        RegExMatch(Win, "i)\S+", TitleMatch)
    WinGet, Arr, List, %WinTitle%
    ;str := ",Default IME,MSCTFIME UI,关闭标签页,nsAppShell:EventWindow" ;排除标题列表 todo 待完善
    Loop,% Arr
    {
        n := Arr%A_Index%
        ;If (hyf_winGet("MinMax", "Ahk_id " . n) = 0) ;跳过不是最大化也不是最小化的
        WinGetTitle, TitleLoop, Ahk_id %n%
        If (TitleLoop = "") || (TitleMatch && (TitleLoop != TitleMatch))
            Continue
        Return n
    }
    Return 0
}

autohotkey window_relative

window_relative
get_window_info(){
WinGetClass, ahk_class, A
WinGetTitle, ahk_title, A
WinGetPos, x1,y1,w1,h1,A
x2:=x1 + w1
y2:=y1 + h1
x3:=x1 / 1920 * 100
x4:=x2 / 1920 * 100
y3:=y1 / 1280 * 100
y4:=y2 / 1280 * 100
str1 = "title:"`t%ahk_title%`n"class:"`t%ahk_class%`n"position:"`t%x1%, %y1%, %x2%, %y2%`n"position_per"`t%x3%, %y3%, %x4%, %y4%

ClipBoard:=str1
}

judge_window1(){
WinGetClass, ahk_class, A
if (%ahk_class%=VistaSwitcher_SwitcherWnd) {
send,{ENTER}
}


r_l:=52.5
c_u:=2.5
r_r:=99
c_d:=50
x1:=r_l/100*pixel_r//1
y1:=c_u/100*pixel_c//1
x2:=(r_r-r_l)/100*pixel_r//1
y2:=(c_d-c_u)/100*pixel_c//1
WinGetPos, xn, yn, wn, hn, A
WinMove,A,,x1,y1,x2,y2
}

autohotkey idlechampions.ahk

idlechampions.ahk
#SingleInstance force
#NoEnv
global uiDelay := 200
global transitionDelay := 1000

global middleScreenX := 620
global middleScreenY := 400
global resetAutoProgressX := 1246
global resetAutoProgressY := 145

CoordMode, Mouse, Relative
CoordMode, Pixel, Relative

`::         ; Press ` to Exit the script program
Send {Shift Up}
Send {Alt Up}
exitapp
+!`::       ; So that above can be used during the loops while holding down Shift and Alt
Send {Shift Up}
Send {Alt Up}

^!p::Pause      ; Press Ctrl+Alt+P to pause. Press it again to resume
+^!p::Pause     ; So that above can be used during the loops while holding down Shift and Alt

#IfWinActive ahk_exe IdleDragons.exe
^j::            ; Toggle the script on/off
    toggle := !toggle   ; Turns toggle on if it is off, and off if it is on
    if (toggle) {
        SetTimer, Timer_Spam, 1000
    } else {
        SetTimer, Timer_Spam, Off
    }
return


F12::
ClickDamageUpgrade()
Return

Timer_Spam:
IfWinActive ahk_exe IdleDragons.exe
{
    CheckWindow()
    IfEqual,toggle,0,return                     ; The following lines are a safety net

    SelectTown()
    SelectAdventure()
    Sleep, 6000
    CheckWindow()
    IfEqual,toggle,0,return                     ; The following lines are a safety net

    ResetAutoProgress()
    Loop ; Endless loop with just Click, damage
    {
        Loop, 50 {
            Click, 170, 500
            Sleep, 10
        }

        CheckWindow()
        IfEqual,toggle,0,return                     ; The following lines are a safety net

        ClickDamageUpgrade()
        Sleep, %uiDelay%
        CheckWindow()
        IfEqual,toggle,0,return                     ; The following lines are a safety net

        PixelGetColor, color, %resetAutoProgressX%, %resetAutoProgressY%
        IfEqual, color, 0xFFFFFF
        {
            Break ; Reset adventure when autoprogress was turned off
        }
    }

    ResetMission()
}

Return

ResetAutoProgress()
{
  autoProgressColor := 0xFFFFFF
  Click, %resetAutoProgressX%, %resetAutoProgressY%, 0
  Sleep, %uiDelay%
  PixelGetColor, color, %resetAutoProgressX%, %resetAutoProgressY%
  If(color = autoProgressColor)
  {
      Click, %resetAutoProgressX%, %resetAutoProgressY%
      Sleep, %transitionDelay%
  }
}

SelectTown()
{
  campaignX := 100
  grandTourY := 140
  tombOfAnnihilationY := 200

  Loop 10 ;Zoom map out FULLY
  {
      MouseClick, WheelDown, %middleScreenX%, %middleScreenY%
      Sleep, 20
  }
  Sleep, %uiDelay%
  Click, %campaignX%,  %tombOfAnnihilationY%     ; Select Tomb of Annihilation
  Sleep, %uiDelay%
  Click, %campaignX%, %grandTourY%      ; Select A Grang Tour of the Sword Coast
  Sleep, %uiDelay%
}

SelectAdventure()
{
  adventuresMenuButtonX := 745
  adventuresMenuButtonY := 400
  adventureListX := 400
  adventureListY := 385
  cursedFarmerFreePlayY := 435
  startObjectiveX := 800
  startObjectiveY := 600

  Click, %adventuresMenuButtonX%, %adventuresMenuButtonY%      ; Opens the Adventures Menu
  Sleep, %uiDelay%
  Loop, 20            ; Reset Adventure Menu Scroll to top
  {
      Click, %adventureListX%, %adventureListY%, 0
      MouseClick, WheelUp
      Sleep, 20
  }

  Sleep, %uiDelay%
  Click, %adventureListX%, %cursedFarmerFreePlayY%  ; Select Cursed Farmer Free Play
  Sleep, %uiDelay%

  Click, %startObjectiveX%, %startObjectiveY%  ; Start Game
}

LevelUpClickDamage()
{
  clickDamageX := 180
  clickDamageY := 745
  disabledColor := 0x7A7A7A

  Click, %clickDamageX%, %clickDamageY%, 0
  Loop,
  {
    PixelGetColor, color, %clickDamageX%, %clickDamageY%
    if (color = disabledColor)
      return
    Click, %clickDamageX%, %clickDamageY%
    Sleep, 20
  }
}

ClickDamageUpgrade()
{
  x1 = 137
  y1 = 739
  x2 = 145
  y2 = 742
  clickDamageX := 180
  clickDamageY := 745
  upgradeColor := 0x26AD4C
  color = 0x7A7A7A

  PixelSearch, x, y, x1, y1, x2, y2, %color%, 2, Fast
  if ErrorLevel
  {
    Click, %clickDamageX%, %clickDamageY%, 0
    LevelUpClickDamage()
  }
  return
}

ResetMission()
{
  completeAdventureX := 275
  completeAdventureY := 125
  completeConfirmX := 570
  completeConfirmY := 530
  continueColor := 0x26AD4C
  continueButtonX := 645
  continueButtonY := 650

  Sleep, %transitionDelay%
  Click, %completeAdventureX%, %completeAdventureY%
  Sleep, %transitionDelay%
  Click, %completeConfirmX%, %completeConfirmY%
  Sleep, %uiDelay%

  Loop,
  {
    Click, %continueButtonX%, %continueButtonY%, 0
    PixelGetColor, color, %continueButtonX%, %continueButtonY%
    If(color = continueColor)
    {
      Click, %continueButtonX%, %continueButtonY%
      return
    }
    Sleep, %uiDelayY%
  }
}

CheckWindow()
{
  IfWinNotActive ahk_exe IdleDragons.exe  ; if the current window stops being IdleChampions
  {                                       ; then the script with turn itself off as if you had
      toggle := 0                         ; pressed the toggle manually to turn it off.
      SetTimer, Timer_Spam, Off           ; This prevents the script from beginning to click
      return                              ; on any other windows by accident, which can be caused
  }
}

autohotkey 这是关于mysql的autohotkey脚本

这是关于mysql的autohotkey脚本

Mysql.ahk
;MYSQL===============================
	; 语法补齐
		:*:mysql/::mysql -u root -p {enter}
		:*:sng::set names gbk;{enter}
		::cd m::cd C:\Software\phpStudy\MySQL\bin

		:*:s*::SELECT * FROM `;{left 1}
		:*:desc::DESCRIBE `;{left 1}

		; 显示/创建:数据库/表
			:*:sd/::SHOW DATABASES; {enter}
			:*:st/::SHOW TABLES; {enter}
			:*:cd/::CREATE DATABASE IF NOT EXISTS `;{left 1}
			:*:ct/::CREATE TABLE IF NOT EXISTS `;{left 1}
		;创建保存日志
			:C*:\T::\T C:\Software\phpStudy\MySQL\mysql1.txt


;大小写转换----------
	; 关键字
		::use::USE; {left 2}
		::into::INTO
		::from::FROM
		::where::WHERE
		::text::TEXT
		::show::SHOW
		::alter::ALTER
		::table::TABLE
		::rename::RENAME
		::database::DATABASE
		::warnings::WARNINGS
		::unsigned::UNSIGNED
		::drop::DROP; {left 2}

	; 数据类型
		:*:tinyint::TINYINT `
		:*:int::INT `
		::char::CHAR
		:*:varchar::VARCHAR(){left 1}

	; 增、删、改、查
		:*:insert::INSERT INTO `
		:*:delete::DELETE `
		:*:update::UPDATE `
		:*:select::SELECT `

autohotkey AHK:设置任意键为热字串的终止符

AHK:设置任意键为热字串的终止符

设置任意键为Hotstring的终止符.ahk

Loop
{
   Input ch, I L1 V
   HOTY = %HOT%
   HOT  =
}
;此处设置为你喜欢的终止符热键
!l::  
   If (Asc(A_PriorHotKey) = Asc(":") and HOTY <> "")
      Send % "{BS " StrLen(A_PriorHotKey)-5 "}" HOTY
Return
;rtfm替换为热字符串
; HOT = 替换为热字符串对应需要发送的字符。
:*B0:rtfm::
   HOT = read the fantastic manual
Return