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

Daraketh

Members
  • Content Count

    17
  • Joined

  • Last visited

Posts posted by Daraketh

  1.  

    I've taken the above codes and gotten very close to making the program work. The problem is that the main loop isn't working right. When you press a key, it either does nothing or only goes to the warp data menu. I don't know whats wrong.

     

    mainloop = true
    while(mainloop) do
     Clear()
     ShowInfo()
     term.setCursorPos(1, 15)
     SetColorTitle()
     ShowMenu("D - Dimensions, M - Toggle summon")
     ShowMenu("S - Set Warp Data, J - Jump, G - Jump to JumpGate")
     ShowMenu("B - Jump to Beacon, H -Jump to Hyperspace")
     ShowMenu("C - Summon, X - Shutdown WarpCore and Exit")
     SetColorDeflt()
     ev, p1, p2, p3, p4, p5 = event.pull(nil, _, ev,  p1, p2, p3, p4, p5)
     if ev == "key_down" then
      local char = keyboard.keys[p1]
      if char == s then
       SetDirection()
       SetDistance()
       SaveData()
      elseif char == m then
       if SData.Summon then
        SData.Summon = false
       else
        SData.Summon = true
       end
      SaveData()
      elseif char == d then
       SetDimensions()
       SaveData()
      elseif char == j then
       if Confirm() then
        Warp()
       end
      elseif char == c then
       Summon()
      elseif char == b then
       JumpToBeacon()
      elseif char == g then
       JumpToGate()
      elseif char == h then
       if Confirm() then
        component.warpdriveShipController.mode(5)
        component.warpdriveShipComponent.jump()
       end
      elseif char == x then
       mainloop = false
      end
     end
    end
     
    if SData.Summon then
     SData.Summon = false
     SaveData()
    end
    Clear()
    print("Shutting Down")
    component.warpdriveShipController.mode(0)
    os.sleep(0.5)
    

     

    I might be missing something, but I can't see where you've assigned values to variables s, m, d, j, c, b, g, h, x etc.

     

    I think you mean to put a " " (possibly ' ', not sure if it matters in lua) around these characters. At the moment it looks like you are trying to compare the key pressed with variables that haven't been declared or assigned values.

  2. Details? Got something to power it? I think there are some options in the config to use no power if that's your thing, don't quote me on that though.

     

    My typical test set-up is the APU, RAM, HDD, openOS floppy, lua EEPROM, internet card, which all goes in the T3 Case (don't forget to use "install' once it boots).

     

    Then you need a screen with a keyboard attached.

     

    Finally (if you haven't turned power requirement off in config) you need a power converter block attached to some sort of power source (various creative batteries from other mods).

     

    Again, don't quote me on this, but I think creative cases don't require power, so that might be an option too.

     

    If you do all of that you should be able to boot it up without a problem.

  3. Hey all,

    I ended up getting a PNG of 160x50 pixels and cutting it into 3 segments, 64x50, 64x50, 32x50, then stitching those together. That seems to have worked for now.

     

    If anyone happens to know why I can't just use a single 160x50 png I'd love to know, particularly if I'm doing it wrong.

     

    The main error I'm getting is a context error of 8, though I was also getting noeof related errors and others too.

     

    Specifically the error is as below...

     

    While attempting to load '/zel4.png' as PNG, libPNGImage erred:

    /lib/deflatelua.lua:115: unexpected end of file with context 8

     

    Cheers!

  4. Hey all,

    Thought you might be interested to know I got a test program working. Turned out sleeping on it was the solution, had something working within 30 minutes of waking up.  :P

     

    If anyone is interested in taking a look and helping out, please see below.

     

    Basic Setup:

     

    glxLntZ.png

     

    I don't actually use the adapter with an inventory controller just yet, but it will hopefully be moved to connect to the ME Controller, the adapter with a database, and the ender chest. The idea being the inventory controller will update the database with items stored in the ME system, if possible. The inventory controller adapter will also probably keep track of items in the ender chest.

     

    Test Program / Code:

     

    Pastebin (easier to read, has correct Lua syntax highlighting): http://pastebin.com/tm9f2hQR

    --      Title: me_exportbus test program
    --
    --  File Name: test
    --
    --Description: Reads all items in database and
    --             attempts to export 1 instance of
    --             each item to a chest through the
    --             export bus
    --
    --      Notes: I use sides.bottom here, this will
    --             be different depending on the placement
    --             of your me_exportbus! I will eventually
    --             write a function to set this value
    --             dynamically (or maybe not, Im lazy)
    --
    --             Keep in mind the database itemstack info
    --             is manually added at the moment, I will
    --             eventually add a means of using an inventory
    --             controller to manage the database programmatically
    --             (if possible with ME system)
    
    local component = require('component')
    local sides = require('sides')
    local db = component.database
    local cont = component.me_controller --not actually used
    local exBus = component.me_exportbus
    local busSide = sides.bottom --you might need to change this
    
    --for loop to print all the items in DB
    --should dynamically calculate end of loop
    for i = 1, 5 do
      item = db.get(i)
      print("--ITEM " .. i ..  " START--")
      for k,v in pairs(item) do
        print(k,v)
      end
      print("--ITEM " .. i .. " END--")
    end
    
    print("\n\n")
    
    --for loop sets the export config to a different item
    --each loop, prints the config, then tries to export 1 item.
    --Should also dynamically calculated end of loop, but in actual
    --real use I probably will have a function along the lines of
    --exportItem(itemName) or something similar, which will do all
    --the work required to set the export config and pump out a single
    --instance of that item to the chest (resetting the config after)
    for i = 0, 4 do
    
      --start run i and set config for next item
      print("--------- Run " .. i .. " Start ---------\n")
      print("Set Config: ",exBus.setExportConfiguration(busSide, 1, db.address, i+1))
    
      --print the config, comment this block out if you dont care
      config = exBus.getExportConfiguration(busSide, 1)
      print("\n!! Export Bus Config Start !!\n")
      for k,v in pairs(config) do
        print(k,v)
      end
      print("\n!! Export Bus Config End !!\n")
    
      print("Try Export: ",exBus.exportIntoSlot(busSide,i+1), "\n") -- try export an item
    
    end
    
    exBus.setExportConfiguration(0) --clear the config
    

    This uses hard coded values at the moment, but eventually I'll change this to use an inventory controller to manager the database and export items.

     

    Also, anyone know how to get Lua syntax highlighting in the code boxes?

     

    Problems:

     

    Solved:

                - As soon as I set the configuration on an export bus it instantly starts trying to pump that item out of the ME system. Solution was to use a Redstone Card upgrade in the export bus. Then set the Redstone Mode to Active with signal (then never send it a signal, so that exBus.exportIntoSlot is the only time it will try move an item).

     

    Unsolved:

               - I'm not sure if there is a way to get information about items in the ME system into the database. I did notice the latest version has added something to do exactly this though, so I may just have to wait until the mod pack my server uses get's an update.

  5. UPDATE: I finally got a test program working. See post below if interested. Going to leave this here as I make changes/improve the functionality, any pointers or suggestions are still more then welcome!


     


    Description:


      My friend and I are trying to get our OC computer to move items from an Applied Energistics 2 ME system into a chest (by any means)


     


    Function:


      I would like functionality that allows me to transfer items from my ME system into a chest, either through the export bus, or directly through a controller (if possible), or even using a robot, literally any means is great.


     


    Deadline:


      No deadline, would mostly just love some help. :)


     


    Additional Information:


      We've made preliminary attempts with ExportIntoSlot and various other methods on both the ME controller and the ME export bus. We've been using the github appeng intergration code as a reference from HERE to try achieve this, but have only had problems thus far. The greatest success so far is getting an export bus to return false with exportBus.exportIntoSlot(i,1) returning as false.


     


    I have previously managed to use a ComputerCraft turtle to do exactly this (I think using openPeripheral?), though this was with Applied Energistics 1.


     


    Thank you in advance!


     


    PS: If anyone is interested in having a crack, I can link some resources we've found that supposedly work, but none of the example code (or our various modifications to said example code) has worked thus far. I admit we're probably doing it wrong, any insight is great.


     


    PPS: Decided to include them anyways, see below if you're interested.


     


    https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/scala/li/cil/oc/integration/appeng


    http://oc.cil.li/index.php?/topic/411-extracting-items-from-me-network-applied-energetics/


    http://oc.cil.li/index.php?/topic/481-ae-item-management-puzzle-whats-the-best-way-to-do-this/


  6. It should be possible. You could create a transfer program that takes the information from the floppy, then sorts the data into seoperate folders ( A good way to organize the various data types). I could post an example if you'd like.

     

    Hey NightWolf,

    I'll take an example if it's still on offer. :P

     

    Sounds like something to learn from.

  7. Hey all,

    I realise this isn't specifically a OpenComputers question. But does anyone have any experience with allowing robots to place inside of a Towny town? I've added the [OpenComputers] fake player to the Towny config, but still not having a win.

     

    I've noticed that turtles from ComputerCraft are able to place/destroy blocks.

     

    Cheers,

    Dara

  8. Thanks for the replies to my threads dgelessus!

     

    That colour chart in the link was very useful, it helped lead to this program - http://pastebin.com/GPg4XVY5

     

    At the moment it uses to GPU to cycle through all available colours as shown in that chart, and prints each colour row by row on the screen (along with it's hex value and brightness value).

     

    "colour normal" just prints the colours as shown on the chart, along with the hex and brightness values.

    "colour lum" first prints the colours as in "colour normal" in order to fill a table with values for later sorting, then it attempts to do what i described in my original post, but does a pretty poor job of it.

     

    I think I've almost got it doing what I want, but at the moment It's only calculating the RBG colour's luminance (brightness) based on the the findings of one gentleman (http://alienryderflex.com/hsp.html). As below

     

    brightness  =  sqrt( .299 R2 + .587 G2 + .114 B2 )

     

    I think I need to find a way to calculate not only the brightness of the colour, but the contrast ratio also. Anyways, I might play around and see what happens. It was a fun learning experience regardless.

     

    Cheers!

  9. Hey al

    I'm wondering if anyone can make a function that returns the value (hex or decimal) for each consecutive colour in the 8 bit (256 colour) range.

     

    The idea being we start at black, then move through each colour in the spectrum in order until we hit white, as demonstrated in the below image.

     

    post-486-0-91320800-1424860345_thumb.jpg

     

    I guess the idea is you'd set a global variable to 0, and operate on that variable to change the colour each iteration.

     

    What do you guys think?

     

    Cheers,

    Dara

     

     

  10. I'm writing a pointless program to start learning about how the GPU api works. It's basically a shrinking and expanding square that changes the border colour and inner square colour every update.

     

    I'm wondering if there is a trivial way to cycle through all the colours starting from black to white, and in reverse, as below.

     

    post-486-0-81205900-1424859686_thumb.jpg

     

    Link below is what I have so far, unfortunately it hasn't got many comments, and my code is probably pretty noobish. I noticed that the top tier screens are capable of only 8 bit colour, but I seem to need to use up to 16mil+ to get access to get all the possible colours.

     

    http://pastebin.com/UKXtPNDt

     

    Anyone able to tell me where I'm going wrong, I know I'm not even close.

     

    Cheers,

    Dara

     

×
×
  • Create New...

Important Information

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