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

Molinko

Members
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    35

Reputation Activity

  1. Upvote
    Molinko got a reaction from Muzarmo in Inventory, moving, accessing   
    What you need is the inventory_controller upgrade. This will allow robots, drones, and an equipped adapter block to manipulate and read external inventories.
  2. Like
    Molinko reacted to Subtixx in VSCode OC Lua   
    I made a visual studio code extension for opencomputers available here:
    https://marketplace.visualstudio.com/items?itemName=subtixx.opencomputerslua
    and here:
    https://github.com/Subtixx/vscode-oclua
     
    Images:

  3. Like
    Molinko reacted to Izaya in realtime - Real world time in OpenComputers   
    Ever needed real-world time in OpenComputers? I did today, so I did something about it.
    realtime
    realtime is a set of libraries and protocols designed to let you synchronise your computers with the real world, and includes:
    The realtime library, for taking and keeping time. The realtime-sync daemon, for synchronising your realtime library with the real world The realtime-relay daemon, for synchronising your realtime across the local network. All of these can be downloaded via oppm, or from the Minitel GitHub repository.
    Additionally, all of these come with manual pages describing their functionality and usage, all of which can be found here.
  4. Like
    Molinko reacted to Totoro in Stem - easy internet bridge   
    What is STEM?
    Did you ever want to have a linked card, but without this pair-to-pair limitations?
    Well, you have internet card. And that is already half of the solution. The other half is to use Stem.

    Stem is a message transmitter for your OpenComputers devices with internet cards.
    Using a small OpenOS library you can use Stem to send and receive messages. Unlike the standard `modem` component, Stem-messaging uses not addresses, but `channels`. You can send messages to any channels, and you can subscribe to any number of channels to listen for messages from them.
    Installation
    The best way is to use HPM:
    hpm install stem If you do not have HPM, install it like this:
    pastebin run vf6upeAN If you do not want to use HPM repository, you can just use wget:
    wget https://gitlab.com/UnicornFreedom/stem/raw/master/stem.lua Example of a program using STEM
    local event = require('event') -- use STEM client library local stem = require('stem') -- open a connection to a STEM server -- the `stem.fomalhaut.me` is a default one local server = stem.connect('stem.fomalhaut.me') -- subscribe for messages from the channel with ID 'my-channel-id' server:subscribe('my-channel-id') -- then listen for events in a loop... while true do local name, channel_id, message = event.pull('stem_message') if name ~= nil then print(channel_id, message) end end -- ...or register an event listener event.listen('stem_message', function(_, _, channel_id, message) print(channel_id, message) end) -- you can also send message to the channel -- (you do not need to be subscribed to this channel, to send a message) server:send('my-channel-id', 'hello there') -- unsubscribe from channel server:unsubscribe('my-channel-id') -- completely close the connection to the STEM server server:disconnect()  
    That is all.
    But there is more.
    Web client
    If you open the link to Stem server in your browser: https://stem.fomalhaut.me/
    You will see some statistics and the web client. Enter your channel ID into the form, and you can send messages to your robot in real time, right from your phone, without even starting Minecraft.

    The web client is limited with UTF-8 encoding, though.
    (Using OpenOS you can send literally anything, as long as the message fits in 64kb of data.)
    Security Questions
    The channels by default do not have any special security measures applied. They do not have any authentication mechanisms, the do not have any encryption.
    Anyone who knows the ID of a channel can send a message to it and can listen for responses. But.
    The length of ID is 256 bytes. And that can be any bytes - from 0 to 255. That means, that you have 256^256 possible combinations for your ID. And that is a giant number. If you need to secure your channel - just use something long and incomprehensible as your ID.
    As an additional measure you can use end-to-end encryption, or anything else - this is up to you.
    Default STEM server uses HTTPS, and does not store any information - message in, message out.
    Self-hosted STEM solution
    For those of you who are strong in spirit and computer knowledge - there is a self-hosted option. You can build Stem server from sources and run it on your machine.
    This is also pretty easy. Additional instructions can be found on GitLab.
    Useful links
    GitLab repository: https://gitlab.com/UnicornFreedom/stem
    Protocol description: https://gitlab.com/UnicornFreedom/stem/wikis/protocol
    Default server: https://stem.fomalhaut.me/
    HPM package: https://hel.fomalhaut.me/#packages/stem
     
    If I forgot something - feel free to ask here, or in IRC (my nickname is Totoro there). Also the project contains at least one "Easter egg" feature, that can offer some interesting options if you know HTML/CSS/JS.
    The Stem protocol is open - you can modify it, you can create your own clients in any programming language, etc.
  5. Upvote
    Molinko reacted to Adorable-Catgirl in OC Programs - Share programs   
    do you want to make an ass out or yourself? this is how you make an ass out of yourself.
    Also, what? Like, what do you mean you want people to teach you but you don't want to look at videos? If videos are a problem, then google is your friend. Lua ain't too hard to learn.
     
    also holy duck it's hard to decipher what the hell you're saying
  6. Upvote
    Molinko reacted to CptMercury in How to write files from outside the directory?   
    Well, first of all, if you only need the message to contain one string, then you are better off by just sending the string as the message, so no need to make a table with that string, serialize the table transforming it into a string which is then send via the modem, once received, transformed back into a table which is then indexed to get the string you want to send...
    But anyways, I would assume the error with the serialization comes from trying to serialize a nil value. You're using a timeout with your event.pull, that means, event.pull returns nil if no modem_message was received within that 239 seconds. So either you simply remove the number specifying the timeout, or you add an if-statement checking whether you actually received a message and skip the serialization part when the message is nil.
    -- without the timeout, if this is possible, but it looks like you want your robot to execute some stuff every 239 seconds function loopWait() loopOff = false db.clear(1) me.store({name = "minecraft:record_wait"}, db.address, 1) selectEmpty() me.requestItems(db.address, 1, 1) ic.equip() robot.useUp() repeat _, _, _, _, _, serialized_message = event.pull("modem_message") received_table = require("serialization").unserialize(serialized_message) if recieved_table.loopSwitch == "off" then loopOff = true end robot.useUp() selectFull() ic.equip() robot.useUp() until loopOff == true robot.useUp() selectFull() me.sendItems() end -------------------------------- -- with an if statement verifying there actually was a message received function loopWait() loopOff = false db.clear(1) me.store({name = "minecraft:record_wait"}, db.address, 1) selectEmpty() me.requestItems(db.address, 1, 1) ic.equip() robot.useUp() repeat _, _, _, _, _, serialized_message = event.pull(239, "modem_message") if serialized_message then received_table = require("serialization").unserialize(serialized_message) if recieved_table.loopSwitch == "off" then loopOff = true end end robot.useUp() selectFull() ic.equip() robot.useUp() until loopOff == true robot.useUp() selectFull() me.sendItems() end But the easiest and best way would be to send your string directly as the message
    -- the computer sending the message modem.send(address, port, "off") -- receiving computer function loopWait() loopOff = false db.clear(1) me.store({name = "minecraft:record_wait"}, db.address, 1) selectEmpty() me.requestItems(db.address, 1, 1) ic.equip() robot.useUp() repeat _, _, _, _, _, message = event.pull(239, "modem_message") if message == "off" then loopOff = true end robot.useUp() selectFull() ic.equip() robot.useUp() until loopOff == true robot.useUp() selectFull() me.sendItems() end  
  7. Like
    Molinko reacted to tpzker in OETF #18 Open Inter-Process Communication   
    This is a draft. Examples of software will be coded later.
    Concepts
    Socket: A file on the system which links two programs' communications. OC: Abbreviation for "OpenComputers" OS: Abbreviation for "Operating System" OpenOS: The stock OS for OC computers. Socket: a medium for communication between two or more programs Rationale
    To standardize any possible IPC implementations
    Basic Concepts
    Background programs (or daemons) can be started with a simple wrapper, such as this example code: thread.create(function() shell.execute(ENV, "/bin/daemon.lua") end) Programs can communicate with sockets through the signals defined in this document These signals can be created with "computer.pushSignal(name: string, [...])" They can be received with "event.pull([timeout: number], [name:string], ...)" or "event.listen(event: string, callback: function)", or on a low-level basis with "computer.pullSignal([timeout: number])" Signals
    oipc_sock_comms(socketID: string, <... (message)>) -- OIPC Socket Communications -- message must be of type nil, boolean, number, string, table (tables and other messages MUST NOT contain threads and functions due to the limitations of computer.pushSignal()) Notes
    Please note that OIPC will only work with OSes which pass signals to all subprocesses instead of simply consuming the signal on "computer.pullSignal", "event.pull", or similar functions to wait for/listen for signals.
  8. Like
    Molinko reacted to its_meow in OpenScreens   
    OpenScreens
    for Minecraft Forge 1.12 to 1.12.2
                                                                                                        

     
    OpenScreens adds more display options for OpenComputers.
    Curse Link: https://minecraft.curseforge.com/projects/openscreens
     
    Holo Screens
    Holo screens are floating displays with adjustable size and color.
     

    Hologram projector model and texture by ZefTheFox
    Right clicking a holo screen with a dye will change the background color. Right clicking the sides with an empty hand while crouching adjusts the size of the display.
     
    Flatscreens
    Flatscreens are simple displays that are... flat! There's two types, one on the front of the block and one on the back to allow more freedom.

     
    I have questions/need support! Where can I get help?
    You can always ask in my Discord server. If your issue is related to OpenComputers, you can read the OpenComputers Wiki. Report bugs here.
     
    My website: https://itsmeow.dev/
    Discord Server: https://discord.gg/zrjXjP5
     
    Curse Link: https://minecraft.curseforge.com/projects/openscreens
  9. Downvote
    Molinko got a reaction from Hakz_Studios in Introducing "Lunatic"   
    Hot damn asie, I think you win coolest shit on the forums with this one...
  10. Like
    Molinko got a reaction from selli69 in GUI: extremely fast advanced interface library   
    Typically the GUI and your application are separated because of the reactive nature of the GUI library. Most of your code for reacting to GUI events will go into a GUIObjects event handler.
    -- # ... myButton.eventHandler = function(app, instance, event) if event == "touch" then -- # react to touch event. Alter state, etc... end end I don't have the time to test this my self but you could try using OpenOS threads to give control back to your main script.
    -- # ... more stuff up here local thread = require 'thread' -- # Gui logic n stuff... -- # This will now run whenever the main script yields i.e event.pulls, os.sleeps, etc.. local guiProc = thread.create(application.start, application) -- # Continue below with main program runtime logic. -- # Be aware that the GUI will only be able to process stuff when this main script yields as Lua is single threaded Multiline text is handled by GUI.textBox rather than GUI.text as far as I can tell.
    Hope this helps you over the initial hump. Happy to help more if you still need it  
     
  11. Like
    Molinko got a reaction from tobivandebulk in Navigation Upgrade, A code newb and his problems   
    Try this out..
    The require function is defined by OpenOS which isn't available in the drone env. 
    require is used to load libraries from the package path. See /lib/package.lua
    local drone = component.proxy(component.list('drone')()) local position = component.proxy(component.list('navigation')()).getPosition() -- # The require keyword is for libraries accessed via a filesystem which the drone doesn't have. Therefor it isn't available. -- # The `component.someComponentName` functionality is defined in the OpenOS component library.. Again, not available here. if position ~= nil then drone.setStatusText("We in business bb") end while true do drone.move(0, 0, 0) -- to keep the drone running end Drones can be a bit of a pain to get used to as they dont have any of the sweet libs defined in OpenOS.
    See https://ocdoc.cil.li/tutorial:custom_oses to see what is available in a hardware only env like drones or and hw that is without an OS
  12. Like
    Molinko got a reaction from Korbin in Nuclearcraft Fission reactor   
    I suspected you might be coming from python :). You might be interested in moonscript. I made a simple patch that allows programs to use the shebang syntax in OpenOS i.e
    #!/usr/bin/moon for i = 1, 5 print i unless i%2 == 0  
  13. Like
    Molinko got a reaction from Korbin in Nuclearcraft Fission reactor   
    There are a couple errors. The first is that the `while` keyword must be lowercase. Also within the `while` loop the if statement is missing the `end` keyword. I believe you'll also need to require the libraries you need before using them in a definition.
    local component = require "component" local sides = require "sides" local redstone = component.redstone local reactor = component.nc_fission_reactor local function GP() return reactor.getEnergyStored() end local mP, MP = 4000, reactor.getMaxEnergyStored() local MMP, CP = (MP / 4) * 3, GP() while CP > 0 do if CP > MMP then redstone.setOutput(sides.top, 15) elseif CP < mP then redstone.setOutput(sides.top, 0) end CP = GP() -- # don't forget to update the variable value within the loop end  
  14. Upvote
    Molinko reacted to Nexarius in Hep with my code?   
    Print3d doesn't check getMaxShapeCount() at all.
    Go to your OpenComputer config file and check the value of "maxPrinterShapes".
  15. Like
    Molinko reacted to Nexarius in Tank Display Program | now with energy and essentia too !   
    And just to push it over the top into the rediculous area I've doubled it again to 256! That should be enough for forever.
    (I even had a lot of trouble coming up with so many for testing)

  16. Like
    Molinko reacted to Log in Robot-miner with geolyzer   
    I present you a program for a robot that allows you to mine ore without going down into the caves. Robot, using a geolyzer, can find and mine ore.
    All features are not yet implemented, so I ask you to test and inform me about a bugs.
     
    Requirements:
    Computer case (tier II or III) Inventory Upgrade (more the better) Inventory Controller Upgrade Hard Disk Drive EEPROM with Lua BIOS Geolyzer RAM (tier I or higher) CPU (any) Hover Upgrade (tier I) Diamond pickaxe or equivalent tool Optional:
    Crafting Upgrade Wireless Network Card or Linked Card Solar Generator Upgrade Battery Upgrade Experience Upgrade Chunkloader Upgrade Generator Upgrade Enderchest from EnderStorage mod  
    Installing:
    Download and save the file as init.lua wget https://raw.githubusercontent.com/DOOBW/geominer/master/miner.lua init.lua Put this file in to root directory of the hard disc. Add the disk when crafting a robot. Place the robot on a solid blocks platform. Give the robot a pickaxe Place a container and the charger near the robot. Press the power button and enjoy a process.
  17. Upvote
    Molinko got a reaction from UCQuasar in Need help using load to execute command using modem messages   
    I believe I see where you're trying to go with this but I think there is an easier way. Store the reactor proxies as values in a key/value table and then send method names and args to be executed.
    Here's a simple example..
    -- # Reactor server: Recieves commands from remote client to be run local component = require 'component' local event = require 'event' local modem = component.modem modem.open(1040) -- # List of reactors to call methods remotely upon local reactors = { r1 = component.proxy(component.get '0c60c'), r2 = component.proxy(component.get '0ef58'), r3 = component.proxy(component.get '255aa') } repeat -- # pack it all into a table local msg = table.pack(event.pull('modem_message')) -- # the droids we're looking for local reactor, method = msg[6], msg[7] -- # args to call with the remote method (if any) local args = #msg > 7 and table.pack(table.unpack(msg, 8)) or {} -- # if remote reactor id is present then... if reactors[reactor] then -- # execute the method call with args on a specific reactor. guarded for faulty messages with pcall so we dont crash. local result = table.pack(pcall(reactors[reactor][method], table.unpack(args))) print(sting.format("called %s on reactor id %s", method, reactor)) -- # respond to client with result modem.send(msg[2], msg[3], table.unpack(result)) end -- # client can send the message 'exit' to quit or hold Ctrl+C on the server until msg[6] == 'exit' -- # End of server -- # client: Send remote commands to be run on server components -- # A very simple client... Spruce it up as needed local component = require 'component' local event = require 'event' local modem = component.modem modem.open(1040) modem.send(server.address, server.port, 'r1', 'isProcessing') -- # exec 'isProcessing' on 'r1' at server print(event.pull('modem_message', modem.address, server.address, server.port)) -- # print and await server response -- # End of client  
  18. Upvote
    Molinko reacted to Rahph in NoteBlock Studio player for Computronics Sound Cards   
    That's right!
    A NoteBlock Studio player! The bane of all multiplayer servers, as I have myself learned.
    I wrote this first a standalone OpenOS program but I later ported it to work on drones (it loads code from a remote server).
    Honestly, I just wanted to listen to positive force from VVVVVV and found that nbs is a fairly easy format to parse and play... So I did!
    And now the server I play on is full of drones playing awful renditions of despacito. I guess I brought this upon myself.

    Anyway, here is a github repository
    https://github.com/thekoksus/oc-nbs-player

    And a video demonstration, where I show both the standalone and drone player (Excuse the weird audio, idk what caused my OBS to record like this):
    Currently I also am experiencing a weird issue where sometimes the audio skips or repeats but I am unable to fix that. However if you do come up with something, please do open a pull request.

    So, are you ready to experience the music revolution?


    (All .lua files published in the repository are released to the public domain. I do not claim rights to songs featured in that repo.)
     
    Enjoy :-)
     
  19. Like
    Molinko reacted to Zen1th in OETF #14 - Open Hypertext Markup Language   
    OHML v1.0.3
    OHML is a markup language based on the eXtensible Markup Language (XML), it is a simpler and OC-graphics adapted version of HTML.
    Why OHML?
    It all started when i noticed that most network programs/libraries were either DNS system, or Website system.
    However it is very important to maintain an universal language for webpages. It is the first step of having
    a stable and universal "OCranet", which will follow with server and client implementations. Protocols, etc..
    Concepts
    HRef: Shortcut for Hyperlink Reference Document Versions
    OHML patch versions (1.0.1, 1.0.5, etc.) minor changes (more understandable descriptions, new optional arguments) can be asked in comments section, might get accepted, and when features are froze, set as a new minor version of OHML specifications.
    OHML minor versions (1.2, 1.1, 1.42) OHML major versions (2, 4, 5) are to be proposed in comments sections and feature froze. Once released they will replace the outdated data in this post.
    Tags
    Table about all tags and their (XML) arguments is available in png format, attached to this topic.
    h1-h5
    6-2 sized OC character font title, each letter must be made from the number of character both in width and height. The font can be any font, as long as it respects the size rule. This would usually be made using a big font library.
    text
    This tag allows to display a text line. If putting the text in the plain document, due to the XML nature line breaks wouldn't be counted. In the text tag they aren't counted neither, but at each tag end, a line is skipped.
    script
    This contains any script made for any scripting language supported by the Browser. The attribute "lang" defines the scripting language, it defaults to "application/lua" for LuaWeb, however it remains an XML tag and will not work well with multi lines, the solution is CDATA, simply add a comment and add <![[CDATA, then at the end of script do another command and put ]]> , this will effectively allow the use of multi-line scripts.
    link
    Displays inline text, it haves, by default, a blue color. When it is clicked the page jumps to the hyperlink reference defined by "href" attribute.
    image
    Contains one attribute: "file". This is the path of the image treated as an Hyperlink reference.
    br
    Breaks a line, which mean that a text line is skipped, this act the same as <text></text> but cannot contains any text.
    button
    Clickable button with text being inside the tag. The text doesn't support OHML but will still be parsed as XML (a CDATA section is then recommended).
    Any <script> tag can set a listener on the button.
    "onclick" listener
    Arguments: mouseButton
    mouseButton is "left" for left button, "middle" for middle button and "right" for right button.
    box
    Container. It can contains any possible tags in OHML. It can be used for styling the element's bounds are fully customizable using Positioning, and while by default it is transparent, using Styling this can be used as a resizable background color.
    Tags Attributes
    Positioning
    Introduced in OHML v1.0.2, Positioning allows to position tags in an absolute or relative way.
    Tags have optional arguments "x", "y", "width", "height" and "relative"
    The "relative" argument is for using relative positions, vertical at first, and horizontal at last, we can use "up" (default) or "bottom", put a ";" for splitting, and add the horizontal value that can be "left" or "right".
    Relative positions works that if for example the value is "bottom;right", and if x = -5 and y = -5, the element Y will be at the most bottom point of the page (meaning that bottom for a page with elements not going after 10 for y, the bottom would be 10), added -5, which is equivalent of minus 5, and the element X will be at most-right point (generally viewport width) and will have minus 5.
    Meaning that for a page sizing 80;25, it would go at 75;20
    Styling
    Introduced in OHML v1.0.3, this allows elements to be stylized in little ways. This should eventually be superseded by a dedicated styling language.
    The styling addition introduces many attributes, these attributes are also by default transmitted to the element's childs
    bgcolor
    This attribute takes an hexadecimal RGB value and sets the background color of an element. The background is effective on the bounds of the element, which are its absolute x, y, width and height.
    color
    This attribute takes an hexadecimal RGB value and sets the foreground color of an element. Like bgcolor, the background is effective on the bounds of the element.
    Hyperlink Reference
    An hyperlink reference can be relative or absolute.
    If a HRef starts with any supported protocol name followed by "://" (ex: ohtp://), the link is fully absolute and will replace the current address. It must be an URI.
    Otherwise, if an HRef starts with "/", it is relative to the website host (e.g: ohtp://test.com), so, the full path is: {WEBSITE HOST} + {HREF}
    Finally, starts with nothing above, it is relative and should be appended to the actual URL
    URI are in the same format than real ones which is "protocol://host(/page)"
    OHML, being a markup language, will not support any kind of dynamic coding like <if> statements, <print> statements, etc., dynamic coding is handled by <script> tags and scripts languages supported by the browser. (Currently no script language has been made, it's coming).
    For now one implementation has been made and it is the reference one called Minescape.
     
     
  20. Like
    Molinko got a reaction from CocoVanChoco in OOOOOooooooooooo   
    This new update look GLORIOUS <3 you wonderful people
  21. Upvote
    Molinko reacted to payonel in remote shell by payonel, psh   
    I've developed a remote shell client and rc daemon called psh (payo-sh, like ssh but without the "secure" part)
    It's still a work in progress, but at this point should be quite usable for basic operations. You can find it via oppm, just `oppm install psh`
    On your hosts that should accept psh connections, run the rc daemon: `rc pshd start`. To have pshd running every boot, make sure to enable it: `rc pshd enable`
    From the client, run `psh -l` or `psh --list` to scan/search for available pshd hosts
    `psh -f` or `psh --first` to connect to the first host to respond, or `psh -f <address_prefix>` to connect to the first pshd host whose modem address string starts with the address_prefix you specify (this gives a quick short hand mechanism for connecting to remote hosts by just a prefix). No, I don't (yet) have hostname-like support
    `psh <full_remote_adddress>` saves you from any broadcast/scan calls, and connects directly to the specified host.
    At this time, psh only works stricly with standard io only, it does not intercept nor fake gpu calls.Most programs will assume you can read and write via the gpu, and psh tells the remote shell that a natural tty (and gpu) is available, thus fooling some programs (such as edit).
    psh also takes an optional additional argument to run as a command on the remote host (just like ssh does). So `psh -f "" ls` is a fast way to run ls on the remote machine without starting an interactive shell (and close the connection immediately)
    In the future I'll be adding `pcp` to the same `psh` oppm package, which will support cp calls (inspired by scp), but for now `psh ... "cat file" > file` works reasonably well. Note though at this time stderr is being communicated to psh as stdout, and thus trying to copy a file in this manner may produce a file with a shell error message (such as if a file doesn't exist). Again, in the future, pcp will be the reliable solution for copying files and folders.
  22. Like
    Molinko reacted to LORD MJ in Help with wireless redstone   
    No worries @Molinko. I really appreciate you taking your time to help me with this problem. Thank you.
  23. Like
    Molinko got a reaction from LORD MJ in Help with wireless redstone   
    I apologize @LORD MJ as I'm on the road atm and internet is spotty place to place. Thanks to @payonel for the input, you're a wonderful pal for strolling the forums with your insight. P.s the update looks awesome 
  24. Like
    Molinko got a reaction from skyzo63 in control door piston   
    The issue is within the checkPassword function definition. Change the '&' symbol to the 'and' keyword. This should resolve the current error.
  25. Upvote
    Molinko got a reaction from EcmaXp in [MC1.12.2][OC1.7] OpenPython, micropython available on OpenComputers   
    I haven't had the pleasure to try this out because I'm on a long road trip, however I love that some wonderful person has made this. I think this could be a great alternative for those who don't like Lua (I<3lua).
×
×
  • Create New...

Important Information

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