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 reacted to EcmaXp in [MC1.12.2][OC1.7] OpenPython, micropython available on OpenComputers   
    https://minecraft.curseforge.com/projects/openpython
    https://github.com/EcmaXp/OpenPython
    OpenPython makes micropython available on OpenComputers.
    micropython is Python for embedded devices and is different from CPython.
    Currently, micropython is partially compatible with Python version 3.4 as of October 2018.
    Features include:
    - Fully persistable.
    - Runs in a sandboxed environment and does not require a separate native DLL.
    - Supports virtual file system.
    - It can call other components and supports Lua architecture's UserData.
    Limitations include:
    - The firmware is 256 KB and the memory limit has the same limit as the Lua architecture, but the stack is allocated in a separate memory.
    - Most modules are difficult to use because the battery is partially included.
    - The operating system is not yet fully implemented, so the Python interpreter now runs.
    - Ctrl + C is not supported, so if you accidentally run infinite repeated code, the only way to stop it is to turn the computer off and then on.
    To use the Python architecture, you need the following items:
    - EEPROM (OpenPython): I'm sorry, but you have to bring items from the Creative tab.
    - Floppy Disk (OpenPython OS): This item can be obtained by creating a floppy disk and Scrench, or you can check it on the Creative tab.
    - OpenPython CPU: You can choose OpenPython architecture by holding Shift + Right Click on the Lua architecture CPU.
    It is still unstable, but we plan to make further improvements in the future.
    I need help from people who are familiar with OpenComputers and Python.
    Thank you for playing.

  2. Upvote
    Molinko reacted to payonel in Are there any tutorials or doumentations for plan9k OS?   
    OpenOS has absolutely proper pipes now, such as those  you invoke with `cat file | grep foobar`, and a kick butt threading library (read https://ocdoc.cil.li/api:thread )
    As for virtual components? No, there is nothing built into OpenOS for virtual components, but gamax92 has written a nice vcomponent library you can add via oppm, `oppm install vcomponent`
    Plan9k is retired, to be honest. It was ahead of its time, but is now outdated. OpenOS is faster, lower memory, has gobs of great libraries, super awesome command line parsing, and is ACTIVELY developed. I might be biased....
  3. Upvote
    Molinko reacted to Piorjade in Efficient way of drawing syntax highlighting   
    The most efficient way that I know of would probably be double buffering. (The reason for that being the fact that direct GPU calls like set or setForeground take a certain amount of time depending on the tier and a good double buffering API has an algorithm that minimizes the amount of GPU calls)
    On the other hand I don't know if that's actually necessary for a text editor.
  4. Upvote
    Molinko reacted to Ta©ti Tac0Z in deleting file with a running program   
    terms:
    the working directory: "the path that the shell is currently in (eg: if in the shell it says: "/home #" the working directory whould be "/home")
    file-root (root): "is the root foldire of the virtuel computers filesystem "/" if not chanched in the mods code. all you need to know is that root means "/"
     
    your program install/downloads the file on the working directory say for instane i am in "/home" when i start the program the files is going to be installed in that foldire then (eg "/home/0-41-0.mb3d") altho when you are deleteing the files you do not delete them from the working directory (eg: the program is trying to delete: "0-41-0.mb3d" insted of "/home/0-41-0.mb3d".
    toavoid OC to write the files to the working directory we write "/" infront of all the paths when downloading so we tell the mod to write the files at the root ("/") insted of just the working directory a good practese is to all ways incluce a "/" first sense its not all functions who uses the working direcrtory forintance "fs.remove()" doesn't
     
    this is a working version:
    local c = require("component") local computer = require("computer") local internet = require("internet") local fs = require("filesystem") local p = c.printer3d args = {...} link = "https://raw.githubusercontent.com/LordNocturnus/sf-" folder = "/master/" imax = 0 local TIMEOUT = 4 -- in seconds for i = 0, imax do local url = link .. i .. folder .. "list.txt" local status, connection = pcall(internet.request, url) if not status or not connection then print("Download of " .. url .. " failed.") else local startTime = computer.uptime() while true do local response, isFinished = pcall(connection.finishConnect) if response and isFinished then local f = io.open("list.txt", "wb") -- print(status) -- print(response) print(isFinished) -- print(connection) for chunk in connection do f:write(chunk) end f:close() break elseif computer.uptime() - startTime > TIMEOUT then print("Request to " .. url .. " timed out") os.exit() else os.sleep(0.25) end end end for line in io.lines('list.txt') do print(line) local url = link .. i .. folder .. line .. ".mb3d" local status, connection = pcall(internet.request, url) if not status or not connection then print("Download of " .. url .. " failed.") else local startTime = computer.uptime() while true do local response, isFinished = pcall(connection.finishConnect) if response and isFinished then local f = io.open("/"..line .. ".mb3d", "wb") -- print(status) -- print(response) print(isFinished) -- print(connection) for chunk in connection do f:write(chunk) end f:close() break elseif computer.uptime() - startTime > TIMEOUT then print("Request to " .. url .. " timed out") os.exit() else os.sleep(0.25) end end end cords = {} for i in string.gmatch(line,"([^-]+)") do cords[#cords+1] = tonumber(i) end print(cords[1],cords[2],cords[3]) -- printer(cords[1],cords[2],cords[3]) -- do something with the file file = "/"..string.format("%d-%d-%d.mb3d", cords[1],cords[2],cords[3]) fs.remove(file) print(file) end end i added the tihng i was talking about:
    adding a "/".. on line 77 and on line 53
     
    am happy to help
     
     
    btw, the 3d files that the program downloads sems to be curupted.
  5. Like
    Molinko reacted to Ta©ti Tac0Z in make opencomputers processors faster   
    I whould have tryed to save my position in this argument but that point is simply to good You are right
    (i gave up quteing at this time...)
     
    The thread was not related to any program when this thread was made i was still on the CC side of the community i did rellate it to a program later tho with the checker patten thing i made 
     
    "it was a joke yes" he lied While thinking about hes math was crappy and forgot how many ticks Per secount minecraft haves. No qestions was asked after that, sens the man infront of him sems to be able to read hes mind.
    "..." the man lost hes apillity to talk, turned around and walked away
     
    "the tree post here..." 
    ye i guess
     
    my problem was OC's apillity to Update screens and Why there was so aggressive limits in genual (and yes You May not comment this Line please)
     
     
    conclusion:
    i suck at forums you are right in all most all your points in You lates post i suck at forums ohhh Wait i Ran out of ideas... Why did i make a list...
  6. Like
    Molinko reacted to Luca_S in make opencomputers processors faster   
    While it is not possible to tell you exactly what to do instead, here are a few things you should've done a little bit differently to make this more pleasant and helpful for everyone:
    Your title: "make opencomputers processors faster". You are asking a question in your post which you want answered, why not make that the title instead: "How do I increase or remove the limits of the CPU/RAM?" This makes it easy at first glance for everyone to see what you try to accomplish "make [...] processors faster" sounds like you are giving someone the command to do so, which is not good when asking questions. What would've been even better is to ask a question in relation to your program(e.g. "How can I optimise a program for <this>?"), however that would require you to show the program to the community, which you seem unwilling to do so.(Also you should note that this decreases the chances of you getting help) Your post You should've clarified better what your actual problem was. E.g. "This program(<link to program>) is running slow, I tried <this and that> to optimise it, but it doesn't seem to work. I would be grateful for any ideas" Your first reply: "right... how lovely... ONLY ONE COMPONENT CALL PER TICK!!! JESUS duckING CRIST... that most be a joke, right? Screaming at people/Writing in all caps is not very well perceived by most and will not get you anywhere This also doesn't add something really constructive to the discussion Better would be something like: "This seems pretty slow. Is there any way to increase the component calls when in single player?" I guess that reply was written in a lot of anger, but if you are angry at something, it might be better to write the post, not click submit, wait a few minutes until you've calmed down and think again if this post will be constructive in any way "so i can see that buffer api thing have the standart gpu functions so i give the infomation to the buffer (eg buffer.set(2,2,0xff0000, 0, " ")) and the buffer api will only do a gpu.set opration when it has to limting unnessary gpu.set's? is that how that works?". This was actually a pretty good post: It shows that you've checked out the topic and know what you are talking about It states a clear question The three posts here are a bit unnecessary and could've been put in one post asking "I've tried this: <code here> and it doesn't work. I have <this and that> problem." These are just a few random thoughts about how you could've gotten/will get better help.
  7. Upvote
    Molinko reacted to Piorjade in make opencomputers processors faster   
    I'm not interested in reading up posts which consist of passive-aggressive comments from the person that created the thread as you seemed not to appreciate the help of others and just cry and complain constantly.
     
    Yes I know but the way I understood your tears that I skimmed over I thought you didn't like the fact that the library he gave you only has one buffer and you thought it was a "bug" at first that you had to reboot or something like that.
     
    What? The comment you quoted doesn't really clear up or negate what I've said. My comment you've quoted is basically the answer for your quote.
     
    Anyway, you don't seem like a person someone can talk to normally. You don't seem to appreciate help from others other than using a solution but still crying about something and answering other posts that don't fit your expectations with passive-aggressive comments so I'm done with you. 
    I recommend you not to post anything on this forum if you plan on being stubborn.
  8. Like
    Molinko reacted to Luca_S in make opencomputers processors faster   
    Doesn't that make you think if you should ask questions in a different way?
  9. Upvote
    Molinko got a reaction from Luca_S in make opencomputers processors faster   
    I'd give you another if I could.
  10. Downvote
    Molinko reacted to Ta©ti Tac0Z in make opencomputers processors faster   
    Shit Sorry bomb block Said he was one of you am Sorry up curse when You Said mod You meant modification not modutator am Sorry. When thats Said You are begging to get a bad resolut when You say:
    You are basicly saying: "p.s i know am a butthole live with it"
    i know my learning skills is about at the zero mark but starting out with and i qoute: Noah, sometimes, you're just wrong/"don't get it"
    is a great Way to not Being a Leading member i see You used the "deleted" efect on it now tho, how conviniend
     
     
    Also as a addisinal thing
    This is the assistance You have given me in this entire thread:
    Ohhh Wait that is a compliant  
    also this thread was not meant as a complaint more of a am-complaining-about-some-thing-now-currect-me-please-becuse-i-know-am-wrong and i was my game is pushing 50fps becuse of tjat buffer API am makeing lemmings in OC it works great
  11. Upvote
    Molinko reacted to Fingercomp in make opencomputers processors faster   
    Please calm down.
    There are some component methods that block the computer for a tick when called, yes. Such methods usually interact with the world. For example, a transposer allows to transfer items between invetories by calling the transferItem method, which takes a tick to execute (so you get up to 20 stacks/second).
    On the other hand, there are a lot of direct methods, which can be called several times per tick. For example, the GPU's methods are direct. And the processor (as well as RAM) determines how many direct calls are allowed per tick. I think T2 T3 setup allows you to call gpu.get one thousand times every tick. Or 256 gpu.sets. Or 128 gpu.fills.
    I also believe you don't realize how bad ComputerCraft is for servers. A really simple and stupidly-written program can eat up all the memory the server has. That's why OC limits the memory available for an in-game computer. And running CPU-intensive tasks on a CC's computer makes the whole server run slow, whereas OC requires scripts to pause to allow other in-game computer to run. OpenComputers imposes the limits not because the mod developers want users to suffer (although I do sometimes think of that when I try to do some stupidly complex things with it), but to make it server-friendly.
    What's important is that OC allows you to configure these limits for your needs. Have you opened its configuration file? It is more than a 1.5k lines long, and has more than 300 settings you can change, each with a comment that explains the effect of the setting. There's callBudgets to increase the direct call number limit. Or decrease it. There's also the ramSizes setting for memory, and hddSizes for the HDD sizes.
    But even with all of these limits, OC can run a lot of programs, including graphical shells, 3D games, reactor control systems. It allows you to send HTTP requests to the real websites, and open raw TCP sockets to interact with network services. It can display 320x200 images. It can even play videos — inside the game, and on the default OC settings!
  12. Like
    Molinko reacted to IlynPayne in The Guard - security system   
    The Guard - security system
    The Guard is a base security control program I've written in 2016. It allows you to use some of the security devices from the OpenSecurity mod. It has modular architecture - all features are implemented in independent modules that can be replaced. It has action-driven - you can specify how everything behaves using the action system.
    Features
    modular architecture action-driven configurable behavior redstone support (Redstone I/O blocks) support of security devices from OpenComputes: keypads biometric readers RFID card readers turrets entity detectors motion sensors alarms Further reading
    The guard has its own wiki, on which you can find the installation instructions as well as the example configuration and other information. If somebody is interested in writing a new module, I can create a wiki page with API documentation (basic information is provided in the_guard.lua file).
    WIKI
    Disclaimer
    Although I have tested this program, a few issues might have slipped through. In that case feel free to report them in this thread or, even better, on the issue tracker if you have Gitlab account. If there's an error, be sure to include log contents (logs button on the right side of the program's interface) containing that error.
    Screenshots



  13. Upvote
    Molinko reacted to asie in Introducing "Lunatic"   
    No spoiler in the title. Just watch the video.
    EDIT: Apparently someone's ComputerCraft fork is more findable on Google than the original OpenComputers repository, so here's the official source code: https://github.com/asiekierka/lunatic86
     
     
  14. Upvote
    Molinko reacted to Fingercomp in Guide to the Sound Card   
    The sound card is added by Computronics, a wonderful addon for OpenComputers. There are a few who actually know what it does. Even less people are able to use it. No one dares to understand how it works, or so I hope.
    Anyway, it appeared a few years (?) ago, and is still mostly undocumented. There is a page in the in-game manual, which fails to explain how great the card is. Of course it does! It has a heap of different methods, which you can use to cast many crazy magics to make the sound card sound, and it's impossible to teach someone to do magic by reading a single page.
    OK, I'm serious now. Last year I managed to understand how to use it, and even wrote a few posts about that. In Russian. Half a year later, I translated them to English. And now I thought of posting a topic here so that you could read them, too.
    Here's the link.
    The first two parts are all about basic things, like getting simple sounds, ADSR, and modulation. The third part features a little bit more complex things, like complex numbers and Fourier transforms. I tried to keep it simple, so I could get something wrong. If so, please leave a comment there pointing out the mistake. Grammar fixes are also highly appeciated.
  15. Like
    Molinko got a reaction from HerrCrazi in Switching the screen the terminal is bound to.   
    Ahh, no problem buddy. Happy to be of some help. Thanks for the feedback as well, it would seem useful to know. Smooches
  16. Like
    Molinko got a reaction from HerrCrazi in Switching the screen the terminal is bound to.   
    Maybe, opening a term window shouldn't be such a pain.. I have done it before, just need to remember and test how I did it... I'll post back asap
    I figured a way to switch terminals. Dunno if its a "good" way or not but it should work.
    local component = require "component" local process = require "process" local term = require "term" local termGpuAddr, termScrAddr = ... -- # use whatever logic you would to get the relevant component address (this line will cause an error if you dont shove some address in) local termGpu = component.proxy(termGpuAddr) termGpu.bind(termScrAddr) -- # component bind -- # I thought you could get the current term window with `process.info().data.window` or `rawget(process.info().data, 'window')` or `term.internal.window()` -- # for some reason getting the current window was giving me nil, even with rawget :/ local window = term.internal.open() -- # create new term window term.bind(termGpu, window) -- # bind pty to gpu window.keyboard = component.invoke(termScrAddr, 'getKeyboards')[1] -- # dont forget a keyboard or it will use the last term kb -- # lastly you have to assign the window to an actual process. here we'll assign the init process our window. all child processes will inherit this window local init_index = 1 -- # find the highest process (init) while true do if process.info(init_index + 1) then init_index = init_index + 1 else break end end -- # cram 'er in there. If you only want the current process to use the pty just use `process.info().data.window = window` process.info(init_index).data.window = window This is tested and should work. It did for me anyway. just adjust for termGpuAddr and termScrAddr
  17. Like
    Molinko got a reaction from HerrCrazi in Switching the screen the terminal is bound to.   
    I feel like I should add some more information.. Just some things I learned asking around and poking at the OpenOS source. So here it goes. Term "windows" aren't really a feature of the OS, they're kinda hidden, and in my quest to abuse them I learned that at the moment they're kinda 'half baked', although functional. If you look at the `term` library you'll see that a lot of methods take an optional `window` argument but the library lacks a documented way to create or get a new or active pty. Wtf mang. Another tip would be to note that the computer has no preference for screen and/or keyboard proximity, hence why you're in this mess in the first place. So it would be handy to know that the "boot screen" is what will become the "primary" screen component and thus the init process(highest process in the OS) will bind the boot screen and first gpu compatible with that screen. `tty.window`  is referenced in `process.info(init_index).data.window`
    You can see more of this reflected in the concept of primary components and that even extends to the /dev dir... i.e.
    -- # get the first non-'primary' component of `ctype` local function getSecondary(ctype) -- # dev component/ listings start at 0. Thus /dev/components/by-type/`ctype`/1 is the second gpu.. local fd = assert(io.open('/dev/components/by-type/'..ctype..'/1/address', 'r')) local address = fd:read('*a') fd:close() return address end You could use this in my example above.
    local component = require "component" local process = require "process" local term = require "term" local function getSecondary(ctype) local fd = assert(io.open('/dev/components/by-type/'..ctype..'/1/address', 'r')) local address = fd:read('*a') fd:close() return address end -- # Get the first non-primary gpu and screen, assuming that this is in a condition where we want to switch the screen... local termGpuAddr, termScrAddr = getSecondary('gpu'), getSecondary('screen') local termGpu = component.proxy(termGpuAddr) termGpu.bind(termScrAddr) local window = term.internal.open() term.bind(termGpu, window) window.keyboard = component.invoke(termScrAddr, 'getKeyboards')[1] local init_index = 1 while true do if process.info(init_index + 1) then init_index = init_index + 1 else break end end process.info(init_index).data.window = window I hope some of this info may save you some time.. Good luck. And feel free to ask away bud
  18. Like
    Molinko got a reaction from DeBrates in event.pull freezing loop workaround   
    event.pull has an optional first argument, a timeout. 
    local name, _, x, y = event.pull(0.1, "touch") if name then -- # name will be nil if event.pull(0.1, ...) times out after 0.1 sec if y == 1 and x < 30 and x > 18 and reactorOnline then r.setActive(false) elseif y == 1 and x < 30 and x > 21 then r.setActive(true) elseif y == 8 and x == 21 or x == 22 then r.setAllControlRodLevels(rodLevel - 10) elseif y == 8 and x == 28 or x == 29 then r.setAllControlRodLevels(rodLevel + 10) end end  
  19. Like
    Molinko got a reaction from IceG4merBR in attemp to index a nil value (local 'i')   
    I believe your error is coming from updateCubeStats().
    cube.stats.stored = cube.getEnergyStored()
    You're missing parentheses.
  20. Like
    Molinko got a reaction from IceG4merBR in How can i terminate this program?   
    Your program has an infinite loop. You'll need to yield either with sleep or by pulling an event. Here is a simple solution.
    repeat energy = toMRf(cube.getEnergyStored()) energyMax = toMRf(cube.getMaxEnergyStored()) energyJ = toJ(cube.getEnergyStored()) energyMaxJ = toJ(cube.getMaxEnergyStored()) label(1, 1, "%.2f MRf / %.2f MJ (Energia Acumulada)", colors.red, energy, energyJ ) label(1, 3, "%.2f MRf / %.2f MJ (Capacidade da bateria)", colors.lime, energyMax, energyMaxJ) until event.pull(1) == "interrupted" -- # change 1 to something smaller to refresh faster  
  21. Upvote
    Molinko got a reaction from Piorjade in Undocumented "window" parameter in the term API wiki   
    From what I understand you're on the right path. What I think* you're missing is a grouping algorithm. Iterate the table for like-pixels chunks by fore/background color and character to draw together. This should result in less gpu calls overall. I'm working on something similar
  22. Upvote
    Molinko reacted to Fictitious Rotor in How could I get the current used RAM of the computer?   
    So a few quick things.
    First, when you get a problem, please send us a screenshot and logs if possible to make it easier for us to identify your problem.
    Second, when you're looking at an API in the documentation, be sure to look at the examples that they give as they contain lots of hints!
    For example, the first snippit.lua in the computer api shows why your program doesn't work.
    I'll demonstrate a working solution here.

    Before you can call any methods, you have to assign the computer API to a variable.
    What they usually do in the documentation is to call the variable 'computer' like so:
    local computer = require("computer") print(computer.totalMemory()) Because you didn't set the api to a variable first, your program tried to call a variable that doesn't exist and gave up.
    Should be an easy problem to fix
  23. Like
    Molinko reacted to soulofthereaver in SGCX - SGCraft Stargate Controller   
    This is brilliant, mate. Really has some of the feel of the software they used on the SG-1 show.
    I can confirm that the irisAuth program works. Unless you change the string sgcx expects in the network message, this shouldn't change.
     
    P.S. I made a smaaall custom modification to the iris opening function of the program that uses redstone and the opensecurity alarm component to add a snazzy warning lights/klaxon alert when the iris is open, make things more dramatic. You can see it here:
    What do you think?
  24. Like
    Molinko reacted to IlynPayne in SGCX - SGCraft Stargate Controller   
    SGCX - SGCraft Stargate Controller
    Stargate controller based on GML library.
     
    Showcase:




     
    Installation steps:
    First download the package manager that will be used to download the application and all required dependencies: wget https://gitlab.com/d_rzepka/oc-equipment/raw/master/installer/arpm.lua Use the package manager do download SGCX: arpm install sgcx  
    Run SGCX with an additional argument - init. This will allow you to pick a stargate interface address from list. It is required only during the first startup - address will be saved in a configuration file. sgcx init  
    Optionally you can install the irisAuth package (remote iris management) using the previously mentioned package manager.  
    Features:
    Displaying Stargate status Storing gate addresses Grouping and searching addresses Disconnecting wormhole after specified time Automatic iris control (see installation steps, step 4) Displaying distance to the selected destination Address calculator: convert addresses within one dimension into chunk (and estimated block) coordinates and vice versa Animated dialing sequence with chevron drawings Future plans:
    Dialing history Iris authorization usage history Requirements:
    Tier 3 screen and GPU At least 1 MB RAM Network card Keyboard  
    (GitLab repository)
     
  25. Upvote
    Molinko got a reaction from Aether in (Proof of concept) Working/toggleable button   
    Aha. I see you're hard at work on your very own solution! Allow me to give a tip or 5
     
    Today we'll talk a little about OOP or Object Oriented Programming. Now, in lua, OOP is a little different than in other more popular OOP languages such as JAVA.
    So for you guys out there who would say lua doesnt have oop... You probably know better than me. With that said lets learn some stuff about simulating OOP in lua.
     
    First off there are tables. myTable = {}. In lua tables are used as objects because every table created is unique. Not table references though. i.e. myTableA = myTable, this is referencing myTable.
     
    With this in mind we can create objects with behavior relevant to that object. Still following? Example:
     
    If you notice the Bob object has specific fields, name and age, that identify him. The fields arent so unique but the Bob object is.
    Bob isnt very flexible as an object though. This brings me to Classes. Classes are Objects. But, they are not the same as lets say Bob.
    Bob is an instance of a Class. We usually wont interact with a class like we would an instance of a class. For example:
     
    Now for my main point.. Buttons. Buttons are a class. We want uniqueness and specified behavior.
     
    I hope this will help you understand the power of OOP like design and some of the more basic ways to use it
    As usual any questions or elaborations by others are welcome. If someone else can explain better please do! lua is my first language!
×
×
  • Create New...

Important Information

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