Jump to content

Search the Community

Showing results for tags 'lua'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Starting Zone (EN)
    • Rules & Announcements
    • General Discussions
    • Off Topic Discussions
  • Starting Zone (DE)
    • Regeln und Ankündigungen
    • Novark's Registratur
    • Allgemeine Diskussionen
  • Starting Zone (FR)
    • Règles et Annonces
    • Registres du Novark
    • Discussions générales
  • Beta Discussion
    • Beta Updates & Announcements
    • Idea Box
    • The Gameplay Mechanics Assembly
    • Streamer's Corner
    • The Builder's Corner
    • Innovation Station
    • DevBlog Feedback
  • Organizations
    • Org Updates & Announcements
    • Novark's Registry
  • Fan Art, Fan-Fic & Roleplay
    • Novark Agora
    • Novark Story Time
    • Novark Art Gallery

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location:


Interests


backer_title


Alpha


community_id

Found 57 results

  1. Basic Ore Monitor. Requires 3 Programming Boards 2 Databanks --two is needed to prevent weird code crossing bugs. later this may be less when they fix bug. 20 Containers of same Size 1 screen 1 switch 1 relay PB1->switch-> relay-> PB2 PB3 Create Events in Lua Editor and Paste the Following as Instructed. 9/17 - Fixed parameter for single boards.Changed some names and Added more exports Programming Board 1 -- Can do 9 Containers OR Read from Databanks ---screen ---databank-----only if your doing more than 9 items added last ---databank2-----only if your doing more than 9 items(using 2 helps code from being crossed from bugs)added last ---switch-----only if your doing more than 9 items ----Unit Start if Morethan9slots == "On" then switch.activate() end unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live Morethan9slots = "Off" --export:Off for 9 slots and On for more than 9 and requires databanks. local containermax = 9600 --export:;Your max container holding. local slot1item = "Bauxite" --export:;Slot1 Iten. local slot1weight = 1.28 --export:;Slot1 weight. local slot2item = "Coal" --export:;Slot2 Iten. local slot2weight = 1.35 --export:;Slot2 weight. local slot3item = "Hematite" --export:;Slot3 Iten. local slot3weight = 5.04 --export:;Slot3 weight. local slot4item = "Quartz" --export:;Slot4 Iten. local slot4weight = 2.65 --export:;Slot4 weight. local slot5item = "Chromite" --export:;Slot5 Iten. local slot5weight = 4.54 --export:;Slot5 weight. local slot6item = "Limestone" --export:;Slot6 Iten. local slot6weight = 2.71 --export:;Slot6 weight. local slot7item = "Malachite" --export:;Slot7 Iten. local slot7weight = 4.0 --export:;Slot7 weight. local slot8item = "Natron" --export:;Slot8 Iten. local slot8weight = 1.55 --export:;Slot8 weight. local slot9item = "Acanthite" --export:;Slot9 Iten. local slot9weight = 7.2 --export:;Slot9 weight. if Morethan9slots == "Off" then local dbhtml = "" local dhtml = "" local index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB1</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] screen.setHTML(html) elseif Morethan9slots == "On" then switch.activate() dbhtml = databank.getStringValue(OreMonitorTwo) dhtml = databank2.getStringValue(OreMonitorThree) local index = {1, 2, 3, 4, 5, 6} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item} -- names to display local htmlContent = "" for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB1</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[]]..dbhtml..[[]]..dhtml..[[ </table>]] screen.setHTML(html) end ---Unit Stop if Morethan9slots == "On" then switch.deactivate() end screen.clear() Programming Board 2 --databank is last slot to add and named databank ---Unit Start unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live --databank is last slot to add and named databank local slot1item = "Malachite" --export:;Slot1 Iten. local slot1weight = 4.0 --export:;Slot1 weight. local slot2item = "Natron" --export:;Slot2 Iten. local slot2weight = 1.55 --export:;Slot2 weight. local slot3item = "Acanthite" --export:;Slot3 Iten. local slot3weight = 7.2 --export:;Slot3 weight. local slot4item = "Garnierite" --export:;Slot4 Iten. local slot4weight = 2.60 --export:;Slot4 weight. local slot5item = "Petalite" --export:;Slot5 Iten. local slot5weight = 2.41 --export:;Slot5 weight. local slot6item = "Pyrite" --export:;Slot6 Iten. local slot6weight = 5.01 --export:;Slot6 weight. local slot7item = "Colbaltite" --export:;Slot7 Iten. local slot7weight = 6.33 --export:;Slot7 weight. local slot8item = "Cryolite" --export:;Slot8 Iten. local slot8weight = 2.95 --export:;Slot8 weight. local slot9item = "Gold Nuggets" --export:;Slot9 Iten. local slot9weight = 19.30 --export:;Slot9 weight. local dbhtml = "" local dhtml = "" local index = {7, 8, 9, 10, 11, 12, 13, 14, 15} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" local containermax = 9600 --export:;Your max container holding. for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB2</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] databank.setStringValue(OreMonitorTwo,html) Programming Board 3 --databank is last slot to add and named databank ---Unit Start unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live --databank is last slot to add and named databank local slot1item = "Kobelckite" --export:;Slot1 Iten. local slot1weight = 2.37 --export:;Slot1 weight. local slot2item = "Columbite" --export:;Slot2 Iten. local slot2weight = 5.38 --export:;Slot2 weight. local slot3item = "Illmenite" --export:;Slot3 Iten. local slot3weight = 4.55 --export:;Slot3 weight. local slot4item = "Rhodonite" --export:;Slot4 Iten. local slot4weight = 3.76 --export:;Slot4 weight. local slot5item = "Vanadinite" --export:;Slot5 Iten. local slot5weight = 6.95 --export:;Slot5 weight. local slot6item = "Not set" --export:;Slot6 Iten. local slot6weight = 0 --export:;Slot6 weight. local slot7item = "Not set" --export:;Slot7 Iten. local slot7weight = 0 --export:;Slot7 weight. local slot8item = "Not set" --export:;Slot8 Iten. local slot8weight = 0 --export:;Slot8 weight. local slot9item = "Not set" --export:;Slot9 Iten. local slot9weight = 0 --export:;Slot9 weight. local index = {16, 17, 18, 19, 20} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" local containermax = 1200 --export:;Your max container holding. for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB3</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] databank.setStringValue(OreMonitorThree,html) Pasteable Config for Programming Board 1. Hook up all containers (Bauxite, Coal, Hematite, Quartz, Chromite, Limestone)first and then link switch, screen, databank, databank2 and named them accordingly in the Lua editor slot area. Leave containers slots alone. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"switch","type":{"events":[],"methods":[]}},"7":{"name":"screen","type":{"events":[],"methods":[]}},"8":{"name":"databank","type":{"events":[],"methods":[]}},"9":{"name":"databank2","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"if Morethan9slots == \"On\" then\nswitch.activate()\nend\n\n\nunit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"if Morethan9slots == \"On\" then\nswitch.deactivate()\nend\n\nscreen.clear()\n","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"1"},{"code":"Morethan9slots = \"Off\" --export:Off for 9 slots and On for more than 9 and requires databanks.\nlocal containermax = 9600 --export:;Your max container holding.\nlocal slot1item = \"Bauxite\" --export:;Slot1 Iten.\nlocal slot1weight = 1.28 --export:;Slot1 weight.\nlocal slot2item = \"Coal\" --export:;Slot2 Iten.\nlocal slot2weight = 1.35 --export:;Slot2 weight.\nlocal slot3item = \"Hematite\" --export:;Slot3 Iten.\nlocal slot3weight = 5.04 --export:;Slot3 weight.\nlocal slot4item = \"Quartz\" --export:;Slot4 Iten.\nlocal slot4weight = 2.65 --export:;Slot4 weight.\nlocal slot5item = \"Chromite\" --export:;Slot5 Iten.\nlocal slot5weight = 4.54 --export:;Slot5 weight.\nlocal slot6item = \"Limestone\" --export:;Slot6 Iten.\nlocal slot6weight = 2.71 --export:;Slot6 weight.\nlocal slot7item = \"Malachite\" --export:;Slot7 Iten.\nlocal slot7weight = 4.0 --export:;Slot7 weight.\nlocal slot8item = \"Natron\" --export:;Slot8 Iten.\nlocal slot8weight = 1.55 --export:;Slot8 weight.\nlocal slot9item = \"Acanthite\" --export:;Slot9 Iten.\nlocal slot9weight = 7.2 --export:;Slot9 weight.\n\nif Morethan9slots == \"Off\" then\nlocal dbhtml = \"\"\nlocal dhtml = \"\"\nlocal index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB1</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\n\nscreen.setHTML(html)\nelseif Morethan9slots == \"On\" then\nswitch.activate()\ndbhtml = databank.getStringValue(OreMonitorTwo)\ndhtml = databank2.getStringValue(OreMonitorThree)\nlocal index = {1, 2, 3, 4, 5, 6} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item} -- names to display\nlocal htmlContent = \"\"\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB1</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[]]..dbhtml..[[]]..dhtml..[[\n</table>]]\n\nscreen.setHTML(html)\n\nend\n\n\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"2"},{"code":"dbhtmltwo = databank.getStringValue(OreMonitorTwo)\nscreen.setHTML(dbhtmltwo)","filter":{"args":[{"value":"option2"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"3"},{"code":"local index = {1, 2, 3, 4, 5, 6, 7} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7} -- slot names\nlocal weights = {1.28, 1.35, 5.04, 2.65, 4.54, 2.71, 4.0} -- inspected kg of item\nlocal items = {\"Bauxite\", \"Coal\", \"Hematite\", \"Quartz\", \"Chromite\", \"Limestone\", \"Malachite\"} -- names to display\nlocal htmlContent = \"\"\n\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><th>\"..items[i]..\"</th><th>\"..index[i]..\"</th></tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:25%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Blue;\ncolor:black !important;\">\n <th>Amount</th>\n <th>Row</th>\n <th>#</th>\n </tr>\n ]]..htmlContent..[[]]..dbhtmltwo..[[]]..dbhtml..[[\n</table>]]\n\nscreen.setHTML(html)\n","filter":{"args":[{"value":"option1"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"4"},{"code":"dbhtmlthree = databank.getStringValue(fuck)\nscreen.setHTML(dbhtmlthree)","filter":{"args":[{"value":"option3"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"5"}],"methods":[],"events":[]} Programming Board 2 Link containers(Malachite, Natron, Acanthite, Garnieririte, Petalite, Pyrite, Cobaltite, Cryolite, Gold Nuggets First and then Last slot is databank and named like so. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"databank","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"--databank is last slot to add and named databank\n\n\nlocal slot1item = \"Malachite\" --export:;Slot1 Iten.\nlocal slot1weight = 4.0 --export:;Slot1 weight.\nlocal slot2item = \"Natron\" --export:;Slot2 Iten.\nlocal slot2weight = 1.55 --export:;Slot2 weight.\nlocal slot3item = \"Acanthite\" --export:;Slot3 Iten.\nlocal slot3weight = 7.2 --export:;Slot3 weight.\nlocal slot4item = \"Garnierite\" --export:;Slot4 Iten.\nlocal slot4weight = 2.60 --export:;Slot4 weight.\nlocal slot5item = \"Petalite\" --export:;Slot5 Iten.\nlocal slot5weight = 2.41 --export:;Slot5 weight.\nlocal slot6item = \"Pyrite\" --export:;Slot6 Iten.\nlocal slot6weight = 5.01 --export:;Slot6 weight.\nlocal slot7item = \"Colbaltite\" --export:;Slot7 Iten.\nlocal slot7weight = 6.33 --export:;Slot7 weight.\nlocal slot8item = \"Cryolite\" --export:;Slot8 Iten.\nlocal slot8weight = 2.95 --export:;Slot8 weight.\nlocal slot9item = \"Gold Nuggets\" --export:;Slot9 Iten.\nlocal slot9weight = 19.30 --export:;Slot9 weight.\nlocal dbhtml = \"\"\nlocal dhtml = \"\"\nlocal index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nlocal containermax = 9600 --export:;Your max container holding.\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB2</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\n\n\ndatabank.setStringValue(OreMonitorTwo,html)\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"0"},{"code":"unit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]} Programming Board 3 Link containers(Kobelckite, Columbite, Illemnite, Rhodonite, Vanadinite) First and then Last slot is databank and named like so. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"databank","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"--databank is last slot to add and named databank\n\nlocal slot1item = \"Kobelckite\" --export:;Slot1 Iten.\nlocal slot1weight = 2.37 --export:;Slot1 weight.\nlocal slot2item = \"Columbite\" --export:;Slot2 Iten.\nlocal slot2weight = 5.38 --export:;Slot2 weight.\nlocal slot3item = \"Illmenite\" --export:;Slot3 Iten.\nlocal slot3weight = 4.55 --export:;Slot3 weight.\nlocal slot4item = \"Rhodonite\" --export:;Slot4 Iten.\nlocal slot4weight = 3.76 --export:;Slot4 weight.\nlocal slot5item = \"Vanadinite\" --export:;Slot5 Iten.\nlocal slot5weight = 6.95 --export:;Slot5 weight.\nlocal slot6item = \"Not set\" --export:;Slot6 Iten.\nlocal slot6weight = 0 --export:;Slot6 weight.\nlocal slot7item = \"Not set\" --export:;Slot7 Iten.\nlocal slot7weight = 0 --export:;Slot7 weight.\nlocal slot8item = \"Not set\" --export:;Slot8 Iten.\nlocal slot8weight = 0 --export:;Slot8 weight.\nlocal slot9item = \"Not set\" --export:;Slot9 Iten.\nlocal slot9weight = 0 --export:;Slot9 weight.\nlocal index = {16, 17, 18, 19, 20} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nlocal containermax = 1200 --export:;Your max container holding.\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB3</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\ndatabank.setStringValue(OreMonitorThree,html)\n\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"0"},{"code":"unit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}
  2. Die Mystic Dynasty hat sich folgende Bereiche zur Aufgabe gemacht: 1. Mining und Expansion 2. Schiffsbau und Design 3. Produktion und Forschung 4. Schiffshandel und Marketing Was wir dir bieten können: 1. Industrie auf Alioth 2. Discord für gemütliche Unterhaltungen. 3. Projekte innerhalb der einzelnen Bereiche sowie Corpweite Events. 4. Einführung in Dual Universe für Neulinge 5. Voxelmancy 6. LUA Programmierung 7. Du hast Familie kein Problem Das erwarten wir von dir: 1. Frustresistenz - "Es ist eine Beta, Bugs kommen und gehen... manche nennt man auch Features " 2. Lust am Miteinander in der Corp sowie Corp Beteiligung. 3. Mindestens 18+ 4. Discord beteiligung. Melde dich im Discord https://discord.gg/fqqRbHa bei derSchotte, KABOOM, ChipDE oder AepicA
  3. Main Page/Git Repo Features: All anti-gravity measurements and controls on one screen. Logarithmic altitude scale for more control at lower altitudes. Set target altitude with a slider or step at any power of 10 from 1 to 10,000 meters. Set target altitude to current altitude in one click. Lock controls to prevent accidental clicks. Power on and unlock protected by a drag-to-activate mechanism to prevent accidental disabling. Requirements: Anti-Gravity Generator (of appropriate size for ship core and with the appropriate number of pulsors linked to it) 1x Programming Board 1x Screen Databank (optional, for remembering controller state between sessions) Install/Use Instructions: Link to pre-built lua config for copy/pasting into a programming board Either build a json configuration (see Building from a Template below) or copy the one above and paste it as a Lua configuration into the programming board. Link the screen to the agScreen slot. Add links to the Anti-Gravity Generator, the Dynamic Core Unit, and the Databank if you have one. Order doesn't matter unless you edit the unit start handler to specify what slot is what instead of allowing it to autodetect them. Activate the programming board, either directly or with a signal. Get in the control seat of the ship so the ship is under control, then use the screen to adjust the antigravity.
  4. Here is a quick video tutorial on how to install and some basic usage for this version. ➡️Video Tutorial⬅️ It was brought to my attention that the spoilers were giving errors when pasted to the programming boards. The spoilers were removing bits of the JSON for some reason. So instead, I have added links to the code located between these ➡️⬅️. You can either right click the link and Save As. Or you can click on the link which will open a new page. You copy and paste the entire page into your programming board. This is a work in progress. The development is completed, but it is constantly being refined and upgraded. I encourage and welcome feedback and you are more than welcome to submit your own code, in the comments, for consideration. You can also email me using the link in the first comment. See 1st comment for more info. Here is the JSON code. Just copy/paste it to the programming board. There was a problem pasting the JSON into a spoiler, so I am making it available for download. Right click and Save as, or just click the link and copy the entire page and paste to PB. See video link at top of this post for a tutorial. ***I wasn't able to get rid of the graphics glitch entirely, but I significantly reduced the shift. Now, it's a minor annoyance instead of a massive pain. ➡️ New Industry HUD.⬅️
  5. Hello Dualiers, You are building your new starbase, with a magnificent hangar, and other amazing things, and you decide to let an AI manage it, yet it is all bland and lifeless, but you just remember there is the Text to speech api!!! so you give life and activity to your starbase, hearing the resonant control tower voices in the main hangar (note it is pressurized ofc) I think it would be great to add it, there is an open source cpp lib for it: http://www.speech.cs.cmu.edu/flite/index.html it would be great if you added these sounds to the echo features for great spaces. api bindings would be like: (if user not specified, everyone can hear it) speak('hello world' [, user]); shout('stop'[, user]); whisper('come in'[, user]); and aimanager.setVoice(voice); (or anything equivalent) voices could be cosmetic goodies, with generic male and female available by default. Hope you like it!
  6. Hello all Noveans, So ive made a small program that i call Screen++ that enables you to add animations to your screens easily. You can use it to create geometrical shapes like ovals, circles or lines and animate them. You can make the geometrical shapes to move in x or y coordinate or change the colors of the border och background of the shapes in intervalls. You can add text and animate them the same way you can animate the geometrical shapes. Check out the newest version (below) to see what new features has been added. -------------------------------------------------------------------- NEW VERSION 3.0 -------------------------------------------------------------------- DATE: 2020 11TH OCTOBER --NEW in version 3.0: -- added ability to set background image, import any picture you like and display it on your screen, normal (use base64) -- +/- in displace elemets in all direction -- added rotation for all functions, clockwise or counter clockwise -- added triangle, normal and animated -- added rectangle, normal and animated (square, width=height) -- added ability to set backgroundcolor, normal and animated -- Z-index, whats elements that should be behind or infront of other elements -- added so all functions can have filled or transparent background (only border will show) -- possible to use Hexcolors -- use variables -- link code/animations to external elements (like a door for example) Tutorial on how to use Screen++ 3.0: I STRONGLY recommend that you watch the video on youtube and not here. Because ive putted timestamps so you easier can navigate through the video This is the link to the codes that you need to copy and past into your programming board (github): https://github.com/robarzangana/dualuniverseRepo/blob/main/screenplusplus_version_3.0 If you have any questions/requests be sure to tell me about them here or on youtube. I hope you'll enjoy it! -------------------------------------------------------------------- OLD VERSION 2.0 -------------------------------------------------------------------- Ive made a tutorial on youtube on how to use Screen++, and im sorry in advance, because i mess up few times in the video. (its my second video): This is the link to the codes that you need to copy and past into your programming board (github): https://github.com/robarzangana/dualuniverseRepo/blob/main/screenplusplus_version_2.0 If you have any questions/requests be sure to tell me about them here or on youtube. I hope you'll enjoy it!
  7. I dropped my old scripts from alpha into a repository: https://github.com/Helediron/dualuniverse No license nor usage restrictions.
  8. I run a L core factory and in a different location a S core store. If the store and factory were both in the same core I would be able to move stock from production side to sales side automatically. Since they are in different cores there is no way to move stock (that I am aware of) other than going to one location, sticking it in your cargo and going to the next location. 400 years in the future (not counting time in deep sleep) and you are telling me we can’t have a delivery drone 😩 Would it not not be possible to be able to link two cores together so they act as one larger virtual core as far as placement, linking and Lua are concerned?
  9. This is the result of running the globals dumping script in-game on constructs that had various elements attached to them. Some exposed functions were called with pcall. The first value indicates whether the call was successful, the second is the actual function return value. All functions that return a vector return it as a table, not as a vec3 structure. Usually such functions will be called like this: local worldGravity = vec3(core.getWorldGravity()). Boolean values are returned as a number 0 or 1, and not as true or false. Element events are not listed here, as they cannot be detected by the dump.lua script. See the codex in-game (press F1) or outside the game (C:\ProgramData\Dual Universe\Game\documentation\web_codex.html) for event and function descriptions and other information. Anti-Gravity Generator r0.21.0 Control unit r0.21.2 Programming board exposes fewer functions compared to cockpit and seat. The control unit has references to linked elements, which are also available as local variables in each event handler. Event handlers defined in the script editor also get placed inside it. Here the control unit is a hovercraft seat that has 2 linked fuel tanks, a radar and a core. Core r0.22.4 Static cores have fewer functions compared to dynamic cores. Databank r0.21.2 Elements with a state r0.21.2 Detection areas, laser detectors and manual buttons expose the same functions. Their state is accessed using getState(). Elements with a toggle-able state r0.21.2 Force fields, ship doors, landing gears, manual switches and lights expose the same functions. The state is accessed using getState() and can be changed by activate(), deactivate() or toggle(). Emitter r0.21.2 Engine r0.21.0 Space engines, atmospheric engines, ailerons, air-brakes, retro-engines and adjustors expose the same functions. Usually engines are controlled through unit.setEngineCommand and do not require linking to the control unit. Fuel tank r0.21.2 Gyro r0.21.2 Industry Unit r0.21.2 Library r0.21.2 PVP radar (atmospheric and space) r0.22.0 Radar not available to craft or buy; for atmosphere and space radars see PVP radar instead Receiver r0.21.2 Screen r0.21.2 System r0.21.2 Telemeter r0.21.2 Warp Drive r0.21.0 Weapon r0.21.0
  10. I just spent about 3days coding a preliminary ATC system for the org I'm in. It was working (for me) but realised the script in the tower shuts off if I wander >1km away or log off. This makes the ATC system worthless entirely. From what I can tell, LUA currently is mostly limited to things like cargo / inventory management (or making HTML games). Which is INCREDIBLY limiting. I think it would be cool to give players/orgs an 'allotment' to run / host scripts on a server. This would allow really cool systems such as ATC, Automated taxi lanes etc to work. For those super-serious about LUA and advanced systems like that, it could even be a 'premium' subscription option to get more allotment on the server. By allotment I mean an amount of CPU resources, and a script can be analysed to estimate how expensive the script will be on the server which takes up your allotment. If it goes over, you get a 5 minute or whatever warning to turn it (or another script) off to bring you under the limit or scripts will be shut off automatically.
  11. About This is a basic autopilot script that can accelerate your construct towards a planet and later apply brakes to stop. Vertical space engines are used to control drift. Requirements Space brakes, 1.5+ g. Vertical space engines (pointing down), 0.3+ g. A remote controller or a separate hovercraft seat. Limitations No manual piloting. Use another script to get to space and to land. No collision avoidance. Make sure there are no planets, moons, asteroids, space stations or pirates between you and the destination. Planet positions are stored in the script. If NQ moves the planets, the script will have to be updated. Set-up With an auto-configuration schema (recommended) Download this file to Game\data\lua\autoconf\custom in your Dual Universe installation directory. By default it's C:\ProgramData\Dual Universe\Game\data\lua\autoconf\custom Right-click the control unit (a remote controller or a hovercraft seat) and select "Update custom autoconf list". This needs to be done only once. Right-click the control unit and select "Actions for this element", "Run custom autoconfigure", "Basic Space Autopilot". With a pasteable script configuration Open this link and copy everything to clipboard. Right-click the control unit (a remote control or a hover seat) and select "Actions for this element", "Paste Lua configuration from clipboard". The game should display a "Lua script loaded" message. If it did not, restart the game and copy the script configuration again. Link the core (required) and fuel tanks (optional) to the control unit. Credits Many planet positions were provided by @meigrafd from Hyperion. The script was bundled (amalgamated from multiple .lua files) using amalg. Change log 2020-09-23. Fixed heavy constructs not accelerating past 29997 km/h. A radar widget will be displayed if a PVP radar is linked (not available on remote controllers). Tested in r0.22.2. 2020-09-16. Posted the first version outside the NDA forums section. Tested in r0.21.6.
  12. About This is a short script that prints base max thrust of linked engines. It can serve as an example, and may also be used to detect which engines do not have a technician buff applied to them. Set-up Place a programming board. Link up to 10 engines to the programming board. In the Lua editor (right-click, "Advanced", "Edit Lua code") create a unit start() event handler with this code: -- detect linked engines local engines = {} for key, value in pairs(unit) do if type(value) == "table" and type(value.export) == "table" then -- `value` is an element and `key` is the slot name if value.getThrust and value.getMaxThrust then -- `value` is an engine engines[#engines + 1] = value end end end -- get engine names local engineNames = {} for _, engine in ipairs(engines) do -- engine name is available in its widget data -- for other elements `core.getElementNameById` would have to be used instead local dataJson = engine.getData() local data = json.decode(dataJson) engineNames[engine] = data.name or "???" end -- sort engines by name table.sort(engines, function (engine1, engine2) return engineNames[engine1] < engineNames[engine2] end) -- print engines and their base max thrust system.print("Linked engines: " .. #engines) for _, engine in ipairs(engines) do local name = engineNames[engine] local maxThrustBase = engine.getMaxThrustBase() system.print(string.format("%s: %.0f N", name, maxThrustBase)) end unit.exit() Click "Apply" in the Lua editor, exit build mode and activate the programming board. You should see base max thrust printed in the Lua chat tab. Change log 2020-09-13. Posted the first version (tested in r0.21.5).
  13. Like the title says, this is probably a simple question but I'm having an issue getting any kind of custom tweaking done in my ship. Hopefully one of you knowledgeable folks can let me know where I've gone wrong. Currently my ship is setup as a flying construct with the mouse-point control method. I figured I'd start with some 'simple' adjustments so that the ship behaved differently when below a certain speed to simplify the landing process. Apparently I was too ambitious, because when I try to fly the ship it locks up the controls and I get a lovely red "LUA Error" message. I did my best to stick to pretty simple code based on what was already in the script so I'm pretty sure my syntax is correct, but I'm new to LUA so I could be way off base. Here's the code I've tried starting with: local autoRollVelThreshold = 50.0 --my created variable local constructVelocity = vec3(core.getWorldVelocity()) --pre-existing variable -- rolls wings level if velocity is below a certain limit defined by the variable autoRollVelThreshold if constructVelocity < autoRollVelThreshold then local targetRollDeg = utils.clamp(0,currentRollDegAbs-30, currentRollDegAbs+30); -- we go back to 0 within a certain limit if (rollPID == nil) then rollPID = pid.new(autoRollFactor * 0.01, 0, autoRollFactor * 0.1) -- magic number tweaked to have a default factor in the 1-10 range end rollPID:inject(targetRollDeg - currentRollDeg) local autoRollInput = rollPID:get() targetAngularVelocity = targetAngularVelocity + autoRollInput * constructForward end It's based on the pre-existing code for the auto-roll parameter, except instead of using the true/false autoRoll variable I'm using the local variable constructVelocity defined elsewhere in flush() alongside my local variable autoRollVelThreshold which sets the speed at which the action takes place. I thought this would be a simple start to something more complex but it appears I've got some basic issues I still need to get sorted. Any help would be greatly appreciated, thanks.
  14. I have been working on a script to construct HTML for those who want a simple tool yet quite powerfull I hope. The Idea is to have the script as a file in your Lua environement and just use the require() function, then start building your HTML. There is a demo at the end of the script (put the commented lines in your unit.start then uncomment them) HTMLhandler = require(HTMLhandler) HUD = HTMLhandler:Create(system) Features: The tool accept multiple monitors at once, like several screens or HUD (system). myHTMLhandler:Create(system,screen1) Simple usage: To get a simple window inside a left grid in your cockpit you can do: local myHTMLhandler = require("HTMLhandler") normalScreen = myHTMLhandler:Create(system) local baseGrid = myHTMLhandler:addDiv("", "left grid") local myWindow, myWindowContent = myHTMLhandler:addWindow(baseGrid, "MyWindow", "Inside the window") ---- change the content inside the window ---- local changeInside = "change the inside of the window" myHTMLhandler:updateContent(myWindowContent, changeInside) You can create a div with a string or a variable like that myHTMLhandler:createDiv(myVar) and it will display on the selected screen as long as the variable accept the tostring() conversion. You can pass in parameter custom style or/and class. There is also function to create a window and a table. At any time you can change the content as the "addx" functions returns a contentId. For the table, when created you get a table of contentId to modify the column's header and when adding a line you get a table of contentId to modify what's in the line. You can also delete a line or push a new line at the top of the table. indexSimpleDiv = myHTMLhandler:addDiv("simpleDiv") myHTMLhandler:addDiv(indexSimpleDiv, "anotherDiv in SimpleDiv") myHTMLhandler:deleteElement(indexSimpleDiv) -- the anotherDiv will be anchor into the simple Div, but once you delete the simpleDiv it will also delete its child, being "anotherDiv" mainDiv, contentIdMainDiv = myHTMLhandler:addDiv("MainDiv", "left grid") -- this will create a div with the content "MainDiv" and class "left" and "grid" local tableDiv = myHTMLhandler:addDiv(mainDiv, "", "window") -- create a div with the class window as NQ style (works only with HUD) local columnHeaders = {"Name", "Quantity", "Container", "Container size"} --define the title of the column's header for the table local simpleTable = myHTMLhandler:addSimpleTable(tableDiv, columnHeaders) -- create a table with headers local firstLine = {"Gold", "153kL", "Treasure", "L"} local firstLineId, firstLineContentId = myHTMLhandler:addSimpleLine(simpleTable, firstLine) -- add a first line local secondLine = {"Silver", "20kL", "Chest"} local secondLineId = myHTMLhandler:addSimpleLine(simpleTable, secondLine) --add a second line but without data in the last column local pushToFirstLine = {"Plastic", "FULL", "line pushed #1", "M"} myHTMLhandler:addSimpleLine(simpleTable, pushToFirstLine, 2) -- add a third line but at the top position in the table (1 being the headers) myHTMLhandler:updateContent(firstLineContentId[2], "20kL") -- change the amount of gold of "firstLine" Advanced usage: You can change the position of element, attach it to any other element, pass the class and the style in parameters, you can delete it and you can update the content. But it is also possible to do more advanced stuff like creating any HTML element template and use them by referencing them. It should also be possible to do svg tags like that : myHTMLhandler:defineElement("svg", '<svg height="100%" width="100%">', '</svg>') then use myHTMLhandler:addElement("svg",myContentInsideTheTag) The defineElement and the addElement accept variadic parameters so there is in theory no limit Another example, to make this '<line x1="939" y1="537" x2="957" y2="519" style="stroke:rgb(1, 165, 177);opacity:0.7;stroke-width:3"/>' being encapsulated as an element you can do: myHTMLhandler:defineElement("svgLine", '<line ', '" style="stroke:rgb(1, 165, 177);opacity:', ';stroke-width:', '"/> ') local content = 'x1="939" y1="537" x2="957" y2="519"' local svgLineId, svgLineContent = myHTMLhandler:addElement("svgLine", content, 0, '0.7', '3') 0 being a default postion value, if you want to change the position in a list of element (see above for the table). '0.7' the opacity and '3' the strokewidth. now you can change the content by using (by default it will rebuild the HTML and display it as soon as the function ends) : myHTMLhandler:updateContent(svgLineContent, 'x1="0" y1="12" x2="37" y2="24"') Note that multi-content is only availible for table for the moment. others functions: addWindow(Anchor, Title, Content, TitleClass, TitleStyle, ContentClass, ContentStyle, Pos) -- to build a window with the NQ style setAutoDisplay(boolean) setAutoCompute(boolean) -- for big HTML structure you might want to turn them off as every time you add element or edit content the HTML is rebuild and displayed compute() --build the HTML display() --display HTML on all the "monitors" computeAndDisplay() --straightforward getElementHTML(Index) -- to get just a chunk of HTML could be used to display just a part of the structure somewhere else I am aware that there is other tool to build HTML. If you find a bug please report it. If you need help, ask me (same name on discord and IGN) or in the #lua-scripting discord channel If you make your own design using the tool, consider sharing Special thanks to @hdparm ps: I'll put images when the server works pastebin instead of file: https://pastebin.com/KuMRGFFp create a file "HTMLhandler.lua" and save it at the root of lua folder as below
  15. About This tool enables a somewhat different way of writing Dual Universe scripts. It takes a single Lua file that defines a global object with event handlers, and automatically generates a script configuration that can be pasted into a control unit. This allows writing the entire script outside the game, and automates away the need to manually set up each event handler. Prerequisites Some knowledge of Dual Universe Lua scripting (watch the official tutorial) Be able to run a Lua script from the command line. Download wrap.lua example-input.lua example-output.json Usage example Let's make a simple script that will react to key presses and display some text on a screen element. 1. Edit and save a Lua script in any plain text editor: -- Define a global script object with event handlers script = {} function script.onStart () -- Display some text screen.setCenteredText("script started") -- Create some timers to show that the script is working unit.setTimer("a", 2) -- timer id "a", ticks every 2 seconds unit.setTimer("b", 3) -- timer id "b", ticks every 3 seconds end function script.onStop () screen.setCenteredText("script stopped") end function script.onActionStart (actionName) screen.setCenteredText(actionName .. " key pressed") end function script.onActionStop (actionName) screen.setCenteredText(actionName .. " key released") end function script.onTick (timerId) screen.setCenteredText("timer " .. timerId .. " ticked") end -- Other events that are available by default: -- * onActionLoop(actionName): action key is held -- * onUpdate(): executed once per frame -- * onFlush(): executed 60 times per second, for physics calculations only; setEngineCommand must be called from here -- Slot events are available if slot type is set with the --slot command line option. function script.onMouseDown (x, y) screen.setCenteredText("mouse down: x=" .. x .. " , y=" .. y) end -- Call the start event handler -- Alternatively, initialization code can be placed anywhere in this file. -- The only requirement is that there is a global "script" object with event handlers script.onStart() Note: sometimes invalid characters are added when copying code from forums. If that happens, copy code from the provided link instead. 2. Run the packaging script: lua wrap.lua yourscript.lua yourscript.json --slots screen:type=screen --handle-errors --slots screen:type=screen sets first slot's name to screen and adds mouse down/up event support for that slot. --handle-errors adds error handling code, so that run-time Lua errors are displayed on the screen and in the Lua tab. 3. Open the resulting configuration file in a text editor, and copy everything to clipboard. 4. Inside Dual Universe, prepare a construct. There must be a programming board and a screen, and the screen must be linked into the programming board's slot 1. 5. Right-click on the programming board, select "Advanced", "Paste Lua configuration from clipboard". Done! The DU construct has been programmed without opening the in-game editor once. Activate the programming board and see if it works. Command line arguments Command line examples To produce a pasteable configuration for a custom piloting script: lua wrap.lua pilot.bundle.lua pilot.bundle.json --slots core gyro container_0 screen verticalEngine To produce a pasteable configuration for a radar script: lua wrap.lua radar.bundle.lua radar.bundle.json --handle-errors --default-slot type=pressable To produce an autoconf file for another custom piloting script: lua wrap.lua flight-enhancednav.bundle.lua flight-enhancednav.conf --output yaml --name "Airplane Cockpit (Enhanced)" --slots core:type=core gyro:type=gyro container:type=fuelContainer,select=all --handle-errors Known issues "Root node should be a map" This error is caused by wrong .conf file encoding. If you are using Powershell, the > operator saves the output with UCS-2 LE BOM encoding. Use cmd.exe instead, or replace > my.conf with | Out-File -Encoding UTF8 my.conf, or do not use output redirection, as the output file name can now be specified as an argument. Change log 2020-09-04. Posted the first version outside the NDA forums section. Output can now be written to a file without using output redirection. Credits This tool uses argparse and dkjson libraries, and was bundled using amalg.
  16. How can i change the item my refiner is producing? I only found the different starting and stopping methods in the Help(F1) documentation. Do i really need to setup multiple refiners to get all ores automated? That would be heavy on the already poor performance.
  17. This is the output of a script that dumps all global variables. Lua coders may find this somewhat useful. The script was run in r0.21.2 on a hovercraft seat that has 2 fuel tanks and a radar linked. Some functions were called with pcall. The first value indicates whether the call was successful, the second is the actual return value or the error message. To see only elements' functions, visit this topic. Dumping script The script used for dumping is based on something I found on Stack Overflow, with some extensions. In unit start(): https://gist.github.com/d-lua-stuff/180707c172382d06d2c80213a1638f66 In system update(): coroutine.resume(dumping_coroutine) The script will run for a few seconds and then automatically turn off. Output is saved to Dual Universe 's log files in %LOCALAPPDATA%\NQ\DualUniverse\log Dump analyzer To avoid having to look through the logs manually, a Python script was written. It extracts the output of the globals dumping script from Dual Universe's log files, and creates separate files for dumped globals and for members of each linked element. Usage: pip install six python dump_analyzer.py C:\Path\To\Log\File.xml Change log 2020-09-01. Posted the first version outside the NDA forums section.
  18. As a future developer in Dual Universe, the idea of DACs as payment seems like an interesting prospect. But the more I think about it, the more it seems like a bit of a d-bag move on the part of the developers. I don't want this to be an overtly negative post, but bear with me.. I intend to be creating a whole lot of stuff in game, ships, defenses, tools, etc. with full Lua scripting to back them all up. These things will take a TON of time to develop if you hope to have a decent result from them. However, with the Dual Access Coupons being the only *real* form of payment I can hope to receive in game, it kind of feels like a bit of a face slap. Think about it. I spend 25 hours working on a super awesome engine control module with advanced auto-maneuvering for someone who requested it custom. Joe Space Captain goes to the Dual website and buys himself two DACs to give to me as payment for the work I did. Great, I got this month and next in game for free as payment. = 30 Euro savings or whatever for me. Now, instead of a custom job, I make a super awesome base turret blueprint that I sell on open market. Let's say 250 people buy it at 500 credits each, and I trade those 125,000 credits for 5 DACs that people are selling on the market. What happened here? I now have 5 free months in game, which I may or may not ever use, but NovaQuark just made 75 euro in real money cash for all of that work that I did. Once I start collecting DACs like candy because now 10,000 users have realized how good it is and have purchased my super-awesome turret, NQ is rolling in the money for work I did, and those DACs I accrued have become virtually useless to me. Obviously, I made assumptions the monthly fee is 12 euro and DAC are 15 euro. Actual cost doesn't really matter. The more I make and sell on market, the more trivial the DACs will become. Meanwhile, NQ makes tons of constant value cash on my work. My alternative would be to just hoard the in-game currency, which has equally nil real-world value. I have to imagine that with this system of payments, serious developers and builders will eventually just start dealing outside of the game and make contracts to do in-game work with payments in real cash. That's the only way it would actually be worth it to build things over the long term. All of the really good stuff in game will only be accessible through various user-run black markets outside of game, with in-game market only used for trivial purchases just to get items transferred and to earn the in-game money needed for resource accumulation. I could be wrong, but that's what I foresee happening. What are your thoughts?
  19. So I was wondering. We will be able to script in LUA, which is pretty cool. But what if we were able to have databases as well to store and fetch data? Think about the world of programming it would open : statistics, history, logging, stock situation of a warehouse, forecast... basically all information-based services! It could be done with a database element that would whether : - Connect to a reserved database on NQ servers, one on each account to which you could assign rights (to allow organizations to use it) - Connect to an external database on the user's PC or on online. Thoughts?
  20. I know that "predefined sounds" is on the "Considered" list on Trello: https://trello.com/c/HVdTjEsH/51-functional-scriptable-speakers-able-to-play-predefined-sounds While I think that would be cool, I think it would be cooler if we had access to a synth sound module through LUA to build and sequence our own custom sounds. Writing sound synthesis by hand isn't unheard of in LUA, for example: And even more, here are some tracks composed entirely with LUA: https://soundcloud.com/luehi/systemf https://soundcloud.com/luehi/luacid1 https://soundcloud.com/luehi/early https://soundcloud.com/luehi/selfkitchen https://soundcloud.com/luehi/luaessay5 https://soundcloud.com/luehi/movk I think that giving us the flexibility to define our own sounds with such an approach would be incredibly more valuable than choosing from a list of predefined sounds. In case anyone is wondering, yes I am suggesting this because I want a night club in DU.
  21. Hey, will there be a kind of Database? Or maybe just a storage for Plain text? If not, please integrate it!!! It would offer so many cool things ! The second idea that i have would be a Networking System between single stations. Further it would be nice to have a quantum cummunicator (for the LUA machines) to communicate beyond planets.
  22. Is there a lifespan to how long a variable in Lua will retain its value in memory, or with this being a 'persistent universe' do variables never lose their value once assigned?
  23. The devs have said that automated mining will probably not be an option. As a student of business and economics, here's what I think: ABSTRACT: Limiting script automation for both mining and weapons fire will greatly limit the capacity for economic growth and in-game innovation. The mining industry, for example, will start out with individuals mining for minerals and directly selling them to other players or on an open market. It will eventually evolve into a number of mining corporations that will be able to provide minerals more cheaply through an organized workforce and semi-automated processes. This is inevitable, as it should be. But why limit the mining industry to this level of business innovation? By disallowing further automation, yes, the market for mundane repetitive tasks like mining by hand will be preserved. But what would happen to the broader job market in a simulated economy where automation is unregulated? It would expand exponentially. How would automated mining exponentially expand economic growth and job availability? Well, the whole purpose of automation is to reduce labor costs, to reduce the price of goods (raw minerals, in this case), so that, in a competitive free market economy, businesses can stay... competitive. Inevitably, reducing the price of raw minerals allows other businesses, further up the chain of production, to increase production and lower their prices (competitive market, remember). These reduced prices further up the chain of production lead to increased demand and, therefore, new market opportunities. STORY TIME: John Smith is a miner. He mines steel all day for Mineral Corp, gets a commission based on how much steel he mines, and Mineral Corp sells the steel to spaceship manufacturing facilities. One day Mineral Corp decides to cut costs by using automated mining drones. Nooooo!!!! Curse you Human Ingenuity!! Let's look at what just happened: In order to cut costs, mining corporations are now buying automated mining drones. This new demand for drones is providing jobs for programmers, industrial designers, manufacturers, and even truckers (to transport all the extra minerals that are being more cheaply produced and are increasingly in demand by all these industries)! Back to John Smith: John lost his job to robots. The Luddite fear that soulless computers will replace all the honest employees has come true! *cough cough* But when John's at home, drinking away his sorrows with some Pan Galactic Gargle Blaster, he opens up the classifieds and is shocked to see hundreds of jobs available that weren't there yesterday! Not only jobs related to the production of mining drones, but many seemingly unrelated jobs! Where did these other jobs come from? They came from the steel being cheaper. Businesses that use that steel for product production, like spaceships and buildings, can now sell their products more cheaply. Having cheaper spaceships increases the demand for spaceships because more people can afford them. In order to meet that increased demand, spaceship manufacturers must increase their production by hiring more employees (new jobs! Yay!). So now, even though less people are mining by hand, more people are building spaceships (as well as countless other things)! John Smith may not be mining anymore, but he has a new job now, that pays more, and he can enjoy a cheaper cost of living thanks to those beautiful automated mining drones. BASIC FORMULA: Automation = reduced cost. Reduced cost + competition = reduced price. Reduced price = increased demand. Increased demand = increased production. Increased production = increased job availability. Automation + competition = increased job availability. Can we please have free automation scripting? (I may touch on automated weapons-fire later)
  24. Keviner88

    HTML Standard

    Can you not use the CHROME instead of the IE or EDGE standard for the HTML standard? Because there are many more possibilities and Microsoft also wants to change to the CHROME standard in the future.
  25. Hey everyone, a few minutes ago, someone asked a question on the official Discord: "How are services going to work in the game, can you have an automated service charge you [...] Like say you have automated buses" That's when I had the idea of a programmable payment terminal. It would be a device that you can place down and customize what it does on interaction. Does it allow donations? Does it pay out some quanta ever so often? Does it request a payment of some amount? On a successful payment it could output a logic signal or do something more complex using LUA. I think we need some way to automate ingame payments, and I think a programmable payment terminal/interface would be an awsome way of achieving that. Just tell me what you think about it!
×
×
  • Create New...