Jump to content

Dmac9244

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Dmac9244

  1. So... therefore I would just use if statements to change the value of i, then whenever i becomes 9, do function2()? That would work, I think. It would still do what I want it to do, which is good. Thank you. EDIT: Thank you so much. It worked.
  2. So now I want the Fuel amount to update quickly, but the RF production amount to update not so quickly, like every five seconds or so. Currently, I have under one loop, the functions getRF() and getFuel(). Can I do this?
  3. M1r077, I did try asking basically the same thing in computercraft forums, but since this problem also has to do with reactors, I decided that it might be better to ask this question on a forum with a more general knowledge base. For strictly computercraft questions, I am asking on the computercraft forums, but unfortunately this can be a problem with bigreactors, and the people at CCForums (what I've decided to call it now) might not know that, but the people here might. That might have been a run-on sentence... Thanks for your help though on those sleep() functions. I figured out already that it had to be os.sleep(), it just wasn't giving me any errors on that. Doomzzday01, I'll try that. So I'll have to add a return part to getMessage(), then use it as a variable like message = getMessage()? EDIT: I just added the line return message to the function getMessage(), then I used getMessage() to fill a variable like RF for getting RF production, and it worked. Thanks, Doomzzday!
  4. I know that that is supposed to help me in some way, but since there is no context to what you are saying, I have no idea what that link is supposed to do for me. Sorry, but can you please elaborate a bit for me?
  5. It runs until it hits that point. It says: fuel:22: attempt to concatenate string and nil. The problem was fixed, and then showed up again when I tried making functions out of the code.
  6. Thanks so much guys. Another question; I tried to make the code easier to handle, in ways like making certain parts of the code functions so I could use them more without taking the time to rewrite them over and over again. But now,I'm getting the same error again. I made sure that my methods like reactor.getFuelAmount had () at the end, but I am still getting a nil concatenating error. Am I making the functions incorrectly? Any help would be appreciated. Here are the two scripts (again) monitor computer, function getMessage() local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message") end function getRF() getMessage() connect.transmit(25565, 25565, "gI") mon.setCursorPos(5, 1) mon.write("The current amount of RF") mon.setCursorPos(6, 1) mon.write("produced is:".. message) end function getFuel() getMessage() connect.transmit(25565, 25565, "iG") mon.setTextScale(1) mon.setCursorPos(1, 1) mon.write("The Current Amount of") mon.setCursorPos(1, 2) mon.write("Fuel is:".. message) end mon = peripheral.wrap("top") mon.clear() connect = peripheral.wrap("back") connect.open(25565) getMessage() if message == "connected" then mon.clear() mon.setTextScale(1.4) mon.setCursorPos(10,2) mon.write("CONNECTED TO REACTOR!") connect.transmit(25565,25565, "iw") os.sleep(2) mon.clear() end i = 5 repeat mon.clear() mon.setCursorPos(1, 1) getFuel() getRF() sleep(1) until i == 6 if message == 0 then mon.clear() mon.setCursorPos(1,1) mon.write("OUT OF FUEL!!!!") end and the reactor computer, function getRF() rF = reactor.getEnergyProducedLastTick() connect.transmit(25565, 25565, rF) end function getFuel() fAmount = reactor.getFuelAmount() connect.transmit(25565, 25565, fAmount) end connect = peripheral.wrap("right") connect.open(25565) reactor = peripheral.wrap("front") if reactor.getConnected() == true then connect.transmit(25565,25565,"connected") sleep(1) end i = 5 repeat getRF() getFuel() sleep(1) until i == 0
  7. off topic, but will Mekanism be added to Tekkit in the future? Is it already in beta versions of the pack?
  8. No, I do not have any errors there, but that may just be my problem. I was using this web page for all my reactor controls, and it doesn't have the () after each function... For Curunir and M1r077, I am currently using the recommended version of tekkit, although with just a couple mods added in, which I think would be a great addition to the pack. (Minus tinker's construct, since this is a tech pack.) These mods should not in any way change how CC works with Big Reactors.
  9. I am trying to use the computer access port from the Big Reactors mod to be able to access my reactor through a computer, but something doesn't seem to be working. I want to use the .getEnergyProducedLastTick function(?) and print it as a string, but when it is printed, it is printed as a nil value, meaning that it either crashes the program, or when I use the tostring() function(?) it shows me a weird set of numbers and letters. What am I doing wrong? Here are the two programs I am using. One of them is for a computer connected to a monitor, the other is for the computer connected to the reactor. monitor computer: mon = peripheral.wrap("top") mon.clear() connect = peripheral.wrap("back") connect.open(25565) local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message") if message == "connected" then mon.clear() mon.setTextScale(1.4) mon.setCursorPos(10,2) mon.write("CONNECTED TO REACTOR!") connect.transmit(25565,25565, "iw") os.sleep(2) mon.clear() end repeat local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message") connect.transmit(25565, 25565, "it") mon.clear() mon.setTextScale(1) mon.setCursorPos(1,1) mon.write("The Current Amount of") mon.setCursorPos(1,2) mon.write("Fuel is:", message) print(message) until message == 0 if message == 0 then mon.clear() mon.setCursorPos(1,1) mon.write("OUT OF FUEL!!!!") end and the reactor computer, connect = peripheral.wrap("right") connect.open(25565) reactor = peripheral.wrap("front") if reactor.getConnected() == true then connect.transmit(25565,25565,"connected") sleep(1) end repeat fAmount = reactor.getFuelAmount Amount = tostring(fAmount) connect.transmit(25565,25565, Amount) sleep(1) until fAmount == 0 in this exact example I am actually using the get fuel amount function(?). Oh, and by the way, each (?) after the word function is me asking if that is the right word to use for that line of code.
×
×
  • Create New...