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

Molinko

Members
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Molinko

  1. Molinko

    a nil value

    It seems like you have a test table of `items` and in your original script only the first element of an `item` is a string and the rest are numbers.. However in your test `items` table in the new script your seems to have a typo.. items = {{"minecraft:coal,1,1,1"}} -- # Everything here is one string.. items = {{"minecraft:coal",1,1,1}} -- # This is what I believe you've overlooked
  2. The error you received stems from the second variant of this function. You can call rs.setOutput like so.. -- # with a number side[0-5] and a signal strength rs.setOutput(2, 15) -- # using the sides api but basically the same thing rs.setOutput(sides.east, 15) -- # or by setting multiple sides at the same time by passing a table rs.setOutput({ -- # [sides.west] evaluates to a number side [sides.west] = 15, [sides.south] = 10 })
  3. Pretty sure you need to use the HTTP Request Object API that component.internet.request returns. It is a userdata table with methods. I broke my MC launcher so I cant test this but you can try something along these lines.. Got a chance to test and the below code I have didn't quite work... I've updated it local success, response = pcall(web.request, "<your api call>") if not success then error("Something sucks here..") end local content = "" for chunk in response.read do -- # changed to response.read content = content .. chunk end doStuffWithData(content) -- # yay!?
  4. I would expect that you're somehow overwriting the string lib in your context.. I would recommend using a different variable name for your string value other than `string` as this will probably cause your error later when calling string.format on it.. The result of type(string) by default would normally result in "table" because `string` is a global Lua library.
  5. Molinko

    Hep with my code?

    Can you do me a solid and either point me to the print3d source code or take a screenie of line 70 in OC?
  6. @Nogitsu there is actually already a mod for that called OC glasses and OC glasses 2
  7. I just tried this in OC 1.7.4.153 | MC 1.12.2 | Forge 14.23.5.2807 No dice. I guess there is indeed a bug.. Perhaps it was fixed in OC 1.7.4.158 when you tried it.. Bummer
  8. Have you tried it in the tool slot and in an inventory slot(while selected)? I'm gonna try it and get back to you..
  9. Have you tried using the sneaky parameter with robot.use?
  10. I think some form of navigation library and server would be great. Imagine a robot or drone wants to go somewhere in your base. You could write a server that calculates a path from point 'A' to point 'B' and serves a path string (like the one your library uses) back to the robot/drone. Maybe have the server update knowledge of the base layout with a robot / drone using a geolyzer so it can give clear paths to clients. It's a mouthful but could keep other programs very simple and would be very reusable.
  11. I love that you're posting OC videos on youtube! Definitely not enough content out there to enjoy . I would suggest a perhaps more simple handler for the list of movements though. -- # The almighty lookup table local actions = { f = robot.forward, b = robot.back, u = robot.up, d = robot.down, tl = robot.turnLeft, tr = robot.turnRight, ta = function() -- # turn around local status, reason for i = 1, 2 do status, reason = robot.turnLeft() if not status then break end end return status, reason end, s = robot.swi
  12. Happy to help. Remember to use the man command to check for docs on shell programs and when possible mentions any errors you get verbatim.
  13. I'm not sure exactly but the leading slash may be throwing you off.. Follow my instructions from your home dir so we can be sure to replicate what I just tested. On source computer: /home # cp ./main.lua /mnt/38d/test.lua /home # ls /mnt/38d #this is to check we're not crazy and the file has been copied to the floppy On robot: /home # cp /mnt/38d/test.lua ./main.lua /home # ls . #list the current dir to check that we have copied our file successfully Run man cp to get a better grip on what the cp command can do.
  14. Insert the floppy into a drive then in the Shell run ls /mnt to find your floppy. Let's say it was /mnt/5ae. Run cp my_file /mnt/5ae/my_file I may be rusty so if you need help on shell programs run the man program with the name of a program for usage instructions. man cp
  15. I'm not sure it's possible. You could try to use component.invoke but I'm not sure if that's the issue..
  16. Exit the Lua interpreter. Run `components | more` without the backticks just like you would in a Linux shell.
  17. local function findInvs(ic) -- # ic: inventory_controller proxy local invs = {} -- # Loop over all sides for an inventory name. for side = 0, 5 do local name = ic.getInventoryName(side) -- # If an inventory name is present then store the name/type and the side:number if name then table.insert(invs, {name = name, side = side}) end end return invs end Example: local component = require 'component' local sides = require 'sides' local ic = component.inventory_controller local inventories = findInvs(ic) for i, inv in ipairs(inventories) do local side, size = si
  18. The server code has no queue implementation so if the server takes too long too execute a certain command then i imagine the packet with a command from another client simply won't be executed. If you can wait a bit I'll update the example with a queue or you can take a walk at it yourself. You're very welcome bud.
  19. I believe I see where you're trying to go with this but I think there is an easier way. Store the reactor proxies as values in a key/value table and then send method names and args to be executed. Here's a simple example.. -- # Reactor server: Recieves commands from remote client to be run local component = require 'component' local event = require 'event' local modem = component.modem modem.open(1040) -- # List of reactors to call methods remotely upon local reactors = { r1 = component.proxy(component.get '0c60c'), r2 = component.proxy(component.get '0ef58'), r3 = component.p
  20. I don't think there is but you can double check by running the dmesg program for observing available events. The only other thing rather than polling the contents would be an observer block maybe.. But that won't give you a slot number..
  21. Pretty sure you need to separate them as you described. Also because each computer will see the others components and eventually fail to boot from a too many components error
  22. Id check out this tiny library that you can probably fit along with your main program. multithread <- yeehaw
  23. Im trying to test it right now but Im not too good with Applied energistics... What component of the me network is your OC adapter touching? I have it touching the me_interface but I dont have the component method me_interface.getAvailableItems() just me_interface.getItemsInNetwork(). And the list doesnt appear to show the correct amount of items or any at all really... just an empty list "{n=0}" I updated to 1.12.2 and now the me_interface.getItemsInNetwork() method returns a populated list however I still dont have the me_interface.getAvailableItems() method.. Anything I need to know ab
  24. centerT func looks fine.. I'd suspect the checkMe func, specifically the loop over the list, or the list length operator. Check that the list is actually reporting the proper length? Shove a few print calls in there to debug.. I can't test ATM but nothing is standing out as the culprit.
×
×
  • Create New...

Important Information

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