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

kevinkk525

Members
  • Content Count

    75
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by kevinkk525

  1. 16 hours ago, SpaceBeeGaming said:

    @BattyCynris When you update OpenComputers (the mod), It doesn't change what is on the computers, it only changes the contents of the OpenOS floppy disk.

    So updating the in-game computer after the mod update only requires you to insert the OpenOS floppy disk and running "install" again.

    The tool you linked is basically just for those who can't update their mod (playing on a server with outdated version but need features of a newer version) so don't use it if normal updating is available.

    No you have to run that tool. The tool downloads the latest openOS files from github.

    Installing your pc with the floppy disk again just updates you to the files the currenly installed mod-version ships, which still contains the regression.

  2. thanks. was worth a try. Sadly this function only works for connecting to a server.
     

    but i found the solution: when reading the connected socket you get "" and if the socket is closed then  you get nil.
    This way it should be reliable to get the connection status.

    Seems like I did not test this enough before.

  3. When using the internet component or internet API I could not find a reliable way to detect a broken socket to an internet adress. Once the connection is broken by the external endpoint, the broken socket can only be detected by writing to the socket, not by reading.

    This makes writing a good program very difficult as it would be impractical to send a ping every second just to detect if the socket is still alive.

    Is there any possibility I did not see? Or is none implemented?

  4. None of my turbines has energy stored, only my enderio capacitors. (except if the capacitors are full, of course)

     

    Typical energy consumption: 500kRF/t but to tes the system I always restart with empty capacitors or higher output

    Reactor: it is a 15x15x7 active reactor, capable of outputting 50B/t

     

    All turbines are activated, conduits are no problem because I use tesseracts, they have no transfer limit.

     

    Oh and btw: setting the steamtarget manually does not seem to work. I always get an error.

     

    My steamtarget seems to be ok but the reactor is not being controlled to output that many.. after a restart my reactor only outputs 700mB/t while calibrating.. it does not want to go higher.. the turbines definitely will work with more steam. I tested the complete setup manually of course. It definitely is able to perform at the maximum of the turbine steam input.

    (not all turbines are visible on the screen... seems like I built too many :D )

     

    a few pictures as requested: https://files.freiebaptisten.de/s/9EVC3EA0qK1uRc0

  5. This is really awesome but it has some problems:

    I'm using one active reactor (max output 50B/t) and 8 Turbines.

    So the steamtarget is 16B/t which is correct.

     

    But your controller calibrates the reactor to output 12B/t...

    I'm using some external power storage. So when power is left in the turbines your controller stops them. Sadly it does not activate them if the power is gone.. Just one turbine is being run (spin down, spin up), i don't understand what that one turbine should be doing..

  6. I tried to program a shop-system in OC with the help of enderio, TE and AE storage system.

     

    It works like this: one player has his OC-PC and can use that to access the OC-Server in the Shop to buy/sell things. The items are being send/received with a tesseract that belongs to the shop owner. In the shop the system is distributed on 4 systems.

    I add a few pictures on my github: https://github.com/kevinkk525/OC-tools/issues/1

    Sadly the code is not completely done. The shop owner /server part is almost complete and works perfectly. Items can be bought and sold. Just the energy rental is not implemented but the setup is ready to support it.

    But on the client side I do have nothing. I just tested the client side like a console program and that worked quite good.

    The server can also include a banking system if you want to. it's just a library to import. The shop uses my other libraries modem-handler and request-handler. I programmed the GUI-API for usage in the client.

    So if anybody wants to continue/finish the development feel free to clone the project or ask me for help in understanding the code and building the setup. It is quite complicated and the pictures are sadly not up to date. But if anybody wants to continue the development I will build a working setup.

    All the important files are in my github.

    Mainly registrations.lua for the registration server that is like a DNS-server in the internal network.

    shopAPI.lua, shopHost.lua,

    switch.lua: handles tesseracts and capacitors

    export.lua: handles the export/import of items

     

    I know this is quite complicated and I do not provide detailed information. But if someone is really interested in continuing this project, i will have a closer look at my code and explain everything to him until he fully understands what i was doing.

     

     

    post-1685-0-11244400-1452864443_thumb.jpg

  7. The request-handler is a program to run as a main program on a PC. It holds execution commands from every program that communicates with it. That means I can run multiple programs that run their commands through the request-handler by adding their command and parameters to the request-handler. It also servers as a server for other computers that can send their requests to the server and if that request is allowed it will be processed automatically and the answer is send back. For this I programmed the modem-API that ensures that message networks are received on the target and works together with the request-handler.

     

    This way it is possible to run programs simultanious (like multithreaded), if they use the request-handler that runs in a main loop.

    It is also possible to simply run a client - server program, ask information from the server and similar.

     

    you find those libraries in my github under request-handler.lua and modem-handler.lua.

    It runs perfectly and was in use by me in several programs and it works awesome. I also used it in my shop-system.

     

    As I do not have time to continue the development, feel free to clone it and use the code as you wish.

  8. Sadly I do not have the time to continue the development of this API. Therefore I would appreciate it a lot if someone would continue the development. I will gladly assist in explaining the code or ideas behind it.

    As far as I know this is the most advanced GUI-API with unique features that can be expanded to support windows with a little bit of effort. Would be a shame if another GUI project dies while others try to program a new API that will be dead before it is even comparable to this one..

    So feel free to clone my github and modify/continue the project or just use parts of the code you think is useful.

  9. Your code does not look bad but it is probably the 5th try of programming a GUI library.

    So please have a look at my project: https://oc.cil.li/index.php?/topic/580-gui-api-064beta/

    and tell me what you think about it. Currently it is the most advanced GUI library but i don't have time for further development.

    So if you think my code is a good base for a gui and you are a good programmer, feel free to clone it and continue the development. I will try to assist the development by explaining the code if something is not clear.

    Would be a shame if we had 5 GUI library attempts but none that is really advanced and in active development..

  10. The ID-Transformation script does work for every building.

    the screens file not, but you can easily implement it into your original code. I did not want to mess up the original table by adding values. Actually only the ["oc:yaw"].value is important. you could implement that value into your table as an additional variable and then generate the NBT-table during execution like the modified building script already does (partly). i still left way too many information in the screens file. the only value that changes the orientation is ["oc:yaw"].value.

    x,y,z are dynamically handled by the building script and the other information is static for screens and do not need to be in the screens file. i could optimize that or script it directly into your original table.

  11. I finished my script to manipulate ids in the building table, it's on my github.

    I manipulated the building script to use the screens file i generated if it exists, it's on my github too.

    The screens file is for tier3 screens, if you want to use different tiers you would need to manipulate the screens file. The file is independent of any coordinates, they are added during the building process.

     

    The screens are now correctly oriented but that comes with a bug: if you attach a keyboard to the screen it does not work. you have to remove the screen and place a new screen. then attach the keyboard exactly to that screen.. messing with NBT has its downsides it seems... still better than rebuilding all screens.

     

    Edit: I could not reproduce the keyboard bug on my second datacenter. everything worked fine this time.. so you'll see for yourself.

     

    Edit 2: If the building is going to be rotated, then the screen orientation will not work again... maybe you can change the building script for a rotation command that automatically changes the orientation of the screens too, it should be the value in oc:yaw.

  12. Which IDs are wrong? I've wrote a little convert perl-script for vanilla minecraft. Should I share it with you?

     

    And yes. Another file for the smaller building would be cool. 

     

    Thanks, i don't know what your program does but mine is almost finished. Going to publish it the next days. was just working on a way to add a way to build the screens with the correct orientation. Actually the code for that part is also almost complete. I just have to fix the screens and run a scan on them, save it as an additional file and modify the original building script. After that the building should have perfectly oriented screens in it. the same method did not work with cases or server racks.. the building is missing keyboards btw...

    So probably I'll post the code in the next days.

     

    To the question which ids are wrong: in the modpack i use all OC-ids are different. and many people will have that problem too. fences were skystone etc...

  13. Awesome program.

    Can you release this program on github?

    I'd like to integrate this program and imageLibrary in my GUI-API but therefore I'd need one feature:  Drawing of a specific area of the image

    And can you add a menu to save the file with a filename? And maybe an exit-button?

     

    And i found a bug that should be fixed: as soon as i press any key the program just exits.. I can't insert any char into the image.

  14. This may be an overkill for your problem and beta but you are free to try it:

    I programmed a request-handler and a modem-hanlder (actually used together). you add a task to send the commands, it then sends those commands and waits for a response and returns the response. the function that is called on the remote client can be programmed like any normal internal function like:

    function turnOff() reactor.off() return true end

    Then you will get a "true" in your host function that looks like this:

    ret=f.remoteRequest(reactor-address,command,data,nil,timeout) --> will be executed on the client as command(data)

    ret gets the return of the client function turnOff().

    If the host does not get an answer within the timeout it will send it a second time. of course you can let it send a third time if ret is still nil.

    Basically it also does what Gangsir said, sending and storing message-ids to take care of duplicate message, so one request can't get executed 10 times if the message arrives this often.

     

    if you are still interested, this is how to work with that (adapted to your situation):

    local f=require"req_handler"
    f.initialize()
    
    local reactor=address
    local reactor2=address
    
    local function turnOff(reactor) 
      local ret
      try=1
     while not ret and try<5 do
       ret=f.remoteRequest(reactor,turnOff,nil,nil,2)
       try=try+1
     end
    print(ret)
    end
    
    local function toggle(...)
      --doStuff
      f.addTask(turnOff,reactor)
    end
    
    event.listen("touch",toggle)
    
    while true do f.execute() end

    the request_handler (f) is like a process manager, you add a task and it will get executed when calling f.execute(). This makes sure that ids will be generated and the remote answer will get back to the correct function (this is not used in this example, there are more complex situations where you have to wait 20 seconds for an answer but don't want your host to get stuck that long. especially for this cases i use the request handler. pausing the execution of one task until an answer arrives and continue it when the answer is received. at the moment not with coroutines sadly, but i will add this one day).

     

     

    On your client the code could look like this:

    local f=require"req_handler"
    f.initialize()
    
    local function turnOffReactor()
    --doStuff
      return true
    end
    
    f.registerFunction(turnOffReactor,"turnOff") --makes this function available for external calls: host calling this function on client
    
    while true do f.execute() end

    So this is basically how you could use this. (you shouldn't change the port 801 though, i did not test that). It automatically uses wireless with strength 400 if available.

    you can get it from my github:

    https://github.com/kevinkk525/OC-tools/blob/master/modem-handler.lua

    https://github.com/kevinkk525/OC-tools/blob/master/request-handler.lua

     

    Use this code to get it to your OC-PC with an internet card:

    local component=require"component"
    
    if not component.isAvailable("internet") then
        print("You need a internet card, quit with any key")
        local inp=io.read()
        os.exit()
    end
    if not component.internet.isHttpEnabled() then
        print("Http is not enabled, please ask your admin! quit with any key")
        local inp=io.read()
        os.exit()
    end
    print("\ndownloading request-handler and modem-handler")
    os.execute("wget -f https://github.com/kevinkk525/OC-tools/raw/master/modem-handler.lua /lib/modem_handler.lua")
    os.execute("wget -f https://github.com/kevinkk525/OC-tools/raw/master/request-handler.lua /lib/req_handler.lua")

    if it is too complicated or not what you want to add just ignore this :D I'm building all my networks with it.

  15. Das ist mit der listing-form möglich. in dieser kannst du pro zeile einen text setzen und ein ClickEvent, welches dann der an/aus-schalter ist. Programmierst du die Funktion, die beim klicken ausgeführt wird, so dass diese den An/Aus-Wert umschaltet, kannst du das mit einer zeile schaffen. du kanst sogar die Text- und Hintergrundfarbe per Zeile setzen.

    Würde praktisch so aussehen:

    "Reaktor1: An" mit Farbe grün als Hintergrund

     

    Du klickst darauf, funktion toggle() auf, ändert text auf "Reaktor1: Aus" mit Farbe rot als Hintergrund. Das Click-Event übergibt den Text in der Zeile an die Funktion, sodass du den Text analysieren kannst, um damit den Reaktor herauszufinden und den aktuellen Zustand, um damit weiterzuarbeiten.

    Nur mal als Beispiel.

    Um einen weiteren Reaktor hinzuzufügen, genügt der folgende code und der neue reaktor wird an letzter stelle hinzugefügt:

    last_entry=#listing_shape.getText()
    listing_shape.setText(last_entry+1,"Reactor"..tostring(last_entry+1)..": On")
    listing_shape.setClickEvent(toggle,last_entry+1)

    Theoretisch kannst du hier dann noch die Farben setzen.

    Lade aber den Code erneut herunter, ich habe gerade noch etwas geändert.

     

     

    Sorry for all people that don't understand german.

    What I tried to explain was (in short version):

    It is possible to dynamically insert reactors with the listing shape, set a clickEvent per line, toggle their state and set the color according to the state.

  16. Thanks for the hint, I really should do that.

    in interactive lua you can type "=GUI" or "for a in pairs(GUI) do print(a) end" to see all the commands but of course not the parameters...

    I will update it soon, until then you have too look it up in the code ;-) or learn from the tech_demo.

×
×
  • Create New...

Important Information

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