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

7Roses

Members
  • Content Count

    7
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by 7Roses

  1. currently it just takes the text size of your screen. so if you change your resolution of the chars the text will scale with it.

    I may try to see if there is an easy way to change the size of the powerchecker separate from other parts of the screen, but for the moment it just takes the gpu and asks to write text.

    So if you want to get it bigger and don't care that all text on the screen will be bigger, just change the screen's resolution and the text will be bigger.

  2. changelog:
    - implemented hpu.fill() function *same as the hologram api, but for multiholo*
    - implemented hpudraw.vertex(point1,point2,point3,value) -- with points a table {x=,y=,z=}
    - implemented some more vector math functions in the vector module.

    sorry no pictures of the new features, can't find out how to add a picture in 0.02MB :-/

     

    EDIT: cause I don't want to post twice in a row:

    version 0.3 is ready!!

    changelog:
    ==Changes:
    - hpu.bind(hologramProxy,x,y,z) now can be called with an additional colorPalet table.
      hpu.bind(hologramProxy,x,y,z,palette) where palette would be something like {1,3,5} -> this means the colorPalet index 1,3,5 will work for this hologram.
      on binding it will overwrite the hpu.palette colors with the hologramProxy's already configured colors.
    - hpu.get(x,y,z) will now return a table of found voxels -> this so that if multiple holograms act on the same x,y,z position you get all there results back.
    
    ==bug fixes
    - fixed a memory leaky bug where running the same program where hpu.bind was used on a already bound hpu would register it a second time.
    
    ==Additions:
    - hpu.setPaletteColor(index,color) this way you can set a color for an index, it also will push this color to all the bound holograms that are registered for this indexed color.
    - hpu.getPaletteColor(index) just to get the color configured in the hpu global palette
    - hpu.initColors() if you have changed the colors directly on the hologramproxy, but want to reset them to the configured hpu.palette, this also will be called on a setPaletteColor of the hpu.
    - hpu.setModeMultiColor(boolean) this will make it so that any hologram will first try to unset the voxel on the specific 3dpoint on hpu.set, this makes that only holograms with the chosen color will act, and no overlap will be visible on the hologram. (if you want to mix voxels and so make multiple colors just don't enable this and you can mix them to make colors by using 2 different voxels on the same position.)
    - hpu.version => just for organising my changelogs
    

     

  3. you can detach the thread...

     

    just make a script that starts a certain function in a separate thread

    local thread = require("thread");
    
    theMainfunctionForThisThread = function()  --[[ here your background process, or a require and a call to the actual process]] end;
    
    local yourBackgroundProcess = thread.create(theMainfunctionForThisThread);
    yourBackgroundProcess:detach();
    
    -- done, the script will stop, but the background process will run till it's mainloop is stoped.

    be aware, errors in other threads can be eaten. so make sure the process is working perfect before doing something like this. (or at least use some logging mechanisme or error handling in your process you want to background.)

  4. at the moment you can, although its not yet supposed to work that way.

    but the current workaround to get that is to configure them as if it where a 48*4 x 48 x 32 space, but use the translation functions on the separate holograms to overlap the regions

    that way you just need to remember to use certain voxel ranges for certain colors :) (1->48 as 3 colors, 49->96 as another 3, 97->... )

    but that's a bit of a difficult thing to do :/ so maybe a later version will give you a much easier way to get what you just asked.

    but currently I'm still working on the fill and copy functions, as well as a small drawing api (for easier line and other form drawing, cause drawing with vertical lines and points is so tiresome)

  5. 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 need of a bigger hologram:

    -- just add this to your script
    local hpu = require("hpu");
    
    -- now you can 'bind' the holograms to this api:
    holo =  component.proxy(component.get(<your short address>));
    hpu.bind(holo,1,1,1);-- first your hologram proxy, next your starting x,y,z positions.
    
    -- and then your second hologram
    holo = component.proxy(component.get(<your short address>));
    hpu.bind(holo,49,1,1);
      
    -- and now your free to use the functions to your content:
    hpu.set(60,1,1,1)-- this will set the needed voxel on the second configured hologram.

    Be ware, while it is already functioning, some api functions of hologram where not yet implemented, but they will come in the coming days. (as fast as I can get some free time to code them)

    functions working: set,get

     

    also for those who wanted some extended drawing features for holograms, on the same github page there is also an hpudraw.lua file, this is an api that builds upon this api, and gives you the possibility to draw a line between 2 points. (maybe later other features as well)

     

    for those who want to see what's possible, and cause everyone wants pictures:

     

    multihologram.jpg

  6. look at how init.lua works. (maybe also take a look at the boot.lua it calls)

    there it is loading/saving code into memory. after that the actual code to make that function doesn't need to exist anymore. (as long as the computer is not shut down or reboots)

    so.. if you wanted to have a function not in the filesystem thats the way to go.

    load it yourself, maybe even assign it to _G.yourfunctionname (global scope) and then you can run it from any script without the require() function.

    if this script to load that function would be placed on a disk, you could load the disk, run the script. and then take the disk back out, so long as openOS doesn't reboot or shut down your code will stay loaded.

     

    there probably some other ways to add certain functionalities without leaving a scripting trace :).

  7. While starting with Opencomputers scripting (and learning some lua),

    I found out that while not much, there computers still need some power.

    So here came my idea to build a powercheck script (deamon) to show my power level of the computer (or network) and be ready to save my files before the computer shuts down mid editing a script.

    this version is only a visual aid for knowing your energy leven, executing some functions if the power is to low to continue aren't implemented.

     

    Requirements:

    not much, the openOS should be enough, and a valid computer with screen.

     

    script & installation:

    http://pastebin.com/0112kJVN

    after downloading this script:

    copy or move it to /etc/rc.d/<your chosen filename>

    then

    rc <yourchosenfilename without .lua> enable

    once you reboot your system you should have an indicator of the power level in the right bottom corner of the screen.

    hope this is usefull for someone :)

×
×
  • Create New...

Important Information

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