9 posts
Location
UK
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
8543 posts
Posted 18 April 2015 - 07:18 PM
Moved to Ask a Pro.
656 posts
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
9 posts
Location
UK
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
9 posts
Location
UK
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
8543 posts
Posted 18 April 2015 - 09:31 PM
There is a sticky post with a Common Errors section that can answer this question.
Threads merged.
9 posts
Location
UK
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
8543 posts
Posted 19 April 2015 - 12:08 AM
Then post the current code and describe the new issues you're having.
9 posts
Location
UK
Posted 19 April 2015 - 01:38 AM
the new issues I am getting is startup: attempt to call nil
7083 posts
Location
Tasmania (AU)
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.
1023 posts
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
9 posts
Location
UK
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????
656 posts
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.
9 posts
Location
UK
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
2427 posts
Location
UK
Posted 19 April 2015 - 09:10 PM
[.code]tags please[./code]
remove the dots
9 posts
Location
UK
Posted 20 April 2015 - 01:37 AM
Lupus590 for example not this way Fuel = reactor.getFuelAmount() but this was Fuel = reactorGetFuelAmount()?????
3057 posts
Location
United States of America
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]
7083 posts
Location
Tasmania (AU)
Posted 20 April 2015 - 01:55 AM
Why not show him
both tags? :P/> [co
de][/co
de]
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.
3057 posts
Location
United States of America
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.
9 posts
Location
UK
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
8543 posts
Posted 23 April 2015 - 12:55 AM
Are we supposed to guess what the new code is? Please post the updated code.
57 posts
Location
Universe:C:/MilkyWay/Sol/Earth/Europe/Germany
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