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

    • Lizzy Trickster

      Latest Stable OpenComputers Version   11/26/16

      The latest released version of OpenComputers is version 1.7.2 for MC 1.7.10, 1.10.2, 1.11.2 & 1.12.2. See more information here! Beta/Dev builds can be found at the Jenkins Build Server (ci.cil.li)

Piorjade

Members
  • Content count

    9
  • Joined

  • Last visited

  • Days Won

    2

Piorjade last won the day on March 25 2017

Piorjade had the most liked content!

About Piorjade

  • Rank
    Junior Member

Recent Profile Visitors

273 profile views
  1. Undocumented "window" parameter in the term API wiki

    I think I'll first try to set up a basic Operating System (I'm trying to make something like "miniOS", so basically imitate DOS a bit) and when the basic system is working, I'll try implementing your idea, if that's okay. Anyway, thanks for your help!
  2. Undocumented "window" parameter in the term API wiki

    Yeah, that's true, but as I said, if I wanted to have "virtual terminals" (-> "windows") and they overlap and I wanted to redraw the one in the background, I somehow need the data that was on it before, which means I have to have its pixels stored somehow. Again, my methods involving having these pixels in a table lead to the whole redrawing process being really slow, as it would call a gpu method for every pixel.
  3. Undocumented "window" parameter in the term API wiki

    That's a great idea! The reason I wanted to make it is that I wanted to try to make an OS myself, idk really why lol. Anyway, I'll take a look at that buffer library that OpenOS apparently uses for I/O. EDIT: I experimented with process metadata and your answer regarding term.internal.open and I don't get why the process doesn't have a "window" entry in the data table and after you set that as the newly created window it only THEN prints to the new window, which is why I also don't get why you used term.bind in the beginning as that apparently doesn't redirect input/output, it binds these components to the current window/terminal (which is still the original one at in that moment) (I attached some screenshots)
  4. Undocumented "window" parameter in the term API wiki

    Okay, thanks for the tip. Another question (it isn't directly related to the topic, so if that's not good tell me and I'll create a new topic for it) If I wanted to make such a system myself (a self-made term API that allows creating multiple windows), how would I have to handle redrawing the content of them? I already tried having pixels saved in a table (with information like background- and foregroundcolor and which character they contain) but that made it really slow as it iterated through the whole table and made a gpu call for every pixel. I need redrawing if I for example have 2 windows overlap each other and I saw something in the OpenOS code about a stream for the ttys.
  5. Undocumented "window" parameter in the term API wiki

    Thanks! Is there any wiki page that shows what metadata processes exactly have?
  6. So I am coming from ComputerCraft and the term API there is pretty straight forward and allows us to create windows to write / redirect to. Anyway, in the term API wikipage of OpenComputers there is for example the method term.bind with an optional parameter "window", the problem is I can't find any information about this parameter and I assumed that this would be the same kind of "window" as in CC and I won't have to write my own API for it. Do you guys know something about it?
  7. net API - The most basic DNS system How this works: The DNS server constantly broadcasts out its information every 2 seconds on the specified port The client APIs have a function to search for the next DNS server (they wait for the above information) which then sets the table containing the information to net.foundServer Now the client APIs have the ability to call net.setDNS(net.foundServer.address) to lock to that DNS With that the client APIs can now register and delete their URLs on this DNS server Every other client who has that DNS server locked on too can look up your modem's address by calling net.resolve(url) [returns true/false and the message (either an error or the address)] Requirements: DNS server: A setup with color support (it logs stuff on the screen and uses colors for that too) Of course a wireless network card My multitasking API which should be saved as "oc_multitasking_api" At best: openOS (because it uses the keyboard and event api) Client: The api A wireless network card of course And maybe an idea on how you can make use of it At best: openOS (because it uses the event api) How to set it up: Build a server / computer for the DNS server (look at the requirements) Buld a computer for the client(s) (look at the requirements) Create a new program to use the API NOTE: At boot, the API doesn't have a DNS server registered, you NEED to register it using net.listenForDNS() or directly putting in an address local net = require("net") --This needs to be called for every program which uses the API, which is normal net.listenForDNS() --This wont stop until it gets a message from a DNS server net.setDNS(net.foundServer.address) --Set the locked DNS to the actual address of the found server Functions: listenForDNS() : Waits for a DNS server to broadcast it's information registerURL([STRING]): Registers an URL for your modem's address (Returns true/false with an (error-) message) removeURL([STRING]): Removes the given URL from the DNS if it's yours (Returns true/false with an (error-) message) setDNS([STRING]): Set the locked DNS' address to the given one getDNS(): Get the currently locked DNS' address (returns the address of the DNS server's modem) getPort(): Get the port which the API looks for messages from the DNS server setPort([NUMBER]): Set the port which the API looks for messages from the DNS server resolve([STRING]): Try to get the modem address of the given URL (Returns true/false with the address or an error message) getURL([STRING]): The reverse of the above function (Returns true/false with the URL or an error message) getAll(): Returns a table with every URL and the associated address on the DNS server (key = URL, value = address) Download: DNS server: Pastebin net API: Pastebin NOTE: The DNS server does currently not save the DNS list on reboot and it looks like it stops broadcasting when the computer stays on when closing the server / game.
  8. Soo I was kinda bored doing basically nothing when I thought about making an OS for OC, which I wanted to do for a long time now. I got pretty far, considering that I'm pretty new to OC, up to the point where it is supposed to start up background "services" at the same time. I didn't know that computer.pullSignal / event.pull doesn't let a coroutine yield (I copied the event and keyboard api over to my OS because I thought I didn't need to rewrite these things on my own) so I quickly had to think of a solution and came up with this. Functions Currently I made it usable for normal OpenOS so that everyone can use it: createTasklist(): returns a table with premade functions which will basically contain all of your tasks createTask(tasklist [tasklist table], name [string], func [string], env [environment table], disableG [bool]): creates a task using the given name, sets its environment to the given one , modifies event.pull (yes you need to have the event library available) and adds a sleep([number]) function which is the same as os.sleep() but only for the task quit([name]): if no name is given, it stops running all the tasks. if a name is given, it stops only the specified task runAll(tasklist): This is the main function. It is the main loop which iterates through every task until it gets a quit signal tasklist:clearLog(): clears the errorLog table and the log table inside the tasklist table tasklist:killTask([name]): Kills the task with the given name. However, I don't recommend this one and you should use quit([name]) for that Short explanation Basically it modifies event.pull (and adds sleep() if you need that) so that it doesn't pull an event, but adds a filter and lets the coroutine yield until it gets an event. (or it yields until it gets the event with the given filters OR until it times out) Which allows us to quickly iterate through every coroutine over and over again. Coroutines which don't yield for a while get killed but while they're not yielding they are basically pausing the whole computer until they time out. Code Pastebin
  9. MineOS - beautiful GUI to standard shell.

    I tried to translate it into german, but fucked the script up. I think i translated the wrong values/strings.
×