This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mz2212's profile picture

Sending Instructions Over Rednet

Started by mz2212, 28 July 2013 - 12:28 PM
mz2212 #1
Posted 28 July 2013 - 02:28 PM
I can't figure out whats wrong with my code
no errors it just wont run the for loop when I put in the correct stuff in the computer
when it works it will be an item fetching system

Turtle Code: http://pastebin.com/PCBzyxAf
Spoiler

    os.loadAPI("goto")
    goto.init("pos")
    rednet.open("right")
	
    ---[[
    while true do
	 event, senderId, message, distance = os.pullEvent("rednet_message") --Recive the Hashed Table
	 t = textutils.unserialize(message) --UnHash The Table
	 print(t[0]) --debug
	 print(t[1]) --debug
	 if senderId == 85 then --If Its the Right Computer Do
	   if tostring(t[0]) == RS then
		 for i = 1,tonumber(t[1]) do
		   turtle.suck()
		 end
	   else
		 print("Somthing Failed")
	   end
	 end
    end
    --]]


Computer Code: http://pastebin.com/7Li0BZXU
Spoiler

    t = {}
    print("What Do You Want?")
    t[0] = read()
    print("How Many?")
    t[1] = read()
    msg = textutils.serialize(t)
    rednet.open("back")
    rednet.send(80, msg)


any help would be greatly apprecatied
Lyqyd #2
Posted 29 July 2013 - 12:57 PM
Split into new topic.