AoRaToS

s!mpL3 LAN Messenger

236 posts in this topic




I am working on something very similar, but am not nearly as far as you are. Any chance you will be releasing the source? If not, no worries and keep up the good work.

Share this post


Link to post
Share on other sites

I tried this with my brother. Everytime I hovered over his name.. a tooltip came up,. Regardless, when I attempted to double click (beating the tooltip showing up), nothing would happen.


[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for your feedback!I won't release the source code yet but I will gladly help if you need anything with your script and I can give some parts of the code if requested...

Javascript_Freek I fixed the tooltip part, It's supossed to NOT show now so it will probably work fine for you now, I had that problem in the past on some computers and I thought I'd fixed it...I've changed the attached file to the corrected one, if anyone has any other problems let me know!

Also, I haven't tried this on Windows Vista so I don't know if it'll work... I've used it on Windows XP Professional SP2 and SP3...

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

Maybe it's cause I'm on Windows Vista! :)

I shall let you back with my info on the new version.


[center]Cookyx.com :: Simple LAN Chat[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I have changed the attached file, it's now version 2.4

FIXED

Clears the list from clients that may close the program by not using File -> Exit or their network connection has a problem(Every 5 mins. In the next version it will be in the options to choose)

ADDED:

A handy view of which networks you are connected to, what IP's you have and how many users are connected on each of those networks.

Many more things to be added soon...

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

New attachment added: Version 2.5

Corrected bug: #2 from the list above, now all open windows are hidden when you press hide and re-appear when you un-hide!

Awesome script! Looks like you put quite a bit of work into this one... :unsure:

P.S. Happy B-day! :P

Thanks allot my friend!!!

Great day yesterday :D

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

I found a bug with the network view when connected to more than one network, also something I'd forgotten about in the duplicate Username check so now it reacts as it should. Same version number. I just changed the attached file with the errors corrected so GRAB It. Version will only change if I add/improve a few important things.


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

New bug found and corrected.

Bug: When you had open conversation windows and the user you were talking to disconnected, if you "HIDE" those windows wouldn't hide, now they do, works for chat windows also. Same happened if you had the program "HIDDEN" and someone sent you something and disconnected then if you "UNHIDE" you wouldn't get what was sent.:P

Also added a notification when you press disconnect and have open conversation windows, if you press yes the windows will close and you will be disconnected.If you press no the notification will close, the windows will stay open and you won't be disconnected.

I will also add an option to close that notification and have a default action set for it.(Later version)

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I have updated the attachment. Many minor bugs fixed.

Next version will be a major release, not a BETA, with Options fixed and more...

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

Very Nice program, works like a charm in Vista x84.


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Glad you like it!!

It's an ongoing project so there is much more to come...!

[i believe you mean Vista x86] :P

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

[i believe you mean Vista x86] :unsure:

Yeah that too :P


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I thought of some bug that probably exists and just tested it, I was right but I don't have the code available at the moment, not until I go home later, so I'll fix it then and update the attachment. Be sure to download it and use that instead of the one you have now cause this bug can make LAN Talk crash, so someone on your network can lead everyone to a LAN Talk crash...

[EDIT]: Also removed the attachment so that noone else gets the bugged version.

Stay tuned for the update...

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

Ok I have updated the attachment in the first post!!!

It's version 2.6 now.

The Bug was in the Username, I'd forgotten to limit the use of ":" and blanks. Use of ":" in the username would lead to a crash If you sent anything to anyone and to everyone at once if it was a chat message.

Use of blanks in the username wouldn't create any problem but it is annoying some times...

GET IT HERE


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

I have updated the attachment with version 2.7!

Check out the options... I have fixed them a bit, some are still under construction and more are on the way.

In options menu:

1. Start with windows doesn't work yet

2. Username doesn't work yet

3. Auto-refresh time doesn't work yet

The rest do work but still need tweaking and some changes, still haven't decided about all the options...


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Version 2.8

1. Effects removed for now, if you want them let me know!All other options fully working. (Start with Windows, Auto connect, Change username, Auto-refresh time)

2. Also added some extra functionality to make the program more aware, so If there is a connection change (network adapter disabled, connection to a new network, IP change etc) any change will be shown. If you are not connected and there is an IP change, the new IP will change in the Connections Box, If a network adapter is disconnected it will be shown there. If those changes happen while you are connected you will be notified. The program checks for changes at every automatic refresh when you are connected.

The best setting for automatic refresh is probably any setting above 10 seconds, you can set it lower but note that for the about 100ms - 500ms that it takes to complete receiving other messages will be paused. I use a 1 minute delay and sometimes 5 minutes.

3. Different compressor used which compresses the .exe further so it's smaller in size. For UPX version please contact me

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

thanks!


mouse not found....scroll any mouse to continue.

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

  • Similar Content

    • ModemJunki
      By ModemJunki
      Hello,
      In Windows 10 PowerShell, one can do this to change the metric for a NIC in Windows 10:
      Get-NetAdapter | Where-Object -FilterScript {$_.InterfaceAlias -Eq "Ethernet 2"} | Set-NetIPInterface -InterfaceMetric 2 I know I can script the above PowerShell line (and it works!), but I wanted to try something I hadn't done before after looking into jguinch's most excellent Network configuration UDF. I wanted to make use of the SetIPConnectionMetric method in the WMI classes. There is an example VBscript here but this is not for Windows 10. Using AutoIT would also give better control over capturing error return codes than with PowerShell.
      But I cannot get my script to work! The return from SetIPConnectionMetric() is 0, which would indicate success. Yet the change does not happen. I also tried WMI methods using .put_ but this fails.
      Anyone more experienced than I have ideas to make this work?
      #RequireAdmin _SetNicInterfaceMetric2("Ethernet 2", "2") Func _SetNicInterfaceMetric2($NIC_NAME, $METRIC) Local $s_setIndx = 0 $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & "." & "\root\cimv2") $colNICItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID = '" & $NIC_NAME & "'", "WQL") If IsObj($colNICItems) Then For $objItem In $colNICItems $s_nicIndex = $objItem.Index Next ConsoleWrite("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE Index = '" & $s_nicIndex & "'" & @CRLF) $colNAC = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE Index = '" & $s_nicIndex & "'", "WQL") If IsObj($colNAC) Then For $objNetCard In $colNAC If $METRIC <> $objNetCard.IPConnectionMetric Then ConsoleWrite("Metric was set to " & $objNetCard.IPConnectionMetric & ". Setting to " & $METRIC & "." & @CRLF) $s_isSet = $objNetCard.SetIPConnectionMetric($METRIC) ConsoleWrite("SetIPConnectionMetric Result = " & $s_isSet & @CRLF) Else ConsoleWrite("Metric is already set to " & $METRIC & @CRLF) EndIf Next EndIf EndIf EndFunc ;==>_SetNicInterfaceMetric2  
    • harvester2001
      By harvester2001
      Hi
      I need your help I need create broadcast text message/notification to multiple lan clients. I can install listener program on pc its not a problem.
      But I don`t know how to start, could somebody write me example script how broadcast script and client who listen non stop for message should look like.
      I try to find example on forum but I have problem to understand those scripts.
      Many thx for help.
    • rcmaehl
      By rcmaehl
      A UDF to connect to IRC using TCP Functions, as well as perform actions once connected.
      WANTED: Technical Writer able to create / maintain a helpfile (.chm) using the Autoit helpfile layout for an negotiated rate.

      Notes:
      Originally created by Chip.
      UDF Headers updated compared to old script.
      Error and Parameter Handling updated compared to old script.
      If you need to bypass the RFC compliance of this UDF, use _IRCRaw.
      The majority of the old functions have been modified. It will break most, if not all, scripts using the old UDF.
      These commands should work on every server following either RFC 1459 (legacy) or RFC 2812 (preferred).
       
      Potential Uses:
      IRC Chat Clients
      Chatroom Integration for software
      IRC Bots for Channel / Server Administration
      IRC Bots for Games such as Hangman, Mafia, and WereWolf
      Remote Administration without having to setup your own AutoIt server


      Functions:
      _IRCChannelInvite
      _IRCChannelJoin
      _IRCChannelKick
      _IRCChannelPart
      _IRCChannelTopic
      _IRCConnect
      _IRCDisconnect
      _IRCGetMsg
      _IRCMultiMode
      _IRCMultiSendMsg
      _IRCRaw
      _IRCSelfOper
      _IRCSelfSetNick
      _IRCSelfSetStatus
      _IRCServerPing
      _IRCServerPong
      _IRCServerTime
      _IRCServerVersion
       
      Extra Functions:
      _IRCReplyTo (IRCExtras.au3)
      _IRCStripSpecial (IRCExtras.au3)
       
      Downloads:
       
      Additional Links:
      Chips' Old UDF Topic:

       
      DISCLAIMER:
      While these downloads are more stable than the ones above, I do not have time to thoroughly test all functions and variable entries. If something doesn't work as expected or gives you an error please check @error and @extended variables then create a reply to this topic.

      Changelog:
      09/06/2016: IRC.au3 Fixed : Updated Headers to UDF-spec (- instead of =) _IRCGetMsg Fixed : Incorrect Return Value On Error _IRCStripSpecial Added : Better documentation of Flags _IRCMultiSendMsg Added : Better documentation of Flags _IRCMultiSendMsg Fixed : Max Message Size based on https://forums.unrealircd.org/viewtopic.php?t=6811 Updated all files to consider themselves a standalone install by default All Functions that didn't Return anything now return Number of bytes sent Slight Performance Improvements by using Parameter Gating instead of Single Input Single Output 07/21/2016: Example.au3 Fixed : Includes Example.au3 Renamed: IRC_Example.au3 IRC.au3 Changed: Minor Performance Improvements 04/18/2016: IRCConstants.au3 Updated: A Ton of New Constants added IRCMultiSendMsg Added : Color Example Increased TCP Timeout in all Examples 04/13/2016: CUI.au3 Updated: Errors now output to Error Stream in Console (C/G)UI.au3 Fixed : Userlists (FOR REAL THIS TIME) by being sure to get the current channel Removed: Duplicate Constants File Include Removed: Local Declaration inside of While loop for Performance Updated: TCPTimeout Increased Updated: $sTemp renamed $sStrip for Readibility Example.au3 Updated: TCPTimeout Increased GUI_Client.au3 Renamed: GUI.au3 _IRCStripSpecial Added : Parameter Checking Updated: Documentation _IRCMultiSendMsg Added : Additional flags for Message Type (POSSIBLY SCRIPT BREAKING if using $_bTrim!) Updated: Example to show new flags Updated: Increase Max Message Size from 368 To 436 04/09/2016: IRC.au3 Updated: All Documentation Added : Now has a Constaznts file _IRCConnnect Fixed : Now PROPERLY returns any errors _IRCGetMsg Removed: $_iChars parameter since it gets one packet at a time and parsing is easier _IRCReplyTo Fixed : Now properly returns username _IRCStripSpecial Added : Now uses Constants File All files are now in a single ZIP Includes 2 basic IRC "clients", a CUI, and a GUI 07/15/2015: Example.au3 Added : Improved Debugging   Updated: All Space Indents to Tab Idents   IRC.au3 Removed: Exception skipping @error = -1 in IRCGetMsg() as 3.3.14.0 fixed it 07/15/2015: Example.au3 Added : Ping Timeout Fixed : Userlist clipping of last user IRC.au3 Fixed : IRCGetMsg() Hang 07/08/2015: Example.au3 Fixed : User Lists   Fixed : Nickname now switches to backup nickname if first choice is already in use IRC.au3 Added : UDF Index Added : #include-once Updated: All Functions updated to Single Entry, Single Exit Updated: Now passes Au3Check on -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 01/15/2015: Example.au3 Fixed : Ampersand channels causing a crash 12/20/2014: Example.au3 Fixed : Nicks not updating on all channel lists when a user changed their nick Fixed : Nicks not deleting on all channel lists when a user quits the network 12/19/2014: Example.au3 Added : User lists Added : Channel lists Added : Bot keeps track of own nick Added : Secondary nick in case first nick choice is in use. Added : Extremely Minor performance improvements _IRCConnect Added : Improved parameter checking _IRCGetMsg Updated: Now only retrieves one packet by default (MAY be script breaking) 10/14/2014: Example.au3 Added : Shutdown TCP on exit Fixed : $Recipient now gets the actual Recipient instead of the 3rd message Added : Now exits when told to quit. IRC.au3 Added : Improved Error Reporting (Includes @extended on error) _IRCDisconnect Added : Close Socket on Disconnect _IRCStripSpecial Added : Improved Color Stripping 09/28/2014: _IRCConnect Fixed : Checking if Mode was blank. _IRCGetMsg Fixed : Spamming of 0 and incorrectly thinking there was an error. 09/28/2014: IRC.au3 Fixed : All functions now return when errors are encountered instead of continuing _IRCConnect Added : Now returns an error if optional password failed to send _IRCGetMsg Added : Now returns an error if it failed to receive a custom amount of data _IRCServerVersion Fixed : Capitalized "Version" 09/26/2014: Example.au3 Fixed : Pings not ending with @CRLF IRCExtras.au3 Added : _IRCStripSpecial(), Cleans special characters sometimes seen in IRC 09/24/2014: Example.au3 Added : Checking for PrivMsg Fixed : Infinite loop if you removed _IRCDisconnect Updated: Bot now disconnects when receiving "!quit" instead of automatically Discontinuted BETA UDF project. 04/20/2014: IRCExtras.au3 Added : Additional IRC Functions _IRChangeNick Renamed: _IRCSelfSetNick (SCRIPT BREAKING! Fix: Replace _IRCChangeNick with _IRCSelfSetNick) _IRCGetMsg Fixed : Now no longer Splits Packets if Default option is used _IRCChannelInvite Added : Invites a User to a Channel _IRCChannelKick Added : Kick a User from a channel _IRCJoinChannel Renamed: _IRCChannelJoin (SCRIPT BREAKING! Fix: Replace _IRCJoinChannel with _IRCChannelJoin) _IRCMode Renamed: _IRCMultiMode (SCRIPT BREAKING! Fix: Replace _IRCMode with _IRCMultiMode) _IRCOper Renamed: _IRCSelfOper (SCRIPT BREAKING! Fix: Replace _IRCOper with _IRCSelfOper) _IRCPartChannel Renamed: _IRCChannelPart (SCRIPT BREAKING! Fix: Replace _IRCPartChannel with _IRCChannelPart) _IRCPing Renamed: _IRCServerPing (SCRIPT BREAKING! Fix: Replace _IRCPing with _IRCServerPing) _IRCPong Renamed: _IRCServerPong (SCRIPT BREAKING! Fix: Replace _IRCPong with _IRCServerPong) _IRCSelfSetStatus Added : Sets you AFK and un-AFK _IRCSendMessage Renamed: Renamed _IRCMultiSendMsg. (SCRIPT BREAKING Fix: Replace IRCSendMessage with IRCMultiSendMsg) _IRCSendMessageRaw Renamed: Renamed _IRCRaw (SCRIPT BREAKING! Fix: Replace _IRCSendMessageRaw with _IRCRaw) _IRCServerTime Added : Get time from a Server _IRCServerVersion Added : Get Software Version from a Server _IRCTopic Renamed: _IRCChannelTopic (SCRIPT BREAKING! Fix: Replace _IRCTopic with _IRCChannelTopic) Improved Parameter detection in all Functions Renamed Functions to show who/what they effect, MASSIVE Script Breaking. Sorry! :/ 04/06/2014: _IRCGetMsg Added : Use to get IRC Messages. _IRCSetTopic Changed: Now named _IRCTopic (SCRIPT BREAKING! Fix: Replace _IRCSetTopic with _IRCTopic) Changed: Can now be used to query topic and does so by default. Use "" to blank the topic All functions now thoroughly check their parameters Updated all functions to use @extended to some errors Fixed @error returning 0 by starting all errors at 1 instead of 0 03/20/2014: _IRCChangeMode Changed: Now named _IRCMode (SCRIPT BREAKING! Fix: Replace _IRCChangeMode with _IRCMode) Changed: $_sMode is now OPTIONAL. Allowing the command to be used to Query current mode as well _IRCConnect Fixed : Missing Colon Before $_sRealName. It should now allow Real Names with spaces _IRCDisconnect Fixed : Issue with Blank Messages. Should now properly blank to Default _IRCPing Changed: $_Server is now REQUIRED. (SCRIPT BREAKING! Fix: Specify a server as Parameter 2) _IRCSendMessage Added : $_bTrim, Trims message if too long instead of breaking up the message, Default is true _IRCSetTopic Added : Command for setting a Channel Topic Updated Most Functions to include better error checking Updated Most Channel Related Functions to check for valid channels 03/16/2014: _IRCChangeMode Added : Optional parameters for channel modes Changed: Parameter ordering Target is now before Mode (SCRIPT BREAKING! Fix: Swap Parameters 2 and 3) _IRCConnect Changed: No longer exits the script on error, instead returns TCPConnect Error Code _IRCJoinChannel Added : Now Supports Channel Passwords _IRCOper Added : Command for IRC Server Operator Login Updated All Functions to have UDF standard error codes 02/24/2014: _IRCSendMessage Changed: Split Into _IRCSendMessage and _IRCSendMessageRaw (SCRIPT BREAKING! No Simple Fix Available) 02/23/2014: Made variables comply to UDF Standards http://www.autoitscript.com/autoit3/udfs/UDF_Standards.htm Removed MsgBoxes left over from old UDF Updated / Uploaded IRC.au3 Known and Reported Bugs:
      Message output only displays ANSI characters in CUI. (Can't Fix) Freenode requires registration for part messages thus the part message in example doesn't show up (Can't fix) Messages (e.g. PRIVMSG) are not forwarded?, when it contains umlauts/german mutations and when the message only contains a dot '.' (Unconfirmed) Warnings:
      Do NOT send a lot of messages at once. MOST networks will disconnect you. SOME networks will permanently ban you. A MINORITY will harshly retailiate. Do NOT use the Sleep() function in your scripts. It prevents you from receiving any new data, can disconnect your from the network, and have other undesired consequences. Use the TimerInit() and TimerDiff() functions and possibly a message queue. To Do:
      Possibly add in SSL functionality Create More Functions for IRC commands An entire IRC daemon written in AutoIt Possibly Include Kips TCP UDF for ASync Port Listening in Example Create Additional UDFs for extras such as CTCP, DCC, and Error Lookup Experiment with having functions check for the reply and see if reliable. Upcoming Changes:
      To Be Decided
    • Cormin
      By Cormin
      My script currently reads a text file line by line. I want it to look for this the chat message below and skip the session messages. 
      There are some garbage lines that I want it to skip over. So if a line doesnt match that format then skip it. I tried experimenting with StringRegExp but I think I'm using it wrong. Heres my code
      If StringRegExp($read, '\W\d\d\w\d\d\D.\W') = Not @error Then I was hoping that this would be able to see the open bracket, 2 digits, a colon, 2 digits,  close bracket, a space and a <. But it doesn't seem to be working.
       
      Eventually I want to be able to extract the username and chat message into separate strings but I haven't got that far yet.
    • PINTO1927
      By PINTO1927
      Hello guys,
      I analyzed script that you find below and I planned to add more information to the ListView, type:
      - Username login
      - Now the computer power
      You think you can take this information and show them in the table?
      #include <Array.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Dim $aBrowdcast[4] $aBrowdcast[0]=@IPAddress1 $aBrowdcast[1]=@IPAddress2 $aBrowdcast[2]=@IPAddress3 $aBrowdcast[3]=@IPAddress4 $filemaclist="MACLIST.DAT" Dim $MACAddressList[1] $MACAddressList[0] = "08000e42faa7" ; =================================================================== ; Gui ; ; =================================================================== $mainwindow=GUICreate("WOLLE",450,300) $mwbtnExit=GUICtrlCreateButton("Exit",350,150,100) $mwbtnGetMac=GUICtrlCreateButton("Get Mac adresses",10,150,100) $mwbtnWakeupall=GUICtrlCreateButton("Wake up all in list",130,150,100) $mwbtnWakeupSelected=GUICtrlCreateButton("Wake up selected",240,150,100) $mwlblIpRange=GUICtrlCreateLabel("Enter Start and End IP for search, will only search for last segment, sorry....",10,115,200,30) $mvinpIpStart=GUICtrlCreateInput("192.168.0.1",250,120,100,15) $mvinpIpStop=GUICtrlCreateInput("192.168.0.10",350,120,100,15) $mvinpWakeupTimeHH=GUICtrlCreateCombo("0",10,220,40) $mvinpWakeupTimeMM=GUICtrlCreateCombo("00",50,220,40) $mvinpWakeupTimeSS=GUICtrlCreateCombo("00",90,220,40) FillTimeCombos() $mwbtnActivateTimer=GUICtrlCreateButton("Activate Timer",290,220,120) $mwbtnSetTimertoNow=GUICtrlCreateButton("Set Timer to now",160,220,120) $mwbtnReadMacListFile=GUICtrlCreateButton("MACLIST.DAT",260,50,120) $mwlvMacadresses=GUICtrlCreateListView("MacAdresses |IP ",10,10,250,100) $mwlblStatus=GUICtrlCreateLabel("Status:",10,180,400) readmacfile() setTimertoNow() $boolTimerActive=0 GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() select case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $mwbtnExit ExitLoop case $msg = $mwbtnWakeupall wol_all() case $msg = $mwbtnGetMac getmacinrange() case $msg = $mwbtnGetMac getmacinrange() case $msg = $mwbtnWakeupSelected wol_selected() case $msg = $mwbtnReadMacListFile readmacfile() case $msg = $mwbtnActivateTimer if $boolTimerActive=1 Then TimerDisable(0) Else TimerDisable(1) endif case $msg = $mwbtnSetTimertoNow setTimertoNow() EndSelect if $boolTimerActive=1 Then CheckWakeup() sleep(100) endif WEnd GUIDelete() exit ; =================================================================== ; Function: setTimertoNow ; sets the thre time controls to the current time ; =================================================================== func setTimertoNow() guictrlsetdata($mvinpWakeupTimeHH,@HOUR) guictrlsetdata($mvinpWakeupTimeMM,@MIN) guictrlsetdata($mvinpWakeupTimeSS,@SEC) EndFunc ; =================================================================== ; Function: TimerDisable ; Toggle for the Timer button ; =================================================================== func TimerDisable($TimerState) $boolTimerActive=$TimerState if $TimerState = "0" Then GUICtrlSetState($mwbtnExit,$GUI_ENABLE) GUICtrlSetState($mwbtnGetMac,$GUI_ENABLE) GUICtrlSetState($mwbtnWakeupall,$GUI_ENABLE) GUICtrlSetState($mwbtnWakeupSelected,$GUI_ENABLE) GUICtrlSetState($mvinpIpStart,$GUI_ENABLE) GUICtrlSetState($mvinpIpStop,$GUI_ENABLE) GUICtrlSetState($mvinpWakeupTimeHH,$GUI_ENABLE) GUICtrlSetState($mvinpWakeupTimeMM,$GUI_ENABLE) GUICtrlSetState($mvinpWakeupTimeSS,$GUI_ENABLE) GUICtrlSetState($mwbtnReadMacListFile,$GUI_ENABLE) GUICtrlSetState($mwbtnSetTimertoNow,$GUI_ENABLE) GUICtrlSetData($mwbtnActivateTimer," Activate Timer") setStatusMsg("Timer deactivated") Else GUICtrlSetState($mwbtnExit,$GUI_DISABLE) GUICtrlSetState($mwbtnGetMac,$GUI_DISABLE) GUICtrlSetState($mwbtnWakeupall,$GUI_DISABLE) GUICtrlSetState($mwbtnWakeupSelected,$GUI_DISABLE) GUICtrlSetState($mvinpIpStart,$GUI_DISABLE) GUICtrlSetState($mvinpIpStop,$GUI_DISABLE) GUICtrlSetState($mvinpWakeupTimeHH,$GUI_DISABLE) GUICtrlSetState($mvinpWakeupTimeMM,$GUI_DISABLE) GUICtrlSetState($mvinpWakeupTimeSS,$GUI_DISABLE) GUICtrlSetState($mwbtnReadMacListFile,$GUI_DISABLE) GUICtrlSetState($mwbtnSetTimertoNow,$GUI_DISABLE) GUICtrlSetData($mwbtnActivateTimer," De-Activate Timer") EndIf EndFunc ; =================================================================== ; Function: CheckWakeup ; critical only equal time will trigger (needs omething better like a small range) ; =================================================================== func CheckWakeup() $strWakeupTime=GUICtrlRead($mvinpWakeupTimeHH)&GUICtrlRead($mvinpWakeupTimeMM)&GUICtrlRead($mvinpWakeupTimess) $strNow=@HOUR&@MIN&@SEC setStatusMsg("Current time:"&@HOUR&":"&@MIN&":"&@SEC) if $strNOW = $strWakeupTime Then SoundPlay(@WindowsDir & "\media\tada.wav",0) wol_all() EndIf EndFunc ; =================================================================== ; Function: FillTimeCombos ; filling the controls with data ; =================================================================== func FillTimeCombos() for $i=1 to 23 GUICtrlSetData($mvinpWakeupTimeHH,$i) Next for $i=1 to 59 GUICtrlSetData($mvinpWakeupTimeMM,$i) GUICtrlSetData($mvinpWakeupTimeSS,$i) Next EndFunc ; =================================================================== ; Function: readmacfile ; reads mac list in ini format ; =================================================================== func readmacfile($filemaclist="MACLIST.DAT") if FileExists($filemaclist) Then $aMaclist=IniReadSection(@scriptdir&"\"&$filemaclist,"MACLISTE") _GUICtrlListView_DeleteAllItems($mwlvMacadresses) for $i = 1 to $aMaclist[0][0] GUICtrlCreateListViewItem(""&$aMaclist[$i][1]&"|"&$aMaclist[$i][0]&"", $mwlvMacadresses) Next EndIf EndFunc ; =================================================================== ; Function: getmacinrange ; simple try to get all mac adresses from a given range (only last segment) ; =================================================================== func getmacinrange() FileDelete(@ScriptDir&"\"&$filemaclist) $aIpStart=StringSplit(GUICtrlRead($mvinpIpStart),".") $aIpStop=StringSplit(GUICtrlRead($mvinpIpStop),".") for $IpSegD = $aIpStart[4] to $aIpStop[4] get_mac($aIpStart[1]&"."&$aIpStart[2]&"."&$aIpStart[3]&"."&$IpSegD) Next readmacfile() EndFunc ; =================================================================== ; Function: wol_selected ; sents magic paket to the macadress selected in listviw ; =================================================================== func wol_selected() $aSelectedItems=_GUICtrlListView_GetSelectedIndices($mwlvMacadresses,true) if $aSelectedItems[0] > 0 Then $macadress=_GUICtrlListView_GetItemText($mwlvMacadresses,$aSelectedItems[1]) for $adapter in $aBrowdcast wol_adapter($adapter,$macadress) Next setStatusMsg("is "&$adapter&" awake?") EndIf endfunc ; =================================================================== ; Function: wol_all ; ; =================================================================== func wol_all() for $adapter in $aBrowdcast wol_adapter_all($adapter) Next setStatusMsg("All awake?") endfunc ; =================================================================== ; Function: setStatusMsg($msgtext) ; $msg --- Message for status text ; =================================================================== func setStatusMsg($msgtext) GUICtrlSetData($mwlblStatus,"Status:"&$msgtext) endfunc ; =================================================================== ; Function: wol_adapter($adapter,$$macadress) ; $adapter --- is the ipadress of the adapter ; $macadress --- is the macadress ; =================================================================== func wol_adapter($adapter,$macadress) if $adapter <> "0.0.0.0" Then $IPADRESS = StringSplit($adapter,".") $Broadcast = $IPADRESS[1] & "." & $IPADRESS[2] & "." & $IPADRESS[3] & "." & "255" $String="" setStatusMsg("Sent WOL via "&$Broadcast&" for:"&$macadress) WOL($Broadcast,$macadress) EndIf EndFunc ; =================================================================== ; Function: wol_adapter($adapter) ; $adapter --- is the ipadress of the adapter ; =================================================================== func wol_adapter_all($adapter) if $adapter <> "0.0.0.0" Then $IPADRESS = StringSplit($adapter,".") $Broadcast = $IPADRESS[1] & "." & $IPADRESS[2] & "." & $IPADRESS[3] & "." & "255" $String="" FOR $macadress IN $MACAddressList setStatusMsg("Sent WOL via "&$Broadcast&" for:"&$macadress) WOL($Broadcast,$macadress) Sleep(1000) Next EndIf EndFunc ; =================================================================== ; Function: WOL($Broadcast,$element) ; $Broadcast --- is ipadress of adapter with 255 at the End ; $MACAddress --- is the macadress ; =================================================================== ; Wake up on Lan Function (Open connection and broadcast to Lan) Func WOL($Broadcast,$MACAddress) UDPStartUp() $connexion = UDPOpen($Broadcast,7) UDPSend($connexion, GenerateMagicPacket($MACAddress)) 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 ; =================================================================== ; Function: get_mac($remote_ip,$filemaclist) ; $remote_ip --- remote ip ; $filemaclist --- file in ini format ; enhanced by TheSovereign - skip local mac adress ; =================================================================== func get_mac($remote_ip,$filemaclist="MACLIST.DAT") Ping($remote_ip,200) if @error =0 Then $arpinfo = Run(@ComSpec & " /c ARP -a "&$remote_ip, @SystemDir, @SW_HIDE, 2) sleep(200) $output = StdoutRead($arpinfo, -1) $aOutputLine=StringSplit($output,@CRLF) If UBound($aOutputLine) > 5 Then ; <=== added so script doesn't choke when processing the IP for the computer it's running on $macadress=Stringmid($aOutputLine[7],25,17) $macadress=StringReplace($macadress,"-","") IniWrite(@ScriptDir&"\"&$filemaclist,"MACLISTE",$remote_ip,$macadress) setStatusMsg("Found maclist "&$macadress) EndIf ; <=== and this one... Else setStatusMsg("Host "&$remote_ip&" not reachable") Return endif EndFunc Source: https://www.autoitscript.com/forum/topic/29772-copyright-free-wake-on-lan-script/