Jump to content

Simplifying code...


JScript
 Share

Recommended Posts

How could I become a part of a script more simple and efficient?

Example:

Func _BroadcastMsg($sMessage = "", $sSendID = "#SendMsg", $iPort = -1, $lAllCmp = False)
    If $iPort = -1 Then $iPort = $iMsgPort

    For $i = 1 To $aCmpList[0][0]
        If $aCmpList[$i][3] = 10 Or $aCmpList[$i][1] = @ComputerName Then ContinueLoop
        If $lAllCmp = False Then
            If $aCmpList[$i][3] = 4 Or $aCmpList[$i][3] = 5 Or $aCmpList[$i][3] = 10 Or $aCmpList[$i][1] = @ComputerName) Then ContinueLoop
        EndIf
        _AdlibEnable("_SendMsg", $aCmpList[$i][1] & "|" & $iPort & "|" & $sMessage & "|" & $sSendID, 1000, 1)
    Next
EndFunc   ;==>_BroadcastMsg

Thanks to whoever can help me.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

Your $aCmpList[$i][3] = 10 Or $aCmpList[$i][1] = @ComputerName has already been checked, so don't repeat it inside the If $lAllCmp = False part.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...