-- MaxMessenger -- ©2004 www.nikclark.com -- -- This script provides two functions -- -- 1) Sending of pop-up messages to any computer on your network -- -- 2) Sending a pop-up message after a render (or sequence) has completed -- -- This is useful when working on multiple machines -- or for sending messages to colleagues. -- -- -- Any problems should be reported to zzubnik@hotmail.com -- -- Installation: -- -- Use: -- Click Search, then click on the computer name which appears. Type in the name of the computer on the network (system properties/network identification/properties/computer name) -- and the message, then click on 'Instant Message" or "Render Notify". -- The title bar of the window will show the network name of the user's PC -- -- Inherits 'features' from windows. Pauses, flashing of DOS box, Network list not updating instantly when machines leave the network. Honestly, the list goes on and on. -- -- Not for use in France -- (seriously) ------------------------ -- -- To Do / bugs -- only clear after confirmation is recieved -- fix notify verification -- fix will notify on empty computer -- if classof PlayControls == RolloutClass do destroydialog PlayControls rollout PlayControls ("maxMessenger - This computer is " + sysInfo.computername as string) width:416 height:261 ( edittext edt1 "Computer:" pos:[7,6] width:400 height:17 edittext edt2 " Message:" pos:[7,31] width:400 height:17 text:(sysInfo.computername as string + "_Reports_render_complete") button but_myTestMessage "Send" pos:[158,125] width:40 height:72 button but_mySender "Notify" pos:[158,203] width:40 height:48 checkbox chk_myVerifySent "Verify Sent message" pos:[160,59] width:120 height:14 ticked:true checkbox chk_myClearOnSend "Clear on send" pos:[284,58] width:86 height:14 listbox listBoxComputers "Computers" pos:[12,58] width:138 height:13 button but_netSearch "Search" pos:[158,87] width:40 height:33 GroupBox grp1 "Instructions" pos:[206,81] width:193 height:168 label lbl1 "To send an instant message, click on 'Search', choose computer. Type message and hit 'Send'" pos:[211,149] width:171 height:50 label lbl2 "Can be used to send instant messages or to be notify another computer when a render has completed" pos:[211,101] width:187 height:44 label lbl3 "To send a render notification, click on 'Search', choose computer. Type message and hit 'Notify'." pos:[212,198] width:171 height:42 --label lbl4 "To send a render notification" pos:[212,200] width:161 height:17 button butHelp "?" pos:[380,57] width:18 height:18 fn mySendMessage = ( if edt2.text != "" then ( global myName = edt1.text global myMessage = edt2.text callbacks.removeScripts #postrender id:#onload_message global myString = "b=DOScommand (\"net send \" + myName as string + \" \" + myMessage as string) callbacks.removeScripts #postrender id:#onload_message" callbacks.addScript #postrender myString id:#onload_message messagebox "The message will be sent when the next render or sequence has completed" title:"MaxMessenger says" ) else (messagebox "Can not send an empty message" title:"MaxMessenger says") ) fn findComputers = ( DOScommand "net view > c:\\netlist.txt" f = openFile "c:\\netList.txt" txt= #() while not eof f do append txt (readline f) close f deleteFile "c:\\netlist.txt" numLines = txt.count global myComputers= #() for i = 1 to numLines do ( myVar = txt[i] mynewVar = "" for myLoop = 1 to myVar.count do ( myVar[myLoop] if myVar[1] != "\\" then exit if myVar[myLoop] == " " then exit if myVar[myLoop] != "\\" then (append mynewVar myVar[myLoop] as string) ) print mynewVar myComputers[i] = mynewVar ) for i = 1 to myComputers.count do ( if myComputers[i] == "" do (deleteItem myComputers i) ) for i = 1 to myComputers.count do ( if myComputers[i] == "" do (deleteItem myComputers i) ) for i = 1 to myComputers.count do ( if myComputers[i] == "" do (deleteItem myComputers i) ) listBoxComputers.items = myComputers ) on butHelp pressed do ( (messagebox "Max messenger serves two purposes.\n\n1) It can send messages to other computers on your Windows network.\n\n2) It can send a message to another computer when a render completes.\n\n\nTo send a message to another computer.\n__________________________________\n\nClick on the 'Search' button and all the computers visible on your network will appear in the list.\nClick on the name of the computer to send a message to in the list that appears\nType a message and click on 'Send'. Your message will be sent immediately.\n\n\nTo send a 'Render Complete' message to another computer.\n__________________________________________________\n\nThis is great when you render on one machine, then carry on working on a different machine.\nClick on the 'Search' button and all the computers visible on your network will appear in the list.\nClick on the name of the computer you will be working at in the list that appears\nType a message and click on 'Notify'. The computer you select will recieve a message\nwhen the render has completed.\n\n\nOther options include verification of a sent message and clearing the message box when the message is sent." title:"maxMessenger Instructions") ) on but_mySender pressed do (mySendMessage() if chk_myClearOnSend.checked then (edt2.text = "") ) on but_myTestMessage pressed do ( if edt2.text != "" and edt1.text != "" then ( myName = edt1.text myMessage = edt2.text if chk_myClearOnSend.checked then (edt2.text = "") b =DOScommand ("net send " + myName as string + " " + myMessage) if b == 0 and chk_myVerifySent.checked then (messagebox ("Message to " + myName as string + " verified as sent ") title:"MaxMessenger says") ) else (messagebox "Please enter a computer name and a message." title:"MaxMessenger says") ) on listBoxComputers selected sel do (edt1.text = (myComputers[listBoxComputers.selection] as string)) on but_netSearch pressed do findComputers() ) createdialog PlayControls style: #(#style_titlebar, #style_border, #style_toolwindow, #style_sysmenu)