BuddyBoy Posted February 25, 2007 Share Posted February 25, 2007 (edited) Noob question... How do you do like, if CTRL+C is pressed on a certain coord, it will remember that coord and then start the other coding after ctrl+c is pressed? Any help be great, ty EDIT: Its kinda unclear there... I want it to record the mouse position once ctrl+c is pressed, then to activate the coding. Edited February 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
phantom Posted February 25, 2007 Share Posted February 25, 2007 (edited) See if this works for you #include <Misc.au3> Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43"),$pos[0] = 311,$pos[1] = 132) ;stuff you want it to do change 311 and 132 to the coords you wanted. Edited February 25, 2007 by phantom Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 I dont think thats what i want... Maybe you can explain it? But i want the user to be able to move there mouse to anywhere on the screen, press ctrl+c, it records that position they are at with the mouse, then does the coords.... "change 311 and 132 to the coords you wanted. " That means a specific coordinate doesnt it? Link to comment Share on other sites More sharing options...
veldrinn Posted February 25, 2007 Share Posted February 25, 2007 See if this works for you #include <Misc.au3> Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43"),$pos[0] = 311,$pos[1] = 132) ;stuff you want it to do oÝ÷ Ûú®¢×¯'!jx"ªºTØ¥+@42¦·¬±çjºuÖ«¨´ë,yÚ®¢Þ7ªê-Ó~©¢Í Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 O, thank you guys. It works fine, but i got a question, so my knowledge of AutoIt increases more What does the... Until BitAND (_ISpressed("11"),_IsPressed("43")) what does the numbers in there mean? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 25, 2007 Moderators Share Posted February 25, 2007 (edited) O, thank you guys. It works fine, but i got a question, so my knowledge of AutoIt increases more What does the...Until BitAND (_ISpressed("11"),_IsPressed("43"))what does the numbers in there mean?If you look at the _IsPressed() function in the help file, it will show the hex values it needs for the keys it represents. Edited February 25, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 (edited) well i ran into more problems, that maybe you guys can help me solve? expandcollapse popupIf BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0,"(blah)", 10) Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43")) While 1 MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) MouseClick("right") Sleep(600) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) WEnd EndIf The other coding is at top of script, but i have 2 questions... 1. I tried putting send('{ctrldown}') right at begining of the while 1, and it wouldnt do it... 2. Is there anyway i can put in MouseClick("right", -the corrds of the ctrl+c-) <--- I want all 11 of those mouse clicks to click on the coords of the ctrl+c... any ideas? Thanks if you can once again help me EDIT: Thanks smoke, ill check that out now Edited February 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 Sry to bump, but it got a page back, and i really would appreciate some help please Link to comment Share on other sites More sharing options...
Paulie Posted February 25, 2007 Share Posted February 25, 2007 2. Is there anyway i can put in MouseClick("right", -the corrds of the ctrl+c-) <--- I want all 11 of those mouse clicks to click on the coords of the ctrl+c... any ideas?Every place you put this: MouseClick("right")oÝ÷ Ù©§Ü"¶aÆ®¶sdÖ÷W6T6Æ6²gV÷C·&vBgV÷C²Âb33c·÷5³ÒÂb33c·÷5³Òà then it will click at those coords. Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 (edited) Every place you put this: MouseClick("right")oÝ÷ Ù©§Ü"¶aÆ®¶sdÖ÷W6T6Æ6²gV÷C·&vBgV÷C²Âb33c·÷5³ÒÂb33c·÷5³Òà then it will click at those coords. I knew it had something to do with pos something, didnt know for sure tho, thanks man... but i keep trying to put Send('{CTRLDOWN}') and begining of the while 1 and it wont hold it down while it does the mouse clicks? any idea it wont work? EDIT: Now i got the ctrl+c working but this is what i have for the ctrldown, and it wont seem to hold ctrldown the whole while 1.... expandcollapse popupIf BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0,"blah", 10) Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43")) While 1 Send('{CTRLDOWN}');<---- right here, this wont seem to work :( MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) WEnd EndIf Edited February 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 (edited) Hmm, i think i might have figured out, just have little problem.... expandcollapse popupIf BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0,"blah", 10) Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43")) While 1 Func ctrl () ----- says it has no matching EndFunc, but i do... (I did declare it with kotkeyset, its just at top of script....) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) EndFunc;----------says this doesnt match with the Func ctrl () WEnd EndIf Edited February 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
Shevilie Posted February 25, 2007 Share Posted February 25, 2007 You cant have a func inside a while loop.. not like that Just remove the 2 func lines Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 Read my other thread above this one, the ctrldown wont work in almost any way Link to comment Share on other sites More sharing options...
Shevilie Posted February 25, 2007 Share Posted February 25, 2007 Well the func there wont do you any good Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Shevilie Posted February 25, 2007 Share Posted February 25, 2007 Try this simple script and see if it writes test where the marker is ClipPut("Test") Send("{CTRLDOWN}") Send("v") Send("{CTRLUP}") Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 25, 2007 Author Share Posted February 25, 2007 Just look at my thread in general help CTRLDOWN... theres many errors that wont work with MY script Link to comment Share on other sites More sharing options...
veldrinn Posted February 26, 2007 Share Posted February 26, 2007 This should work. expandcollapse popupIf BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0,"blah", 10) Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43")) While 1 Send("{ctrldown}") MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send("{ctrlup}") WEnd EndIf Link to comment Share on other sites More sharing options...
BuddyBoy Posted February 26, 2007 Author Share Posted February 26, 2007 This should work. expandcollapse popupIf BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0,"blah", 10) Do Sleep (100) $pos = MouseGetPos () Until BitAND (_ISpressed("11"),_IsPressed("43")) While 1 Send("{ctrldown}") MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) MouseClick("right",$pos[0],$pos[1],1) Sleep(600) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send('{F1}') Sleep(11000) Send('{F8}') Sleep(100) Send("{ctrlup}") WEnd EndIf thanks for trying, but no it didnt work Link to comment Share on other sites More sharing options...
veldrinn Posted February 28, 2007 Share Posted February 28, 2007 (edited) ooooh, I don't think you can do If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then.This should work:If GUICtrlRead($Checkbox_2) = $GUI_CHECKED Then By the way, is this part of an automization script for a game? Edited February 28, 2007 by veldrinn Link to comment Share on other sites More sharing options...
Helge Posted February 28, 2007 Share Posted February 28, 2007 ooooh, I don't think you can do If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then.Oh ? Well, it looks awfully similar to what's used in the example for GUICtrlCreateRadio. 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