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

Plazter

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by Plazter

  1. 8 hours ago, RandomRedMage said:

    I would, but they would be useless to anyone other than me, in my current world, with my current set of nany machines. Nanomachines are randomized, so upon ingesting them, the different abilities you can get are completely random. For example, If I activate flag 5, and flag 7 I get Night Vision, Absorption, and Fire Protection. Someone else, may just get, water breathing or or haste. So it's best to test out what you can get and be careful. Instant damage is also a potential effect, and that can be a bit deadly.

    oh... i wasnt aware of that well ok!, thanks for the response :D looks usefull !

  2. Hello folks!, i've been working on this little program for a few days, and think im at the final stage i want it to be in.

    - This is the first program i share on here, hope you will enjoy it ^^

    PASTEBIN

    //Plazter

     

    ADDED FAILSAFE FUNCTION, Note: In the Vars you're able to set a temperature you want it to turn off at, and set it on or off. The fail safe is on by default.

    Picture + code:

     

    http://imgur.com/a/jymyH

     

    Code:

     
    
    
    --[[
    //      MADE BY...: Plazter
    //      Date......: 29. April 2017
    //      Mod:......: OpenComputers
    //  
    //      Note: This program contains a debug tool, thats intented for you to use
    //            to figure out where to get your clicks, incase a button or something
    //            is not working correctly. if you use this program, i hope you will
    //            Enjoy it.
    --]]
    ------------------------------------------------------------------------------------------------------------------
                                                     --[[ WRAPPINGS ]]--
    ------------------------------------------------------------------------------------------------------------------
    component = require("component")
    reactor = component.draconic_reactor
    FluxGateOutput = component.proxy(component.get("61f04087-c625-45db-b2ab-294f808749a4")) -- 61f04087-c625-45db-b2ab-294f808749a4
    FluxGateShield = component.proxy(component.get("b0c649d1-fac1-48bd-bc57-d1f448439233"))
    term = require("term")
    gpu = component.gpu
    event = require("event")
    keyboard = require("keyboard")
    ------------------------------------------------------------------------------------------------------------------
                                                     --[[  TABLES  ]]--
    ------------------------------------------------------------------------------------------------------------------
    
    args = {...}
    
    colors = { black = 0x000000, white = 0xf8f8ff, blue = 0x0000ff, lightGray = 0xd9d9d9, red = 0xff0000,
    purple = 0x9b30ff, carrot = 0xffa500, magenta = 0xcd00cd, lightBlue = 0x87cefa, yellow = 0xffff00,
    lime = 0x32cd32, pink = 0xffc0cb, gray = 0x696969, brown = 0x8b4500, green = 0x006400, cyan = 0x008b8b,
    olive = 0x6b8e23, gold = 0x8b6914, orangered = 0xdb4e02, diamond = 0x0fa7c7,crimson = 0xaf002a,fuchsia = 0xfd3f92,
    folly = 0xff004f, frenchBlue = 0x0072bb, lilac = 0x86608e, flax = 0xeedc82, darkGray = 0x563c5c,
    englishGreen = 0x1b4d3e, eggplant = 0x614051, deepPink  = 0xff1493, ruby = 0x843f5b, orange = 0xf5c71a,
    lemon = 0xffd300, darkBlue = 0x002e63, bitterLime = 0xbfff00 }
    ------------------------------------------------------------------------------------------------------------------
                                                     --[[ VARIABLES ]]--
    ------------------------------------------------------------------------------------------------------------------
    Border_bg = colors.white
    Default_bg = colors.black
    text_col = colors.orange
    status_col = colors.blue
    failsafe = true
    failSafeTemp = 6500
    ------------------------------------------------------------------------------------------------------------------
                                                     --[[ FUNCTIONS ]]--
    ------------------------------------------------------------------------------------------------------------------
    function guiBorders(x,y,len,height,str) -- BORDER FUNC FOR GUI
      gpu.setBackground(Border_bg)
      gpu.fill(x,y,len,height,str)
      gpu.setBackground(Default_bg)
    end
     
    function GUI() -- SETS THE GUI LAYOUT (GRAPHICAL USER INTERFACE)
      gpu.setBackground(Default_bg)
      term.clear()
      w,  h = gpu.getResolution()
      guiBorders(1,1,w,1," ")
        for i = 1,h do
          guiBorders(1,i,1,1," ")
          guiBorders(w,i,1,1," ")
        end
      guiBorders(1,h,w,1," ")
      gpu.setForeground(text_col)
    end
    
    function Center(y,text) -- CENTERS TEXT   
      w, h = gpu.getResolution()
      term.setCursor((w-string.len(text))/2+1, y)
      term.write(text)
    end
    
    function info(title,x,y) -- Rewriting of gpu.set
      gpu.set(x,y,title)
    end
    
    function InfoUpdate(y, text) -- Text for function UPDATE
      w, h = gpu.getResolution()
          place = (w-string.len(text))-2
        gpu.set(place, y, text)
    end
    
    function display() -- Text to load onto screen on launch
      -- TITLE
      Center(2, "{{  Draconic Reactor  }}")
      -- Info Title
      info("Temperature",2,4)
      info("Shield",2,6)
      info("Generation Rate", 2,8)
      info("RF Output", 2, 10)
      info("RF Net gain", 2,12)
      info("Energy Saturation", 2, 14)
      info("Fuel Conversion Rate", 2,16)
      -- Button Panel
      Center(18, "Set Output")
      Center(19, "<<< << < = > >> >>>")
      Center(21, "Set State")
      Center(22, "Charge - Online - Offline")
      end
    
    function UPDATE() -- The Information we want to keep update
      InfoUpdate(5, "  "..tostring(temperature).." C") -- Temperature
      InfoUpdate(7,"  "..string.format("%2.f",perc*100).." %") -- Shield %
      InfoUpdate(9,"  "..tostring(gen).." RF/T") -- Generating
      InfoUpdate(11, "  "..tostring(FluxGateOutput.getFlow()).." RF/t") -- What the Current output is set to.
      InfoUpdate(13,"  ".. tostring(FluxGateOutput.getFlow() -FluxGateShield.getFlow()).." RF/t") -- The total gain in rf
      InfoUpdate(15, "  "..string.format("%.3f",tostring(reactorInfo.energySaturation / reactorInfo.maxEnergySaturation * 100)).." %") -- The 		
      --energy Saturation
      InfoUpdate(17, tostring(reactorInfo.fuelConversionRate).." nB/t")  -- Fuel use
    end
    
    
    
    function getPress(line) -- Reads where we press, and set it as we wishes it
      if x ~= nil and y ~= nil then
        if x >= 32 and x <= 37 and y == 22 then -- Online
          reactor.activateReactor()
          gpu.setBackground(status_col)
          gpu.set(32,22, "Online")
          gpu.setBackground(Default_bg)
          gpu.set(23,22, "Charge")
          gpu.set(41,22,"Offline")
        elseif x >= 23 and x <= 28 and y == 22 then -- Charge
          reactor.chargeReactor()
          gpu.setBackground(status_col)
          gpu.set(23,22, "Charge")
          gpu.setBackground(Default_bg)
          gpu.set(32,22, "Online")
          gpu.set(41,22, "Offline")
        elseif x >= 41 and x <= 47 and y == 22 then --Ofline
          reactor.stopReactor()
          gpu.setBackground(status_col)
          gpu.set(41,22, "Offline")
          gpu.setBackground(Default_bg)
          gpu.set(23,22, "Charge")
          gpu.set(32,22,"Online")
        end
    
        if x >= 23 and x <= 29 and y == line then -- <<<
          FluxGateOutput.setFlowOverride(currOut - 10000)
        elseif x >= 30 and x <= 32 and y == line then -- <<
          FluxGateOutput.setFlowOverride(currOut - 1000)
        elseif x >= 33 and x <= 34 and y == line then -- <
          FluxGateOutput.setFlowOverride(currOut - 100)
        end
    
        if x >= 36 and x <= 37 and y == line then -- >
          FluxGateOutput.setFlowOverride(currOut + 100)
        elseif x >= 38 and x <= 41 and y == line then -- >>
          FluxGateOutput.setFlowOverride(currOut + 1000)
        elseif x >= 42 and x <= 46 and y == line then -- >>>
          FluxGateOutput.setFlowOverride(currOut + 10000)
        end 
      end
    end
    
    function FailSafe()
    	if failsafe then
    		if temperature > failSafeTemp then
    			reactor.stopReactor()
          		gpu.setBackground(status_col)
          		gpu.set(41,22, "Offline")
          		gpu.setBackground(Default_bg)
          		gpu.set(23,22, "Charge")
          		gpu.set(32,22,"Online")
    		end
    	end
    end
    		
    ------------------------------------------------------------------------------------------------------------------
                                                  --[[ PROGRAM INITATION ]]--
    ------------------------------------------------------------------------------------------------------------------
    
    gpu.setResolution(70,23)
    
    GUI() -- Loads screen layout
    display() -- Loads Text Layout
    ------------------------------------------------------------------------------------------------------------------
                                                     --[[ MAIN LOOP ]]--
    ------------------------------------------------------------------------------------------------------------------
    
    while true do
        --UPDATING VARS THAT NEEDS TO BE HERE --
        reactorInfo = reactor.getReactorInfo()  
        target = 0.30
        currShield = reactorInfo.fieldStrength
        maxShield = reactorInfo.maxFieldStrength
        perc = (currShield/maxShield)
        shieldDrain = reactorInfo.fieldDrainRate
        shieldStr = reactorInfo.fieldStrength
        temperature = reactorInfo.temperature
        currOut = FluxGateOutput.getFlow()
        gen = reactorInfo.generationRate
        -- FUNCTIONS TO KEEP LOOKING UP --    
        UPDATE()
        getPress(19)
        FailSafe()
        -- EVENT LISTENER 
        _,_,x,y = event.pull(1, "touch")    
          -- DEBUG TOOL
          if args[1] == "debug" then
            if x ~= nil and y~= nil then
              Center(16,"X: ".. x .." Y: "..y)
            end
          end
          -- TERMINATE PROGRAM AND RESTORE RESOLUTION
          if keyboard.isKeyDown(keyboard.keys.w) and keyboard.isControlDown() then
              term.clear()
              w,h = gpu.maxResolution()
              gpu.setResolution(w,h)
              os.exit()
        end
    
    end

     

  3. function checkDust()
        top = trans.getInventorySize(chest)
        for i = 1,top do
            inventory = trans.getStackInSlot(chest, i)
            if inventory ~= nil then
                for k,v in pairs(inventory) do
                    if k == "name" then
                        if v == "minecraft:cobblestone" then
                            trans.transferItem(chest, hammer, 1,i, 1)
                            os.sleep(.5)
                            trans.transferItem(hammer, chest)
                        elseif v == "minecraft:gravel" then
                            trans.transferItem(chest,hammer, 1,i,1)
                            os.sleep(.5)
                            trans.transferItem(hammer, chest)
                        elseif v == "minecraft:sand" then
                            trans.transferItem(chest, hammer, 1,i, 1)
                            os.sleep(.5)
    						trans.transferItem(hammer, chest, 1,i,1)
                        elseif v == "exnihloadscensio:blockDust" then
    						trans.transferItem(chest, siev, 1,i,1)
    					end
                    end
                end
            end
        end
    end

    this is one of my functions on my functions in my sieve program, this is how i check all the slots =), hope its for any use to u :P

     

  4. Cwest = chestwest.getInventorySize(sides.west)

    For i = 1,Cwest do

     Check = chestwest.getStackInSlot(sides.west, i)

    For k,v in pairs(Check) do

    If check ~= nil then

    If k == ''label'' then -- this can be name aswell, comes out like ''minecraft:stone''

    --func 

    End

    End

    End

    End

     

    This should get the name in the way u want ^^

  5. Hello folks!, i've been browsing, searching for hours now,  tried and tested, done whatever i could do, i have been trying to find/make my code read from another file, that it also eventually should save to, but havent  gotten that far yet ^^, the reason i want to do it with another file, is because, the server i play on crash, or if the area aint loaded, the computer needs to be rebooted, and i would like to be able to add new Todo's as i go.

    I must admit, this is a stupid and hard wall, and its properly VERY simple, once i get it :b, none the less, heres the code im at. 

    --[[                                            [Requirements]                    ]]--
    component = require("component")
    event = require("event")
    gpu = component.gpu
    computer = component.computer
    keyboard = require("keyboard")
    term = require("term")
    fs = require("filesystem")
    
    
    
    Scolors = { black = 0x000000, white = 0xf8f8ff, blue = 0x0000ff, lightGray = 0xd9d9d9, red = 0xff0000,
    purple = 0x9b30ff, carrot = 0xffa500, magenta = 0xcd00cd, lightBlue = 0x87cefa, yellow = 0xffff00,
    lime = 0x32cd32, pink = 0xffc0cb, gray = 0x696969, brown = 0x8b4500, green = 0x006400, cyan = 0x008b8b,
    olive = 0x6b8e23, gold = 0x8b6914, orangered = 0xdb4e02, diamond = 0x0fa7c7,crimson = 0xaf002a,fuchsia = 0xfd3f92,
    folly = 0xff004f, frenchBlue = 0x0072bb, lilac = 0x86608e, flax = 0xeedc82, darkGray = 0x563c5c,
    englishGreen = 0x1b4d3e, eggplant = 0x614051, deepPink  = 0xff1493, ruby = 0x843f5b, orange = 0xf5c71a,
    lemon = 0xffd300, darkBlue = 0x002e63, bitterLime = 0xbfff00 }
    
    
    --[[                                            [Var]                             ]]--
    
    --Line = 4
    
    --[[                                            [Table for list]                  ]]--
    
    Todo = {}
    
    --[[                                            [Functions]                       ]]--
    
    function getTodo()
    	for line in io.lines("TodoList.txt") do
    		table.insert(Todo, line)
    	end
    end
    
    --[[                                            [Exit Key]                        ]]--
    
    function Exit()
    	if x ~= nil and y ~= nil then
    		if x >= 12 and x <= 18 and y == 1 then
    			os.exit()
    		elseif x >= 16 and x<=20 and y == 1 then
    			os.execute("edit todo")
    		end
    	end
    end
    
    
    --[[                                             [MODE KEY]                       ]]--
    
    function mode()
        h,w = gpu.getResolution()
    	if x ~= nil and  y ~= nil then                    
    		gpu.set(h-10,w, "X: ".. x.. " Y: ".. y)
    		os.sleep(1)
    			if x >= 1 and x <= 9  and y == 1 then
    				Add()        
    				os.sleep(1)
    			end
    		term.clear()
    		os.sleep(.5)    
    	end
    end
    
    --[[                                             [ADD KEY]]                       ]]--
    
    function Add()
    	h, w = gpu.getResolution()
    	gpu.setForeground(Scolors.orange)
    	gpu.set(1, w,"Enter Todo: ")
    	term.setCursor(13,w)
    	
    	data = io.open("TodoList.txt","a")
    	input = io.read()
    		if input then
    			data:write(input.."\n")
    		end
    	data:close()
    end
    
    --[[                                            [Import Key]                      ]]--
    
    function Import()
    	if x ~= nil and y ~= nil then
    		if x >= 24 and x <= 31 and y == 1 then
    			getTodo()
    			Line = 1
    			for k,v in pairs (Todo)do
    				Line = Line + 1
    				gpu.set(1,Line, "* "..v)
    			end
    		end
    	end
    end
    
    --[[                                            [Clean Key]                       ]]--
    
    function clean()
    	if x ~= nil and y ~= nil then
    		if x >= 36 and x <= 42 and y == 1 then	
    			Line = 2
    			term.clear()
    		end
    	end
    end
    
    --[[                                             Pre Settings                     ]]--
    
    gpu.setBackground(Scolors.gray)
    gpu.setForeground(Scolors.orange)
    h, w = gpu.maxResolution()
    gpu.setResolution(h/2,w/2)
    term.clear()
    Line = 1
    
    --[[                                             Main Loop                        ]]--                                                                 
    
    while true do
    	gpu.set(1,1,"Add Todo! - Exit - Edit - Update - Clear")
    	--[[Touch Part]]--
    	_,_,x,y = event.pull(1,"touch")
    	mode()
    	Import()
    	Exit()
    	clean()
    end

    I Really hope theres someone out here, that feels like a good samaritan and help a fella out^^

    //Regards Plazter

×
×
  • Create New...

Important Information

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