zoukankan      html  css  js  c++  java
  • AutoHotKey脚本模板:初始化、配置、退出

    AutoHotKey脚本模板实现初始化、配置、退出

    #NoEnv
    SetWorkingDir %A_ScriptDir%
    CoordMode, Mouse, Screen
    SendMode Input
    #SingleInstance Force
    SetTitleMatchMode 2
    #WinActivateForce
    SetControlDelay 1
    SetWinDelay 0
    SetKeyDelay -1
    SetMouseDelay -1
    SetBatchLines -1
    ; WinSet, Transparent, Off
    
    #NoEnv
    #Warn
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    toggle_get_blood := 0
    get_blood_count := 0
    is_show_gui := 0
    is_create_gui :=0
    NewHotKey := "^F9"
    
    MsgBox , 64, 使用提示, 系统要求:xxxxxxxxxxxx, 30
    
    ;;先配置默认快捷键
    Hotkey, ^F1, Change_HotKey_Show
    Hotkey, ^F2, Exit_App
    Hotkey, ^F9, Run_arkAutoGetBlood
    Return
    
    ;;;
    Change_HotKey_Show:
    if is_create_gui = 0
    {
        is_create_gui = 1
        Gui, Add, Text,   x8 y8 w100 h24 +0x200, 自动抽血快捷键:
        Gui, Add, Hotkey, x128 y8 w268 h24 vNewHotKey, %NewHotKey%
        Gui, Add, Button, x40 y56 w80 h25 default gChange_HotKey, 确认(&O) 
        Gui, Add, Button, x288 y56 w80 h25 gCloseForm, 取消(&C)
        Gui, Show, w412 h97, 配置快捷键
    } else
    {
         if is_show_gui = 0
        {
            is_show_gui = 1
            Gui, Show, w412 h97, 配置快捷键
        } else {
            MsgBox , 64, 提示, 重复按键, 1
        }
    }
    Return
    
    Change_HotKey:
    Gui Submit
    display_hot_key = %NewHotKey%
    StringReplace, display_hot_key,  display_hot_key, +,Shift + , All
    StringReplace, display_hot_key,  display_hot_key, ^,Ctrl + , All
    StringReplace, display_hot_key,  display_hot_key, !,Alt + , All
    MsgBox , 64, 提示, 新快捷键: %display_hot_key%, 3
    Hotkey, %NewHotKey%, Run_arkAutoGetBlood
    Return
    
    CloseForm:
    Gui, Hide
    is_show_gui = 1
    Return
    
    ;;;

    脚本下补充自己的主体功能实现体:

    Run_arkAutoGetBlood
    即可
  • 相关阅读:
    MySQL字符集 utf8 和 utf8mb4 区别及排序规则 general_ci 和 unicode_ci 和 bin 的区别
    tp5定时任务
    PHP7.X连接SQLSERVER数据库(CENTOS7)
    php 连接sqlserver
    接口踩坑:Status (blocked:other)
    php 一些常用函数
    tp5支付宝和微信支付
    php 数组相关方法的一些实际妙用
    MySQL如何利用索引优化ORDER BY排序语
    composer命令介绍之install和update及其区别
  • 原文地址:https://www.cnblogs.com/eaglexmw/p/12624962.html
Copyright © 2011-2022 走看看