Guest User

Untitled

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