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

[1.5][SSP]Computers becoming inaccessible

Started by grand_mind1, 24 February 2013 - 03:45 AM
grand_mind1 #1
Posted 24 February 2013 - 04:45 AM
I am using the FTB Direwolf20 v5.1.1 pack.
I was trying to make a program that would control a turtle from a computer depending on what key you pressed while in the computer.
This is what I had so far on the computer:

rednet.open("right")
event, code = os.pullEvent("key")
while true do
  if code == 75 then
	rednet.send(30,"Turn Left")
  elseif code == 77 then
	rednet.send(30,"Turn Right")
  elseif code == 76 then
	rednet.send(30,"Go Back")
  elseif code == 72 then
	rednet.send(30,"Go Forward")
  elseif code == 200 then
	rednet.send(30,"Go Up")
  elseif code == 208 then
	rednet.send(30,"Go Down")
  end
end
And this is what I was testing with on the turtle:

rednet.open("right")
while true do
  id, msg = rednet.receive()
  print(msg)
end
If I run both of the programs and hit any of the keys that I am detecting then all computers and turtles in the world become inaccessible. Newly placed computers are also inaccessible, unbreakable, and have the wrong texture. Attempting to leave the world will result in a game crash. I have only tested this with the keys on the Number Pad and advanced computers. The only way I know to reproduce this is to paste this code into a turtle and computer.

After some testing I have also found out that not only are turtle and computers inaccessible but all blocks in the game that have an interface when right-clicked. Also, almost all of Redpower2 items are unbreakable and pressing Q to drop an item on the ground does not work. All mobs in the game are stuck in one place and trying to hit them will do nothing. At this point, I am sure that many features of the game are broken.
In a previous post, dan200 stated that a bug very similar to this was fixed in 1.5. In the same thread many people were talking about rednet spending so much time processing that minecraft was not able to process anything else.

Link to thread:
http://www.computercraft.info/forums2/index.php?/topic/10010-147dw20-501-using-rednet-breaks-reality/
Edited on 24 February 2013 - 04:14 AM
Cloudy #2
Posted 24 February 2013 - 06:10 AM
You're making the server take lots of CPU usage due to crappy code. Good job. Infinite Loop rednet spam!
grand_mind1 #3
Posted 24 February 2013 - 06:32 AM
I'm sorry that not everyone can be a master like you.
Cloudy #4
Posted 24 February 2013 - 06:47 AM
I will look into making the system more hardy against people spamming like this - and now is definitely the time to report these kind of things, as we're in beta - but please, fix your code. It is definitely a bug which originates from you making an infinite loop.

On top of that, I've just tested doing what your code would actually do - and I haven't been able to reproduce your results. While it is true that computers will be unresponsive for a while, opening and closing a GUI works as expected, items can still be dropped, and it will eventually recover (once the elements have all been removed from the queue, and proper events start coming back through)!
grand_mind1 #5
Posted 24 February 2013 - 08:24 AM
That's strange. I don't really know how any of this works. I only tested it in one world so maybe I was doing something else in the world that was taking up even more? Again, I don't really know how it works.
Shirkit #6
Posted 24 February 2013 - 08:28 AM
I'm sorry for the spam, but I've posted a similar bug report to this. I should have posted on this topic, I'm sorry. The post is in here: http://www.computercraft.info/forums2/index.php?/topic/345-how-to-post-a-bug-non-bukkit/page__view__findpost__p__90694

Can a mod move that to here? Or I should post on this topic also?

I'm really sorry, didn't think this before =\