Kern Posted April 20, 2014 Share Posted April 20, 2014 Hello all, I am new to this forum and new to the world of AutoIt. Im reading stuff around on the forum for a while now and I find all this programming really interesting. Now since i don't have any programming background ( but got the feeling i understand it all quite fast what i read so far ) I want to make a plan of attack for learning. And i was wondering if u guys could help me a bit with it. Next week i will be at home again and then i want to start learning and playing with AutoIt. So my first step is too start with the tutorial Learning to script with AutoIt V3 from BrettF and go through the Wiki page more ( allready looked around for some time ) But what would be a good step after that.. tutorial and reading wise? I could also jump straight in the program and just play around and learn like this but i think its beter to follow some tutorials first and read so i got a solid base and then start playing. I don't have any plan yet on what kinda script(s) i want too make in the future but i think that will come by the time when your busy with this.. for now it's just to interesting for me and i like to learn new stuff Is it also possible to install the editor on a Android tablet? so i can bring it to my work ( its on sea ) and practice here in the future after my shifts. Thanks in advance guys Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2014 Moderators Share Posted April 20, 2014 Kern,First, welcome to the AutoIt forums. my first step is too start with the tutorial Learning to script with AutoIt V3 from BrettFAn excellent idea and exactly what I would have suggested - so consider yourself off to a good start! As you have no specific goal in view, I would suggest looking carefully at some of the example scripts in the Help file and changing them slightly to see if you get the result you think you should. That way you get a good feel for how the different parameters work. Then I would suggest choosing some of the forum threads that interest you and seeing how the problem was solved by the more experienced coders here - their code often shows some of the more interesting ways in which you can use AutoIt. As to using the editor on an Android tablet, I think you will find it very frustrating to be able to code but not to run the scripts. But there used to be an online compiler in the Examples section - perhaps that might help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Kern Posted April 20, 2014 Author Share Posted April 20, 2014 Thanks for your quick reply Melba23! That's a good one to look how the pro's are solving problems. Maybe i will even get my favorite coder When i'm at that point i will take a look in too the online compiler.. sounds very interesting though ( the coding behind it ) For now i just have to be patience because i got one more week to go on sea...Wish i could start haha Link to comment Share on other sites More sharing options...
Kern Posted April 29, 2014 Author Share Posted April 29, 2014 I read the whole Learning to script with AutoIt pdf, and it was very interesting and put together really well.. i think i need to read it again after a bit because it's alot of information to remember. Since i finished it i just couldn't resist it and i wanted to play a bit.. So i played around with Koda to make an GUI.. ( this works really well.. wow! ) But it looks so basic.. i wonder if u can make nicer graphics with it? So on the moment im stuck now with my Playing around to learn script. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Stick2Me = GUICreate("Stick2Me", 395, 196, 189, 123) $Home = GUICtrlCreateMenu("&Home") $Exit = GUICtrlCreateMenuItem("Exit", $Home) $About = GUICtrlCreateMenu("&About") $Abou = GUICtrlCreateMenuItem("About", $About) $Group1 = GUICtrlCreateGroup("Start", 6, 24, 129, 65) GUICtrlSetFont(-1, 12, 400, 0, "Cooper Black") GUICtrlSetBkColor(-1, 0x00FF00) $Button1 = GUICtrlCreateButton("F1", 16, 56, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Stop", 6, 111, 129, 65) GUICtrlSetFont(-1, 12, 400, 0, "Cooper Black") GUICtrlSetBkColor(-1, 0xFF0000) $Button2 = GUICtrlCreateButton("F3", 16, 144, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label1 = GUICtrlCreateLabel("Press F1 to Start.", 161, 24, 125, 17) $Label2 = GUICtrlCreateLabel("Press F3 to Stop.", 161, 111, 125, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd HotKeySet("{F1}","_Start") HotKeySet("{F3}","_Terminate") Func _Terminate() Exit 0 EndFunc Func _Start() While 1 MouseClick("left") WEnd EndFunc The problem i can't seem to solve on my own is how the heck i let the script start by using a Start hotkey ( is this even possible? ) but also on the same time let a click on a button start the script. ( I can't see what i did wrong, with this use of the help file and tutorial this should be right . ) I couldnt come up with a script for it yet ( got to go step by step else it will get to messy ) so i just made it a simple mousclick.. it's just playing and learning anyhow. I don't know if my Stop hotkey works because i cant start the script haha. I feel so noobish, but yet this is so much fun and too interesting. I hope someone can give me a push in the right direction. Thanks. Link to comment Share on other sites More sharing options...
BrewManNH Posted April 29, 2014 Share Posted April 29, 2014 Your HotKeySet commands are after the While loop, so they're never activated. Put them at the top of your script. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Kern Posted April 29, 2014 Author Share Posted April 29, 2014 Your HotKeySet commands are after the While loop, so they're never activated. Put them at the top of your script. Thanks for the fast reply! Can't beleave it was such an easy solution haha. Now i can confirm that the Stop hotkey works aswell. Only it closes the whole GUI instead of just stopping the script. Next challenge Link to comment Share on other sites More sharing options...
BrewManNH Posted April 29, 2014 Share Posted April 29, 2014 The Exit keyword tells the script to exit, stop running. So when you run the terminate function, the script closes. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Kern Posted April 30, 2014 Author Share Posted April 30, 2014 (edited) Morning, Yeah i understand that mate, so as a solution for this i thinki have to change the exit function in too a Pause function. Atleast thats my plan.. i go try to make it and see what happens, ill keep you updated. *update* Awesome! Pause function made it work.. this is really cool everytime overcome a "problem/issue" and learn from it. wonder where i will be in 1 year haha. There is a "bug" though.. because when the script is running and i press any button it makes the script go stuck,and i cant do anything anymore except for smashing F3 ( pause ) few times then it stops or ESC ( terminate whole script ) So example : Script is running and type something it freezes .. even if i just press Shift button or something.. any button. Is this normall? i thought u could just use your computer normally when a script is running ( except for the hotkeys u set because they will activate/deactivate something in your script ) Edited April 30, 2014 by Kern Link to comment Share on other sites More sharing options...
Palestinian Posted April 30, 2014 Share Posted April 30, 2014 With the script you made I don't believe you can use the computer at all, unless you changed it to do something else beside spamming the left mouse button, I ran the script and started typing, nothing froze, the script kept clicking my mouse's left click and of course marking everything I write which gets overwritten To use the buttons to call functions you need to add 'cases' for them inside the GUI loop While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Call("_Start") Case $Button2 Call("_Terminate") EndSwitch WEnd Link to comment Share on other sites More sharing options...
Kern Posted May 1, 2014 Author Share Posted May 1, 2014 Sorry for the late respond, was really busy yesterday. When i do nothing the script runs perfect but when im in a programm ( i tried Firefox,words,excel ) and the script is running and i press one button ( not one of the hotkeys ) then the script freezes and i have to terminate it and restart it. I dont know if its possible because i just woke up and just came with the idea.. but seems like i need to give keys a function that u can press/hold it and it wont interupt the script ( cliking the mouse ) Thanks for the info about the buttons. I did manage that myself yesterday aswell.. wasnt so hard first time using case tho for me. I really like this way of learning/playing around for myself because you come along alot of problems and they need to be solved. So in the future if i would write a real script and i come across same kind of problems it will be easily regonized and fixed 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