Jump to content

Pixelsearch and Mousemove mouse stops 100 pixel before the pixel wanted


Recommended Posts

I wanted to know how the mouse stops at mousemove 100 pixels before the pixel wanted.(as in the title)

My script looks like this: 

HotKeySet ("{NUMPADMULT}", "Start")
HotKeySet ("{NUMPADSUB}", "Pause")
HotKeySet ("{Esc}", "_Exit")
 
While 1
   Sleep(10)
WEnd
 
Func Start()
While 1
$pos = PixelSearch(1680,1050,0,0,15935534,10)
If isArray($pos) then
   MouseMove($pos[0],$pos[1],2)
EndIf
    WEnd
 EndFunc
 
Func Pause()
While 1
  Sleep(10)
    WEnd
EndFunc
 
Func _Exit()
   Exit
EndFunc
 
It would be nice if someone could help me if it is possible.
Sorry about my bad english.
Link to comment
Share on other sites

  • Moderators

You should be able to just add the distance on your MouseMove statement:

MouseMove($pos[0] - 100, $pos[1] + 100, 2)

I'm curious, though, what app you're trying to manipulate? There are tons of better methods than PixelSearch and MouseMove to control most apps.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Timo196,

Bearpocalypse is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. :naughty:

But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...