Jump to content
Sign in to follow this  
Fin

Can MouseMove($pos[0], $pos[1]$x,0) take a variable at $x...?

Recommended Posts

Hello...:)

I have done extensive searches on this issue before posting but have not found a solve. Any help will be greatly appreciated.

;I have a valid AutoIt support question and kindly provided the details of my system:
;AutoIt Version: V3.3.14.2 [X32]
;Windows Version: WIN_VISTA [X86]
;Language: English (0409)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $form = GUICreate("O_o", 146, 66, -1, -1)
Global $inputNorth = GUICtrlCreateInput("", 12, 24, 53, 21)
Global $btnSet = GUICtrlCreateButton("Set Controls", 72, 16, 65, 33, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)

HotKeySet("{UP}","_north")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $btnSet
            Global $goNorth= "-" & GUICtrlRead($inputNorth)
            MsgBox(0,"", "go north: " & $goNorth)

        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
;functions
Func _north()
    $pos=MouseGetPos()
    MouseMove($pos[0], $pos[1]$goNorth,0) ;-results in syntax error
EndFunc

As you can see, $goNorth gets its value from $inputNorth
(the MsgBox shows it works)
But I cannot get MouseMove() to take $goNorth

If I use: MouseMove($pos[0], $pos[1]$goNorth,0) --I get a syntax error.

If I use: MouseMove($pos[0], $pos[1] & $goNorth,0) --I no longer get a syntax error, but that's not right so the function, (likely), moves by zero.

So is there a way I can get MouseMove() to take a variable for that parameter?

Thank you in advance should you choose to help!

Share this post


Link to post
Share on other sites

@Fin
What is this script for?

Best Regards.


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

FrancescoDiMuro,

Why do you ask? What business is it of yours?

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

 

Share this post


Link to post
Share on other sites

@Melba23
I saw $goNorth, and I thought that it was something for game automation.
Just to point out that here, game automation scripts are not allowed.

Best Regards.


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
11 hours ago, Fin said:

So is there a way I can get MouseMove() to take a variable for that parameter?

yes there are so many ways :D, but you need to tell us what app you want to automate because there are strict rules here and I don't want my ass to be kicked... :sweating:


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

232showtime,

Quote

 you need to tell us what app you want to automate

No he/she does not. - there is nothing in that question other than some operator confusion. Why are you all trying to get the thread locked?

Quote

I don't want my ass to be kicked

Then report the thread and ask for a Mod to take a look before you reply - simples.

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

 

Share this post


Link to post
Share on other sites
On 6/19/2018 at 12:46 AM, pixelsearch said:

Hello Fin, a plus sign should do it :

MouseMove($pos[0], $pos[1] + $goNorth, 0)


 

Thanks!  That worked.  I was hoping it was something small like that...:)

Share this post


Link to post
Share on other sites
On 6/19/2018 at 2:54 AM, FrancescoDiMuro said:

@Fin
What is this script for?

Best Regards.

It's just to control my mouse in photoshop.

 

2018-06-20 12_08_13-MouseController.png

Share this post


Link to post
Share on other sites
On 6/19/2018 at 3:28 AM, 232showtime said:

yes there are so many ways :D, but you need to tell us what app you want to automate because there are strict rules here and I don't want my ass to be kicked... :sweating:

Thanks.  I understand.  I read all the rules before posting and saw that about game and other program automation.  I'm not into that so it'll be no problem...:)

All I'm doing is making a small program to control my mouse (brush/tool) in photoshop, and to send button clicks so I get even looking dots or whatever.

Adding a + before the variable solved my issue but thanks for offering to help! I really appreciate it...:)

Share this post


Link to post
Share on other sites

@Fin

My apologizes to you :) Feel always free to ask what is not clear for you :)

@Melba23

On 19/6/2018 at 1:51 PM, Melba23 said:

Why are you all trying to get the thread locked?

In a forum where almost everyday someone asks for gane-automation, I think it is legit to ask what he was trying to do with his script, and he has been courteus replying us :)

I don't see anything wrong with MY question.

Thanks again Fin for have read Forum Rules :)

 

Best Regards.

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

@FrancescoDiMuro

1 hour ago, FrancescoDiMuro said:

My apologizes to you :) Feel always free to ask what is not clear for you :)

No apology necessary...:)  I probably should have been more clear upfront.  TBH, I was a little nervous after reading all the rules and just wanted to be as short and to the point as possible.  Next time I'll include a little more information for sure...:)

Thanks again for the offer to help!  I'm just learning AutoIt and I love it!  It's very easy to understand, but I'm sure I'll have questions in the future so it's nice to know there are people around to ask.  And while I don't know very much yet, I will spend some time here in case I can be of help to someone else...:)

Thanks again!  Take care!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Atrax27
      I have a webpage that I would like to Focus the Input on a particular field, which is not automatically set as the initial input.
       
      Website:
      https://fiscaloffice.summitoh.net/PropertyTaxValues/PayTaxCC.htm
       
      I want to just simply use the Send(“154xxx”) into the “Parcel” field, then Send(“{ENTER}”) without cycling through tab presses each time before getting to the correct inputbox, where number of tab press numbers might change depending on a few things (using either IE, chrome, etc). On most websites I try this with, the “Login ID” field is the first one that the cursor jumps to so all I do is just start a Send command, but here I can’t do that since it’s not the initial cursor location.
       
      I’ve read a few things on the forums about “_WinAPI_SetFocus” but that appears to work on AutoIT generated form fields only (see below code), I don’t know how to translate it for website use, thanks for any help!
       
      #include <GUIConstantsEx.au3> #Include <WinAPI.au3>   $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 400, 20) GUICtrlCreateButton("Test", 10, 100, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS)   GUISetState() Sleep(5000) _WinAPI_SetFocus(ControlGetHandle("Test", "", $hInput)) While 1     Switch GUIGetMsg()         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd  
         
    • By paradox109
      Hello, 
      I have A simple question about http request. What would be the fastest way to send mupltiple http request at the same time with autoit? The only way i figured  out was to to start multiple processes. This way works fine but its not really a good way. What user would like to see 15 processes running in the background at the same time. I know multithread is also not available in autoit.
    • By undcover
      Hello, I'm automating part of the note taking ability of my old bad POS, I managed to do much of the heavy lifting in the past weeks, I can finally do everything i want and more.
      Now I have a form with two buttons that expand the form to show a note taking beast that can lets us escape the hell of the one way editing the POS actually support (no cursor just delete. want to change the time on that order better delete everything and start the note from scratch, well not anymore)
      Now i'm stuck, my form shows up as two buttons over the POS window, however I need it to go away when I minimized the POS or switch to a different page or application, I was able to do so by doing a while loop, it worked badly as it will repeat the show command infinitely and if i break the loop then there's no way to restart the loop if the user didn't interact with the buttons directly.
      I have many ways I could know when controls are visible and it worked, I just don't have a way of constantly checking for this without straining the CPU, I know if I work it somehow I could do a while loop that can work, but it'll be CPU intensive. (Bad POS entails BAD PC)
      Should I make another form that does the loop? can I make the loop slower ?
      I'm using  VB.net VS 2017 with AutoitX dll.
      EDIT: Hello anyone who searched for this, if you're and idiot like me and forgot that Timers exist then this will jog your memory
       
      Add a timer to your form, set the timer for 1 sec intervals (dealers choice)
      start your timer (within form load or manually)
      Timer1.start()
      then double click the timer to create a Timer tick (for my case the control visibility test i want to make each second)
      it should look something like this :
          Private Sub timer1_Tick(sender As Object, e As EventArgs) Handles timer1.Tick         dim visibleform = ait.ControlCommand("my app", "", "[NAME:wacontact]", "IsVisible", "")         If visibleform = 0 Then             Me.Hide() ElseIf visibleform = 1 And Me.Visible = False Then ' to prevent the timer ticks from interupting any sendkeys or something we put two conditions. Me.Show() End If     End Sub remarks: ait. is the call I set for Autoit DLL.
       
       
       
    • By BlueSkyMemory
      Hello guys! I'm a rookie in AutoIt lol.
      I've tried to looking up in MSDN and the UDFs, but it can only get the GUID of a usual partition and with the GUID to control it. Now I have no ways😥.
      Thanks a lot for your help!
    • By Zaoka
      Hi guys,
      i have simple report in PowerPivot that shows Orders (Values) by Regions (Row) and Weeks (Columns). In Filter field is WeekDAYS (Monday,Tuesday,Wednesday,Thursday etc )
      how to filter WeekDAYS Filed on WEEKDAYYesterday with autoit ?
      my junky try
      #include <Date.au3> #include <Excel.au3> Local $sWEEKDAYYesterday = _DateDayOfWeek(@WDAY-1) Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, "C:\Users\.......\Orders.xlsb") Sleep (5000) $oExcel.ActiveWorkbook.RefreshAll Sleep (5000) $oExcel.Application.Sheets("Sheet1").PivotTables("PivotTable1").PivotFields("WeekDAYS").PivotFilters($sWEEKDAYYesterday)  
      Error result
      $oExcel.Application.Sheets("PivotTable1").PivotTables("PivotTable1").PivotFields("WeekDAYS").PivotFilters($sWEEKDAYYesterday) $oExcel.Application^ ERROR  
×
×
  • Create New...