Fossil Rock Posted March 16, 2006 Share Posted March 16, 2006 This code runs wild on the last case statement. Can someone tell me why? #include <misc.au3> HotKeySet("{ESC}", "exit") While 1 Select Case _IsPressed (Hex(96)) = 1 Send("Text A {enter}") Case _IsPressed (Hex(97)) = 1 Send("Text B {enter}") Case _IsPressed (Hex(98)) = 1 Send("Text C {enter}") Case _IsPressed (Hex(99)) = 1 Send("Text D {enter}") EndSelect WEnd Func exit() Exit EndFunc Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
nfwu Posted March 16, 2006 Share Posted March 16, 2006 Try putting a Sleep(100) in there. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Fossil Rock Posted March 16, 2006 Author Share Posted March 16, 2006 Tried several in different locations but..... haven't found the magic yet. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
nfwu Posted March 16, 2006 Share Posted March 16, 2006 #include <misc.au3> HotKeySet("{ESC}", "exit") While 1 Select Case _IsPressed (Hex(96)) = 1 Send("Text A {enter}") Case _IsPressed (Hex(97)) = 1 Send("Text B {enter}") Case _IsPressed (Hex(98)) = 1 Send("Text C {enter}") Case _IsPressed (Hex(99)) = 1 Send("Text D {enter}") EndSelect Sleep(100) WEnd Func exit() Exit EndFunc This better? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Fossil Rock Posted March 16, 2006 Author Share Posted March 16, 2006 Done that and in all the other logical locations. Run the code to see what happens. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
nfwu Posted March 16, 2006 Share Posted March 16, 2006 Global $DllUser32 = DllOpen('user32') While 1 Sleep ( 10 ) If _IsPressed(0x30) Then Send("Text A {enter}") ENdif If _IsPressed(0x31) Then Send("Text B {enter}") ENdif If _IsPressed(0x32) Then Send("Text C {enter}") ENdif If _IsPressed(0x33) Then Send("Text D {enter}") EndIf WEnd ;DllClose($dll) Func _IsPressed($hexKey) Local $aR $aR = DllCall($DllUser32, "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then Return 1 Else Return 0 EndIf EndFunc This works, for some reason... 0Text A ,1Text B ,2Text C ,3Text D on the numerical strip on the top o you keyboard. 0Text A 1Text B 2Text C 3Text D I seem to still have my test on!Text B ... #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
cdkid Posted March 16, 2006 Share Posted March 16, 2006 instead of 0x30 try just _IsPressed('30') ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Fossil Rock Posted March 16, 2006 Author Share Posted March 16, 2006 Still runs wild.... does it not run keep typing the text for you when you press just one key or no key at all ? Agreement is not necessary - thinking for one's self is! 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