So, i have a problem.
In my code i have a sender and a receiver.The sender will send a table, that contains 2 variables - Command and Message.
And the receiver will then print the msg (Unserialized) and then it will perform the command - txt.command().
My problem is, that the receiver will fail at running the code (Because the command is a string).
So does anyone have a solution to fix my program? like making the txt.command unstringed somehow?
So this is the receiver:
rednet.open("right")
function sayHi()
print("HI")
end
local sID, dst, msg = rednet.receive()
local txt = textutils.unserialize(msg)
print(msg)
print("------------------")
txt.command()
And this is the sender:
rednet.open("right")
local txt = textutils.serialize({command = "sayHi", message = "10 + 10 = 20"})
rednet.send(1, txt)
Thanks for your patience :)/>