Мне нужна помощь со скриптом, я хочу, чтобы он работал только тогда, когда я держу нажатой клавишу. Вот сценарий:
;If you use this, you have to use absolute screen coordinates.
CoordMode, Mouse, Screen
;Suppose a 100x100 px bounding box for your game inventory.
;Eg., from (500, 500) to (600, 600)
w::
{
;Get current Mouse coords
MouseGetPos, xCurrent ,yCurrent
;Calculate future Mouse coords
xMoved := xCurrent
yMoved := yCurrent - 35
;Check if the future mouse postion will be
;below the top border of your bounding box,
;aka still inside it, after it has moved.
;If so, proceed and move the mouse,
;otherwise do nothing.
MouseGetPos, CoordXRec, CoordYRec
MouseMove, xMoved, yMoved
if(yMoved < 503 && yMoved > 350 && yMoved > 360){
MouseMove 1846, 166
}
if(yMoved < 145){
MouseMove, %CoordXRec%, %CoordYRec%, 0
}
if(yMoved < 718 && yMoved < 720 && yMoved > 680){
MouseMove 1771, 671
}
return
}
s::
{
;Get current Mouse coords
MouseGetPos, xCurrent ,yCurrent
;Calculate future Mouse coords
xMoved := xCurrent
yMoved := yCurrent +35
;Check if the future mouse postion will be
;below the top border of your bounding box,
;aka still inside it, after it has moved.
;If so, proceed and move the mouse,
;otherwise do nothing.
MouseMove, xMoved, yMoved
if(yMoved > 285 && yMoved < 360){
MouseMove 1773, 526
}
if(yMoved > 697 && yMoved < 715){
MouseMove 1772, 736
}
return
}
a::
{
;Get current Mouse coords
MouseGetPos, xCurrent ,yCurrent
;Calculate future Mouse coords
xMoved := xCurrent -40
yMoved := yCurrent
;Check if the future mouse postion will be
;below the top border of your bounding box,
;aka still inside it, after it has moved.
;If so, proceed and move the mouse,
;otherwise do nothing.
if (xMoved > 1740) {
MouseMove, xMoved, yMoved
}
return
}
d::
{
;Get current Mouse coords
MouseGetPos, xCurrent ,yCurrent
;Calculate future Mouse coords
xMoved := xCurrent +40
yMoved := yCurrent
;Check if the future mouse postion will be
;below the top border of your bounding box,
;aka still inside it, after it has moved.
;If so, proceed and move the mouse,
;otherwise do nothing.
if (xMoved < 1917) {
MouseMove, xMoved, yMoved
}
return
}
По сути, вы управляете мышью с помощью WASD, и в ней есть и другие функциональные возможности, но я хочу сделать так, чтобы вам приходилось удерживать клавишу, чтобы двигаться. Спасибо!