Rabbitman Posted December 15, 2010 Share Posted December 15, 2010 (edited) I am soooo close to finishing, but then one thing is wrong. EDIT: FIRST PROBLEM SOLVED! SECOND PROBLEM: NOT SOLVED! DETAILS: So here is my code (edited: expandcollapse popupHotKeySet("{Esc}", "ExitProg") HotKeySet("{F3}", "StartStop") HotKeySet("{PAUSE}", "Click") Dim $On, $click $click = False $On = False While 1 If $click = True Then MouseClick("left") EndIf If $On = True Then Send("{Z down}") Sleep(10) Send("{Z up}") Sleep(10) EndIf WEnd Func StartStop() If $On = False Then $On = True Else $On = False EndIf EndFunc Func Click() If $click = False Then $click = True Else $click = False EndIf EndFunc Func ExitProg() Exit 0;;Exits the program EndFunc Now i want to add in a message box: While 1 $msg = GUIGetMsg() If $msg = $Button2 Then MsgBox(0, 0, 'Read The Help File.') EndIf WEnd Question is, where do i put messagebox? Rabbitman~~~~~~ Edited December 16, 2010 by Rabbitman Link to comment Share on other sites More sharing options...
Zedna Posted December 15, 2010 Share Posted December 15, 2010 Don't create new topics for the same thing! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
LurchMan Posted December 15, 2010 Share Posted December 15, 2010 (edited) I can't test it for you but try this: expandcollapse popupHotKeySet("{Esc}", "ExitProg") HotKeySet("{F3}", "StartStop") HotKeySet("{PAUSE}", "Click") Dim $On, $click $click = False $On = False While 1 If $click = True Then MouseClick("left") EndIf If $On = True Then Send("{Z down}") Sleep(10) Send("{Z up}") Sleep(10) EndIf WEnd Func StartStop() If $On = False Then $On = True Else $On = False EndIf EndFunc Func Click() If $click = False Then $click = True Else $click = False EndIf EndFunc Func ExitProg() Exit 0;;Exits the program EndFunc Edited December 15, 2010 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
shanet Posted December 15, 2010 Share Posted December 15, 2010 I am soooo close to finishing, but then one thing is wrong. Look: expandcollapse popupHotKeySet("{Esc}", "ExitProg") HotKeySet("{F3}", "StartStop") HotKeySet("{PAUSE}", "Click") Func ExitProg() Exit 0;;Exits the program EndFunc Dim $On, $click $click = False $On = False Func Click() If $click = False Then $click = True Else $click = False EndIf EndFunc While True If $click = True Then MouseClick("left") EndIf WEnd Func StartStop() If $On = False Then $On = True Else $On = False EndIf EndFunc While True If $On = True Then Send("{Z down}") Sleep(10) Send("{Z up}") Sleep(10) EndIf WEnd SO in that code, i have 3 hotkeys, Esc., F3 and Pause. F3 presses Z, Pause clicks, and Esc. exits. Now exit part works, but sadly only one hotkey seems to be working. I have tried moving things around and such but i cant seem to get it right. I would greatly appreciate help as this needs to be completed soon. Rabbitman~~~~~~ Would the exit part be completing straight away? Try this: expandcollapse popupHotKeySet("{Esc}", "ExitProg") HotKeySet("{F3}", "StartStop") HotKeySet("{PAUSE}", "Click") Func ExitProg() Exit 0;;Exits the program EndFunc Dim $On, $click $click = False $On = False While 1 ;No difference, I just use a 1 instead of true. If $click = True Then MouseClick("left") EndIf If $On = True Then Send("{Z down}") Sleep(10) Send("{Z up}") Sleep(10) EndIf WEnd ;If you want these scripts to run at the same time, which I believe is what you want, you must include them in the same when statement. ;However this means it will not be constantly clicking, your best bet would be to run another script handling the clicking. Func Click() If $click = False Then $click = True Else $click = False EndIf EndFunc Func StartStop() If $On = False Then $On = True Else $On = False EndIf EndFunc I hope that all works for you. shanet [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
JohnOne Posted December 15, 2010 Share Posted December 15, 2010 Your StartStop function just checks and sets some variables, I dont see a send in it, and also your secong while loop will never be entered into, unless true somehow = false AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Rabbitman Posted December 15, 2010 Author Share Posted December 15, 2010 Lurchman you are a god! Thank you it works perfecttt! Link to comment Share on other sites More sharing options...
Rabbitman Posted December 15, 2010 Author Share Posted December 15, 2010 Thanks for your quick help! I got it to work Link to comment Share on other sites More sharing options...
Rabbitman Posted December 15, 2010 Author Share Posted December 15, 2010 Ok new problem i cant add in a button where would i put it? Here is code for my button While 1 $msg = GUIGetMsg() If $msg = $Button2 Then MsgBox(0, 0, 'Read The Help File.') EndIf WEnd I put it at the top it works but hotkeys dont. I put it at the bottom hotkeys work but buttons dont... Link to comment Share on other sites More sharing options...
Zedna Posted December 15, 2010 Share Posted December 15, 2010 MsgBox(0, 0, 'Read The Help File.') Yes. You are right. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Rabbitman Posted December 15, 2010 Author Share Posted December 15, 2010 Haha very funny but I don't think it will give exact directions on where to put it... Link to comment Share on other sites More sharing options...
Rabbitman Posted December 16, 2010 Author Share Posted December 16, 2010 Edited 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