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

Kodos

Members
  • Content Count

    15
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Kodos

  1. 4 hours ago, 23Link89 said:

    Really cool, though the only thing I would really use it for is the Mine IDE editor so I don't have to use an external editor that doesn't have the OpenOS libraries. Which leads me on to my next point: cross-compatibility. MineOS isn't cross-compatible with OpenOS's libraries, which I really need unless you make a command line, low memory usage, version of your MineOS to run on extremely low-end machines. Even then, I would have to port all of my existing programs on to your OS.

    I create a lot of programs for computers around my MC world to manage redstone things in a neat manner. Installing MineOS on every one of those computers isn't an option. Would be really cool if you could make an OpenOS emulator of sorts just to create programs for OpenOS.

    https://github.com/gamax92/OCEmu

  2. With Computronics installed, EnderIO's Teleporter Block can be controlled via an OC Computer. I'd recommend using that, as EnderIO is a nice mod to have, and Computronics is an addon to OC that adds tons of inter-mod compatibility with OC and various mods.

  3. I, Kodos (Ingame name as well), hereby request a special thinger on account of the following:

     

    1: I'm awesome.

    2: I help out a TON in IRC when people come in asking for help with things. If I'm awake enough to, and know what they're asking, I usually make it a point to help them as much as I can, because I used to be that nub who didn't know how to do a table or didn't know the difference between write and print, so I like giving the same support I had and keeping up the spirit of niceness that #oc has been known for.

    3: Did I mention how awesome I am? 

    4: Also I write random programs and share them with people. Some have even been integrated into addon mods such as OpenPrinter's xerox.lua, and (Hopefully soon) OpenSecurity's Security Door control program.

     

    Requested color is 255, 255, 255 because clinical white is kind of my thing :3

  4. I got tired of having to remember which color was which number on the default colors lib, so I made my own library so I could easily just call things like 'red' or 'lightblue' instead of  14 or whatever number the color I needed was.

    Finally got it working, so I figured I'd share it.  Feel free to do whatever you want with it.

     

     

    kcolors = {
     
    white = 0xFFFFFF,
    orange = 0xFFAA00,
    magenta = 0xFF55FF,
    lightblue = 0x55FFFF,
    yellow = 0xFFFF00,
    lime = 0x55FF55,
    pink = 0xFF5555,
    gray = 0x555555,
    lightgray = 0xAAAAAA,
    cyan = 0x00AAAA,
    purple = 0xAA00AA,
    blue = 0x5555FF,
    brown = 0x421010,
    green = 0x00AA00,
    red = 0xAA0000,
    black = 0x000000
    }
     
    return kcolors
     

     
    Pastebin for the lazy: 
     

    pastebin get 01ZrHdgk /lib/kcolors.lua

  5. Hi Joshua!

     

    First of all, neat utility! This would come in very handy for a few things.

     

    I'm putting together a small pack of utility programs that, once finished, will be PR'd in as a loot disk.  Would you mind granting me permission to add this in to the pack?

  6. I'm not much for forum post making, so here goes.

     

    I basically made a program that when ran, will keep listening on the network (Works wirelessly, too!) for modem_message events, and will write them to file.  Just type 'logger' to get a usage printout.

     

    Code is in the spoiler =) or if you prefer being lazy...

    pastebin get DbYMfRj4 logger.lua
    -- We require our libraries and modules here
    
    local component = require("component")
    
    local modem = component.modem
    
    local io = require("io")
    
    local event = require("event")
    
    local fs = require("filesystem")
    
    
    
    -- This line will allow the user to easily specify how many
    
    -- ports, and messages, we want to use with the program.
    
    local ports, msgs = ...
    
    
    
    -- This ensures that the proper amount of arguments are being used,
    
    -- and if not, will display proper usage of running the program
    
    if #({...}) ~= 2 then
    
    error("Usage: Logger (# of ports to listen to, starting at 1) (# of messages to write to file before program ends.", 0)
    
    return
    
    end
    
    
    
    -- You can ignore this snippet of code, unless you're
    
    -- ping. Or unless you really want to wait half an hour
    
    -- for all ports to open. Luckily if you're running this
    
    -- on a Minecraft server, you will only need to do this once,
    
    -- so long as you set a high enough message count.
    
    if ports == "potato" then
    
    ports = 65535
    
    end
    
    
    
    -- This is to check whether or not the argument being passed
    
    -- as ports is actually a number, and not words or symbols.
    
    if not tonumber(ports) then
    
    error("The port needs to be a number!",0)
    
    return
    
    end
    
    
    
    -- Same thing as our first check, only here we're checking the
    
    -- messages amount argument.
    
    if not tonumber(msgs) then
    
    error("The amount of messages needs to be a number!", 0)
    
    return
    
    end
    
    
    
    -- Now, we have to open our ports that we want to listen to.
    
    -- Note the maximum on our range is the variable we defined in our
    
    -- first argument.
    
    for prt = 1,ports do
    
    modem.open(prt)
    
    end
    
    
    
    -- This is where the magic happens. This is where we open our log file, or
    
    -- create one if it doesn't exist, and listen for messages to write to our
    
    -- file until we've caught enough messages to satisfy our second argument.
    
    local h = io.open("Logs.txt", "a")
    
    for n = 1, tonumber(msgs) do
    
    local _, _, from, port, _, message = event.pull("modem_message")
    
    print("Got a message from " .. from .. " on port " .. port .. ": " .. tostring(message))
    
    h:write("Got a message from " .. from .. " on port " .. port .. ": " .. tostring(message) .. "\n")
    
    end
    
    
    
    -- Now that we have enough messages, we can close the ports we opened earlier on.
    
    modem.close()
    
    -- Notice I didn't specify a port? That's because
    
    -- by default in OC, when a port isn't defined, all
    
    -- ports are closed when this method is called.
    
    
    
    -- Now we must close our log file to ensure that it saves.
    
    h:close()
    
    
    
    -- This lets the user know that the logs were successfully saved.
    
    -- Huzzah!
    
    print("Saved logs to Logs.txt.")
    

     

     

  7. If you store your libraries in a standard location, such as /lib or /usr/lib (and probably /home/lib), they get loaded with a require("libraryName"), without the path.

    To do this for /lib or /usr/lib, you will need to mount your own drive as root, since the default root file system is the rom which is read only.

    I should point out that in OC 1.3, the OS is mounted at root, but is installed on the HDD and is therefore fully editable =)

×
×
  • Create New...

Important Information

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