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 

Script for CS:S

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
alienwear
Guest





PostPosted: Sun Jul 06, 2008 9:28 pm    Post subject: Script for CS:S Reply with quote

I want a script that when i push (and hold) "g" it will press 4 then hold MOUSE 1 until g is released at which point MOUSE 1 will also be released. I don't have a clue where to start and would like help!
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 235
Location: Canada

PostPosted: Sun Jul 06, 2008 11:26 pm    Post subject: Reply with quote

something like this might work....

Loop,
GetKeyState, g, g
if g = D
{
Sleep, 1000
GetKeyState, g, g
if g = D
{
Send, 4
LButton = D
GetKeyState, g, g
if g = D
{
Continue
}
Else
Break,
}
}
_________________
http://www.spider-games77.piczo.com
Join the Elite few...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
alienwear
Guest





PostPosted: Mon Jul 07, 2008 10:00 am    Post subject: Reply with quote

When I run the script it states that the continue must be enclosed by a loop. Could you help?
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Mon Jul 07, 2008 9:45 pm    Post subject: Reply with quote

Code:

Loop,
{
  GetKeyState, g, g
  if g = D
  {
    Sleep, 1000
    GetKeyState, g, g
    if g = D
    {
      Send, 4
      LButton = D
      GetKeyState, g, g
      if g = D
      {
        Continue
       }
      Else
       Break,
    }
  }
}


I cannot support this code, just fixing syntax.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
300W



Joined: 12 Jan 2008
Posts: 24

PostPosted: Tue Jul 08, 2008 2:11 am    Post subject: Reply with quote

I'm just writing this from the top of my head, cba to check the manual atm...
Code:

g::
Send, 4
Click, d
Keywait, g
Click, u
Return


You will prolly like my version more than the other loop/sleep based one...
Back to top
View user's profile Send private message
alienwear
Guest





PostPosted: Wed Jul 09, 2008 8:55 am    Post subject: Reply with quote

Thanks everyone - both scripts work really well.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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