ok i have been working on a chat program from a tut. i typed it all but i am totoly going to change it but im still keeping the cor eengine. ok i want to make a menu so that the user can change font change font size and be able to change the background using pictures that i have. hwo would i do this and here si the code im using.
rem -------------------------------
rem march 2006
rem chat program
rem -------------------------------
rem start sync
sync on
sync rate 30
rem keep track of who said what
DIM chattext$(32)
DIM playersname$(1)
DIM numberofplayers(1)
DIM lastnumberofplayers(1)
rem find the TCP/IP connection number
TcpIpNumber = FindTCPIPConnectionNumber()
print "simple network chat client!"
print
sync
rem get there name
INPUT "Please enter your name: ",MyName$
playersname$(1) = MyName$
sync
sync
if MyName$ = ""
print "you need to enter a name!"
wait key
end
endif
rem find out who the host and the clients are.
print "(1) I'm the Host"
print "(1) I'm the Client"
sync
sync
A$ = ""
Answer = 0
rem get host or client
while Answer = 0
A$ = INKEY$()
if A$ = "1" then Answer = 1
if A$ = "2" then Answer = 2
endwhile
rem do this if im the host..
if Answer = 1
print "creating net session. please wait"
sync
sleep 200
SET NET CONNECTION TcpIpNumber, " "
CREATE NET GAME "Sample Net session", MyName$, 16, 1
endif
rem do this if im the client
if Answer = 2
input "Please enter the Hosts IP Adress: ",AddressData$
print "Connecting to net session. Please Wait"
sync
SET NET CONNECTION TcpIpNumber, AddressData$
PERFORM CHECKLIST FOR NET SESSIONS
NumberOfGames =CHECKLIST QUANTITY()
if NumberOfGames = 0
print "No session found at that address."
sync
wait key
end
endif
JOIN NET GAME 1, MyName$
print "connected to session!"
sync
endif
rem do the chat client
ChatClient()
end
rem this function will detirmin wich net connection is TCP/IP
FUNCTION FindTCPIPConnectionNumber()
Flag = 0
CLS
PERFORM CHECKLIST FOR NET CONNECTIONS
for x = 1 TO CHECKLIST QUANTITY()
Service$ = CHECKLIST STRING$(X)
if LEFT$(Service$,15)="Internet TCP/IP"
FLAG = X
endif
NEXT x
ENDFUNCTION Flag
rem this function does all of the chat client functionality
FUNCTION ChatClient()
rem clear the chat text from the array..
ClearChatText()
rem displays the intial players in the room
PERFORM CHECKLIST FOR NET PLAYERS
NumberOfPlayers(1) = CHECKLIST QUANTITY()
for x = 1 TO NumberOfPlayers(1)
AddUserMessage(CHECKLIST STRING$(x))
next x
rem send a coming in message
C$ = PlayersName$(1)+" has joined."
SEND NET MESSAGE STRING 0,C$
rem displays the chat text..
DisplayChatText()
rem set the entry buffers
A$ = ""
B$ = ""
C$ = ""
CLEAR ENTRY BUFFER
rem capture text input and procces it.
WHILE ESCAPEKEY()=0
CheckIncomingMessages()
A$ = INKEY$()
if ACS(A$) = 8
C$ = C$ + ENTRY$()
C$ = LEFT$(C$,LEN(C$)-1)
CLEAR ENTRY BUFFER
CLS
DisplayChatText()
endif
B$ = C$ + ENTRY$()
TEXT 10,460,B$
if RETURNKEY()=1 AND B$ <> ""
sleep 250
rem send remote message
D$ = PlayersName$(1)+": "+B$
SEND NET MESSAGE STRING 0,D$
rem display local message
AddStringToChat(D$)
D$ = ""
B$ = ""
C$ = ""
CLEAR ENTRY BUFFER
rem display new chat window
DisplayChatText()
endif
sync
endwhile
endfunction
rem scans the incoming messages for strings and displays them
FUNCTION CheckIncomingMessages()
GET NET MESSAGE
IF NET MESSAGE EXISTS()=0 THEN EXITFUNCTION
WHILE NET MESSAGE EXISTS()<>0
MsgType = NET MESSAGE TYPE()
IF MsgType = 3
Msg$ = NET MESSAGE STRING$()
AddStringToChat(Msg$)
DisplayChatText()
endif
GET NET MESSAGE
ENDWHILE
ENDFUNCTION
rem message to display if user has joined
FUNCTION AddUserMessage(Name$)
NewString$ = Name$+" is here."
AddStringToChat(NewString$)
ENDFUNCTION
rem adds a string to the ChatText$ array
FUNCTION AddStringToChat(a$)
for x = 1 to 32
if ChatText$(x) = ""
ChatText$(x) = a$
EXITFUNCTION
endif
next x
for x = 32 to 2
y = x - 1
ChatText$(32) = a$
ENDFUNCTION
rem clears the ChatText$ variables
Function ClearChatText()
for x = 1 to 32
ChatText$(x) = ""
next x
ENDFUNCTION
rem displays the chat text on the screen
FUNCTION DisplayChatText()
CLS
SET CURRENT BITMAP 0
CENTER TEXT 320,10,"Chat Client"
for x = 1 to 32
TEXT 10,10+(x*15),ChatText$(x)
next x
ENDFUNCTION
thank you guys.
visit my site (unfinished)
www.freewebs.com/dbnewbie