for SET NET CONNECTION you should use the ip of the host (the computer running the room you want everyone to connect to).
Make sure you use the correct ip as well. If you are trying to connect across a local network, then the host ip will be along the lines of 192.168.XXX.XXX. If however your trying to connect across the internet and the host computer is connected to a router, ipconfig will likely return the ip the router has assigned to the computer. This is different to the ip that other computers across the internet will see (the ip of your modem), if in doubt just use
this site to get your ip if you’re trying to connect across the internet not a LAN.
Here is some code I found from a simple chat program I made ages ago (around 2002/3 I think), can't remember if I made it in DBPro or DBC, but I know it worked at the time so I figure you may find it useful.
rem internet chat prog
set window on :rem puts program into window
always active on :rem makes sure it always recives messages
prog_start:
set window title "Chat Prog (Test Version 3)" :rem sets the title of the window
sync rate 60 :rem sets the sync rate - quite fast so it picks up all key presses
sync on :rem turns sync on
cls :rem clears the screen!
rem set values
choice# = 0
playername$ = ""
sessionname$ = ""
rem selecting connection
print "Step 1:"
Print " Please note: All connection types should work now but the program is specifically designed for"
print " IP connection or modem connection."
print
rem check for internet connection types
perform checklist for net connections :rem checks for what types of net connections are available
print "CONNECTION SELECTION (";checklist quantity();")"
for n=1 to checklist quantity()
print "[ ";n; " ] ";checklist string$(n)
next n
Print
input "Please select a number:";choice#
print
rem find out if hosting or joining
host_or_join:
cls
print
print "Step 2:"
print " Type only 'y' or 'n' (the program is not case sensitive)."
input "Will you be hosting?[Y or N]:";horj$
If horj$ = "y" or horj$ = "Y" then host$ = "host": gosub connecting
If horj$ = "n" or horj$ = "N" then host$ = "join": gosub connecting
gosub host_or_join
rem connect to other player
connecting:
cls
print
print "Step 3:"
rem if hosting do this
if host$ = "host"
input " Enter your name:";playername$
print
input " Enter session name:";sessionname$
print
print "Thankyou. Creating game."
set net connection choice# :rem sets the type of connection to be used (option selected in step one)
create net game sessionname$,playername$,2 :rem creates net game with selected name - sets players name and how many people can join
gosub chat_prog :rem goes to main program
endif
rem if joining do this
if host$ = "join"
input " Enter your name:";playername$
print
input " Enter IP/phone number to connect to:";ipchoice$
print
print "Thankyou. Connecting to IP/phone number"
set net connection choice#, ipchoice$
cls
print
print "Step 4:"
perform checklist for net sessions :rem checks for what sessions are available on the already selected ip address
print " SESSION SELECTION (";checklist quantity();")"
for n=1 to checklist quantity()
print " [ ";n; " ] ";checklist string$(n)
next n
Print
input "Please select a number (0 to cancel):";seschoice#
print
print "Thankyou. Joining session."
if seschoice# = 0 then gosub prog_start
sessionname$ = checklist string$(seschoice#)
join net game seschoice#,playername$ :rem joins the selected session
Gosub chat_prog
endif
rem main prog
chat_prog:
cls
set window title "Chat Prog (Test Version 3): "+ playername$ +" In session: "+ sessionname$
rem define variables
incoming$ = ""
sending$ = ""
reciveda$ = ""
recivedb$ = "Messages:"
olda$ = ""
ekey = 0
rem main loop
clear entry buffer :rem clears the buffer containing keys which have been pressed
sync rate 20 :rem slows sync rate so cursor flashes better
do :rem starts main loop
cls
rem print text at top of screen
set cursor 0,0 :rem positions where the text will apear
print "Welcome to "+ sessionname$ +". Press ESC to quit."
print "Type in your message and press enter to send."
rem list who is in the conversation
set cursor 5,50
PERFORM CHECKLIST FOR NET PLAYERS :rem preforms a check for who is in the session
print "People in session (";checklist quantity();"/2)"
for n=1 to checklist quantity()
print " [ ";n; " ] ";checklist string$(n)
next n
Rem list previous messages
set cursor 15,150
print recivedb$
print
print " "+reciveda$
rem recive message
repeat
get net message
if net message type() = 3
incoming$ = net message string$() :rem puts any incoming strings into the incoming$
recivedb$ = reciveda$: reciveda$ = incoming$ :rem updates strings
incoming$ = "" :rem sets incoming to nothing
endif
until net message exists()=0
rem typing message
new$=entry$() :rem sets new$ to what keys have been pressed since last time prog looped
for n=1 to len(new$) :rem gets length of new$ and makes a for next loop
if asc(mid$(new$,n))=13 then sending$ = line$: line$ = "": ekey = 1 :rem sends line$ if enter pressed
if asc(mid$(new$,n))=8 :rem deletes last letter pressed if backspace pressed
line$=left$(line$,len(line$)-1)
else
line$=line$+mid$(new$,n) :rem adds new letters to line$
endif
if ekey = 1 then line$ = "": ekey = 0 :rem deletes the enter sign from line$ if enter has been pressed
next n
clear entry buffer
rem Make simple cursor
if flash$="" then flash$="|" else flash$=""
rem Show Entry Buffer
center text 320,200,"Enter your message"
text 160,240,line$+flash$
rem send message
if sending$ <> ""
recivedb$ = reciveda$
reciveda$ = sending$
send net message string 0,reciveda$ :rem sends string to everyone in the session
sending$ = "" :rem resets sending$
endif
sync :rem updates screen
loop :rem loops the program