Lemures Posted December 31, 2004 Posted December 31, 2004 Ok... i have been working with autoit for a while, never on anything TOO advanced though, but i have just now decided to get into using au3xtra.dll and the GUI things. right now i would like to be able to let another computer know when an event takes place, but without the user being aware of it. for example: user "HelloWorld" signs on on AOL instant messenger, which is running on Comp1. (this is checked using autoit) Comp1 lets Comp2 know of the event. Comp2 boots up AOL instant messenger and direct connects with "HelloWorld". ok so that was way to complicated of an example. but hopefully you get the idea... i just need to be able to let a comp know that a certain event has happened, so it should be able to send it a short message or something. how can i do this?
Insolence Posted December 31, 2004 Posted December 31, 2004 I think you can send messages via TCP/IP, not sure though. Try searching for TCP/IP on the forums. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Helge Posted December 31, 2004 Posted December 31, 2004 (edited) You could read and write the information to a INI-file located on a shareddirectory in your network. Easy way to communicate.Another way to do it, is to use (like Insolence said) the TCP/IP functions thatLarry has created for use with the AutoIt's DLLCall(), which probably isthe best way.. Good luck !Find Au3Xtra.dll here.. (TCP/IP-functions and more)- Helge - Edited December 31, 2004 by Helge
Lemures Posted December 31, 2004 Author Posted December 31, 2004 hmm.. ive been messing with this dll for the past 2 adn a half hour or so... i cant seem to figure this out, lol. how do i simply send a message, and then receive it?
Helge Posted December 31, 2004 Posted December 31, 2004 A test I made earlier (Based on Larry's scripts)..Remember to change the IP-address in both the client- and server-scriptsbefore running them. Set it to the server-address in both..Serverexpandcollapse popup;EXAMPLE SERVER CODE using AU3Xtra.DLL ;====================================== Global $WSABASEERR = 10000 Global $g_PORT = 65432 Global $g_IP = "192.168.0.181" Global $socket = 0 HotKeySet("{scrolllock}","Bye") ;Start the TCP abilities ;----------------------- $x = DLLCall( "AU3Xtra.dll", "int", "TCPStartUp" ) If @error Or $x[0] = 0 Then MsgBox(64,"","what !!!") ;Wait for connections ;----------------------- $x = DLLCall( "AU3Xtra.dll", "int", "TCPListen",_ "str", $g_IP,_ "int", $g_PORT ) If @error Then CleanUp(0) $socket = $x[0] ;Wait For Window Title ; or disconnection. ;--------------------------------------------------------- While 1 $x = DLLCall( "AU3Xtra.dll", "int", "TCPSend",_ "int", $socket,_ "str",@HOUR & ":" & @MIN & @SEC) $err = @error If Not $err And $x[0] >= $WSABASEERR Then Exit Sleep(900) WEnd ;CleanUp() is a wrapper for TCPShutDown ;-------------------------------------- CleanUp($socket) ;FUNCs ;++++++++++++++++++++++++++++++++++++++ Func CleanUp($CU_SOCKET) DLLCall( "AU3Xtra.dll", "int", "TCPShutDown",_ "int", $CU_SOCKET) Exit EndFunc Func Bye() CleanUp($socket) Exit EndFuncClientexpandcollapse popup;EXAMPLE SERVER CODE using AU3Xtra.DLL ;===================================== #include <GUIConstants.au3> $wTitle = "Server Clock" Global $WSABASEERR = 10000 Global $g_PORT = 65432 Global $g_IP = "192.168.0.181" Global $socket = 0 HotKeySet("{scrolllock}","Bye") ;Start the TCP abilities ;----------------------- $x = DLLCall( "AU3Xtra.dll", "int", "TCPStartUp" ) If @error Or $x[0] = 0 Then Exit ;Wait for a connection ;----------------------- $x = DLLCall( "AU3Xtra.dll", "int", "TCPConnect",_ "str", $g_IP,_ "int", $g_PORT ) If @error Or $x[0] < 0 Then CleanUp(0) $socket = $x[0] ;Send InputBox() contents to SERVER ;---------------------------------- While 1 $x = DLLCall( "AU3Xtra.dll", "int", "TCPRecv",_ "int", $socket,_ "str", "",_ "int", 1024 ) If Not @error Then If $x[0] >= $WSABASEERR Then ExitLoop ToolTip("Server clock : " & $x[2] & @CRLF & @CRLF & "Scrolllock to close..",0,0) Else ExitLoop EndIf Sleep(500) WEnd ;CleanUp() is a wrapper for TCPShutDown ;-------------------------------------- CleanUp($socket) ;FUNCs ;++++++++++++++++++++++++++++++++++++++ Func CleanUp($CU_SOCKET) DLLCall( "AU3Xtra.dll", "int", "TCPShutDown" ,"int", $CU_SOCKET) Exit EndFunc Func Bye() CleanUp($socket) Exit EndFuncGood luck !
Lemures Posted December 31, 2004 Author Posted December 31, 2004 *sigh* im stupid. laptop = .1.104 main comp = .1.101 where do i put the server, where do i put the client, and what should each ones ip be set to? im not sure if i understand how the ip is being use. should the ips on the main comp be set to 104?
buzz44 Posted January 1, 2005 Posted January 1, 2005 you can send messages to other computer that are connectected to your network using cmd. "net send (ip address or computer name) (msg)" there are also other various commands that can provide a list of all the computers networked, if that helps, we used to do this at school as we werent aloud to use chat prog's but we could do this to chat, qq
buzz44 Posted January 1, 2005 Posted January 1, 2005 forgot to add, you should check out winchat.exe, should be located in c:\windows\system32\, its a network chat program qq
Lemures Posted January 2, 2005 Author Posted January 2, 2005 i have net send disabled, else i would use that (its disabled to prevent ads, and my stupid friends who like screwing with people =P)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now