AutoHotKey变量,MouseMove

时间:2018-02-05 21:05:47

标签: variables autohotkey

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

目前一切正常,只是无法让MouseMove使用我在ComboBox中指定的值。

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

#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

1 个答案:

答案 0 :(得分:0)

你应该包裹你的&#34; Posx,Posy&#34;我认为,因为它们是变量,所以在%。