Jump to content
Sign in to follow this  

Simplifying code...

Recommended Posts


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


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
        _AdlibEnable("_SendMsg", $aCmpList[$i][1] & "|" & $iPort & "|" & $sMessage & "|" & $sSendID, 1000, 1)
EndFunc   ;==>_BroadcastMsg

Thanks to whoever can help me.

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

Somewhere Out ThereJames Ingram


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

Share this post

Link to post
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

Share this post

Link to post
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
Sign in to follow this