rcmaehl Posted August 7, 2011 Share Posted August 7, 2011 Any ways I can reduce the lines of code on this? 1500+ is a lot of code and I'm sure there's some redundant code. I had to pastebin it because the code was too big. http://pastebin.com/eUViaNNQ My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Rogue5099 Posted August 7, 2011 Share Posted August 7, 2011 Something simple instead of all the GUICtrlSetBKColor: GUICtrlSetDefBkColor(0xFFFFFF) Use a Loop for your Labels: $ypos = 10 For $i = 65 to 90 $ypos = $ypos + 15 GUICtrlCreateLabel(Chr($i) & ":\", 10, $ypos) Next Just use more loops like this also could create Arrays for drives My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
rcmaehl Posted August 7, 2011 Author Share Posted August 7, 2011 Something simple instead of all the GUICtrlSetBKColor: GUICtrlSetDefBkColor(0xFFFFFF) Use a Loop for your Labels: $ypos = 10 For $i = 65 to 90 $ypos = $ypos + 15 GUICtrlCreateLabel(Chr($i) & ":\", 10, $ypos) Next Just use more loops like this also could create Arrays for drives Thanks a lot. Any other recommendations? My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
rcmaehl Posted August 7, 2011 Author Share Posted August 7, 2011 Quick question, how to I set the BkColor back to default using GUICtrlSetDefBkColor()? My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
martin Posted August 7, 2011 Share Posted August 7, 2011 Thanks a lot. Any other recommendations?I think the main thing is to learn to use arrays. They can save you a lot of time writing a script and maintaining it as well as making it easier to read. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Rogue5099 Posted August 7, 2011 Share Posted August 7, 2011 Quick question, how to I set the BkColor back to default using GUICtrlSetDefBkColor()?Yes in script everything after GUICtrlSetDefBkColor() will be that default so GUICtrlSetDefBkColor(0xFFFF00) ;Yellowlabel 1 ;yellowlabel 2 ;yellowGUICtrlSetDefBkColor0xFF0000) ;Redlabel 3 ;Redlabel 4 ;RedGUICtrlSetDefBkColor(0xFFFF00) ;Yellowlabel 5 ;yellowlabel 6 ;yellow My projects: Inventory / Mp3 Inventory, Computer Stats 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