This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Cybermegatroll's profile picture

Setting up a computer for a Big Reactor

Started by Cybermegatroll, 18 April 2015 - 04:15 PM
Cybermegatroll #1
Posted 18 April 2015 - 06:15 PM
Hi all

When i try and start up my code for a Big Reactor this message comes up bios:367: [string "startup"]:7: '=' expected but I have put it in my code is attached


can someone help please
Lyqyd #2
Posted 18 April 2015 - 07:18 PM
Moved to Ask a Pro.
flaghacker #3
Posted 18 April 2015 - 07:27 PM
You forgot your parentheses on line 6.

Pleasy post your code on pastebin in the future, that easier to read.
Edited on 18 April 2015 - 05:27 PM
Cybermegatroll #4
Posted 18 April 2015 - 07:35 PM
Hi all

When i try and start up my code for a Big Reactor this message comes up bios:367: [string "startup"]:7: '=' expected but I have put it in my code is



1.reactor = peripheral.wrap("back")
2.display = peripheral.wrap("right")
3.display.setBackGroundColors(color.blue)
4.
5. while true do
6. display.clear()
7. Fuel = reactor.getFuelAmount()
8. Max = reactor.getFuelAmountMax()
9. CasingHeat = reactor.getCasingHeatTemperature()
10. CoreHeat = reactor.getCoreHeatTemperature()
11. Water = reactor.getWaterAmount()
12. WaterMax = reactor.getWaterAmountWaterMax()
13. Steam = reactor.getSteamAmount()
14. SteamMax = reactor.getSteamAmountSteamMax()
15. ReactorControlRod = reactor.getReactorControlRod()
16. ReactorCoolantport = Reactor.getReactorCoolantPort()
17.
18. display.setCursorPos(1,1)
19. display.writer("Fuel % ")
20. display.setCursorPos(8,1)
21. display.write(math.floor((Fuel/Max)*100))
22. display.write(Fuel)
23. display.setCursorPos(1,3)
24. display.write("CasingHeat")
25. display.setCursorPos(8,3)


can someone help please
Edited on 18 April 2015 - 08:12 PM
Cybermegatroll #5
Posted 18 April 2015 - 08:18 PM
You forgot your parentheses on line 6.

Pleasy post your code on pastebin in the future, that easier to read.


I just added them to line 6 and it still not working
Lyqyd #6
Posted 18 April 2015 - 09:31 PM
There is a sticky post with a Common Errors section that can answer this question.

Threads merged.
Cybermegatroll #7
Posted 18 April 2015 - 10:11 PM
about this () yeah I know about that i missed them when copying them to the message it about the other bits that i can on get working
Lyqyd #8
Posted 19 April 2015 - 12:08 AM
Then post the current code and describe the new issues you're having.
Cybermegatroll #9
Posted 19 April 2015 - 01:38 AM
the new issues I am getting is startup: attempt to call nil
Bomb Bloke #10
Posted 19 April 2015 - 01:45 AM
What line number did that error point you to, and have you checked your spelling there? Remember Lua's case-sensitive.
valithor #11
Posted 19 April 2015 - 01:45 AM
the new issues I am getting is startup: attempt to call nil

That is not the full error message, and most of the people on the forum are not familar enough with the functions from peripherals to readily recognize one that is not real or correct.

The full error message contains a number at some point in it, which is the line that the error occurs on. Now that you know this you have two options.
1: Post the full error message here, so we can attempt to help
2: You can look at the line the error occurs on, see if it is misspelled, or if the function even exists

edit:
ninja'd

edit2:
Now that I spent all the time typing this all out it appears you accidently capitalized the variable reactor on line 16.
Edited on 18 April 2015 - 11:46 PM
Cybermegatroll #12
Posted 19 April 2015 - 03:41 PM
sorry about that the message is startup:7: attempt to call nil and I looked at the code and I can not see a misspelled and how can i find the function exists????
flaghacker #13
Posted 19 April 2015 - 03:57 PM
sorry about that the message is startup:7: attempt to call nil and I looked at the code and I can not see a misspelled and how can i find the function exists????

Please post the full code.
Cybermegatroll #14
Posted 19 April 2015 - 08:35 PM
1.reactor = peripheral.wrap("back")
2.display = peripheral.wrap("right")
3.display.setBackGroundColors(color.blue)
4.
5. while true do
6. shell.run("clear")
7. Fuel = reactor.getFuelAmount()
8. Max = reactor.getFuelAmountMax()
9. CasingHeat = reactor.getCasingHeatTemperature()
10. CoreHeat = reactor.getCoreHeatTemperature()
11. Water = reactor.getWaterAmount()
12. WaterMax = reactor.getWaterAmountWaterMax()
13. Steam = reactor.getSteamAmount()
14. SteamMax = reactor.getSteamAmountSteamMax()
15. ReactorControlRod = reactor.getReactorControlRod()
16. ReactorCoolantport = Reactor.getReactorCoolantPort()
17.
18. display.setCursorPos(1,1)
19. display.writer("Fuel % ")
20. display.setCursorPos(8,1)
21. display.write(math.floor((Fuel/Max)*100))
22. display.write(Fuel)
23. display.setCursorPos(1,3)
24. display.write("CasingHeat")
25. display.setCursorPos(8,3)
26. display.write(Temperature((CasingHeat)*C))
27. display.write(CasingHeat)
28. display.setCursorPos(1,5)
29. display.write("CoreHeat")
30. display.setCursorPos(8,5)
31. display.write(Temperature((CoreHeat)*C))
32. display.write(CoreHeat)
33. display.setCursorPos(1,7)
34. display.write("Water % ")
35. display.setCursorPos(8,7)
36. display.write(math.floor((Water/WaterMax)*100))
37. display.write(Water)
38. display.setCursorPos(1,9)
39. display.write("Steam % ")
40. display.setCursorPos(8,9)
41. display.write(math.floor((Steam/SteamMax)*100))
42.
43. if CoreHeat >= 20000 then
44. reactor.getReactorControlRodInsertRods(true)
45. end
46.
47. if CoreHeat <=250 then
48. reactor.getReactorControlRodRetractRods(true)
49. end
50.
51. if Water >= 40000 then
52. reactor.getReactorCoolantPortActive(false)
53. end
54.
55. if Water <= 20000 then
56. reactor.getReactorCoolantPortActive(true)
57. end
58.
59. sleep(5)


this is the new code
Edited on 19 April 2015 - 06:43 PM
Lupus590 #15
Posted 19 April 2015 - 09:10 PM
[.code]tags please[./code]
remove the dots
Cybermegatroll #16
Posted 20 April 2015 - 01:37 AM
Lupus590 for example not this way Fuel = reactor.getFuelAmount() but this was Fuel = reactorGetFuelAmount()?????
KingofGamesYami #17
Posted 20 April 2015 - 01:49 AM
No, he means for the code tags. Because posting actual code tags.. uh.. turns them into code tags.

I can show you a code tag, without the closing:

[code]
Bomb Bloke #18
Posted 20 April 2015 - 01:55 AM
Why not show him both tags? :P/> [code][/code]

Anyway, Big Reactor computer port blocks should have a getFuelAmount() function to call. But "getCasingHeatTemperature" doesn't appear to've ever existed as a function; methinks you got the line numbers mixed up.
KingofGamesYami #19
Posted 20 April 2015 - 02:00 AM
Why not show him both tags? :P/>/> [code][/code]

Well, I never thought that would work for one… I will hopefully remember that next time.
Cybermegatroll #20
Posted 22 April 2015 - 10:37 PM
I've updated my minecraft computer code but now it is saying bios:367: [ string "startup"]:8: '<name>' expected and how can i get around that now
Lyqyd #21
Posted 23 April 2015 - 12:55 AM
Are we supposed to guess what the new code is? Please post the updated code.
Square789 #22
Posted 25 April 2015 - 01:15 PM
I'm not 100 % sure, but i think '<name>' expected means that you misstuctured a for loop or a function.

for local i = 0, 5, 2.5 do
	 print(i)
end

function
	print("When this gets printed, lua is corrupted")
end
Both of them will return the '<name>' error but there could be other reasons for this error.
Edited on 25 April 2015 - 11:22 AM