Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Auto right click - help pls..


  • Please log in to reply
19 replies to this topic
  • Guests
  • Last active:
  • Joined: --
i am very new in this and after reading the tutorials i still dont know how to start. i am very bad in programming. can someone pls help me?

i want to write a script that helps me to do the following:

1. right click (then let go)
2. wait 1.5 or 2 sec
3. repeat from (1)

and there should be a button lets say "CTRL + Z" to start the script and "CTRL + X" to end the script.

PurpleApple
  • Members
  • 9 posts
  • Last active: Nov 10 2004 02:57 AM
  • Joined: 10 Sep 2004
erk.. that was me who post. i forgot to login. pls help~! :)
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?

PurpleApple
  • Members
  • 9 posts
  • Last active: Nov 10 2004 02:57 AM
  • Joined: 10 Sep 2004
#z::suspend
#x::reload

#c::
SetMouseDelay, 10; //delay 10miliseconds
Mouseclick, RIGHT, , , 1 ; //mouse right click 1 tmie
#c //repeats process again
return



i tried to write these frm seeing some previous post. is it correct?
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?

Candle
  • Members
  • 326 posts
  • Last active: May 17 2010 03:04 PM
  • Joined: 19 Aug 2004
Loop, 3
{
; Example #1: 
Send, {Control down}
MouseClick, right,
Send, {Control up}
Sleep, 2000 ; 2 second
}

Not sure about the loop ..
Well not sure about all of it.. but someone will come along and help .

PurpleApple
  • Members
  • 9 posts
  • Last active: Nov 10 2004 02:57 AM
  • Joined: 10 Sep 2004
hmm.. then how do i deactivate the loop then? and how to reactivate the script?
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Here:

^z::Goto, Start ;This makes CTRL+Z go to the Start block... 

Start: 
Loop, 
{ 
MouseClick, right 
Sleep, 1500 ;This means the script will wait 1.5 secs 
} 

^x::ExitApp ;This makes CTRL+X exit the program.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The above should work. Here is a slightly improved version from someone else's request. It makes the same hotkey both start and stop the loop:
#MaxThreadsPerHotkey 3

#z::

#MaxThreadsPerHotkey 1

if keep_winz_running = y

{

    keep_winz_running = n

    return

}

; Otherwise:

keep_winz_running = y

Loop, 

{ 

    MouseClick, right 

    Sleep, 1500 ;This means the script will wait 1.5 secs 

    if keep_winz_running = n  ; The user signaled the loop to stop.

        break  ; break out of the loop

}


PurpleAppple
  • Guests
  • Last active:
  • Joined: --
as for the new code that u just posted, how do u stop the loop then?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The same key both starts and stops the loop. In this example, its Win+Z.

PurpleApple
  • Members
  • 9 posts
  • Last active: Nov 10 2004 02:57 AM
  • Joined: 10 Sep 2004
The script worked. Thank you very much. But there's a problem. I am actually trying to play a game that makes it auto attack on a unit when i press the win+z. But i have tried it in game and found out that it does not work in the game but it works if its not the game. The game is called priston tale. What could possible be wrong? Do u know what is gameguard? Might it because of gameguard? :wink:
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, some games are designed to resist automation. If that is the case here, there might not be much you can do. But here is some info from a previous post:

If you're using Windows XP/2k/NT, you could try adding a $ in front of the hotkey definition to make a hook hotkey.

You could also try using joystick hotkeys and/or mouse hotkeys. But that won't help if the game blocks artificial input entirely (i.e. the Send command).

If that isn't suitable, there are some other topics that discuss this issue, and may be of help. They mention ControlSend and PostMessage:

http://www.autohotke...topic.php?t=560

http://www.autohotke...topic.php?t=506

PurpleApple
  • Members
  • 9 posts
  • Last active: Nov 10 2004 02:57 AM
  • Joined: 10 Sep 2004
:lol: thanks .. i read them all but i dont understand a thing. :? im not so good in programming...
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
If you have specific questions, we'll try to help.

Astaelan
  • Guests
  • Last active:
  • Joined: --
Chris,

This is more or less the same problem I am having, and from reading the forums it looks like it's a problem that keeps popping up quite a bit. I'd like to figure out this VxD stuff, but it looks like it's getting into assembly and that's way out of my expertise.

As it turns out, I do suffer from Carpel Tunel, and Tennis Elbow. I love to play these games, but after about 2 minutes of clicking repeatedly, my hands get sore. It would be nice if I could just turn on the macro to right click every 5 seconds for me. Unfortunately, it's proven to be a very difficult task, I hope we can make some headway on this issue somehow. Maybe there is a way without writing a VxD, to hook into the existing VMOUSE, and create a callback we can inject new events in? Same sort of approach with keyboard...

Wingfat
  • Members
  • 937 posts
  • Last active: Oct 14 2015 04:20 PM
  • Joined: 23 Aug 2004
can this game be run in a windowed mode? If so you should be able to get the scripts to work. But like Chris said the programers of the games are now makeing it so you cant use the automated programs to send keys to the game.
I have been useing AHK for City of Heroes and it works like a dream. Love that get pixel color function.