Poll

is minecraft dead

yes
270 (61.6%)
no
168 (38.4%)

Total Members Voted: 437

Author Topic: Minecraft Megathread; yeah its update 1.12 big whoop what about it  (Read 6753285 times)

Can a Computercraft expert help me out here?
I'm trying to have my auto-sugarcane farm loop itself, but simulataneously look for a rednet message for when to stop. Whenever I try to incorporate the receiving part of the code, the operation pauses. By the way, I'm using 1.6 so I can't have a separate program running the reciever.

Post your current code? Theoretically, you could just have something like this:

local farming = true
while true do
  if farming then
    farmSugarCanes()
  end
 
  if receivedStopSignal() then
    farming = not farming
  end
end

Where it's essentially a sort of toggle, and receiving the rednet signal toggles the farming (the farming = not farming line).

I'm not nearly close to an expert but I like messing around with computer craft. I'm pretty sure the program pauses until the message is received. You might be able to fix this by adding the receiving line outside of the loop, so after it. (Not sure if it works but you can try it)

If the receiving line is added outside of the loop, the loop will never check if it's receiving the signal. What you could do is implement a timeout, where it'll either receive the signal, or wait a couple of seconds. http://computercraft.info/wiki/Timer_(event)

Another option is running a parallel.waitForAny, where the first part always runs, and the second stops when the signal is received, e.g.


function farm()
  -- sugar cane farming stuff
end

function getSignal()
  while true do
    -- event pulling stuff
    if receivedStopSignal() then
      return -- this should stop the waitForAny if we received the signal
    end
  end
end

parallel.waitForAny(farm, getSignal)
« Last Edit: March 30, 2014, 04:21:53 PM by Kingdaro »

Post your current code? Theoretically, you could just have something like this:

local farming = true
while true do
  if farming then
    farmSugarCanes()
  end
 
  if receivedStopSignal() then
    farming = not farming
  end
end

Where it's essentially a sort of toggle, and receiving the rednet signal toggles the farming (the farming = not farming line).
You're right. Posting the code would have been a good idea. Thankfully, I can adapt your concept into what I've got. Thanks for the help.
EDIT: It's working. I've got a farm where every turtle stands in front of a stalk. It's not very resource friendly, but it doesn't require reprogramming when making changes to the farm.
Here's the code:
1. Put this in the main computer with a wireless modem on the right: http://pastebin.com/gejw6jKX - startup
2. Put these in wireless farming turtles and put a chest below them: http://pastebin.com/Ct66h12A -startup http://pastebin.com/LMibAq4F - auto
(Turtles contain code if you wish to put a monitor on top of it.)

If you guys got cleanup suggestions, go for it.
« Last Edit: March 30, 2014, 07:26:27 PM by BlockoCrafter »



i finally found this biome <3

too bad its still really ugly





Does anyone have any idea what skin pack this is?

oh my god I'm gonna faint

oh my god thats amazing

Does anyone have any idea what skin pack this is?
Framerate Killer, Prince of Overheating

afaik it's the 1024*1024 Sphax pack with shaders

Quote from: Minecraft News
Minecraft is Experiencing Some Problems

The long-nosed villagers introduced in Minecraft beta 1.9 have become sentient. They have taken over our skin servers and content delivery networks (CDN), so unfortunately you will not be able to change your skins until we fix the problem. We are desperately trying our best to pull the plugs, but we should prepare ourselves to serve under our new villager overlords. Singularity may be upon us.

Well stuff.

Holy stuff get onto Minecraft guys and look at your skin, also listen to the sounds.

I noticed the skin in playing with a friend, but not the sounds until now.