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

Forums

  1. OpenComputers

    1. Announcements

      OpenComputers official announcements.

      121
      posts
    2. Feedback

      Tell us what you think.

      372
      posts
    3. IRC

      #OC channel discussion
      irc.esper.net #oc

      25
      posts
  2. Code Central

    1. Support

      Ask for support from the OpenComputers community

      3592
      posts
    2. Showcase

      Showcase what you have created for OC. No 'malware' or other junk!

      2466
      posts
    3. Tutorials

      Help other users out. Please no 'false tutorials'

      111
      posts
  3. Addons & More

    1. Addons Mods

      Show off your OC addons mods

      220
      posts
    2. Architectures

      Discussions for Architectures

      176
      posts
    3. OpenEngineering Task Force

      Discussion board for the OETF documents

      70
      posts
  4. General

    1. Lounge

      Just lounge around or have an open discussion.

      309
      posts
    2. Forum Games

      Fight boredom!

      61
      posts
    3. Showcase

      Show off your creations! (not for your programs)

      127
      posts
    4. Servers

      A place to advertise your servers

      142
      posts
  5. Archives

    1. Public Archives

      OpenComputers public archive forum

      8
      posts
  • Forum Upkeep

    In order to keep the forums updated with improvements and security fixes, we need to pay for a subscription.

    Currently, this is: $25/6-months for the forums itself and $10/6-months for the Theme (totalling $35 USD/6-months).

    You're not obligated to donate anything, but anything you do donate will be much appreciated. :)



    2% of donation goal reached.
    Donate Sidebar by DevFuse
  • Topics

  • Posts

    • I used a interface block to connect to the oc via a adapter block and then a simple dense cable to the controller via a p2p and it actually through out 1 item but not all of them in lua    
    • Id check out this tiny library that you can probably fit along with your main program. multithread <- yeehaw
    • aye, the threading library is part of openos. without installing it, you've got not thread api My solution to your issue would be to put a timeout on computer.pullSignal. If it times, execute the next pending command (if there is one)  
    • I'm trying to write a script to control a worker drone. This drone will interact with plants on specific coordinates that are being fed to him by mainframe via wireless modem. I've planned to have those commands:
      1. Add/remove new coordinates.
      2. Print out all registered coordinates.
      3. Finish the job, return to charger and wait for further commands. 
      4. ... The initial solution included using two threads: a worker thread that executes requested and routine actions and a controller thread that listens for new modem messages, updates drone status and generates responses for the mainframe. The problem is - drones have no access to Thread API. I believe there should be a simple solution for this task but I don't see any suitable way to provide such level of responsiveness without proper threading. Rough example for drone :
        ... thread.waitForAny({   thread.create(function()  -- Worker     while true do       if state == "work" then         for _, pos in pairs(locations) do           moveto(pos)           dostuff()           if state ~= "work" then break end         end       elseif state == "stop" then       sleep(5)       end     end   end),   thread.create(function() -- Controller     while true do       local message = table.pack(computer.pullSignal())       if message[1] == "modem_message" then       local command = serialization.deserialize(message[5])       if command.text == "stop" then       state = "stop"       elseif command.text == "resume" then       state = "work"       end     end }})   I am sure somebody already did this kind of stuff on their server, I just can't come up with anything effective and simple without surpassing the 4KiB threshold. Do you have any suggestions?
  • Popular Contributors

    Nobody has received reputation this week.

×

Important Information

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