TGC Codebase Backup



a buggy messaging program by Mr Guillory

10th May 2006 14:05
Summary

this is a cheap messaging program that uses a network interface for a game to send messages over the internet using an ip adress or computer name



Description

a simple messaging system that has a few bugs to work out, agian, I'm at school for the moment, so I can't type much, I'll update tis when I get home.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    REM Project: Chat Room
REM Created: 5/9/2006 9:56:51 PM
REM
REM ***** Main Source File *****
disable escapekey
set window layout 1,1,1
set window title "Chat Room"
set window size 640,480
set window position screen width()/4,screen height()/4
load image "Sunset.jpg",1
paste image 1,1,1

trya:
set text to bold
set text size 26
set text font "book"
Input "  Name: ",name$
enable escapekey
if escapekey()=1 then end
gosub start

start:
cls
set window layout 1,1,1
set window title "Chat Room"
set window size 640,480
set window position screen width()/4,screen height()/4
load image "Sunset.jpg",1
paste image 1,1,1
set text to bold
set text size 36
set text font "book"
enable escapekey
if escapekey()=1 then end
IF NET GAME EXISTS()=1
   JOIN NET GAME 1,name$
   else CREATE NET GAME "chat",name$,200,2
endif
joined$ = name$ +" has joined."
send net message string 0,joined$
print joined$
gosub main

main:
gosub checkppl
print "Press enter to send"
do
if NET MESSAGE EXISTS()=1
   GET NET MESSAGE
   if net message type()=3
      incoming$ = net message string$()
   endif
endif
if spacekey()=1 then gosub write
loop


checkppl:
perform checklist for net players
for t=1 to checklist quantity()
write string 1,checklist string$(t)
next t
return

write:
set window layout 1,1,1
set text to bold
set text size 36
set text font "book"
set window title "Chat Room"
set window size 640,480
set window position screen width()/4,screen height()/4
load image "Sunset.jpg",1
paste image 1,1,1
enable escapekey
if escapekey()=1 then end
print name$
input "Type Message: ",sendout$
send net message string 0,sendout$

cls
set window layout 1,1,1
set text to bold
set text size 36
set text font "book"
set window title "Chat Room"
set window size 640,480
set window position screen width()/4,screen height()/4
load image "Sunset.jpg",1
paste image 1,1,1
print "Message Sent:",sendout$
enable escapekey
if escapekey()=1 then end
wait 500
gosub write