AutoHotkey Community

It is currently May 27th, 2012, 6:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: September 10th, 2004, 9:07 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 9:10 am 
Offline

Joined: September 10th, 2004, 6:47 am
Posts: 9
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 10:06 am 
Offline

Joined: September 10th, 2004, 6:47 am
Posts: 9
#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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 10:07 am 
Offline

Joined: August 19th, 2004, 10:53 pm
Posts: 326
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 .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 10:11 am 
Offline

Joined: September 10th, 2004, 6:47 am
Posts: 9
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 12:15 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 12:50 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 7:31 pm 
as for the new code that u just posted, how do u stop the loop then?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2004, 8:59 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The same key both starts and stops the loop. In this example, its Win+Z.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2004, 1:34 am 
Offline

Joined: September 10th, 2004, 6:47 am
Posts: 9
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2004, 1:52 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2004, 2:05 am 
Offline

Joined: September 10th, 2004, 6:47 am
Posts: 9
: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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2004, 2:08 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
If you have specific questions, we'll try to help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2004, 6:43 pm 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2004, 7:34 pm 
Offline

Joined: August 23rd, 2004, 10:06 pm
Posts: 276
Location: East Bay, California USA
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, hd0202, Yahoo [Bot] and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group