Jump to content

n2989

Members
  • Posts

    4
  • Joined

  • Last visited

n2989's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. That worked ..... Thankyou for your assistance. regards
  2. Hi The following produces some very strange results When reading from the ini file if the values are Start = 1 to end = 99 everything works as expected When reading from the ini file if the values are start = 100 to end = 255 everything works as exected When reading from the ini file if the values are Start = 1 to end = 100 if fails instantly. (only completes one loop) When NOT reading from the end value from the ini file and setting the end value to 100 in the code it works as expected HELP please ............. INIFile [GENERAL] NetRange=192.168.0. Start=90 End=100 CODE Global $IniFile = @ScriptDir & 'Scan.ini' Global $Start = IniRead($IniFile,'GENERAL','Start','') Global $End = IniRead($IniFile,'GENERAL','End','') Scan() Msgbox(0,'','Finished',10) Func Scan() $i= $start while $i <= $end Msgbox(0,'','Pass - ' & $i,3) $i = $i + 1 WEnd Msgbox(0,'','Fail',20) EndFunc
  3. #include <Array.au3> $IPADRESS = StringSplit(@IPAddress1,".") $Broadcast = $IPADRESS[1] & "." & $IPADRESS[2] & "." & $IPADRESS[3] & "." & "255" $String="" Dim $MACAddress[14] $MACAddress[0] = "00E08154F343" $MACAddress[1] = "000FEA46F77C" $MACAddress[2] = "000FEA38D5E1" $MACAddress[3] = "000FEA38D090" $MACAddress[4] = "00016CD6DB40" $MACAddress[5] = "001A4D74A1D1" $MACAddress[6] = "001A4D08C9D6" $MACAddress[7] = "000FEA38D42F" $MACAddress[8] = "000D61468AEB" $MACAddress[9] = "000FEAF5EC65" $MACAddress[10] = "0002E32322E3" $MACAddress[11] = "001485F17150" $MACAddress[12] = "000D61401AF8" $MACAddress[13] = "000FEAF1BD96" FOR $element IN $MACAddress WOL() Sleep(1000) ;MsgBox(0,"",$element,"") Next MsgBox(0,"","WOL Completed",10) Exit ; =================================================================== ; Functions ; =================================================================== ; Wake up on Lan Function (Open connection and broadcast to Lan) Func WOL() UDPStartUp() $connexion = UDPOpen($Broadcast,7) UDPSend($connexion, GenerateMagicPacket($element)) UDPCloseSocket($connexion) UDPShutdown() EndFunc ; This function convert a MAC Address Byte (e.g. "1f") to a char Func HexToChar($strHex) Return Chr(Dec($strHex)) EndFunc ; This function generate the "Magic Packet" Func GenerateMagicPacket($strMACAddress) $MagicPacket = "" $MACData = "" For $p = 1 To 11 Step 2 $MACData = $MACData & HexToChar(StringMid($strMACAddress, $p, 2)) Next For $p = 1 To 6 $MagicPacket = HexToChar("ff") & $MagicPacket Next For $p = 1 To 16 $MagicPacket = $MagicPacket & $MACData Next Return $MagicPacket EndFunc Assumes a broadcast address of 255 Uses an Array
  4. #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("01", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf WEnd DllClose($dll) You might try searching on _IsPressed. I think it is number 01 and 02 for the left and right mouse buttons
×
×
  • Create New...