Results 1 to 8 of 8
  1. #1
    OblivionPO's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    1

    AHK script for X-Walking.

    I've never tried AHK but I've taken a few java classes at my college so know the basics of programming.
    What im trying to make.
    Step 1, let user select a location on the screen to lock ( for use on realm you would lock the location of the x on your swf)

    Step 2, let the user select a hotkey to correspond to left mouse click, when desired hotkey is held mouse click is held then moved to the center of the screen.

    Step 3, when desired hotkey is let go stop holding left mouse click

    Not really looking for anyone too just give me the answer, just some tips on ahk before I start would be greatly appreciated.
    I'll put pastebin's of the source as I'm going.
    Last edited by OblivionPO; 04-26-2016 at 02:46 PM.

  2. #2
    The_En|D's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Stark Industries
    Posts
    856
    Reputation
    18
    Thanks
    468
    My Mood
    Innocent
    I think he has the most experience with AHK-scripts, maybe he wants to help you @ll1312ll

    "They say the best weapon is one you never have to fire.
    I respectfully disagree.
    I prefer the weapon you only have to fire once."

    ~ Tony Stark

  3. The Following 2 Users Say Thank You to The_En|D For This Useful Post:

    ll1312ll (04-26-2016),OblivionPO (04-26-2016)

  4. #3
    ll1312ll's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    216
    Reputation
    56
    Thanks
    1,666
    My Mood
    Buzzed
    Quote Originally Posted by The_En|D View Post
    I think he has the most experience with AHK-scripts, maybe he wants to help you @ll1312ll
    Thanks

    @OblivionPO
    Im not sure if i got your problem right, english is not my first language.
    and i have not worked with ahk a while but i try my best.

    example code:

    F9::
    {
    MouseGetPos,x,y
    sleep, 5000
    MouseMove %x%, %y%
    }

    this code means if you press F9 it gets the mouse position into variables x and y
    than sleep 5sec
    and than move the mouse back to old position
    Ahk has also some easy to use comands to check if the mousebutton is pressed down:

    GetKeyState, State, LButton, P
    If State = D # D means down

    and now let a loop permacheck for the button:

    example:

    F9::
    MouseGetPos,x,y
    loop
    {
    sleep, 5000
    GetKeyState, State, LButton, P
    If State != D
    {
    MouseMove %x%, %y%
    break
    }
    }
    exitapp

    When f9 is pressed this code gets the mouseposition and than checks every 5 seconds if the mousebutton is still down
    and if its not down anymore move the mouse back.
    Hope this helped you a bit

  5. The Following User Says Thank You to ll1312ll For This Useful Post:

    OblivionPO (05-01-2016)

  6. #4
    Plus22's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    527
    Reputation
    53
    Thanks
    103
    My Mood
    Inspired
    Quote Originally Posted by OblivionPO View Post
    I've never tried AHK but I've taken a few java classes at my college so know the basics of programming.
    What im trying to make.
    Step 1, let user select a location on the screen to lock ( for use on realm you would lock the location of the x on your swf)

    Step 2, let the user select a hotkey to correspond to left mouse click, when desired hotkey is held mouse click is held then moved to the center of the screen.

    Step 3, when desired hotkey is let go stop holding left mouse click

    Not really looking for anyone too just give me the answer, just some tips on ahk before I start would be greatly appreciated.
    I'll put pastebin's of the source as I'm going.
    1- MouseGetPos, using the active window's coords(it does that by default so don't worry)

    2- Holding keys down:
    Send W : it presses the W a single time
    Send {W down} : holds the W key down
    Send {W up} : releases the W key
    KeyWait W : waits for W to be pressed/released to continue

    Making the user choose his X location with Alt + T:

    Code:
    !T::
    MouseGetPos, coordx, coordy
    return
    Using the letter T as our hotkey:

    Code:
    T::
    MouseMove, coordx, coordy    ; moves cursor to the X
    Send {LButton down}          ; holds click
    MouseMove, 200, 200          ; any coord in the middle of the screen
    KeyWait, T                   ; waits for the T to be released
    Send {LButton up}            ; releases click
    return
    You may tweak it a bit. I don't think we need to make the user choose the X location everytime, just find the default one and try to put it directly there without variables.

    edit: lol got ninja'd. I think I made mine simpler, though - the KeyWait makes the usage of loopchecking unnecessary.
    Last edited by Plus22; 04-26-2016 at 08:22 PM.
    just stop. come with me son.

  7. The Following User Says Thank You to Plus22 For This Useful Post:

    OblivionPO (05-01-2016)

  8. #5
    ll1312ll's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    216
    Reputation
    56
    Thanks
    1,666
    My Mood
    Buzzed
    Plus is right i forgot about keywait should be even simpler with that.
    Edit:

    Bonustip:
    never forget to set an exit hotkey in your test scripts.
    like:

    F12::
    exitapp

    because ahk can suck a lot sometimes. The script you want for example could bind your mouse to the center of the screen with just one simple syntax mistake.

    U can search for my old releases i just tested 'ASSCursor' and it still works its marked as outdated..
    It just dont change the cursor size anymore.. but i think its a windows10 problem.
    And check for my autotradebot it uses the mouse a lot and i hope i coded it understandable for beginners..
    Maybe it helps u getting the basics.
    Last edited by ll1312ll; 04-26-2016 at 08:53 PM.

  9. The Following User Says Thank You to ll1312ll For This Useful Post:

    OblivionPO (05-01-2016)

  10. #6
    Plus22's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    527
    Reputation
    53
    Thanks
    103
    My Mood
    Inspired
    Quote Originally Posted by ll1312ll View Post
    Plus is right i forgot about keywait should be even simpler with that.
    Edit:

    Bonustip:
    never forget to set an exit hotkey in your test scripts.
    like:

    F12::
    exitapp

    because ahk can suck a lot sometimes. The script you want for example could bind your mouse to the center of the screen with just one simple syntax mistake.

    U can search for my old releases i just tested 'ASSCursor' and it still works its marked as outdated..
    It just dont change the cursor size anymore.. but i think its a windows10 problem.
    And check for my autotradebot it uses the mouse a lot and i hope i coded it understandable for beginners..
    Maybe it helps u getting the basics.
    All my scripts have a Reload bound to the Del key, it's an easy break for loops too
    just stop. come with me son.

  11. The Following User Says Thank You to Plus22 For This Useful Post:

    OblivionPO (05-01-2016)

  12. #7
    OblivionPO's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    1
    Ugh i cant tag you guys cus I'm not allowed to for some reason, So ill have to thank you guys separately. I really appreciate you helping me on this, and pointing me to what I need to know to make it work. I'm sorry I havent posted my source yet I've been mad busy with midterms :c once I have something decent to show I'll show you guys what I have.

  13. #8
    Danny's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    9,617
    Reputation
    2835
    Thanks
    3,002
    My Mood
    Aggressive
    looks solved.

    /closed also 7 days inactivity.

    I am not a middleman nor do I buy/sell anything. If you are being contacted by someone off-site from MPGH then it's not me! Please report these to me via PM. Don't be stupid, think first.

Similar Threads

  1. [Help Request] Requesting a working AHK script for QuickSpeech similiare to BMJs old script
    By BrownBagSwag in forum Realm of the Mad God Help & Requests
    Replies: 0
    Last Post: 08-20-2015, 10:01 PM
  2. [Outdated] AHK Scripts for Bug using
    By Maxxxel18 in forum Trove Hacks & Cheats
    Replies: 10
    Last Post: 06-02-2015, 03:09 AM
  3. AHK Script for ak47
    By twojakurwa in forum Counter-Strike 2 Coding & Resources
    Replies: 1
    Last Post: 02-15-2015, 04:58 AM
  4. [Help Request] AHK Script For Auto Deposit
    By ANewBlis in forum Realm of the Mad God Help & Requests
    Replies: 2
    Last Post: 03-06-2014, 09:11 AM
  5. Updating AHK Script for v1.0
    By MateyB in forum Realm of the Mad God Help & Requests
    Replies: 9
    Last Post: 10-09-2012, 08:51 AM