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

SinaMegapolis

Members
  • Content Count

    7
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by SinaMegapolis

  1. 20 hours ago, Molinko said:

    Hi again, sorry for the delay, It's 12:35 in the afternoon here. I made a bit of an error. It can work, but it may have given you a slight headache if you weren't sure what you were looking at.

    Lua can be a little strange but I love me some strange :P . First off you should know that in Lua tables can be an Array or an Object (as you understand them in other languages). Even stranger still to a C guy is that they can be a hermaphroditic structure too! Like that users table we created. See here.

    
    local users = {}
    
    for i, v in ipairs( bridge.getUsers() ) do
    	local user = {
    		name = v.name,
    		uuid = v.uuid, -- this might be v.UUID im not sure :/
    		surface = bridge.getSurfaceByName( v.name ) -- THIS WAS AN ERROR. SHOULD BE "v.name"!!!
    	}
    	
    	users[ i ] = user
    	users[ v.name ] = user
    end
    
    -- lets say this table just has one result.. You. It would have this structure. below is not code but an example of the users table with one 'user'
    users = {
    	[1] = {
    		name = "TheTrueReaper",
    		uuid = "Xjs92BbHj2xAA...some key",
    		surface = surfaceInstance -- this should have methods like addBox and the like... I think.
    	},
    	["TheTrueReaper"] = {
    		name = "TheTrueReaper",
    		uuid = "Xjs92BbHj2xAA...some key",
    		surface = surfaceInstance -- this should have methods like addBox and the like... I think.
    	}
    }

    Note: Using the # operator may show unexpected result here.. # only shows the indexes and not the keys in a table. So the example users table above  would report just a length on 1!  print( #users ) -- > '1'

    Note. The table has two entries of the same data. One by #index and one by 'key'. I did this for convenience but it can be tricky. This is what I meant by hermaphroditic.. Is that even a word?? Is now.. Another note about getting or setting keys in a table... Every key in a table is a string! Event if you use a function value as a key, it is coerced to a string and used as a key! This is handy for table access like so...

    
    local player1 = "TheTrueReaper"
    
    local function getUserSurface( player, userList )
    	return userList[ player ]["surface"] -- this can also be written with a mix of accessors.. userList[ player ].surface
    end
    
    local p1surface = getUserSurface( player1, users )
    p1surface.addBox( --[[ variables n shit...]] )

    Looking around I also found a gist of peripheral events from the glasses bridge. Its also kinda old so you might have to rely on in game docs. Bridge events gist .

    You shouldn't need to add methods to a 'surface' but rather create functions that can operate on one, calling the surfaces' existing methods.

    From what I can tell the bridge returns a global 'surface' that will update all connected glasses. Calling bridge.getSurfaceByName( playername ) will return

    a private 'surface' with the same drawing methods. Hope that clears that up. Also, I believe to update whats been drawn you must call bridge.sync() to update both 

    the global and private surfaces.

    If you need anything else... Just ask :) .

    Im also happy to shoot some ideas back and forth about how to write/structure the program if you don't mind hacking it together..

    So thats why lua knows empty table values with nil values -_-

    If you have time, plz go and answer my question

     

  2. I downloaded and installed Mineos from the forums
    But when running it im just seeing an error:
    "Attempt to index field 'localization' (a nil value)"

    I go to source to see where is this error from but what i saw is that:
    'Localization' is an empty table value 
    And when os trys to enter data into it , the error appears!

    Annnd im seeing another errors like this error in another open computer programs
    Such as lperskins python file editor:
    "Attempt to index field 'f' (a nil value)"

    If it isnt a bug, tell me why these errors appears
    And if its a bug, fix it in next versions

    (Sorry for bad decryption, and for bad English. If you need information, tell me to post here)

  3. 3 hours ago, Laughing_Dragon said:

    Minecraft 1.10.2
    OpenComputers 1.6
    I have attempted the install several times.
    Tier3 everything. OS installed to Tier3 HDD.
    What am I missing?

    2017-01-24_09.54.30.png

    Thats what im said in the previous post:

    That error is because of that : lua compiler confuses empty table(array) values with table values

    Maybe we need to report that in opencomputer's github repository as an bug ;)

  4. On 1/21/2017 at 1:51 PM, DarkPikachu said:

    unfortunately, I can't redistribute as it's against his license, as much as I would absolutely love to...

    hopefully he'll give me permission. :)

    I may be a hacker, but when something good comes around, I have to respect. ;)

    I can tell you what I did to install, but be warned, it's quite tedious... (just placing stuff in it's proper directories and creating links)

    format for the .lnk files is very simple, it's just an lua file that returns a string to the desired location:

     

    
    return "/MineOS/Applications/RayWalk.app"

     

    ^ would be nice if these functioned more like Linux . desktop launchers...

    all I did was download the MineOS repository here: https://github.com/IgorTimofeev/OpenComputers

    before doing anything related to copy/paste, first build or spawn a hard drive, and install OpenOS on it.

    now OpenComputers likes to preserve the drive as much as possible, but can't do so on an item being dragged (I had to redo everything about 3 times before figuring this out).

    if you leave the hdd in any inventory slot, OC will overwrite anything you try to change, thus breaking your manual installation. (this really sucks for me because I use external IDEs for editing lua)

    so to prevent this, just simply click (pick up) the hdd, and drag your cursor out of the window.

    to find your hdd, simply navigate to your Minecraft directory/saves/*world*/opencomputers/*hdd id*

    NOTE: the hdd id is displayed either in the item tooltip, or when you call the mount command.

    you should find your OpenOS installation there.

    now, in the repo you downloaded /Installer/installer.lua, it checks the initial requirements (which I believe could be lower), and then downloads /Applications.txt and parses it into an array, performing everything required via this array.

    NOTE: everything in quotes refers to a variable for the current entry in the Application array.

    1: if "preLoadFile" then create file /"name"

    2: create the file /MineOS/System/OS/OSSettings.cfg with this code:

     

    
    {
    	    ["showHelpOnApplicationStart"] = true,
    	["screensaver"] = "Matrix",
    	["screensaverDelay"] = 20,
    	["language"] = "English",
    	["dockShortcuts"] = {
    	    [1] = {
    	        ["path"] = "/MineOS/Applications/AppMarket.app"
    	    },
    	    [2] = {
    	        ["path"] = "/MineOS/Applications/RayWalk.app"
    	    },
    	    [3] = {
    	        ["path"] = "/MineOS/Applications/Photoshop.app"
    	    },
    	    [4] = {
    	        ["path"] = "/MineOS/Applications/VK.app"
    	    }
    	}

     

    "Directory/saves/*world*/opencomputers/*hdd id*/"

    Well i didnt see that coming ;D

    And thank you for the tip :D

    (Trying to use mineos on my oc but it has many bugs becuz of confusing "empty table(array)" values with "nil" values :l)

    Edit:  the last error i had: (im tired of this debugging i had >:-l )

    /lib/filesystem.lua:284: bad argument #1 (string exepected, got nil):

    stack traceback:

      [C]: in function 'error'

      machine:29: in global 'checkArg'

    .....

      /lib/MineOSCore.lua:117: in field 'getFileList'

    /lib/MineOSCore.lua:392: in method 'updateFileList'

    /OS.lua:637: in field 'updateFileList'

    /OS.lua:444: in local 'changeResolution'

    /OS.lua:688: in main chunk

  5. On ۱۳۹۵/۱۰/۲۸ ه‍.ش. at 11:49 PM, DarkPikachu said:

    This post is a day late because this site kept crashing chrome on this stupid phone, but whatever...

    Don't try what you're about to see at home kids.

    Manual installation, 100% no internet!

    igjQH4gqj_IoKp51iumDhhCXq1JSZlFMcOUbKQsl

    I'm personally amazed by the triple-buffered 3D application called "Ray Walk".

    After doing a manual CPU clock speed test of an average of slightly over 100 (250 for void worlds) TPS, I never would have thought this could have been pulled off at this level of performance.

    I'm going to work on improving image support for this, as well as non-faked (actually transformed) wallpaper support.

    (down with the .pic format, up with .tga)

    ^ I do believe this is a direct pixel format anyways...

     

    EDIT: btw, there's also this lockup glitch I get, fixed by restarting:

    pfSF1MNSxWd08Jwy53u1rm7c1qXYIGfYrdjZ6zfS

    This is Open OS 1.6 btw ;)

    oh good :)
    im also wondering why this os-owner needs our informations? :(
    annnnd
    im waiting for english comment-translated mineos-installer.lua to see how we can install mineos manually :l

  6. On 9/8/2016 at 1:50 AM, jhagrid77 said:

    I'm currently working on translating this Repository from Russian into English, would you like me to send you the link? Also, I translated the Installer if you would like.

    And you translated the installer? Great :))

    Send it here for me

    Because i want to examine and see how it works

    Maybe i can create an "offline" installation .lua script for this mineos XD

    Because im troubled with installing mineos manually in my net-less computer :(

    And im seeing many people have trouble with downloading

    Another reason: topic creator doesnt seem to be online anymore

    And he isnt the mineos creator :l (why are you asking for mod the mineos :l )

×
×
  • Create New...

Important Information

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