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

iceman11a

Members
  • Content Count

    17
  • Joined

  • Last visited

Posts posted by iceman11a

  1. Well it doesn't work, It's just that plan, If your saying that 2 values are not the same, Then I need to make some fixes in the code. Maybe that's why it doesn't work, I don't know.

     

    UPDATE:

    I fount the value on the button line is the only one that didn't match the others. How ever that's only for display. The idea is that this code should work and doesn't. When I click on a button,. It needs to update the display all so. So I can turn the value from true to false and back.The problem is to update the menu. or screen with the new value. So when I click in the button. The value in the display changes.

  2. I don't think I under stand the lua rules. I have done programming in C#  and lua is nothing like c#.

    http://pastebin.com/6D6wpqSB Save in your library folder as "screen.lua"

    The above code is a library that I use for my menus and buttons. It does work. The problem is that I can't seem to get the code to work. ?. Look at my code below. and it should make some sense to you. The idea is to start and stop trains (railcarft) using signals from bundled cable. with menus and buttons. The idea is to update the menu as well as sending signals out and being able to to turn the signals off. I just don't think I under stand the rules for coding in lua. For a sample. Look at isRefueling. When this is turned on, It sends a signal to a switch motor then switches a train track. Sending the train to refuel. When you stop trains and they have been sitting for a while. and not knowing how much fuel is left. I thought this was a good idea.

    Can some one help me code this.
     

    
        local scr = require("screen")
        local component = require("component")
        local colors = require("colors")
        local rs = component.redstone
        local event = require("event")
        local term = require("term")
        local sides = require("sides")
    
        local rs = component.redstone
        isRefueling = false
        isCityActive = false
        isTownActive = false
    
        
        local win = scr:newPane(win, 50, 25)
        term.clear()
        win:center()
        win:box(1, 1, 50, 25, 0x999999)
        win:centerText(1, 10, 50, 0x999999, 0x000000, "Trains Main Menu.")
        win:button("Start / Stop Town  "..tostring(IsTownActive), 19, 12, 25, 3, 0xFF0000, "town")
        win:button("Start / Stop City  "..tostring(isCityActive), 19, 14, 25, 3, 0xFF0000, "city")
        if isRefueling == false then
        win:button("Refuel On   "..tostring(isRefueling), 19, 16, 20, 3, 0xFF0000, "refueloff")
        elseif isRefueling then
        win:button("Refuel Off  "..tostring(isRefueling), 19, 16, 20, 3, 0xFF0000, "refuelon")
        end
        
        win:button("Exit me",19 , 22, 20, 3, 0xFF0000, "exit")
        win:render()
    
    
    function startIt(mode, place)
    
        if place == "city" then
    
          if mode == "on" then
          rs.setBundledOutput(sides.north, colors.lime, 255) --Starts train for city
          rs.setBundledOutput(sides.north, colors.pink, 0) -- Turns Parks off
          isCityActive = true
          elseif mode == "off" then
          rs.setBundledOutput(sides.north, colors.pink, 255) -- Stops Train
          rs.setBundledOutput(sides.north, colors.lime, 0) -- Turn Start off
          isCityActive = false
          end
    
      elseif place == "town" then
    
          if mode == "on" then
    	  rs.setBundledOutput(sides.north, colors.green, 255) -- Starts train for town
          rs.setBundledOutput(sides.north, colors.red, 0) -- turns Stop off 
          isTownActive = true      
          elseif mode == "off" then
    	  rs.setBundledOutput(sides.north, colors.green, 0) -- Shuts train city off
          rs.setBundledOutput(sides.north, colors.red, 255) --  Stops Train
          isTownActive = true
          end
      end
    end
    
    function Refueling(mode)
    
      if mode == "on" then
      rs.setBundledOutput(sides.north, colors.blue, 255)
      isReFueling = true 
      elseif mode == "off" then
      rs.setBundledOutput(sides.north, colors.blue, 0)
      isRefueling = false
      end
    end
    
    
      
    local function run(ev, p1, p2, p3, p4, p5)
      if ev == "touch" then
            if win:clicked(p2, p3) then
                ret = win:buttonClicked(p2, p3)
                if ret == "town" then     
     
                 
              
                          
                    term.clear()
                    win:render()
                elseif ret == "city" then
                
                if isCityActive == true then
                startIt("on","city")
                elseif isCityActive == false then
                startIt("off","city")
                end
                
                elseif ret == "refuelon" then
                Refueling("on")
                
                elseif ret == "refueloff" then
                Refueling("off")
                              
                elseif ret == "exit" then
                    term.clear()
                    running = false      
                end
            end
      
      elseif ev == "key_down" then
        term.clear()
        running = false
    
      end
    
    end
    
    running = true
    repeat
    
        local ev, p1, p2, p3, p4, p5 = event.pull(.5, _, ev, p1, p2, p3, p4, p5)
        run(ev, p1, p2, p3, p4, p5)
      
    until running == false
    term.clear()
    
      
    
  3. I have 2 PC connected to one server. The problem is that I get monitor and boot problems. The PC or the server don't want to boot up. or rebooting one pc or server boots every thing. Does any one have a photo or a video that can show me hot to connect them together where I won't have any conflicts. The way I have it connected not. Doesn't work and I can't connect to a modem or broadcast.

     

    I just need a good sample to show me how to connect the 2 pc's and the server together so that I can use one of the pc to broadcast to the server.

     

    The 2nd thing is that I want to be able to use modem.send(). The problem is that the PC or server has an id that way too long. Is there  a way to give each pc and the server a name. and then use that when using modem. send().

     

     

  4. Yes, I'm on a server and yes i uploaded the mod to my server. and to the new server I been playing on. and last that's why I wish the editor for lua was a lot better then it is. I can copy and paste into the editor. I just can't copy and paste from the editor. That should be added on the next release. This idea is to monitor the air pressure to start and stop an engine to add more air to the compressor(s). with out blowing the tubes and machines up. I was told that the option is in Opencomponents. i just have to find it. SO in the mean time. It;s the old way.

  5. not a problem. Ok, I run a mod pack I don't know if i can install those mods. Some of them I all ready have installed. I just don't have OpenPeripherals and i know this has nothing to do with it sense I all ready check this my self. This is still in the Alpha and it was never added. So that I do know.

  6. Well then I'm all confused. Do I need all of those extra mods or what? Your saying I need all of those mods and your saying just install CC. well will CC do it all for me or will I have to install all of the mods from the other post. Please tell me just what I need. This is why you have me so confused.

  7. Ok, That's why. Lets look at your list

     

    ComputerCraft1.64 (I don't have this mod nor do I want it)

    Computronics-1.7.10-1.0.5 ( I don't know what this mod is I have to see if it was added to the modpack I have)

    OpenComponents-MC1.7.10-0.2.0.20-universal  (Yes. I have this one)

    OpenComputers-MC1.7.10-1.3.4.63-universal (Yes I have this one)

    OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122 (I don't think these are added to my mod)

    OpenPeripheralCore-1.7.10-0.5.0-snapshot-142 ( This one I don't think have been added to my mod)

    PneumaticCraft-1.7.10-1.2.8-15-universal (this version haven't been updated in my mod pack at this time)

     

    At the time I was playing with OP and in MC 1.6.4. This option didn't exist. I checked and the mod Computronics-1.7.10-1.0.5 is not a part of the modpack. I don't think nor will I think that DNS will add this mod. CC or Computercraft is a mod I don't like. Because of the limits on this mod. I don't think that OP will be getting added to the mod all so. Like I said. The option I want is not available in the modpack I have. I don't have access to the server to add these mod's. How ever  can you get me a link for these mods.

     

    Computronics-1.7.10-1.0.5

    OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122

    OpenPeripheralCore-1.7.10-0.5.0-snapshot-142

    PneumaticCraft-1.7.10-1.2.8-15-universal (I Have 1.2.6) I couldn't find this mod

     

    Ice

  8. Oh and I did add opencompunents to the client. So I have that all so. From what I have seen and what I saw there's not a way to read the air pressure in a tube or a machine. I can read the energy and things like that. How ever I didn't want to have to monitor the pressure the old way. (With redstone on the ground.) and a valve. I just have no idea if it was ever added or just not at this time. it would be a great idea. To be able to monitor the pressure in a tube or a machine. That way you can send another signal for an alarm or some thing.

  9. Thanks how ever adigyran, You told me that you were using computercraft. The same options your telling me that work in computercraft also work in opencomputers and that's not true. I all ready looked That doesn't work.

     

    JoshTheEnder, That could be very true. The idea is that this is a opencomputer forum and the other guy should have known that and tested his idea in opencomputer, As far as I can see there is no way to check for the pressure in opencomputer.

  10. Ok, does this have to be a machine or can it be a tube. Or ?. The idea is that I can play with it. to check it for my self. It would be an idea to get some kind of an idea so that I don't spend hours playing with some thing that doesn't work.

     

    and do you know how many adapters I can have on one PC system. will the pc just list it with a new id. I'll have to play with that all so.

    Last is there a limit on the length on how much network cable I can place down. Can I stretch the network cable. I need to make some poles from blocks and run it 1000 blocks up to 4000 blocks away from the PC and Servers.

     

    Thanks for your help

     

    UPDATE: getPressure() is not supported any more.

  11. I have a mod installed and with the DNS Techpack. and I need an option to monitor the air pressure going threw a tube. Below is a sample code I have in lua for CC (Computercraft) and I need this to work in OC (Opencomputers)

    p = peripheral.wrap("back")
    while true do
     x = p.getPressure()
     print("Current pressure " .. x)
     if x < 4 then
     rs.setOutput("right", true)
     print("Pressure low, Starting Engines")
     else
     rs.setOutput("right", false)
    end
    sleep(5)
    end
    

    This code monitors the back of the pc and reads the air pressure and displays the amount of bars, If the amount of bars falls below. 4.0. It sands a redstone signal and engines start up and keep the air pressure up to 4.0 bars

     

    Does any one know how to do this in OpenC

     

    Thanks

    Ice

     

  12. Finding samples so that I can learn from is not an easy thing to do. I'm looking for simple samples to learn from. Some thing that can teach me how to display colors on the screen and words. How to monitor storage tanks and energy and pressure tubes. I'm not looking for some one to write the code for me. It would be nice if I can find some one that can help me with the code.
     
    Ice
     
    Edited by the authorities: please don't randomly post links to unrelated sites.

×
×
  • Create New...

Important Information

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