- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
-
Content Count
35 -
Joined
-
Last visited
-
Days Won
18
Posts posted by Totoro
-
-
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.
-
Really handy and neat looking tool.
Took it for one of my projects (with the license included, of course).
-
Hello Doggle.
On 01.04.2018 at 12:02 AM, Doggle said:1.Whenever I try to "show" the file it always says projector is not found so I think that I did not propely connect it, but I do not know how to "properly connect" it.
The projector need to be connected to the computer (where the editor is running) with a cable.
The cable can be connected to the computer from any side, and to the projector only from the bottom side.
You can check a list of components available for the computer by entering an OpenOS command:components
If the resulting output will contain any string with a word `hologram` in it - there you are.
On 01.04.2018 at 12:02 AM, Doggle said:2.Whenever I try to print3d the models it always says: [string "return ?"]:1: unexpected symbol near char(255)
Unfortunately, this editor models are not compatible with the 3D printer.
To create 3D models for the printer with some comfort you can use some external voxel tools like this, and then convert a *.vox file to the printer compatible format, for example with this JS converter. -
I don't think this is very practical way to hunt players
Because robots are pretty slow compared to players, and can turn only on right angles, and strike only in front of itself, and can easily be trapped by blocks or even be broken and picked up by the `target` player. -
Use
buttons[name].rect
or
buttons[name]["rect"]
In your current edition Lua thinks `rect` is local variable, which obviously equals `nil`. And `buttons[name][nil]` is nil too. -
You can use GPU component to get current screen resolution and use gpu.set() to center text on the screen.
For example:
local com = require('component') local gpu = com.gpu local width, height = gpu.getResolution() local text = "Some info to be centered" gpu.set(width / 2 - #text / 2, height / 2, text)
-
I agree with Gorzoid. gpu.bind will do it.
You can get screen address from `touch` event every time someone clicks the button somewhere, then bind to that screen and render animations etc.
-
On 10/15/2017 at 2:32 AM, Arron said:
Please could we get something to be able to rotate a hologram on the x and z axis as I built it top down not side view.
Yeah, quite reasonable feature, i think.
I will add it to the next version sometime soon. =) -
I tracked down these bugs and fixed them. Also refactored source codes a bit (particularly textbox widget)
Try the new version, please:
-
19 hours ago, Crimsonknight3 said:
[update] typing the full path does work, nothing else however, I took a few screenshots to show you. Also, when closing the editor, the screen isn't properly cleared, so the console's color gets changed and there is a large block of red left on the screen.
also, the ghost image doesn't appear to be working in version 0.7
Wow. That's a nice bunch of bugs
I'll look at the code and try to fix them this evening. Thank you for the screens!
-
15 hours ago, Crimsonknight3 said:
I am using the 7,0 version *russian to see if the older english one wasnt working but they are both doing the same
0.7 version includes a few improvements, but yeah, it pretty much does the same. =)
How do you specify the path to you model? `show` util is purely console, and basically it can be used like this:
show yourfile
You can try to use full path (/home/yourmodel) or relative (./yourmodel).
Also it is worth mentioning, that in last version (0.7.0) saved hologram files have a new (effectively compressed) format `*.3dx`. Pay attention to file extension, when spelling file name.
UPD.
I have updated the first post, and added new editor version (0.7.0) with English localization (translation is pretty raw, if you see any errors, feel free to write me about them =)).
-
-
On 1/14/2017 at 6:39 AM, Ciclope Bizco said:
explain, pls
This is my old attempt to create holographic map. Like in sci-fi movies.
Debug card (or AMI block from Immibis's Peripherals) scanned the map, and collected the data. A grid of projectors under the floor was responsible for rendering.
The color of any map point depends on it altitude.
On 1/14/2017 at 6:40 AM, Ciclope Bizco said:and amazing your hologram editor and viewer
Thank you!
-
Have you imported the `event` library (local event = require('event'))?
Source code on Pastebin may be helpful, yep =)
UPD.
And you seem to override the `event` variable in the line:
event, p2, x, y, p5, input = event.pull(..)
-
Amazing! Must be the most epic image lib for OC =)
-
Hi, Daraketh!I'm sorry it has taken me so long to get back to you, I've been very busy lately.Maximal size for images that I have used - 160x100 px. To improve the picture quality, I used a trick with Unicode characters - half blocks (http://www.alanwood.net/unicode/block_elements.html).I have modified "show" script a bit, to render images properly. Here you can find it: http://pastebin.com/UqM8dTjH
Images:
-
Hi, just want to try it, but I cant get it to work. It wants load some file, but I dont have one, I want to create a new one, but it said something about byte error... Its possible?
You need to run `holo` program, then draw something on the grid, then input new file name in textbox, then click the `Save` button.
New file will be created in the same directory, where `holo` program lies.
Yeah, console interface (commands like `holo myholofile.3d`) would be nice for work, but is not yet available. =)
P.S. Also, `holo` is Hologram Editor here, not Hologram Viewer.
-
This is really cool but the show and save functions dosent work. I don't know anything about coding but could you fix it or atleast get it to work with opencomputers version MC1.7.10-1.5.9.21
Hm.. Checked both on 1.5.12 and 1.5.9 (MC 1.7.10). I can not reproduce the error. All functions works fine.
-
Try to add "YourIngameNickname.Robot"
-
-
-
-
This is awesome! Can i rip through you code for this??
Oh, I apologize for the long absence. Here is my code:
But it is pretty raw =)
Edit pos constant, to change relative clock face position.
-
Take a look here: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration
Each folder contains one mod integration files.
"appeng" - Applien Energistics
"builcraft" - BuildCraft
e.t.c.
Look for "@Callback" instructions. There you will find a command, and description.
Avatar CSS style
in Website
Posted
CSS style for avatar is a little bit off:
The reason is that the avatar box is 26 pixels in size, but the CSS dictates a different value:
When disabling the "height: 34px" line - everything starts to work as it is supposed to.