AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto right click - help pls..
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Fri Sep 10, 2004 8:07 am    Post subject: Auto right click - help pls.. Reply with quote

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.
Back to top
PurpleApple



Joined: 10 Sep 2004
Posts: 9

PostPosted: Fri Sep 10, 2004 8:10 am    Post subject: Reply with quote

erk.. that was me who post. i forgot to login. pls help~! Smile
_________________
I've got a purple apple.
One of its kind.
First of its kind.
Do you want to see?
Back to top
View user's profile Send private message
PurpleApple



Joined: 10 Sep 2004
Posts: 9

PostPosted: Fri Sep 10, 2004 9:06 am    Post subject: Reply with quote

#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?
Back to top
View user's profile Send private message
Candle



Joined: 19 Aug 2004
Posts: 326

PostPosted: Fri Sep 10, 2004 9:07 am    Post subject: Reply with quote

Code:
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 .
Back to top
View user's profile Send private message
PurpleApple



Joined: 10 Sep 2004
Posts: 9

PostPosted: Fri Sep 10, 2004 9:11 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
polyethene



Joined: 11 Aug 2004
Posts: 5248
Location: UK

PostPosted: Fri Sep 10, 2004 11:15 am    Post subject: Reply with quote

Here:

Code:
^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.

_________________
GitHubScriptsIronAHK Contact by email not private message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Sep 10, 2004 11:50 am    Post subject: Reply with quote

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:
Code:
#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
}
Back to top
View user's profile Send private message Send e-mail
PurpleAppple
Guest





PostPosted: Fri Sep 10, 2004 6:31 pm    Post subject: Reply with quote

as for the new code that u just posted, how do u stop the loop then?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Sep 10, 2004 7:59 pm    Post subject: Reply with quote

The same key both starts and stops the loop. In this example, its Win+Z.
Back to top
View user's profile Send private message Send e-mail
PurpleApple



Joined: 10 Sep 2004
Posts: 9

PostPosted: Mon Sep 13, 2004 12:34 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Mon Sep 13, 2004 12:52 am    Post subject: Reply with quote

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.autohotkey.com/forum/viewtopic.php?t=560

http://www.autohotkey.com/forum/viewtopic.php?t=506
Back to top
View user's profile Send private message Send e-mail
PurpleApple



Joined: 10 Sep 2004
Posts: 9

PostPosted: Mon Sep 13, 2004 1:05 am    Post subject: Reply with quote

Laughing thanks .. i read them all but i dont understand a thing. Confused 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?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Mon Sep 13, 2004 1:08 am    Post subject: Reply with quote

If you have specific questions, we'll try to help.
Back to top
View user's profile Send private message Send e-mail
Astaelan
Guest





PostPosted: Wed Sep 15, 2004 5:43 pm    Post subject: Reply with quote

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...
Back to top
Wingfat



Joined: 23 Aug 2004
Posts: 275
Location: East Bay, California USA

PostPosted: Wed Sep 15, 2004 6:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group