mvriesen2004 Posted November 13, 2006 Share Posted November 13, 2006 (edited) Hi All, I am trying to write a script for a game I am playing. This game has a toolbar where if I type 1 to 9 I get skills activated on the main bar. If I type Shift-1 to Shift-9 I get skills activated on the 2nd toolbar (not the main toolbar). My question is how to send a LSHIFT -3 (for example) using the Send command and variables from the settings on a user interface: If GUICtrlRead($cbPotsUseShift) == 1 Then $chPotsShift = "{LSHIFT}" ;use a LSHIFT to access the pots when they are on the 2nd toolbar Else $chPotsShift = "" ;else access the pots on the main toolbar EndIf . . ;do other stuff in here . If TimerDiff($tPot1) > GUICtrlRead($tbPotCD1) OR $bFirstPots Then ;see if it is time to reuse a pot $sCmd = $chPotsShift & GUICtrlRead($tbPotKey1) ;BAD STUFF HAPPENS HERE Send($sCmd) Sleep(500+Random(20,60)) ;Wait for the key to get sent $tPot1 = TimerInit() ;restart the timer Sleep(2000) ;delay while the game uses the pot EndIf Edited November 13, 2006 by mvriesen2004 Link to comment Share on other sites More sharing options...
mvriesen2004 Posted November 13, 2006 Author Share Posted November 13, 2006 Bump Link to comment Share on other sites More sharing options...
lopolop Posted November 13, 2006 Share Posted November 13, 2006 like send("{LSHIFT}" & $Variable) Link to comment Share on other sites More sharing options...
mvriesen2004 Posted November 13, 2006 Author Share Posted November 13, 2006 like send("{LSHIFT}" & $Variable) oÝ÷ Ûú®¢×¡¶¬yÚ'Ê«r¦z{mç(uë'^´k¢øyÛ!¢é]Âä½êâµÚ²z-"ÚâyÛayú%"^²Úk¢ Ú©Ý©â·Ø^rê좸§¶ºÚMÊ'²^Â)Ý£áz¦ëb³Zkg¢Ú®¢Ðªê-êÞËayÊy«¢+ØÀÌØí¡A½ÑÍM¡¥ÐôÅÕ½Ðíí1M!%QôÅÕ½Ðì(ÀÌØí¡ ¡ÉÑÈôÅÕ½ÐíÅÕ½Ðì((ÀÌØíÍ µôÀÌØí¡A½ÑÍM¡¥ÐµÀìÀÌØí¡ ¡ÉÑÈí MQU!AA9L!I)M¹ ÀÌØíÍ µ¤)M±À ÔÀÀI¹½´ ÈÀ°ØÀ¤¤í]¥Ð½ÈÑ¡äѼÐ͹Ð)M¹ ÅÕ½Ðíí1M!%QôÅÕ½ÐìµÀìÀÌØí¡ ¡ÉÑȤ)M±À ÔÀÀI¹½´ ÈÀ°ØÀ¤¤í]¥Ð½ÈÑ¡äѼÐ͹РAnyone else have any ideas? What I am trying to do is allow the user to specify a keystroke from a GUI with checkboxes for Shift and Ctrl. Thus I can make various combinations of: Char, Shift-Char, Ctrl-Char, and Ctrl-Shift-Char based on the user's needs. Link to comment Share on other sites More sharing options...
lod3n Posted November 13, 2006 Share Posted November 13, 2006 Try this:$chPotsShift = "LSHIFT" $chCharacter = "a" Send("{" & $chPotsShift & " down}") Send($chCharacter) Send("{" & $chPotsShift & " up}") [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
mvriesen2004 Posted November 13, 2006 Author Share Posted November 13, 2006 Nope. This is a real nut buster. Here is the sample script I wrote using your suggestion: run ("notepad.exe") WinWaitActive("Untitled - Notepad") If WinExists("Untitled - Notepad") Then Send("How are you?") Send(@CRLF) $chPotsShift = "LSHIFT" $chCharacter = "a" Send("{" & $chPotsShift & " down}") Send($chCharacter) Send("{" & $chPotsShift & " up}") Send(@CRLF) Send("{LSHIFT}a") Sleep(500+Random(20,60)) ;Wait for the key to get sentaa Send(@CRLF) EndIf I still get lower case 'a' 'a'. Link to comment Share on other sites More sharing options...
mvriesen2004 Posted November 13, 2006 Author Share Posted November 13, 2006 I got it. See below: run ("notepad.exe") WinWaitActive("Untitled - Notepad") If WinExists("Untitled - Notepad") Then Send("How are you?") Send(@CRLF) $chPotsShift = "{LSHIFT}" $chCharacter = "a" Send($chPotsShift & "+" & $chCharacter) Send(@CRLF) Send("{LSHIFT}+a") Sleep(500+Random(20,60)) ;Wait for the key to get sentaa Send(@CRLF) EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted November 13, 2006 Developers Share Posted November 13, 2006 This is what you should use: Send("+a") 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...
mvriesen2004 Posted November 14, 2006 Author Share Posted November 14, 2006 This is what you should use: Send("+a") Yes. I know this is the hard coded approach. I was using a checkbox to to create alternative combinations of the shift, ctrl, and letter keys, so I need to dynamically create the Send string. I have what I need. Thanks!!! Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2006 Developers Share Posted November 14, 2006 Yes. I know this is the hard coded approach. I was using a checkbox to to create alternative combinations of the shift, ctrl, and letter keys, so I need to dynamically create the Send string. I have what I need. Thanks!!!Was only indicating that "{LSHIFT}" in Send("{LSHIFT}+a") doesn't do anything. 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...
mvriesen2004 Posted November 16, 2006 Author Share Posted November 16, 2006 Was only indicating that "{LSHIFT}" in Send("{LSHIFT}+a") doesn't do anything.Oh. Right. Thanks - i'm such a noob at this and the syntax is strange to a C++/Java programmer like myself. It seems more like VB.Thanks!!!!! 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