- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
Search the Community
Showing results for tags 'API'.
-
A simpe API to connect to a Websocket Server / Endpoint Forgot to mention: This API requires a Internet Card and Lua 5.3 Example Code: local ws = require("websocket_client"); local event = require("event"); local cl = ws.create(function(ev ,var1) print(ev .. "->" .. var1) end); cl:connect("localhost", 12345, "/"); while true do local ev = {event.pull()}; if ev[1] == "interrupted" then cl:disconnect(); return; elseif ev[1] == "touch" then cl:send("HI"); end end Full API documentation here: https://github.com/feldim2425/OC-Programs/blob/master/w
-
It seems completely funny but I am actually trying to get through this for the last 2 days: I try to access weather data through the OpenWeatherMap.org API wich seems to work fine with internet.request(url). The problem is just that it returns me the JSON as a table instead of a String. I tried to access fields of that table but everything seems to return nil. I just can't get to access anything from that table. There are tons of JSON serialization librarys out there but they all need the JSON as a String. I am completely lost rn. This is the API response that gets stored as a t
-
I have developed a sort of DNS server/client system. This is the fifth iteration of this system and finally, one which works and I'm happy with. Here is the link: https://github.com/SpaceBeeGaming/OC-DNS I know there was another "DNS" posted recently but it has not influenced mine (sounds selfish, I know; but true).
-
Hello everyone! Direwo... eh, not quite right. Well, OpenGlasses for 1.12 is out! And I noticed there were no public button API for it, so I made one myself! I have a few functions built-in to make it easier to change stuff, but it was created with simplicity in mind. So if you simply just initialize a button and bind a function to it, it won't do any fancy stuff except for activating the function when you press it, so you have to add your own functionality to it: But with a little bit of extra code: Ok, not that big a difference, you guys are probab
-
i don't know if this is even possible but what i am trying to do is this NOTE: that is know that useing a thread in this scene is 100% Unnecessary but remeber this is a simple test -------------------------------------------------------------------------------- thread = require "thread" e = require "event" running = true t = thread.create(function() e.pull("touch") -- i know that i can put a os.exit() here but the thing is to try to get this to work running = false --<< that end) while running do
-
I present you my first version of a hologram api. so first of all, yes I know the hologram already has an component api well documented. but I extended a bit upon this. First and for all, I found the 48*48*32 voxels a bit low... so thats what this api does. it will give you the option to combine 2,3,4,n hologram projectors and access them as if it where one. so how to use this api? just download the files and save them on your pc. github link to files (you only need the /usr/lib/hpu.lua for the basic functionality) then add the next requirement to your script in n
-
where is the thread api. as i understand it, then the thread api is a build in api in openos aka in /lib (/lib/thread.lua) require("thread") >> file not found (module "thread" not found in: (and so on) ) please tell me if i miss understood this and then were i can get it NOTE: i know that you can get this file on the internet but it does not work that well (at all)
-
An API that makes creating and reading configuration files easier. Any line starting with a '#' is ignored in config files. Documentation: loadConfig(string: path) Returns a stream of the file the path points to. saveConfig(string: path) Creates a config file at the given path. If a config file with the same name already exists it will be overwritten. flush() Clears all properties currently in memory. addProperty(string: name, value) Adds a property to the config. Note that the order properties appear in the config is the same order that the functions are called in. addComment(str
-
How do I interface with an IC2 reactor to get values like case heat, EU/t, etc?
-
I wasn't sure where else to put this, hopefully I got the rightish area. Any who, I'm working on a mod and want to add OpenComputers as an optional dependency. I've never used another mods before and I'm having difficulty adding OC's. I'm trying to add it via gradle.
-
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
-
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 Ope
-
So i'm working on a super simple logs library to make outputting errors/messages to a log alot simpler in a different program i'm working on. The issue is that i am completely unable to find a way to create a new file inside of code! I remember in computercraft it was simply trying to open a file that didn't exist yet, would create a new one. but for some reason, it's not doing it in this instance. my code is roughly: local fname = "output.txt" local file, err = io.open(fs.concat(shell.getWorkingDirectory(),"/logs/",fname),w)--i've tried both w and a at this poin
- 2 replies
-
- filesystem
- api
-
(and 1 more)
Tagged with:
-
Hello everybody i guess i am wrong here, i moved it to support, programming Well, for the first let me tell you, i'm a bloody beginner in OC and lua, so i hope to get some help here I'm trying to modify a code for my world but when i do, i just get errors So, please, can anybody help me to get this work.... The "buttonAPI" is the part in the background and the "aufzu" is the working part where the functions are told. buttonApi.lua local API = {} local button={} local component = require("component") local colors = require("colors") local term = requi
-
- bundled cable
- api
-
(and 1 more)
Tagged with:
-
Changelog: First and foremost, yes, this is a port of DW20's button API from ComputerCraft. Why do his? Because his is a rather simple API and it provided a challenge, at least for me, to learn more about OC. When I did the port, it is more or less a direct port, so any limitations, or bugs (if any) were present in it, are still there. The only change I made to his api is that I made the button flash delay configurable from your script so you shouldn't have to edit the API itself to change it. Now, for some of the issues I noticed from this API running on OC: 1. It does fully wo
-
BlocksImageAPI (Made for my project - tde-desktop as optimization for wallpapers) Example on TIER III graphics card: Example on TIER II graphic card: Example program code: defX = 80 defY = 25 term = require("term") setpos = term.setCursor dofile("tde-apis") gl.setResolution(defX,defY) wallpaper = loadImage("tde-wallpaper") setbg(0xFFFFFF) xfill(1,1,defX,defY," ") drawImage(wallpaper) setbg(0x000000) xfill(1,1,defX, 1, " ") setpos(1,1) write("[S] [Меню]") This API have 2 functions: loadImage(filepath : string) drawImage(image : array of integer) Pastebin Link (API
-
Rainbow Sometimes you need to write colored strings in terminal. It isn't easy in some cases, so i wrote library for colored output. Download You can download this library using this command: pastebin get J9nAzYai Also this library can be found in my oppm repository, just navigate to rainbow folder. Example Documentation ... will be here soon. Just wait. Enjoy!
-
So, I've written my own menu API in CC, called 'Jenisis' named after what I called my software company on me and a few friends servers, (did quite well actually seeing as how I'm the only one who could code) and I ported it over to OpenComputers and then continued development on this, seeing as how IMO OC is better. Which brings me to my problem. I've been trying to add a feature where the API takes a table full of functions to run whenever an event is triggered, like for receiving modem messages whilst still in the menu's loop. I can't quite get it working and just need some new ideas on how.
-
So, my problem occurs when trying to use this api, converted from CC: http://pastebin.com/qwt98zmj Original: http://pastebin.com/XZS4eF9Z Basically, all I am doing is: cselected = jenisis.drawScreen(static, menu) And I did this at the top (yes, before the function, and also the tables were declared as well): jenisis = require("jenisis") It's located inside the lib folder, and it's not about not finding/loading the API, because I already sorted that out. It's returning a rather unique error for an API: /jentest:17: attempt to index global 'jenisis' (a boolean value) stac
-
Hello everyone, I finally made the last huge step in developing my GUI-API to give you a usable BETA to play around with. And I have a tech_demo for you! It already works quite stable, as far as I tested it, and runs on top of OpenOS. I made a gif of the tech_preview on my github. Simply put the GUI.lua and shapes_default.lua in the /lib folder and the tech_demo in / and execute it to see how it is running (or use download code in update August 18). (Or you can try it on the server where I play, "Proton Colony", http://protoncolonygen2.enjin.com/) ------------- Update June 15:
-
I am having issues with a text API that I am writing and am looking for input from more experienced coders. The problem I am currently facing is with my centering method. If be used to center text to the full screen width it works great, if I am trying to center text in a smaller portion of the screen that is offset towards either edge, it fails miserably. API-in-progress below: --[[ Text utilities API by jaspercayne A collection of functions to work with text ]]-- local textTools = {} local component = require("component") local term = require("term") local text = require("text") local gpu
- 1 reply
-
- text
- formatting
-
(and 1 more)
Tagged with:
-
About library: This library helps you to out ComputerCraft image in diamond computer. How to use: Install: Pastebin get xUyZWrab paintutils how to connect: dofile("/path/to/paintutils/paintutils") paintutils.loadImage("/path/to/computercraft/image/file/imagefile", X : integer, Y : integer, Color) Example: dofile("./paintutils") paintutils.loadImage("./test", 1, 1, 0x000000) Output of example:
-
PotatoLib This will be updated as I add new things version(): Returns the version of PotatoLib writeFile(path, data): Writes data to the file located at path readFile(path): Returns the data of the file located at path encode(data): Serializes data decode(data): Unserializes data getModemAddress(): Returns the modem address of the network card in the computer
-
- PotatoTrumpet
- Potato
-
(and 3 more)
Tagged with:
-
I've created a number of LUA files which define the APIs and components in OpenComputers. They're useful as an easier-to-read reference or inside of your favorite IDE for code completion. See the README in the repo for more information. https://github.com/Pwootage/oc-apis I'll be continuing to add APIs and components and watching for any issues/pull requests for additional ones. I plan on adding the rest of OC's built-in APIs and several addon mods' as well.