Jump to content

Recommended Posts

Posted (edited)

There is/was a child's game years ago that helped physically challenged computer users in eye/hand coordination.  You used the mouse to approach the cat on the screen and the cat jumps away. I am looking for the code for this to be used in a much more practical sense.

To be clear, I am not developing or modifying a game. The description is strictly to help develop the software to cure a problem. I just want to see if this can be written using AutoItScript.

What I need is a program that:
.1) knows the present mouse position,
.2) watches the movement of the text-insertion point by text being entered or movement by arrow keys,
.3) automatically moves the mouse to avoid the collision.

Background:

In this case, as when navigating a text document by using the arrow keys, or entering text, there can be a collision of the mouse pointer and the text insertion point. The average person might simply move the mouse to move the pointer away from the text on the screen.

The key phrase there is "average person". I am working with savants.  These people are so advanced in thinking skills that a mundane interruption like this can be devastating. These are incredibly genius people, but super highly focused, people. The problem is when such a collision happens, their thought patterns get so totally interrupted that it is highly problematic and many times the writer has an extremely hard time getting back on track.  I want to write a program that automatically anticipates the collision on the screen and moves the mouse pointer out of the way pre-emptively. 

I am sure that this might take more explanation but that is the best I can describe it at the moment. What code is available on which should I do research to see how it works, that will help build this project?

Edited by Emerogork
Clarification
  • Emerogork changed the title to A program requested by my nephew. Modification of the Mouse VS Cat game.
  • Developers
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Moderators
Posted

Hiya,

An exchange of PMs with the OP has clarified that this is something he wishes to code in AutoIt - not an automation of an existing application.

So the thread is unlocked - please feel free to offer assistance.

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

 

Posted

It could be done using Notepad or a large edit field in an AutoIt GUI.  You could fill it with text (or just numbers from 0 to 9), position the caret in the middle, and move the mouse somewhere away to the caret.  WinGetCaretPos will tell you where the caret is located, while MouseGetPos will tell about mouse.  If both are getting too close, you just randomly move the mouse a certain distance from the caret with MouseMove.  Doable for sure.

  • Melba23 changed the title to A program requested by my nephew. Modification of the Mouse VS Cat game.
Posted (edited)
In case you're using _WinAPI_GetCaretPos(), just make sure you're using a recent version of AutoIt, as function _WinAPI_GetCaretPos() was bugged in version 3.3.14.5 (2018) and probably in older AutoIt versions. There was an incorrect line in the function, where $tagPOINT was used in DllCall, instead of $tPoint. It has been fixed in AutoIt 3.3.16.1

Local $tPOINT = DllStructCreate($tagPOINT)
...
; DllCall('user32.dll', 'bool', 'GetCaretPos', 'struct*', $tagPOINT) ; AutoIt 3.3.14.5
  DllCall('user32.dll', 'bool', 'GetCaretPos', 'struct*', $tPOINT) ; AutoIt 3.3.16.1

Edited by pixelsearch
  • Emerogork changed the title to A program requested by my nephew. A practical modification of the Mouse VS Cat game.
Posted
On 8/26/2023 at 3:48 PM, Nine said:

 WinGetCaretPos will tell you where the caret is located, while MouseGetPos will tell about mouse.

   Looking into it, thanks...

  • 2 weeks later...
Posted

Unfortunately, I have to turn away from this programming task to resolve other issues.  I can only say that I hope to return to this one in the near future.

 I thank everyone for their input so far.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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