HELP with %MouseMove Please!!!

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jakk_Uber_Noob
Posts: 18
Joined: 19 Sep 2017, 04:14

HELP with %MouseMove Please!!!

22 Sep 2017, 21:57

Hello all, This is my hypothetical code

Code: Select all

F1::
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\Users\Picture11.bmp
MouseMove, %foundX%, %foundY%
Sleep, 50, 100
MouseMove, %Value1%, %Value2%, 0, R ;;;; Trying to make the mouse move randomly a small amount from current/[b]relative[/b] location.
Click

Value1 = (-100, 100) ;;;; Most likely very wrong here hehehehe,
Value2 = (-100, 100) ;;;;  idk if even possible.

Return
How do i make this work Please someone!!
Last edited by Jakk_Uber_Noob on 24 Sep 2017, 04:11, edited 1 time in total.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: HELP with %MouseMove Please!!!

23 Sep 2017, 02:47

Use -tags for your hypothetical code! Thx :)
Btw, is this for a game?
Jakk_Uber_Noob
Posts: 18
Joined: 19 Sep 2017, 04:14

Re: HELP with %MouseMove Please!!!

24 Sep 2017, 04:15

BoBo wrote:Use -tags for your hypothetical code! Thx :)
Btw, is this for a game?
Done :) yea initially for a game..
Need something like ::

Code: Select all

MouseMove, %Rand%, %Rand%, 0, R
Rand = (-100,100)
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: HELP with %MouseMove Please!!!

24 Sep 2017, 08:28

Untested, but to give You idea:

Code: Select all

F1::
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, C:\Users\Picture11.bmp
If (ErrorLevel = 0)	; Image found
{
	MouseMove, %foundX%, %foundY%
	Sleep 50
	MouseMove, % RNG(-100,100), % RNG(-100,100), 0, R
	Click
}
Else if (ErrorLevel = 1)	; Image not found
{
	ToolTip % "Image not found"
}
Else if (ErrorLevel = 2)	; File couldn't be loaded
	MsgBox % "Error"
Return

RNG(min,max)
{
	Random, RNG, % min, % max
	Return RNG
}
Consider using CoordMode and SendMode Input.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
Jakk_Uber_Noob
Posts: 18
Joined: 19 Sep 2017, 04:14

Re: HELP with %MouseMove Please!!!

24 Sep 2017, 18:26

IT WORKS PERFECTLY OMG
ILY GUYS <3
Jakk_Uber_Noob
Posts: 18
Joined: 19 Sep 2017, 04:14

Re: HELP with %MouseMove Please!!!

24 Sep 2017, 18:27

kudos to SirRFI AND BoBo <3 the kings :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee and 295 guests