Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Kyle

Members
  • Content Count

    10
  • Joined

  • Last visited

About Kyle

  • Rank
    Junior Member

Contact Methods

  • Minecraft
    kmccmk9
  • GitHub
    kmccmk9
  1. I'm truly starting to think this is some weird edge case bug but I don't have any clue why it is. I should note the machine is from ExtraPlanets so maybe there's something wrong with how that is interfacing with OC? I'm far from knowledgeable when it comes to Scala so I'm not sure.
  2. 1. It is not, many slots are empty. 2. Yes plenty of items have been sucked in that loop until the last iteration. 3. Max size is 64.
  3. Check out this source for an example viewer of images. https://github.com/ChenThread/ctif
  4. For a robot or computer? If it is for a robot make sure you have a tank controller in your robot. Then put your robot in front of the tank in question and use one of the functions listed here to get the information you need. https://ocdoc.cil.li/component:tank_controller
  5. You will need to use the Power Converter block provided by the OpenComputers mod to convert the power. RF power is supported.
  6. Did you shutdown/power off the computer before breaking it?
  7. I don't have direct experience with this library/programs but I have some experience with OpenComputers and the general layout of the system. Can you link to the thread with the solution/workaround you are tying to use, I can probably walk you through it.
  8. When it comes to receiving messages over the modem, you're going to want to use something like this: local _,_,from,senderport,_,message = event.pull("modem_message")
  9. Sure, below is the code for that function. What's interesting to note: is if I add a print statement before my suckFromSlot print("Size of inputSlot:"..inputSlotDetails.size) print("Size of outputSlot:"..outputSlotDetails.size) It will print: Size of inputSlot:0 Size of outputSlot:6 And that will print out every time it loops. So tit does seem to be seeing the outputslot of the machine has something in it. function getExternalSlotDetails(side, slotNum) local returnTable = {} local slotTable = inventory.getStackInSlot(side, slotNum) if slotTable == nil then returnTable.size = 0 returnTable.maxSize = 100 else for tableKey, tableValue in pairs(slotTable) do if tableKey == "size" then returnTable.size = tableValue elseif tableKey == "maxSize" then returnTable.maxSize = tableValue end end end return returnTable end
  10. I've run into a weird situation, I have a robot trying to put items into a machine and retrieve them. I have this set up in a loop that while there is still materials to insert or materials being processed, or materials in the output the robot tries to execute a series of functions. This works flawlessly until the last loop. At this point, there is no more materials within the Robot's inventory, there is no more materials in the input slot of the machine, and only materials in the output slot. If I understand my logic correctly, it should try to pull items out of the machine. In fact when checking the robot logs, it does. It will infinitely loop printing "Sucking items from slot" and then "Sucked items:false". Now keep in mind the robot hasn't changed directions or moved and it has successfully inserted and extracted many resources within this loop. Am I missing something here? function fillSmasherAndGetShards() local inputSlot = 2 local outputSlot = 3 local inputSlotDetails = getExternalSlotDetails(sides.front, inputSlot) local outputSlotDetails = getExternalSlotDetails(sides.front, outputSlot) -- While we still have potash to process or there is something in either the input or output slot while findSlotByItem("Potash") ~= nil or inputSlotDetails.size > 0 or outputSlotDetails.size > 0 do -- Try to put more potash in if inputSlotDetails.size < inputSlotDetails.maxSize then local potashSlot = findSlotByItem("Potash") if potashSlot ~= nil then robot_api.select(potashSlot) inventory.dropIntoSlot(sides.front, inputSlot, 1) end end -- Try to take potash shards out if outputSlotDetails.size > 0 then print("Sucking items from slot") local suckTest = inventory.suckFromSlot(sides.front, outputSlot, outputSlotDetails.size) print("Sucked items:" .. tostring(suckTest)) end -- Update slot details inputSlotDetails = getExternalSlotDetails(sides.front, inputSlot) outputSlotDetails = getExternalSlotDetails(sides.front, outputSlot) os.sleep(1) end end
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.