Posted 16 June 2012 - 10:09 PM
Hi guyz i got this really anoying bug/problem when i use my sender program on pc1 to send an existing file on pc1 to pc2 using modems to overwrite file on pc2, everything works but lua changes the conten of the file transfered to a freaking table! anyone knows how to resolve this?? am fairly new to computercraft and LUA(got some experience with visualbasic xD and roblox)
BTW the main purpose of these programs is to use them on tekkit to make a local server on my plot…pls dont tell me how to do it better way( i like to do everything almost by myself)
Sender:
works perfectly …sends everything with no errors…( i know that cos i used the same code to send single lines of code to the other console)
receiver
and on the receiver console i got:
>receiver
Got Mesage!!
save – my file which i want to overwrite
Processing Message
Writting Mesage to the table :17b59e2
Message saved to the table: 17b59e2
i like how the errors exactly fit my sentence choice
BTW the main purpose of these programs is to use them on tekkit to make a local server on my plot…pls dont tell me how to do it better way( i like to do everything almost by myself)
Sender:
print("What do you want to send?")
filename = io.read()
file = io.open(filename, "r")
file2 = file.read("a")
rednet.broadcast(file2)
works perfectly …sends everything with no errors…( i know that cos i used the same code to send single lines of code to the other console)
receiver
local event, param1, param2, param3 = os.pullEvent("rednet_message")
print("Got message!!")
name = io.read() -- filename to be overwritten
local file = io.open("name", "w")
print("Processing Message")
file:write(param2)
print("Writting Mesage to the ",file)
file:close()
sleep(1)
print("Message save to ",file)
and on the receiver console i got:
>receiver
Got Mesage!!
save – my file which i want to overwrite
Processing Message
Writting Mesage to the table :17b59e2
Message saved to the table: 17b59e2
i like how the errors exactly fit my sentence choice