Jump to content

How can I compress this


Recommended Posts

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

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

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

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

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

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

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

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) ;Yellow

label 1 ;yellow

label 2 ;yellow

GUICtrlSetDefBkColor0xFF0000) ;Red

label 3 ;Red

label 4 ;Red

GUICtrlSetDefBkColor(0xFFFF00) ;Yellow

label 5 ;yellow

label 6 ;yellow

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...