Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m$ = "" #just making a variable
- input "Username: ", user$ #getting the person's username and storing it in user$
- print "Trying to connect with username " + user$ #just prints a message
- netconnect "188.40.106.223", 50000 #connects to my website on port 50000 (this is where I get an error)
- netwrite "!!!JOIN" #sends a message that a user has joined
- netwrite "User " + user$ + " has joined."
- print "Now connected to AnovaChat." #tells the user they have connected
- print "Type /quit to quit."
- while m$ <> "/quit" #the code executes while the user's message is not equal to /quit
- print netread #reads the data coming through and prints it
- k = key #sets a variable to check the current key pressed
- if k = asc("C") then gosub sendmsg #if the person presses C, goto sendmsg
- sendmsg:
- input "Message: ", m$ #gets input from the user
- netwrite "<" + user$ + ">" + m$ #sends their username and their message
- return #goes back to the gosub command
- endwhile #marks the end of the while loop
- netclose #closes the connection when the while loop is exited
Add Comment
Please, Sign In to add comment