如何将最小化、展开和十字图标添加到我的自动热键脚本中,就像您在右上角的网络浏览器中看到的那样

问题描述 投票:0回答:1

我一直在为《Valorant》触发器机器人编写一段代码,当它根据颜色检测到屏幕上的敌人时,它就会激活,我想为其添加一个最小化、十字和展开图标。你能帮我把它集成到我的图形用户界面中吗?谢谢。

我尝试在 yt 上搜索教程,但没有找到。

我还隐藏了触发器机器人代码,这样就没有人会窃取它。 `

; Initialization and Settings

Gui, +AlwaysOnTop 
#NoEnv 
#persistent
#MaxThreadsPerHotkey 2
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input
CoordMode, Pixel, Screen
SoundBeep, 300, 200
SoundBeep, 400, 200

; Default Settings
PixelBox := 2.5
PixelSens := 75
PixelColor := 0xffff45
TapTime := 140
HoldKey := "Xbutton2" ; Default Hold Key

; GUI Creation
; GUI Creation
Gui, Font, s10, Verdana ; Set font for the GUI

; Mode Selection Group
Gui, Add, GroupBox, x10 y10 w280 h130, SCREMER SCRIPT
Gui, Add, Text, x20 y30, Select Mode:
Gui, Add, Button, x20 y50 w120 h30 gStayOn, Constant Mode
Gui, Add, Button, x150 y50 w120 h30 gHoldMode, Hold Mode
Gui, Add, Button, x20 y90 w120 h30 gOffLoop, Turn Off
Gui, Add, Button, x150 y90 w120 h30 gTerminate, Exit Script


; Settings Group
Gui, Add, GroupBox, x10 y150 w280 h210, Settings
Gui, Add, Text, x20 y170, Pixel Box:
Gui, Add, Edit, x150 y170 w120 vPixelBox, %PixelBox%
Gui, Add, Text, x20 y200, Pixel Sensitivity:
Gui, Add, Edit, x150 y200 w120 vPixelSens, %PixelSens%
Gui, Add, Text, x20 y230, Pixel Color:
Gui, Add, Edit, x150 y230 w120 vPixelColor, %PixelColor%
Gui, Add, Text, x20 y260, Tap Time (ms):
Gui, Add, Edit, x150 y260 w120 vTapTime, %TapTime%
Gui, Add, Text, x20 y290, Hold Key:
Gui, Add, Edit, x150 y290 w120 vHoldKey, %HoldKey%
Gui, Add, Button, x90 y330 w150 h30 gApplySettings, Apply Settings

; Status Display
Gui, Add, Text, x10 y370 w280 vStatus, Status: Not started
Gui, Add, Text,, Toggle GUI with Right Shift 
Gui, Show, w300 h410, AHK Script GUI
WinSet, Style, -0xC00000, AHK Script GUI



StayOn:
SoundBeep, 300, 200
GuiControl,, Status, Status: Constant Mode
settimer, loop2, off
settimer, loop1, 1
return

HoldMode:
SoundBeep, 300, 200
GuiControl,, Status, Status: Hold Mode
settimer, loop1, off
settimer, loop2, 1
return

OffLoop:
SoundBeep, 300, 200
GuiControl,, Status, Status: Turned Off
settimer, loop1, off
settimer, loop2, off
return

Terminate:
SoundBeep, 300, 200
SoundBeep, 200, 200
Sleep 400
exitapp

ApplySettings:
SoundBeep, 300, 200
Gui, Submit, NoHide
return

loop1:
PixelSearch()
return


RShift:: ; Hotkey for the '.' key
if (GuiVisible := !GuiVisible) ; Toggle the GuiVisible variable
    Gui, Show
else
    Gui, Hide
return
user-interface autohotkey
1个回答
0
投票

这个怎么样:

; Initialization and Settings

Gui, +AlwaysOnTop 
#NoEnv 
#persistent
#MaxThreadsPerHotkey 2
#KeyHistory 0
ListLines Off
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input
CoordMode, Pixel, Screen
SoundBeep, 300, 200
SoundBeep, 400, 200

; Default Settings
PixelBox := 2.5
PixelSens := 75
PixelColor := 0xffff45
TapTime := 140
HoldKey := "Xbutton2" ; Default Hold Key

; GUI Creation
; GUI Creation
Gui, Font, s10, Verdana ; Set font for the GUI

; Mode Selection Group
Gui, Add, GroupBox, x10 y10 w280 h130, SCREMER SCRIPT
Gui, Add, Text, x20 y30, Select Mode:
Gui, Add, Button, x20 y50 w120 h30 gStayOn, Constant Mode
Gui, Add, Button, x150 y50 w120 h30 gHoldMode, Hold Mode
Gui, Add, Button, x20 y90 w120 h30 gOffLoop, Turn Off
Gui, Add, Button, x150 y90 w120 h30 gTerminate, Exit Script


; Settings Group
Gui, Add, GroupBox, x10 y150 w280 h210, Settings
Gui, Add, Text, x20 y170, Pixel Box:
Gui, Add, Edit, x150 y170 w120 vPixelBox, %PixelBox%
Gui, Add, Text, x20 y200, Pixel Sensitivity:
Gui, Add, Edit, x150 y200 w120 vPixelSens, %PixelSens%
Gui, Add, Text, x20 y230, Pixel Color:
Gui, Add, Edit, x150 y230 w120 vPixelColor, %PixelColor%
Gui, Add, Text, x20 y260, Tap Time (ms):
Gui, Add, Edit, x150 y260 w120 vTapTime, %TapTime%
Gui, Add, Text, x20 y290, Hold Key:
Gui, Add, Edit, x150 y290 w120 vHoldKey, %HoldKey%
Gui, Add, Button, x90 y330 w150 h30 gApplySettings, Apply Settings

; Status Display
Gui, Add, Text, x10 y370 w280 vStatus, Status: Not started
Gui, Add, Text,, Toggle GUI with Right Shift 
Gui, Show, w300 h410, AHK Script GUI
WinSet, Style, -0xC00000, AHK Script GUI

OnMessage(0x201, "WM_LBUTTONDOWN")  ;  <---

StayOn:
SoundBeep, 300, 200
GuiControl,, Status, Status: Constant Mode
settimer, loop2, off
settimer, loop1, 1
return

HoldMode:
SoundBeep, 300, 200
GuiControl,, Status, Status: Hold Mode
settimer, loop1, off
settimer, loop2, 1
return

OffLoop:
SoundBeep, 300, 200
GuiControl,, Status, Status: Turned Off
settimer, loop1, off
settimer, loop2, off
return

Terminate:
SoundBeep, 300, 200
SoundBeep, 200, 200
Sleep 400
exitapp

ApplySettings:
SoundBeep, 300, 200
Gui, Submit, NoHide
return

loop1:
PixelSearch()
return


RShift:: ; Hotkey for the '.' key
if (GuiVisible := !GuiVisible) ; Toggle the GuiVisible variable
    Gui, Show
else
    Gui, Hide
return

WM_LBUTTONDOWN() {

   PostMessage, 0xA1, 2,,,A

 }
© www.soinside.com 2019 - 2024. All rights reserved.