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

    1. Announcements

      OpenComputers official announcements.

      122
      posts
    2. Feedback

      Tell us what you think.

      380
      posts
    3. IRC

      #OC channel discussion
      irc.esper.net #oc

      25
      posts
  2. Code Central

    1. Support

      Ask for support from the OpenComputers community

      5649
      posts
    2. Showcase

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

      2593
      posts
    3. Tutorials

      Help other users out. Please no 'false tutorials'

      115
      posts
  3. Addons & More

    1. Addons Mods

      Show off your OC addons mods

      225
      posts
    2. Architectures

      Discussions for Architectures

      176
      posts
    3. OpenEngineering Task Force

      Discussion board for the OETF documents

      71
      posts
  4. General

    1. Lounge

      Just lounge around or have an open discussion.

      314
      posts
    2. Forum Games

      Fight boredom!

      61
      posts
    3. Showcase

      Show off your creations! (not for your programs)

      132
      posts
    4. Servers

      A place to advertise your servers

      146
      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

    • Can you insert your entire code? Then I could help you find the issue. If you kept the order of your function definitions, you need to change the order a bit, I will talk you through once posted the new code.
    • Hey, Thank you for your help CptMercury I did as said use "local", however I had to miss somewhere because I have as error "line 72: attempt to call global 'checkMod' local function autoMenu() API.clearTable() API.setTable("Automatic", autoMode, "", 3, 13, 6, 6) API.setTable("Manual", manualMode, "", 15, 25, 6, 6) if steamReactor then API.setTable("Reactor", reactorMenu, "", 5, 18, 19, 19) API.setTable("Turbine", turbineMenu, "", 22, 35, 19, 19) end API.screen() checkMode() <-- on this line menuMode() end  
    • I recommend joining the discord server, there you can get support and talk to other members of the server. Download link for the pack: https://drive.google.com/open?id=1QBcmUJvBjldiBgTRpQQ6Cs_nvdB6aK7d The pack zip includes a batch file installer, it's not necessary to run, just copies the files to your mods and config folders. If you know how I suggest installing them manually IP address: zefsvanillaplus.g.akliz.net Mod list: Apple Core Apple Skin BetterFps Bibliocraft Bonsaitrees Codechickenlib Computronics Cooking For Blockheads Coroutil Good Ol' Currency Mod Discord Chat Doggy Talents Ender Storage Fast Leaf Decay Foamfix FTBLib FTBUtils Ironchest Mousetweaks OCDevices Opencomputers Openprinter Opensecurity Pam's Harvestcraft Placebo RadixCore Spice Of Life Carrot Edition Toast Control Vivecraft Forge Extensions Waystones  
    • I think its working but its not starting directly so i would maybe start it ones before timer starts it "loopDelay" later.     I appreciate it and thx for helping me
    • So I did some small changes to  your AE2Crafting.lua file, it should work now as intended. I wasn't able to test it yet, so tell me if it works or not. -- Original by Palagius : https://oc.cil.li/index.php?/topic/1426-ae2-level-auto-crafting/ -- Modfied by Dalden 2018-07-28 -- - Store crafting result object to check for status -- - If crafting job is not yet finished from previous cycle then skip this cycle local arg = {...} if not arg[1] then arg[1] = "009" else arg[1] = tostring(arg[1]) end if not arg[2] then arg[2] = "ac7" else arg[2] = tostring(arg[2]) end local component = require("component") local term = require("term") --local thread = require("thread") local event = require("event") local meController = component.proxy(component.me_controller.address) local gpu2p = component.proxy(component.get(arg[1])) local screen2 = component.get(arg[2]) local count = 0 startScreen(arg[1],arg[2]) gpu2p.setForeground(0xFFFFFF) --term.setViewport(nil, nil, nil, nil, nil, nil, window) -- Each element of the array is "item", "damage", "number wanted", "max craft size" -- Damage value should be zero for base items items = { { "minecraft:coal", 1, 100, 300 } -- { "minecraft:coal_block", 0, 10, 256 } -- { "minecraft:iron_ingot", 0, 16384, 256 }, -- { "minecraft:gold_ingot", 0, 16384, 256 }, -- { "minecraft:glass", 0, 16384, 256 }, -- { "minecraft:quartz", 0, 16384, 256 }, -- { "minecraft:diamond", 0, 16384, 256 }, -- { "minecraft:emerald", 0, 16384, 256 }, -- { "draconicevolution:draconium_ingot", 0, 16384, 256 }, -- { "thermalfoundation:material", 128, 1024, 256 }, -- Copper Ingot -- { "thermalfoundation:material", 129, 1024, 256 }, -- Tin Ingot -- { "thermalfoundation:material", 130, 1024, 256 }, -- Silver Ingot -- { "thermalfoundation:material", 131, 1024, 256 }, -- Lead Ingot -- { "thermalfoundation:material", 161, 1024, 256 }, -- Electrum Ingot -- { "thermalfoundation:material", 162, 1024, 256 }, -- Invar Ingot -- { "thermalfoundation:material", 163, 1024, 256 }, -- Bronze Ingot -- { "thermalfoundation:material", 164, 1024, 256 }, -- Constantan Ingot -- { "thermalfoundation:material", 165, 1024, 256 }, -- Signalum Ingot -- { "thermalfoundation:material", 166, 1024, 256 }, -- Lumium Ingot -- { "thermalfoundation:material", 167, 1024, 256 }, -- Enderium Ingot -- { "appliedenergistics2:material", 24, 4096, 256 }, -- Engineering Processor -- { "appliedenergistics2:material", 23, 4096, 256 }, -- Calculation Processor -- { "appliedenergistics2:material", 22, 4096, 256 }, -- Logic Processor -- { "appliedenergistics2:material", 11, 4096, 256 }, -- Pure Nether Quartz Crystal -- { "appliedenergistics2:material", 10, 4096, 256 }, -- Pure Certus Quartz Crystal -- { "appliedenergistics2:material", 7, 4096, 256 }, -- Fluix Crystal -- { "appliedenergistics2:material", 12, 4096, 256 }, -- Pure Fluix Crystal -- { "appliedenergistics2:material", 0, 4096, 256 }, -- Certus Quartz Crystal -- { "appliedenergistics2:material", 1, 4096, 256 }, -- Charged Certus Quartz Crystal -- { "appliedenergistics2:material", 8, 4096, 256 }, -- Fluix Dust -- { "appliedenergistics2:material", 2, 4096, 256 }, -- Certus Quartz Dust -- { "actuallyadditions:item_dust", 5, 4096, 256 }, -- Crushed Quartz -- { "enderio:item_material", 5, 4096, 256 }, -- Silicon -- { "enderio:item_alloy_ingot", 1, 1024, 256 }, -- Energetic Alloy Ingot -- { "enderio:item_alloy_ingot", 2, 1024, 256 }, -- Vibrant Alloy Ingot -- { "enderio:item_alloy_ingot", 5, 1024, 256 }, -- Pulsating Iron Ingot -- { "enderio:item_alloy_ingot", 6, 1024, 256 }, -- Dark Steel Ingot -- { "enderio:item_alloy_ingot", 7, 1024, 256 }, -- Soularium Ingot -- { "enderio:item_alloy_ingot", 8, 1024, 256 }, -- End Steel Ingot -- { "enderio:item_alloy_ingot", 0, 1024, 256 } -- Electrical Steel Ingot } loopDelay = 60 -- Seconds between runs -- Init list with crafting status for curIdx = 1, #items do items[curIdx][5] = false -- Crafting status set to false items[curIdx][6] = nil -- Crafting object null end local function loop() for curIdx = 1, #items do curName = items[curIdx][1] curDamage = items[curIdx][2] curMinValue = items[curIdx][3] curMaxRequest = items[curIdx][4] curCrafting = items[curIdx][5] curCraftStatus = items[curIdx][6] -- io.write("Checking for " .. curMinValue .. " of " .. curName .. "\n") storedItem = meController.getItemsInNetwork({ name = curName, damage = curDamage }) drawText("Network contains ",gpu2p) gpu2p.setForeground(0xCC24C0) -- Purple-ish drawText(storedItem[1].size,gpu2p) gpu2p.setForeground(0xFFFFFF) -- White drawText(" items with label ",gpu2p) gpu2p.setForeground(0x00FF00) -- Green drawText(storedItem[1].label .. "\n",gpu2p) gpu2p.setForeground(0xFFFFFF) -- White if storedItem[1].size < curMinValue then delta = curMinValue - storedItem[1].size craftAmount = delta if delta > curMaxRequest then craftAmount = curMaxRequest end drawText(" Need to craft ",gpu2p) gpu2p.setForeground(0xFF0000) -- Red drawText(delta,gpu2p) gpu2p.setForeground(0xFFFFFF) -- White drawText(", requesting ",gpu2p) gpu2p.setForeground(0xCC24C0) -- Purple-ish drawText(craftAmount .. "... ",gpu2p) gpu2p.setForeground(0xFFFFFF) -- White craftables = meController.getCraftables({ name = curName, damage = curDamage }) if craftables.n >= 1 then cItem = craftables[1] if curCrafting then if curCraftStatus.isCanceled() or curCraftStatus.isDone() then drawText("Previous Craft completed\n",gpu2p) items[curIdx][5] = false curCrafting = false end end if curCrafting then drawText("Previous Craft busy\n",gpu2p) end if not curCrafting then retval = cItem.request(craftAmount) items[curIdx][5] = true items[curIdx][6] = retval gpu2p.setForeground(0x00FF00) -- Green drawText("Requested - ",gpu2p) --while (not retval.isCanceled()) and (not retval.isDone()) do -- os.sleep(1) -- io.write(".") -- end gpu2p.setForeground(0xFFFFFF) -- White drawText("Done \n",gpu2p) end else gpu2p.setForeground(0xFF0000) -- Red drawText(" Unable to locate craftable for " .. storedItem[1].name .. "\n",gpu2p) gpu2p.setForeground(0xFFFFFF) -- White end end end drawText("Sleeping for " .. loopDelay .. " seconds...\n\n",gpu2p) end event.timer(loopDelay, loop, math.huge) So what I did was removing your while loop, and just put the entire code inside that loop into a function called "loop". Then I set a timer with event.timer, that will wait "loopDelay" seconds until it calls the loop function. Since I added math.huge as third variable, the loop function will be called repeatedly.
  • Popular Contributors

    Nobody has received reputation this week.

×
×
  • Create New...

Important Information

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