-TheShadowMoose (TSM)
Here are the scripts (Below them is the download for how I use them):
SENDING -- NOTE: When I created this one, I tested it by reading each ds_list value to the buffer, writing it to a file, then clearing the list. That worked perfectly.
//0 -- socket to send over
//CALL ONLY ONCE!
var pos, chunk,i,f;
tcp=argument0
pos = 0
chunk = 1000
global.list = ds_list_create()
i = 0
f=fileopen(get_open_filename("All Files *|*",""),2)
//-------------------------------------------------------------------------------
setformat(tcp,2)
while(pos <filesize(f))
{
filesetpos(f,pos);
ds_list_add(global.list,fileread(f,chunk))
pos+=chunk
}
fileclose(f)
show_message("BUFFERED ALL THE DATA...SENDING...")
///loop ends
//now for sending it...
for(i=0;i<=ds_list_size(global.list);i+=1)
{
writechars(ds_list_find_value(global.list,i))//writes to buffer
sendmessage(tcp)//sends it.
clearbuffer()//clears le buffer
}
show_message("SENT!!!")RECIEVING
//0 -- socket to listen on
//1 -- name to save as.
//CALL IN STEP/DRAW
var tcp,f,s;
tcp=argument0
setformat(tcp,2)//sets the format.
f=fileopen(argument0,2)
//remember to close it!!!!!
while(receivemessage(tcp) >0)
{
filewrite(f)
}
fileclose(f)And HERE -- .zip contains 2 game maker files, and 39dll
Thanks!
Edited by theshadowmoose, 20 August 2009 - 10:41 PM.











