Nuffilein805 Posted October 31, 2005 Author Posted October 31, 2005 updated the server/client added some new functions ~~kick:USERNAME (to kick a user) ~~pm:USERNAME TEXT (for private message) userlist refreshes properly this server only holds 30 clients, but you can change it as you need it have fun my little chatmy little encryption toolmy little hidermy unsafe clickbot
YoseMite Posted October 31, 2005 Posted October 31, 2005 Hi, Thanks for the update/new functions! But I've a question... If I type ~~pm:client TEST (I work with the server) the client have doesn't a PM. And ~~kick:client also doesn't work... What do I wrong?:$
poisonkiller Posted October 31, 2005 Posted October 31, 2005 (edited) hmmm. someone's server up? It's cool, to see, if all things working Edited October 31, 2005 by poisonkiller
Nuffilein805 Posted October 31, 2005 Author Posted October 31, 2005 ok, my server is up ip: 84.156.51.251 @YoseMite have you downloaded the latest files (client + server)? my little chatmy little encryption toolmy little hidermy unsafe clickbot
YoseMite Posted November 1, 2005 Posted November 1, 2005 Yes, and I work with the last AutoIT bèta..
themax90 Posted November 1, 2005 Posted November 1, 2005 I am working on completely rebuilding this into a more effecient and easily upgradable and change able system that is more secure. I will post my results when finished. It will be a part of the AutoITS project. The generalized idea is from Nuffilein805 but the architecture and everything else, including complete script is from me. I just took his script, looked at it, and took the idea of a chat environment and created my own, completely different copy. I hope you are happy with my results to come Talk to you later. AutoIt Smith
Nuffilein805 Posted November 1, 2005 Author Posted November 1, 2005 @yosemite: the kick and pm thing is just up to the clients you can look into the code if you have a line in there (something like this) if stringinstr($recv, "~~kick:") then then you should have the latest version and the client has to understand what you write from the server don't forget that clients can be spelled several ways: client Client clienT you will need the exact spelling for the commands to work my little chatmy little encryption toolmy little hidermy unsafe clickbot
victor Posted November 7, 2005 Posted November 7, 2005 why i cannot run the script ? client : Line 9 ( file"path\client3.au3"): tcpstartup() ^ERROR Error: Unknown function name I get this error message
Nuffilein805 Posted November 7, 2005 Author Posted November 7, 2005 thx poisonkiller for responding so quickly you're saving me quite a lot time my little chatmy little encryption toolmy little hidermy unsafe clickbot
themax90 Posted November 8, 2005 Posted November 8, 2005 (edited) I Wrote a different version of this server, I think it's a bit streamlined.It's part of the AutoIt ITS project, with all adue to the original idea from nuffilein.Official File Releaseshttp://codewizonline.com/autoit/viewtopic.php?t=4I have the original idea of his server and client, and a new rewritten and beta versions + clients.P.S. @Nuffilein, are you still a devel on our team or are you quitting? Havn't seen you on recently Edited November 8, 2005 by AutoIt Smith
CrewXp Posted November 8, 2005 Posted November 8, 2005 i have a problem with this. Sometimes not all of the messags get to everyone. Sometimes the message appears in the right, but not on the actual screen.
DaLiMan Posted November 9, 2005 Posted November 9, 2005 With whos software, mine or Nuffilens.It's probably me, but I cannot download yours..... All I see is "text".......must I register or something??
themax90 Posted November 9, 2005 Posted November 9, 2005 LOL, copy and paste the link!!!!!! Wow your funny!
Nuffilein805 Posted November 9, 2005 Author Posted November 9, 2005 (edited) ok, seems to be my version tried to reproduce the error and managed to do it after about 30 mins of posting you just have to delete the line at the server where it sends the userlist (usually this should not happen, but somehow it does) don't know why and got no time to investigate should be line 114 Edited November 9, 2005 by Nuffilein805 my little chatmy little encryption toolmy little hidermy unsafe clickbot
themax90 Posted November 10, 2005 Posted November 10, 2005 Nuffilein, now do you see where my Server is almost COMPLETELY different and a bit more effecient?
DaLiMan Posted November 10, 2005 Posted November 10, 2005 (edited) LOL, copy and paste the link!!!!!! Wow your funny!Eeehhh.......DOH!!!...... :"> :"> :"> :"> Yeah, I'm THE most funny gay...eehh....guy...... (no offence intended!) Edited November 10, 2005 by DaLiMan
Nuffilein805 Posted November 10, 2005 Author Posted November 10, 2005 @autoitsmith: i know your server is a bit different from mine although doing the same (kinda paradox) @daliman: have you tried to remove the line? my little chatmy little encryption toolmy little hidermy unsafe clickbot
Gene Posted February 2, 2006 Posted February 2, 2006 @autoitsmith: i know your server is a bit different from mine although doing the same (kinda paradox) @daliman: have you tried to remove the line? Hi Nuffilein, I tried your server and client and liked them. I have no interest in Internet Chat, I am interested in Intranet Chat. Mine and my wife's PCs are in different rooms on different floors. Not only that, but I have some hearing loss too. I hope to use a modified version of your server & client to communicate more directly than shouting up/down the stairs. I added an INI file to the client so they remember the IP address and user names. The server is running on my server which only provides DNS services and supports an AutoIt script that tracks my DSL uptime. I modified the client to write both outgoing and incoming messages to the on screen message log so you could see the dialog content. I thought it would be more useful if it POPPED to the top every time a message arrived so we would be sure to notice so I added that. I made the user list narrower so I could add acouple buttons, I plan to add a button to minimize the client and reply "Wait a minute, I'm in the middle of a thought." and another to toggle a flag on and off that will reply to any message "I've gone to the kitchen or the bathroom or I'm taking a nap." So, why am I telling you all this you ask. I'm having a problem and I'm not sure if it was already there, or if I caused it. On my wife's PC the running client only has the INI mods. The same on my PC. I'm running the most modified version from a separate folder on my PC, its UserId is Test1, my UI is GS, my wife's UI is CS. When I send a plain message from GS it sometimes appears on CS's window, it never appears on the Test1 window. If I send a ~~pm:Test1 message it appears on the Test1 window. When I send a ~~pm:GS message from Test1 it never appears on the GS window. If I send a plain message from Test1 it sometimes appears on the CS window, but never on the GS window. Is that clear as mud? Below is the modified version of the client script. I hope you can help me with this. Gene expandcollapse popupClient Code with several mods ;client for 100client-server ;made by Marten Zimmermann #include <guiconstants.au3> global $connect_port = 34000 $ip = "" $ip = IniRead(@ScriptDir & "\client.ini","Server","IPaddr", "") If $ip = "" Then $ip = InputBox ("IP-Adress", "Gimme the IP-Adress of the Server", @IPAddress1) IniWrite(@ScriptDir & "\client.ini","Server","IPaddr",$ip) EndIf tcpstartup() $socket = tcpconnect ($ip, $connect_port) if $socket = -1 then Exit EndIf Do Do $user = "" $user = IniRead(@ScriptDir & "\client.ini","Client","User", "") If $user = "" Then $user = InputBox ("Connected", "Connection established please type in your desired Username") IniWrite(@ScriptDir & "\client.ini","Client","User",$user) EndIf if @error = 1 Then $end = msgbox (4, "End client", "Sure you want to exit?") if $end = 6 Then Exit EndIf EndIf until StringLen ($user) > 2 and StringLen ($user) < 12 tcpsend ($socket, "~~us:" & $user) Do $recv = tcprecv ($socket, 512) if $recv = "~~password" Then $pw = InputBox ("Password required", "Please type in the password for " & $user, "", "*") tcpsend ($socket, "~~pw:" & $pw) EndIf until $recv = "~~accepted" or $recv = "~~rejected" or @error = 1 until $recv = "~~accepted" or $recv = "~~rejected" if $recv = "~~rejected" Then msgbox (0, "Failure", "Maximum number of users reached or Server currently not availible, please try again later") Exit EndIf $CCT = "Chat Client - Connection established: " & $user $main = GUICreate ($CCT, 500, 200) $input = GUICtrlCreateInput ("", 10, 10, 280) $edit = GUICtrlCreateEdit ("", 10, 40, 280, 110, $ES_READONLY + $ES_MULTILINE + $WS_VSCROLL + $ES_AUTOVSCROLL) ;$userlist = GUICtrlCreateEdit ("", 300, 10, 190, 180, $ES_READONLY + $ES_MULTILINE + $WS_VSCROLL + $ES_AUTOVSCROLL) $userlist = GUICtrlCreateEdit ("", 300, 10, 95, 180, $ES_READONLY + $ES_MULTILINE + $WS_VSCROLL + $ES_AUTOVSCROLL) $send = GUICtrlCreateButton ("Send", 10, 160, 280, 20, $BS_DEFPUSHBUTTON) GUICtrlSetState ($input, $GUI_FOCUS) GUISetState(@SW_SHOW) while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then $CCT = "Chat - Client shutting down in 5 seconds." GUICtrlSetData ($edit, $CCT) tcpsend ($socket, "~~bye") sleep (5000) tcpshutdown() Exit EndIf ; The mods just below were temporary while checking if ~~pm: could be used to force delivery/aceptance if $msg = $send Then if guictrlread ($input) <> "" Then If @IPAddress1 = "192.168.0.180" Then ;MsgBox(0,"Info.","guictrlread($input) = " & guictrlread($input) & " " & @IPAddress1, 2) tcpsend ($socket, "~~pm:test1 " & guictrlread($input)) Sleep(100) tcpsend ($socket, "~~pm:CS " & guictrlread($input)) EndIf If @IPAddress1 = "192.168.0.183" Then ;MsgBox(0,"Info.","guictrlread($input) = " & guictrlread($input) & " " & @IPAddress1, 2) tcpsend ($socket, "~~pm:GS " & guictrlread($input)) tcpsend ($socket, "~~pm:test1 " & guictrlread($input)) EndIf ;tcpsend ($socket, guictrlread($input)) ;MsgBox(0,"Info.","guictrlread($input) = " & guictrlread($input)) GUICtrlSetData ($edit, guictrlread($input) & @crlf & guictrlread ($edit)) GUICtrlSetData ($input, "") EndIf EndIf $recv = tcprecv ($socket, 512) $err = @error if $recv = "~~bye" Then GUICtrlSetData ($edit, "~~Connection Lost" & @CRLF & GUICtrlRead($edit)) tcpshutdown() ExitLoop EndIf if StringInStr ($recv, "~~kick:") and stringinstr($recv, $user, 1) then TCPSend ($socket, "~~bye") GUICtrlSetData ($edit, "You have been kicked!" & @crlf & guictrlread($edit)) sleep (2000) TCPShutdown() ExitLoop EndIf $priv = 0 if StringInStr ($recv, "~~pm:") and stringinstr($recv, $user) then $user1 = $user & " " if StringInStr ($recv, $user1) Then $recv = StringReplace ($recv, "~~pm:", "", 1) $recv = StringReplace ($recv, $user & " ", "", 1) GUICtrlSetData ($edit, $recv & " (private)" & @crlf & guictrlread($edit)) WinSetOnTop ( "Chat Client - Connection established: " & $user, "", 1 ) WinActivate ( "Chat Client - Connection established: " & $user) Sleep(200) WinSetOnTop ( "Chat Client - Connection established: " & $user, "", 0 ) $priv = 1 EndIf EndIf if stringinstr ($recv, "~~accepted") then $recv = "" EndIf if $recv <> "" and $err = 0 and not StringInStr ($recv, "~~users:") and not StringInStr ($recv, "~~accepted") and not StringInStr($recv, "~~pm:") and not stringinstr($recv, "~~kick:") and $priv = 0 Then GUICtrlSetData ($edit, $recv & @CRLF & GUICtrlRead($edit)) WinSetOnTop ( "Chat Client - Connection established: " & $user, "", 1 ) WinActivate ( "Chat Client - Connection established: " & $user) Sleep(200) WinSetOnTop ( "Chat Client - Connection established: " & $user, "", 0 ) EndIf if StringInStr($recv, "~~users:") then $users = StringTrimLeft ($recv, 8) $users = StringReplace ($users, "|", @crlf) GUICtrlSetData ($userlist, $users) EndIf WEnd Func OnAutoItExit() $CCT = "Chat - Client shutting down." GUICtrlSetData ($edit, $CCT & @CRLF & GUICtrlRead($edit)) TCPSend( $socket, "~~bye" ) TCPCloseSocket( $socket ) TCPShutDown() EndFunc [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...
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