tqt129 Posted November 9, 2006 Share Posted November 9, 2006 I am trying to make a simple game. What i want is when evertime someone hit "w" it would set point to 100 and play the soundfile and also increment the points and display them as i hit "w". also like to add more condition to if someone hit "w" more than 3 times, it would play a different sound file, like tripple combo for 3 hits in a roll. etc #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 ;Sleep ( 250 ) If _IsPressed("57", $dll) Then SoundPlay("headshot.mp3",0) EndIf WEnd DllClose($dll) Link to comment Share on other sites More sharing options...
Developers Jos Posted November 9, 2006 Developers Share Posted November 9, 2006 ...and the question is ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
tqt129 Posted November 9, 2006 Author Share Posted November 9, 2006 ...and the question is ?ah darn it, left that out. how do you do the counting part =). Link to comment Share on other sites More sharing options...
Paulie Posted November 10, 2006 Share Posted November 10, 2006 Like This? #include <Misc.au3> Global $points = 0 While 1 ToolTip("Points: "&$Points, 0, 0) Sleep(100) If _IsPressed("57") Then $Points = $Points + 100 ToolTip("Points: "&$Points, 0, 0) EndIf WEnd Would be alot cleaner if you used HotKeySet() Link to comment Share on other sites More sharing options...
Jabberwock Posted November 10, 2006 Share Posted November 10, 2006 depends on what 57 is, a lot of the keys on the keyboard are not available with hotkeyset as far as I know, i'd really like to see a full list my self Link to comment Share on other sites More sharing options...
Paulie Posted November 10, 2006 Share Posted November 10, 2006 depends on what 57 is, a lot of the keys on the keyboard are not available with hotkeyset as far as I know, i'd really like to see a full list my self57 is "w", and that is available with hotkeysetthe only disadvantage is that hotkeyset would steal the key from other uses, so it wouldn't actually send "w" Link to comment Share on other sites More sharing options...
tqt129 Posted November 12, 2006 Author Share Posted November 12, 2006 Like This? #include <Misc.au3> Global $points = 0 While 1 ToolTip("Points: "&$Points, 0, 0) Sleep(100) If _IsPressed("57") Then $Points = $Points + 100 ToolTip("Points: "&$Points, 0, 0) EndIf WEnd Would be alot cleaner if you used HotKeySet() I dont think the ToolTip("Points: "&$Points, 0, 0) do anything for me. is there a way to show the counts actively? maybe a GUI or something. also the key ID you can find in your help file if you search for ispressed. Link to comment Share on other sites More sharing options...
AzKay Posted November 12, 2006 Share Posted November 12, 2006 Or more like this? #include <Misc.au3> Global $Points While 1 ToolTip("Points: " & $Points, 0, 0) Sleep(100) If _IsPressed("57") Then $Points += 1 If $Points = 1 Then ;PlaySound HeadShot ConsoleWrite("HeadShot" & @CRLF) ElseIf $Points = 2 Then ;PlaySound Double Kill ConsoleWrite("Double Kill" & @CRLF) ElseIf $Points = 3 Then ;PlaySound Un Stoppable ConsoleWrite("Un Stoppable" & @CRLF) EndIf EndIf WEnd # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
tqt129 Posted November 12, 2006 Author Share Posted November 12, 2006 Or more like this? #include <Misc.au3> Global $Points While 1 ToolTip("Points: " & $Points, 0, 0) Sleep(100) If _IsPressed("57") Then $Points += 1 If $Points = 1 Then ;PlaySound HeadShot ConsoleWrite("HeadShot" & @CRLF) ElseIf $Points = 2 Then ;PlaySound Double Kill ConsoleWrite("Double Kill" & @CRLF) ElseIf $Points = 3 Then ;PlaySound Un Stoppable ConsoleWrite("Un Stoppable" & @CRLF) EndIf EndIf WEnd need umm to reset counter if any other is press heh Link to comment Share on other sites More sharing options...
bigassmuffin Posted November 12, 2006 Share Posted November 12, 2006 (edited) need umm to reset counter if any other is press heh #include <Misc.au3> Global $Points While 1 ToolTip("Points: " & $Points, 0, 0) Sleep(100) If _IsPressed("57") Then $Points += 1 If $Points = 1 Then ;PlaySound HeadShot ConsoleWrite("HeadShot" & @CRLF) ElseIf $Points = 2 Then ;PlaySound Double Kill ConsoleWrite("Double Kill" & @CRLF) ElseIf $Points = 3 Then ;PlaySound Un Stoppable ConsoleWrite("Un Stoppable" & @CRLF) ElseIf $Points < 1 or $Points >3 Then Consolewrite("whatever" & @CRLF) EndIf EndIf WEnd oÝ÷ ØêÜj{X¢èìº×hjëh×6 Else Consolewrite("whatever" & @CRLF) ? Edited November 12, 2006 by bigassmuffin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now