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

NomNetworkFeed (NNF) - Broken

Started by Nom, 28 December 2013 - 02:24 PM
Nom #1
Posted 28 December 2013 - 03:24 PM
Can someone please fix my script!
My system uses two computers and two scripts and uses rednet to transmit new feeds
but the feed computer (the computer that displays the feed won't receive the broadcasted message from the Feed Updater computer which you can type in the new feed and it sends it via rednet!
I have been working hard on this and it needs fixing.


I also made a map that demonstrates the setup, which vital to see to understand the scripts. (Here is the link: https://www.mediafir...mm63mxisxmieaby )

You also need the resource pack which has the scripts. (Use it with the map and test the scripts) (I attached the resource pack to the post)

Instructions:
Select the resource pack
open my map
Launch the bulletin computer by going into it and launching a program called recieveFeed (I know i spelt receive wrong but thats how I named my program!
Go into the feedUpdate Computer and type in feedUpdate
then type in the new bulletin message
hit enter
You notice that the bulletin computer doesn't receive the rednet broadcast from the feedUpdate computer!
feedUpdate script

rednet.open("back")
print("Insert Bulletin Feed")
currentFeed = read()
print("Bulletin now set to " .. currentFeed)
print("Please restart all Bulletin Computers to display new feed in 5 minutes")
rednet.broadcast(currentFeed)
recieveFeed script

input1 = "shell"
monitor = peripheral.wrap("right")
monitor.setTextScale(1)
repeat 
	    term.clear() 
	    term.setCursorPos( 1, 1 )
	    local nTime = os.time()
	    print("Welcome to Nom Inc, Nuclear Laboratories")
	    id, newFeed = rednet.receive()
	    if id == 20 then
			    print( "Feed: " .. newFeed)
			    print( "The time is "..textutils.formatTime( nTime, false ) )

			    if nTime < 18 and nTime > 6 then
					    print("Have a good day!")
			    else
					    print("Have a good night!")
			    end

			    input = read(" ")
			    if input == input1 then
					    print("Booting Back Into Shell.")
					    print("Bypassing Bootloader.") --This is a joke
					    print("Done.")
					    os.shutdown()
			    else
					    print("Error!")
			    end
	    end
until false
Edited on 28 December 2013 - 02:50 PM
gollark8 #2
Posted 28 December 2013 - 03:38 PM
Please describe the setup and post the code.
Nom #3
Posted 28 December 2013 - 03:46 PM
Please describe the setup and post the code.
Waaaaa?
TR1T0N_ #4
Posted 28 December 2013 - 04:15 PM
the reason why recieveFeed wont receive rednet messages is because you havent opened the modem using rednet.open("top")
H4X0RZ #5
Posted 28 December 2013 - 05:16 PM
It IS displaying the message, but it clears the screen directly after that
TR1T0N_ #6
Posted 28 December 2013 - 05:33 PM
It IS displaying the message, but it clears the screen directly after that
thats not true as the program waits for users input before clearing the screen so you would see the message its just he hasnt opened the modem so the computer cant receive the broadcast its being sent