Jump to content




Nuclear Reactor Setup For Dummies (and I'm a dummy...) HELP!


  • You cannot reply to this topic
27 replies to this topic

#21 wowplayer101

  • New Members
  • 17 posts

Posted 06 July 2012 - 06:04 PM

View PostLyqyd, on 06 July 2012 - 05:32 PM, said:

Not the mods folder, the world folder. Where all the chunk files live. There's a computer folder inside there.
I went to my world folder, here is what is in here:
data folder (empty)
EnderStorage(empty)
players: Contains dat files on Nomad_Novix, litlpaul, and WoWplayer101 (me)
RedstoneEther: filled with .dat files (fmap, fprop, gprop, node1 and node2)
region: r.0.0.mca, r.0.1.mca, so forth and so on
level.dat DAT file
level.dat_old DAT_OLD file
railcraft.dat
session.lock, and
uid.dat

Thassit... The only file related to CC is in my mods (what I previously posted) :P/>

#22 wowplayer101

  • New Members
  • 17 posts

Posted 06 July 2012 - 06:08 PM

Thanks for all the help, everyone. Sorry I'm asking so many questions, I really don't know much about my server (didn't realize how much I didn't know until now =()

Thanks to all of you who have bared through these comments, just to try and help me! :P/>

#23 wowplayer101

  • New Members
  • 17 posts

Posted 06 July 2012 - 07:42 PM

View PostLyqyd, on 06 July 2012 - 05:19 PM, said:

Go to the server files, look in the world directory. There should be a "computer" folder. The program will be in one of the individual computer folders in there.

Disregard that post about it not working, I got it fixed. Now I'm having trouble with the Reactor-menu sub-menu.... When I try to take action (press a number to start reactor, for instance) it wont work. Period. Do I need to have ANOTHER sub-menu in there? All I want it to do is print some stuff, sleep, then turn on redstone behind it and return to the reactor menu. I guess I'd need to set that up as a loop, but does that mean I need 4 more sub menu's just to preform that function as well as stopping the reactor, starting the timer and returning?

#24 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 July 2012 - 12:17 AM

I really can't guess at what's not working correctly without seeing the current code, sorry.

#25 wowplayer101

  • New Members
  • 17 posts

Posted 07 July 2012 - 03:45 AM

View PostLyqyd, on 07 July 2012 - 12:17 AM, said:

I really can't guess at what's not working correctly without seeing the current code, sorry.

I FOUND IT!!!

Apparently, I have 2 tekkit servers, one of which I thought had the world I was playing in. WRONG! I found the coding!

local function subMenu()

while true do

term.clear()

term.setCursorPos(1,1)

print ()

print ("**************************************************")

print ()

print (" Reactor Menu")

print ()

print ("1. Start Reactor")

print ("2. Start Refill Timer")

print ("3. Stop Reactor")

print ("4. Back")

e, p = os.pullEvent()

if e == char then

if p == "1" then

while true do

term.clear()

term.setCursorPos(1,1)

print ("Loading Mainframe...")

sleep(3)

print ()

print ("Loading Subsystems...")

sleep(2)

print()

print ("Starting Reactor...")

sleep(2)

redstone.setOutput("back", true)

sleep(2)

print ()

print (" Reactor Successfully Started")

return

end

elseif p == "2" then

term.clear()

term.setCursorPos(1,1)

print ("Starting Timer...")

redstone.setOutput("left", true)

sleep(2)

return

elseif p == "3" then

print ("Stopping Reactor...")

sleep(4)

rs.setOutput("back", false)

sleep(2)

print ("Reactor Stopped.")

sleep(2)

return

elseif p == "4" then

return

end

end

end
end


-- Variables go here
x = 1
y = 2
z = 5
r = (x + y)
s = (y + z)
t = (x + z)

--Beginning of Code

while true do

term.clear()

term.setCursorPos(1,1)

print ()
print ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")

print ("--------------------------------------------------")

print ()


print (" Welcome to the Nuclear Reactor Mainframe!")
print ()

print ("Please Choose an Action")

print ("1. Reactor Menu")
print ("2. Early Warning Systems")
print ("3. Emergancy Shutdown")

print ("4. Cooldown Settings")

e, p = os.pullEvent()

if p == "1" then

subMenu()

elseif p == "2" then

print ("hi")

end
end
end
-- I haven't actually finished this part here, just made a filler so I could test the program.

When I test the program, I can access the submenu (good) but I can't access any of the submenu's functions (bad).

Hope this helps!
Thanks!

#26 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 July 2012 - 04:28 AM

Okay, I've revised the code and added comments where I made changes.

--renamed function to better describe which submenu it is.
local function reactorMenu()
	while true do
		term.clear()
		term.setCursorPos(1,1)
		print ()
		print ("**************************************************")
		print ()
		print (" Reactor Menu")
		print ()
		print ("1. Start Reactor")
		print ("2. Start Refill Timer")
		print ("3. Stop Reactor")
		print ("4. Back")
		e, p = os.pullEvent()
		--char is a string, so we need quotes around it.
		if e == "char" then
			if p == "1" then
				-we do not need a while true do here since we return immediately at the end of the sequence.
				term.clear()
				term.setCursorPos(1,1)
				print ("Loading Mainframe...")
				sleep(3)
				print ()
				print ("Loading Subsystems...")
				sleep(2)
				print()
				print ("Starting Reactor...")
				sleep(2)
				redstone.setOutput("back", true)
				sleep(2)
				print ()
				print (" Reactor Successfully Started")
			elseif p == "2" then
				term.clear()
				term.setCursorPos(1,1)
				print ("Starting Timer...")
				redstone.setOutput("left", true)
				sleep(2)
				return
			elseif p == "3" then
				print ("Stopping Reactor...")
				sleep(4)
				rs.setOutput("back", false)
				sleep(2)
				print ("Reactor Stopped.")
				sleep(2)
				return
			elseif p == "4" then
				return
			end
		end
	end
end


-- Variables go here
x = 1
y = 2
z = 5
r = (x + y)
s = (y + z)
t = (x + z)

--Beginning of Code

while true do
	term.clear()
	term.setCursorPos(1,1)
	print ()
	print ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
	print ("--------------------------------------------------")
	print ()
	print (" Welcome to the Nuclear Reactor Mainframe!")
	print ()
	print ("Please Choose an Action")
	print ("1. Reactor Menu")
	print ("2. Early Warning Systems")
	print ("3. Emergency Shutdown")
	print ("4. Cooldown Settings")
	e, p = os.pullEvent()
	--make sure we are handling a char event before checking the parameter.
	if e == "char" then
		if p == "1" then
			reactorMenu()
		elseif p == "2" then
			print ("hi")
		end
	end
end


#27 wowplayer101

  • New Members
  • 17 posts

Posted 07 July 2012 - 05:39 AM

View PostLyqyd, on 07 July 2012 - 04:28 AM, said:

Okay, I've revised the code and added comments where I made changes.

--renamed function to better describe which submenu it is.
local function reactorMenu()
	while true do
		term.clear()
		term.setCursorPos(1,1)
		print ()
		print ("**************************************************")
		print ()
		print (" Reactor Menu")
		print ()
		print ("1. Start Reactor")
		print ("2. Start Refill Timer")
		print ("3. Stop Reactor")
		print ("4. Back")
		e, p = os.pullEvent()
		--char is a string, so we need quotes around it.
		if e == "char" then
			if p == "1" then
				-we do not need a while true do here since we return immediately at the end of the sequence.
				term.clear()
				term.setCursorPos(1,1)
				print ("Loading Mainframe...")
				sleep(3)
				print ()
				print ("Loading Subsystems...")
				sleep(2)
				print()
				print ("Starting Reactor...")
				sleep(2)
				redstone.setOutput("back", true)
				sleep(2)
				print ()
				print (" Reactor Successfully Started")
			elseif p == "2" then
				term.clear()
				term.setCursorPos(1,1)
				print ("Starting Timer...")
				redstone.setOutput("left", true)
				sleep(2)
				return
			elseif p == "3" then
				print ("Stopping Reactor...")
				sleep(4)
				rs.setOutput("back", false)
				sleep(2)
				print ("Reactor Stopped.")
				sleep(2)
				return
			elseif p == "4" then
				return
			end
		end
	end
end


-- Variables go here
x = 1
y = 2
z = 5
r = (x + y)
s = (y + z)
t = (x + z)

--Beginning of Code

while true do
	term.clear()
	term.setCursorPos(1,1)
	print ()
	print ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
	print ("--------------------------------------------------")
	print ()
	print (" Welcome to the Nuclear Reactor Mainframe!")
	print ()
	print ("Please Choose an Action")
	print ("1. Reactor Menu")
	print ("2. Early Warning Systems")
	print ("3. Emergency Shutdown")
	print ("4. Cooldown Settings")
	e, p = os.pullEvent()
	--make sure we are handling a char event before checking the parameter.
	if e == "char" then
		if p == "1" then
			reactorMenu()
		elseif p == "2" then
			print ("hi")
		end
	end
end

Ok, wow, I cannot thank you enough, man. This thing is lookin' pretty sweet, all thanks to you. I now have it working properly, and the rest won't be hard.

I am truly grateful! Thank you SOOOOO much, man!

@HelenB: I plan on finishing the scripting tomorrow, haven't tested the programming to it's full extent but have tested failsafes, and they seem to be working. I'll work hard to get the finished product out tomorrow!

THANK YOU SOOOO MUCH
to everyone who helped!

#28 HelenB

  • New Members
  • 27 posts

Posted 22 July 2012 - 03:43 PM

View Postwowplayer101, on 07 July 2012 - 05:39 AM, said:

View PostLyqyd, on 07 July 2012 - 04:28 AM, said:

Okay, I've revised the code and added comments where I made changes.

--renamed function to better describe which submenu it is.
local function reactorMenu()
	while true do
		term.clear()
		term.setCursorPos(1,1)
		print ()
		print ("**************************************************")
		print ()
		print (" Reactor Menu")
		print ()
		print ("1. Start Reactor")
		print ("2. Start Refill Timer")
		print ("3. Stop Reactor")
		print ("4. Back")
		e, p = os.pullEvent()
		--char is a string, so we need quotes around it.
		if e == "char" then
			if p == "1" then
				-we do not need a while true do here since we return immediately at the end of the sequence.
				term.clear()
				term.setCursorPos(1,1)
				print ("Loading Mainframe...")
				sleep(3)
				print ()
				print ("Loading Subsystems...")
				sleep(2)
				print()
				print ("Starting Reactor...")
				sleep(2)
				redstone.setOutput("back", true)
				sleep(2)
				print ()
				print (" Reactor Successfully Started")
			elseif p == "2" then
				term.clear()
				term.setCursorPos(1,1)
				print ("Starting Timer...")
				redstone.setOutput("left", true)
				sleep(2)
				return
			elseif p == "3" then
				print ("Stopping Reactor...")
				sleep(4)
				rs.setOutput("back", false)
				sleep(2)
				print ("Reactor Stopped.")
				sleep(2)
				return
			elseif p == "4" then
				return
			end
		end
	end
end


-- Variables go here
x = 1
y = 2
z = 5
r = (x + y)
s = (y + z)
t = (x + z)

--Beginning of Code

while true do
	term.clear()
	term.setCursorPos(1,1)
	print ()
	print ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
	print ("--------------------------------------------------")
	print ()
	print (" Welcome to the Nuclear Reactor Mainframe!")
	print ()
	print ("Please Choose an Action")
	print ("1. Reactor Menu")
	print ("2. Early Warning Systems")
	print ("3. Emergency Shutdown")
	print ("4. Cooldown Settings")
	e, p = os.pullEvent()
	--make sure we are handling a char event before checking the parameter.
	if e == "char" then
		if p == "1" then
			reactorMenu()
		elseif p == "2" then
			print ("hi")
		end
	end
end

Ok, wow, I cannot thank you enough, man. This thing is lookin' pretty sweet, all thanks to you. I now have it working properly, and the rest won't be hard.

I am truly grateful! Thank you SOOOOO much, man!

@HelenB: I plan on finishing the scripting tomorrow, haven't tested the programming to it's full extent but have tested failsafes, and they seem to be working. I'll work hard to get the finished product out tomorrow!

THANK YOU SOOOO MUCH
to everyone who helped!
AWESOME! :)/>
Can't wait to see it! :3
I can now abandon my old computer powered power plant because it has a bad design. That's if this script works ofc. lol
Reactor 4 just exploded anyway :o/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users