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.

2D All the way! / Chat box

Author
Message
Reaper Master
21
Years of Service
User Offline
Joined: 27th Mar 2004
Location:
Posted: 28th Mar 2004 07:27
Hey friends

what I am trying to do is make something similar to battle.net. I am wanting to make a chat room friends can join and make/join games. What would I do to make a chat box where I can add a side scroller to view all msgs said, and a chat box to write the messages in? Keeping it simple with a grey background and black chat boxes. Thanks for any and all help
James
21
Years of Service
User Offline
Joined: 1st Apr 2004
Location:
Posted: 5th Apr 2004 20:50
yo use this code play with it hope it has helped
James
21
Years of Service
User Offline
Joined: 1st Apr 2004
Location:
Posted: 5th Apr 2004 20:50
dim message$(30)
dim mess$(30)
waitup=20
randomize timer()
sync on : sync rate 0

connect:
do : cls : sync
Ink RGB(69,100,182),0
Box 100,150,525,275
ink rgb(255,255,255),RGB(69,100,182)
Line 100,150,525,150
Line 100,275,525,275
Line 100,150,100,275
Line 525,150,525,275
Text 200,175,"WHAT IS YOUR USERNAME?"
Set Cursor 200,225
input "";user$
if user$="" then user$="Guest"+Str$(RND(RND(400)))
sync
cls
Center Text 320,240,"CONNECTING TO SERVER"
Center Text 320,260,"PLEASE WAIT...."
sync

playerconnect=default net game("Chat Room",user$,255,1)
send net message string 0,"***** "+user$+" HAS JUST ENTERED THE ROOM"
goto chat
sync : loop

chat:
clear entry buffer
do : cls
menufun()
dec waitup
`Receive Messsages
gosub receivem
set text font "system"
`Show Your Name To The Left Of Your Typing Text

`If Text Lines Reach then Reset All Arrays To Prevent Exceeding

`Variable For Entry Text
texty$=texty$+entry$() : clear entry buffer
`Transform Entry Text Into an array For Sending
if returnkey()=1 and waitup<0
waitup=20
if addbuddy<>1
message$=user$+": "+texty$
if num = 24
for i=1 to num-1
Message$(i) = Message$(i+1)
next i
Message$(24) = message$
else
inc num
Message$(num) = message$
endif
endif
gosub sendm
buddy$=texty$
addbuddy=0
texty$=""
message$=""
clear entry buffer
endif
`Delete Unwanted Characters In Your Text
if keystate(14)=1
waitup=20
temp$=texty$
texty$=left$(temp$,len(temp$)-1)
endif
`Show Text Being Typed
Text 40,384,user$+": "+texty$
`Show All Sent And Received Text
for x=1 to num
text 40,5+(15*x),message$(x)
next x
Center Text 320,420,"YOBAR INSTANT MESSENGER"
Center Text 320,440,"2003 YOBAR INTERACTIVE"
sync : loop

`----------------------------------------------
sendm:
if addbuddy=0 then send net message string 0,message$
return
`-----------------------------------------------
receivem:
repeat
get net message
if net message type()=3
message$=net message string$()
mess$(num)=message$
if num = 24
for i=1 to num-1
Message$(i) = Message$(i+1)
next i
Message$(24) = message$
else
inc num
Message$(num) = message$
endif
endif
until net message exists()=0
return








`--------------------------------Functions-----------------------------------
function menufun()
ink RGB(69,100,182),0
box 30,10,600,400
ink rgb(255,255,255),0
Line 30,380,600,380
Line 30,400,600,400
Line 30,10,30,400
Line 600,10,600,400
Line 30,10,600,10
set text font "abaddon"
set text size 20
endfunction



function mousclick(x,y,name$)
if mousex()>=x and mousex()<=x+text width(name$) and mousey()>=y and mousey()<=y+text height(name$)
ink rgb(0,232,0),0
If mouseclick()=1 then click=1
else
ink rgb(255,255,255),0
endif
text x,y,name$
endfunction click

Login to post a reply

Server time is: 2025-05-15 03:17:17
Your offset time is: 2025-05-15 03:17:17