Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / SImple chat, need a little help

Author
Message
Your mother
20
Years of Service
User Offline
Joined: 21st May 2005
Location:
Posted: 29th Mar 2006 14:09
i have become pretty familiar with dbc during the years i've had it, and i recently got the enhanced version, and would like to begin playing with the multiplayer. I created a simple chat program, but i need the program to always be looking for new messages, but still allow the clients to type messages, please help.
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 29th Mar 2006 16:34 Edited at: 29th Mar 2006 16:35
use entry$() to track what a client entered since the last frame, and add that to a variable which stores the entire message up to now...

upon pressing enter send the variable using send net message string
upon pressing backspace, take one character off the message (see below if not sure)

at the end of every frame use clear entry buffer

deleting characters:
message$ = left$(message$,len(message$) - 1)
`(all but the last character)

Every frame do your usual get net message, net message exist() and net message tpye() commands...

Hope this helped slightly... I'm not the world's best at explaining things...

Login to post a reply

Server time is: 2025-05-23 21:27:32
Your offset time is: 2025-05-23 21:27:32