Close
Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 11
  1. #1

    Default Mousemove - Basic math problems..

    I got an issue with AutoHotkey. I try to broadcast mouseclicks to other windows.


    I want to get mouse coords, calculate new Y value and then move mouse to new location. I just got one problem.
    The problem is this

    Code:
    yposmove = -70
    MouseGetPos, xpos, ypos             ;Get mouse position
    ypos2 = Add(ypos, yposmove)     ;Calculate new Y position
     MouseMove, xpos, ypos2, screen  ;Move to New position
    AutoHotkey understands this ypos2 as string for some reason. So when I run this it moves mouse to MouseMove, xpos, 0, screen

    Also tried MouseClick, left, xpos, ypos2, screen but that didnt work either.
    Last edited by aasi888 : 01-31-2012 at 10:45 PM Reason: Changed Title Of Thread

  2. #2

    Default

    Quote Originally Posted by aasi888 View Post
    I got an issue with hotkeynet. I try to broadcast mouseclicks to other windows.The problem is this
    Code:
    yposmove = -70MouseGetPos, xpos, ypos             ;Get mouse positionypos2 = Add(ypos, yposmove)     ;Calculate new Y position MouseMove, xpos, ypos2, screen  ;Move to New position
    hotkeynet understands this ypos2 as string for some reason. So when I run this it moves mouse to MouseMove, xpos, 0, screenAlso tried MouseClick, left, xpos, ypos2, screen but that didnt work either
    That's not a HotkeyNet script. Are you using AutoHotkey?
    �Author of HotkeyNet and Mojo

  3. #3

    Default

    Yeah. My bad. Its autohotkey. I edited the post. But can't edit the title.
    Last edited by aasi888 : 01-31-2012 at 06:35 PM

  4. #4
    Member luxlunae's Avatar
    Join Date
    Aug 2008
    Location
    Bay Area, CA
    Posts
    1431
    Blog Entries
    37

    Default

    Try using %variable% rather than variable. My understanding is that % pulls the value out of the variable.

    I'm also amused because I spend half my time on the ahk forums telling people that if they want to box they really should come here, and now that you've come here I'm going to say "if you persist in using AHK rather than a good program (like isboxer), its best to ask those questions on the ahk forum."

    Most people here haven't used ahk and its considered pretty obsolete. I use it for a lot of things at work and its a godsend, but for multiboxing the $3 a month I spend on isboxer is well worth it.

  5. #5

    Default

    Yeah, most people use ISBoxer. I use HotKeyNet and can usually jump in on that, and obviously Freddie is pretty quick on the ball when a HKN question comes up. And then there's Keyclone, which most people here have used at some point even if they don't use it now.

    AutoHotkey has maybe a handful of users here, so there's not many people that can offer help with it.
    Blog : Herding Khats
    Team : Kina - Çroaker - Messkit - Lìfetaker - Wìdowmaker
    Newbie Guides : Multiboxing Vol. 1 - Multiboxing Vol. 2 - HotKeyNet - Jamba
    The Almighty Lax made a liar out of me, apparently I DO get prizes for it.
    *Commences Wielding the Banhammer like there's piñatas up in here and I'm Lady Thor*

    _ Forum search letting you down? Use the custom Google search _

  6. #6

    Default

    If your MouseClick, left, xpos, ypos2, screen didn't work, I would suspect the ypos2 is assigned wrongly in Add function.

    I used mouseclick for mouse broadcast to all screen and it works. My code is 'MouseClick, left, tx, RY, 2', and really no diff from yours.

    Did u set the CoordMode correctly?

    What is the 'screen' variable for? Isn't that the Speed parameter?

  7. #7

    Default

    1. I need to make the program understand the following
    calculate: ypos + yposmove and save the value to ypos2. How can I do it?

    I need to somehow calculate ypos + yposmove and then store the result as into ypos2.
    When I use Msgbox, ypos2:%ypos2% to print the value of ypos2 it turns out like this ypos2:%ypos2%. This means that ypos2 is understood as a string. I need the program to understand ypos2 as value e.g 1023.

    Can you copy paste your code, please?

    2. I got and easy version of the move to work.
    This works: MouseMove, 0,70,, R.

    Quote Originally Posted by Cptan View Post
    What is the 'screen' variable for? Isn't that the Speed parameter?
    The Screen command: ; Interprets the coordinates below as relative to the screen rather than the active window. You can read about it in CoordMode section.

    I was mixing hotkeynet and autohotkey with each others . I was reading the wrong guides from the net. Awesome what lack of sleep does to you! Had a 30 min blackout from my memory in the morning.

  8. #8

    Default

    Quote Originally Posted by aasi888
    I need the program to understand ypos2 as valuee.g 1023.
    I use ':='. For example
    RY := (MY - BigWoWY)/BigWoWH*SmallWoWH + BigWoWH
    MouseClick, left, tx, RY, 2



    Quote Originally Posted by aaasi888
    The Screen command: ; Interprets the coordinates below as relative to the screen rather than the active window. You can read about it in CoordMode section.
    When I post you the question on screen variable, I was referring to your codes

    Quote Originally Posted by aaasi888
    MouseMove, xpos, ypos2, screen ;Move to New position
    AHK - MouseMove, X, Y [, Speed, R]
    e.g. MouseMove, 20, 30, 50, R

    Your working code
    Quote Originally Posted by aaasi888
    A comma is missing in your non-working code?


    At any rate, you should be able to solve this problem.

    Happy hunting!

  9. #9

    Default

    I guess I got it working somehow now. Perhaps I got some extra spacebars after the lines or something.

    Thx for all for help. I'm gonna start working on the mouse system now!

    EDIT: I managed to move cursor to the correct location but its very uncertain whether is presses the button or not. Is there a more sure way to broadcast keys?
    Last edited by aasi888 : 02-04-2012 at 12:21 AM

  10. #10

    Default

    Quote Originally Posted by aasi888
    I managed to move cursor to the correct location but its very uncertain whether is presses the button or not.

    Double click works very well for me

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •