Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

TCP/IP Server+Client Chat Script (w/ Features)


  • Please log in to reply
131 replies to this topic

Poll: Would you use this script? (35 member(s) have cast votes)

Would you use this script?

  1. Yes (33 votes [71.74%])

    Percentage of vote: 71.74%

  2. No (3 votes [6.52%])

    Percentage of vote: 6.52%

  3. Frequently (5 votes [10.87%])

    Percentage of vote: 10.87%

  4. Maybe once or Twice (5 votes [10.87%])

    Percentage of vote: 10.87%

Vote Guests cannot vote
Reggie88
  • Members
  • 5 posts
  • Last active: Sep 06 2011 08:17 PM
  • Joined: 04 Mar 2010
Nice mod WankaUSR:)

The only think that buged me was when a user logon, he comes up two times on the list, when he log off the server only remove one of the name on the list, and when he logon agian the server adds two new names.
It just keep stacking up till he gets the message that the user is already in use.

I discoverd that it had something to do whit Userlist.txt that keep on remebering the names and keep typeing them in when a user logon. I could even type in a random word and it pop up:P

So i removed this part from the code and the problem disappeard:)
fileappend, %recievedx1%`n, Settings\userlist.txt
fileread, userlist, Settings\userlist.txt

Donno if it was the right move since im still a new student at programing, but hope you can look in to it:)

WankaUSR
  • Members
  • 87 posts
  • Last active: Jul 14 2013 09:59 AM
  • Joined: 14 Aug 2007
ok that was something I did not see when testing when fixing that I found another bug it also doesn't make the difference between already logoned users . I will look into this

Rock-um
  • Guests
  • Last active:
  • Joined: --
I still see the same strange outgoing text. It obviously works, but there is "extra" redundant text being sent from the server (and maybe the client too). I logged into the server using putty and here is the conversation color-coded for clarity.

Client Sent Text = Red
Server Sent Text = Green

______________________________________________

Joe Connected!
Hello
Joe: Hello
How are you?
Joe: Fine thank you, how are you?
Fine

______________________________________________

However this is what Putty reports as the incoming and outgoing text

______________________________________________

RX2CLIENTCON:Joe Connected!
HelloENTCON:elloENTCON:Joe: Hello
How are you?ow are you?Joe: Fine thank you, how are you?
Finere you?inere you?

______________________________________________

So why is "ENTCON:elloENTCON:" and "ow are you?" and "re you?inere you?"being sent?

By the way this is not new to WankaUSR's code it has been there since the start. It obviously works, but is there anyway to eliminate the junk text? Thanks WankaUSR, jmanx and others

rockum
  • Members
  • 23 posts
  • Last active: Jul 11 2013 10:50 PM
  • Joined: 20 Dec 2007
bumpidy bump

Zaelia
  • Members
  • 754 posts
  • Last active: Jul 09 2014 03:51 AM
  • Joined: 31 Oct 2008
Sorry I need to understand this script, if you can help me :)

For kick an user this code is beter ?
DllCall("Ws2_32\closesocket" , "UInt", conectioncheck%a_index%)
or perhaps Ws2_32\shutdown

And about DllCall("Ws2_32\WSACleanup") they send a message to server for free socket or socket is always use after a crash client ?
( if ReceivedDataLength = 0 )

ddk_
  • Guests
  • Last active:
  • Joined: --
Hmm.. Could someone explain me how is the userlist thing done? How does the server know that someone connected and how does it get the nick? :)

Zaelia
  • Members
  • 754 posts
  • Last active: Jul 09 2014 03:51 AM
  • Joined: 31 Oct 2008
I have found a bug on my computer, it's about SendData() :

VarSetCapacity(SendData) must be replace by StrLen(SendData) for to have the real lenght, it's seems that return of VarSetCapacity "bug" for this use, normal it's a String.

With StrLen, the size of data (that we send) don't grow and are true... Sorry it's hard to explain it, you can view it with ressource system or a msgbox.

mr. mooyeah
  • Guests
  • Last active:
  • Joined: --
make a video streaming of webcams if its possible :D

jingha
  • Guests
  • Last active:
  • Joined: --
hi!

i've tried to get this work but nothing helps. client gives allways same winsock error.
i have win7 and window's own firewall (with ports open for autohotkey.)

the weird thing is that this works in VirtualBox.

could router be the problem? i dunno how to enter it.

Zaelia
  • Members
  • 754 posts
  • Last active: Jul 09 2014 03:51 AM
  • Joined: 31 Oct 2008
I can't help a lot, but what is the number code of the winsock error ? what port and address do you use for your client and server ?
Router and firewall can be a problem, I guess you have to redirect your address:port with your router or with your ISP webpage (to say to your router to redirect some message to your computer with a specific port and protocol), or maybe to select a port number and not programs name with your firewall.
Anyway, this thread seems more appropriate <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=2&t=58183">viewtopic.php?f=2&t=58183</a><!-- l -->

wnltl
  • Members
  • 8 posts
  • Last active: May 09 2013 01:20 PM
  • Joined: 12 Jun 2012
It's a good script. Thank you so much! Has been very helpful.

  • Guests
  • Last active:
  • Joined: --
i found this wont work with lexikos' 1.1.07.03. works with normal version 1.0.48.05.