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

Tharotiger

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by Tharotiger

  1. Hey Guys,

    i just want to ask you Guys for some Inspiration on /tmp Folder usage!

     

    I can't get the point of using /tmp Folders in OpenComputers. You could easly store the Data in Global Vars!

    So, what could i use it for?

  2. Hi Guys,

     

    i've just a short Question. With the 1.5.8 Update there was the adding of Peacful Recipes. But how can i use them? I'm playing on Peacful and it just don't use these Recipes from the Peaceful File.

     

    I'v searched the Config for a option to Change it, but i haven't found it.

     

    Greets ;-)

  3. Do they need to use the same Components, or do you just want to "talk" to each other? 

     

    If you don't need Access to the Components just place a Switch between the Computers!

    Otherwise you can use this:

    component.setPrimary("keyboard", "<-The Address of the keyboard->")
    component.setPrimary("screen", "<-The Address of the screen->")
    

    you can get the Address's by CTRL+RMB with the Analyzer and past it in with the MMB.

  4. Hello everyone!
     
    I'm almost new to OpenComputers. Now i wrote a program for a Tier 2 Computer with 2 Tier 2.5 Memorys inside.
     
    After a while the Program Crashs with Out of Memory. If i restart the Program, a few seconds later the whole Computer crash into Bluescreen.
     
    Is there a method to get around this?
     

    -----------------
    --Configuration--
    -----------------
    local programName = "Fluid Monitor"
    local programVersion = "v0.02"
    local latenz = 0.5
    local showRAM = false
    
    --Farben des Bildschirms
    local mainBackground  = 0x0000FF
    local mainForeground  = 0xFFFFFF
    local titleBackground = 0x333333
    local titleForeground = 0xFFFFFF
    local labelBackground = 0xAAAAFF
    local labelForeground = 0xFFFFFF
    
    --Adressen der Tanks
    local tankAddresses = {
    	"ff6bd79a-16b7-439f-8301-94ad5b1f36da",
    	"9296cb58-590a-4a7e-83cd-0ed335e10515",
    }
    
    ----------
    --System--
    ----------
    
    --Componenten
    local term = require("term")
    local c = require("component")
    local gpu = c.gpu
    local com = require("computer")
    local shell = require("shell")
    
    --Informationen der Tanks werden geupdated
    function tankUpdate()
    	tank = {}
    	for key,value in pairs(tankAddresses) do
    		local t = c.proxy(value)
    		local tInfo = t.getTankInfo()
    		local tAmount = tonumber(tInfo["amount"])
    		local tCapacity = tonumber(tInfo["capacity"])
    		
    		tank[key] = {}
    		tank[key].amount = tAmount
    		tank[key].capacity = tCapacity
    	end
    end
    
    
    function fillBar(x, y, amount, capacity)
    	--Prozent errechnen
    	percent = amount / (capacity / 100)
    	percent = math.floor(percent / 10)
    	
    	gpu.setBackground(0x00FF00)
    	gpu.fill(x,y,percent,1," ")
    	gpu.setBackground(0xFF0000)
    	startPointRedX   = x + percent
    	gpu.fill(startPointRedX,y,10-percent,1," ")
    end
    
    function tankDisplay(label, x, y, tank)
    	gpu.setForeground(labelForeground)
    	gpu.setBackground(labelBackground)
    	term.setCursor(x,y)
    	term.write(label)
    	fillBar(x, y+1, tank["amount"], tank["capacity"])
    	gpu.setBackground(mainBackground)
    
    	percent = tank["amount"] / (tank["capacity"] / 100)
    	percent = math.floor(percent)
    	
    	term.setCursor(x,y+2)
    	term.write("P: "..percent.."%   ")
    	term.setCursor(x,y+3)
    	term.write("C: "..tank["amount"])
    	term.setCursor(x,y+4)
    	term.write("M: "..tank["capacity"])
    end
    
    gpu.setBackground(mainBackground)
    term.clear()
    
    function displayUpdate()
    	tankUpdate()
    
    	--Titelleiste
    	gpu.setForeground(titleForeground)
    	gpu.setBackground(titleBackground)
    	term.setCursor(1,1)
    	term.clearLine()
    	term.write(programName.." "..programVersion)
    	
    	--Tankanzeigen
    	tankDisplay(" Gülle    ", 3, 3, tank[1])
    	tankDisplay(" Gülle    ", 15, 3, tank[2])
    	--tankDisplay(47, 3, allTankTable)
    
    	
    	--Informationen zum RAM
    	if showRAM == true then
    		term.setCursor(1,24)
    		term.write("FreeMemory:  "..com.freeMemory())
    		term.setCursor(1,25)
    		term.write("TotalMemory: "..com.totalMemory())
    	end
    		
    	gpu.setForeground(0xFFFFFF)
    	gpu.setBackground(0x000000)
    end
    
    while true do
      displayUpdate()
      os.sleep(latenz)
    end
    

     
    As you can see in the end of the Code i've added Code to Show the RAM usage. You can see that the RAM is filled over the Time.
     
     
    PS: I've startet a new Thread because the other one a few days ago is Marked as answerd!

×
×
  • Create New...

Important Information

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