Yes once people understand the internal memory buffer and writing in different data types its very easy to use. Ill show you how to know which data type to use.
Alright say i want to send my x and y co-ordinate in 1 packet. I would write this:
clearbuffer(); //Make sure their is nothing in the buffer.
writebyte(1); //This can be used as a message id system.
writeshort(x); //Write 2 bytes representing the x.
writeshort(y); //Write 2 bytes representing the y.
sendmessage(socket); //Now send all the data in the buffer!
Alright tthe first line "clearbuffer()" is just used in case their is already data in the internal buffer. The second line writes the message id. I made it a byte because you probably wont need more than 255 different message id's. The second line says write the x position. The reason i wrote it as a short is because if i wrote it as a byte then the maximum x position could only be 255. A short can be anywhere from -32500 to +32500. As long as your room width is smaller than 32500 than you should use a short for the x and y position. This is also the case for the y position. Now i just use the script sendmessage() which will work on a tcp socket and udp sockets (no seperate scripts for the 2 protocols).
To recieve that message i just wrote i would put in the step event of the person to recieve it:
while(1) //make a loop because we might recieve multiple messages a step
{
size = recievemessage(socket);
if(size <= 0) break; //If no message
mid = readbyte(); //Get the message id
switch(mid)
{
case 1: //If the message id is for the players x, y pos.
x = readshort();
y = readshort();
break;
}
}