首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AutoHotKey变量,MouseMove

AutoHotKey变量,MouseMove
EN

Stack Overflow用户
提问于 2018-02-06 05:05:47
回答 1查看 133关注 0票数 1

使用ComboBoxes为MouseMove指定X和Y坐标时需要帮助

目前一切正常,只是不能让MouseMove使用我在ComboBoxes中指定的值。

我的代码(包括所有内容,如果你特别想要的话,在底部的鼠标移动和ComboBoxes是Gui部分的最后一部分):

代码语言:javascript
复制
#NoEnv
SetWorkingDir %A_ScriptDir%
#SingleInstance Force
#Persistent
onexit, close

pressed := false
Prepared := false
ar := false
timer = 0;

Gui, New,,ChinkoHack
Gui, Font, Batang
Gui, Color, 0xF0F0F0
Gui, Add, GroupBox, x10 y5 h150 w200, AR-15
Gui, Add, Button, xp+10 yp+20 w180 vbtn_ar gbtn_ar, AR-15
Gui, Add, Button, w180 h40 gChangeKeyARCallback vChangeKeyARText, Change Key AR-15
Gui, Add, Text, xp1 yp+46, AR-15 Delay:
Gui, Add, Slider, Left Range+50-250 TickInterval50 page15 gSyncdFramePositionAR vSyncdFramePositionAR AltSubmit,150
Gui, Add, Text, x160 y110 w40 h30 Center 0x200 0x1000 vValueAR, 0

Gui, Add, GroupBox, x225 y5 h150 w200, AK-47
Gui, Add, Button, xp+10 yp+20 w180 vbtn_ak gbtn_ak, AK-47
Gui, Add, Button, w180 h40 gChangeKeyAKCallback vChangeKeyAKText, Change Key AK-47
Gui, Add, Text, xp1 yp+46, AK-47 Delay:
Gui, Add, Slider, Left Range+50-250 TickInterval50 page15 gSyncdFramePositionAK vSyncdFramePositionAK AltSubmit,150
Gui, Add, Text, x375 y110 w40 h30 Center 0x200 0x1000 vValueAK, 0

Gui, Add, Button, x224 y194 w202 gChangeTriggerKeyCallback vChangeTriggerKeyText, Change Trigger Key

Gui, Add, Button, x224 y164 w202 gChink, ChinkoBot Toggle
Gui, Add, ComboBox, x8 y164 w202 vPosx, 40||60|80|100|
Gui, Add, ComboBox, x8 y194 w202 vPoxy, 420||440|460|480|

Gui, Show, w435 h225

Random ranSleep, 25, 35

IniRead, SwitchARKey, Settings.ini, Settings, SwitchARKey
IniRead, SwitchAKKey, Settings.ini, Settings, SwitchAKKey
IniRead, TriggerKey, Settings.ini, Settings, TriggerKey
IniRead, ARSpeed, Settings.ini, Settings, ARSpeed
IniRead, AKSpeed, Settings.ini, Settings, AKSpeed
GuiControl,, ChangeKeyARText, AR Switch Key: %SwitchARKey%
GuiControl,, ChangeKeyAKText, AK Switch Key: %SwitchAKKey%
GuiControl,, ChangeTriggerKeyText, ChinkoShoot Key: %TriggerKey%
GuiControl,,SyncdFramePositionAR,%ARSpeed%
GuiControl,,SyncdFramePositionAK,%AKSpeed%
GuiControl,,ValueAR,%ARSpeed%
GuiControl,,ValueAK,%AKSpeed%
Goto, LoopRunAR
Return

Chink:
Hotkey, T, Toggle
Return

SyncdFramePositionAR:
GuiControlGet,SyncdFramePositionAR,2:
GuiControl,,ValueAR,%SyncdFramePositionAR%
If (A_GuiEvent <> "Normal" && A_GuiEvent <> "4") {
Return
}
IniWrite, %SyncdFramePositionAR%, Settings.ini, Settings, ARSpeed
Return

SyncdFramePositionAK:
GuiControlGet,SyncdFramePositionAK,2:
GuiControl,,ValueAK,%SyncdFramePositionAK%
If (A_GuiEvent <> "Normal" && A_GuiEvent <> "4") {
Return
}
IniWrite, %SyncdFramePositionAK%, Settings.ini, Settings, AKSpeed
Return

ChangeTriggerKeyCallback:
GuiControl,, ChangeTriggerKeyText, Press a key...
Input, OutputVar, L1 E
GuiControl,, ChangeTriggerKeyText, ChinkoShoot Key: %OutputVar%
IniWrite, %OutputVar%, Settings.ini, Settings, TriggerKey
Return

ChangeKeyARCallback:
GuiControl,, ChangeKeyARText, Press a key...
Input, OutputVar, L1 M
GuiControl,, ChangeKeyARText, AR-15 Switch Key: %OutputVar%
IniWrite, %OutputVar%, Settings.ini, Settings, SwitchARKey
Return

ChangeKeyAKCallback:
GuiControl,, ChangeKeyAKText, Press a key...
Input, OutputVar, L1 M
GuiControl,, ChangeKeyAKText, AK-47 Switch Key: %OutputVar%
IniWrite, %OutputVar%, Settings.ini, Settings, SwitchAKKey
Return

btn_ar:
ar := true
GuiControl, Disable, btn_ar
GuiControl, Enable, btn_ak
Return

btn_ak:
ar := false
GuiControl, Disable, btn_ak
GuiControl, Enable, btn_ar
Return

LoopRunAR:
IniRead, TriggerKey, Settings.ini, Settings, TriggerKey
IniRead, SwitchARKey, Settings.ini, Settings, SwitchARKey
IniRead, SwitchAKKey, Settings.ini, Settings, SwitchAKKey
IniRead, HelmetbotKey, Settings.ini, Settings, HelmetbotKey
if (GetKeyState(SwitchARKey,"P")=1)
GoSub, btn_ar
if (GetKeyState(SwitchAKKey,"P")=1)
GoSub, btn_ak
if (ar == true)
IniRead, Speed, Settings.ini, Settings, ARSpeed
else
IniRead, Speed, Settings.ini, Settings, AKSpeed

while GetKeyState(TriggerKey)
{
SetMouseDelay, Speed
Click
}
if (ar == true)
Goto, LoopRunAR
else
Goto, LoopRunAK
Return

LoopRunAK:
IniRead, TriggerKey, Settings.ini, Settings, TriggerKey
IniRead, SwitchARKey, Settings.ini, Settings, SwitchARKey
IniRead, SwitchAKKey, Settings.ini, Settings, SwitchAKKey
if (GetKeyState(SwitchARKey,"P")=1)
GoSub, btn_ar
if (GetKeyState(SwitchAKKey,"P")=1)
GoSub, btn_ak
if (ar == true)
IniRead, Speed, Settings.ini, Settings, ARSpeed
else
IniRead, Speed, Settings.ini, Settings, AKSpeed

while GetKeyState(TriggerKey)
{
SetMouseDelay, 20
Click
Sleep, Speed
}
if (ar == true)
Goto, LoopRunAR
else
Goto, LoopRunAK
Return

GuiClose:
exitapp
return

insert::
    tongueclosed:
    Pause,toggle
return

~*$T::
Send, i
sleep, %ranSleep%
SendEvent {Click Posx, Posy}
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Click
sleep, %ranSleep%
Send, i
return

Close:
exitapp
return
EN

回答 1

Stack Overflow用户

发布于 2018-02-07 23:56:45

你应该用%s包装你的"Posx,Posy“,因为它们是变量,我想。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48631460

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档