Nuclear Reactor Setup For Dummies (and I'm a dummy...) HELP!
#1
Posted 05 July 2012 - 04:31 AM
The problem I'm having is that I can't figure out the programming for a multiple choice system.
I have something as follows:
print ("Welcome to The Nuclear Reactor Mainframe!")
print ()
print ("Please select an action to take.")
print ("1. Reactor Menu")
print ("2. Early Warning Systems")
print ("3. Manual Shutdown")
print ("4. Cancel")
input = read()
if input == "1" then
term.clear()
term.setCursorPos(1,1)
print (" Reactor Menu ")
print ()
print ("1. Start Reactor")
print ("2. Start Cooling Systems")
print ("3. Begin Timer Until Uranium Refill Required") --I'm making the refill of uranium manual, so there are no "accidents"
print ("4. Cancel")
input = read()
if input == "1" then
term.clear()
term.setCursorPos(1,1)
print ("Accessing Files...")
sleep(2)
print ()
print ("Starting Reactor...")
sleep(2)
redstone.setOutput("back", true) --I have a NOT gate setup, so this will turn the reactor on (will run continously without a redstone signal)
print ()
print ("Reactor Successfully Started")
Now here's the part I need help with. I want the program to return to the Nuclear Reactor Menu, not the mainframe menu or the startup password entry. The only way I've learned to program this is to type os.shutdown() to shut down the computer and then restart, but then you'd have to navigate there again. If someone could:
A: Help me with the return function of my programming (to the previous page)
and B: Either proofread my programming or tell me how to do this...
The program should look something like this
startup --> Enter Password --> type in Nuclear Reactor --> Display Reactor Mainframe Choices
1. Reactor Menu
2. Early Warning Systems
3. Emergancy Shutdown
4. Cancel
1. Should Entail:
Starting the Reactor
Stopping the Reactor
Starting the Cooling Systems (just needs to power pistons to let water flow in)
Stopping Cooling Systems
Start Timer Until Next Uranium Refill
and the all important: Cancel
2 Should just have:
Starting the Sirens
Stopping the Sirens (Manually; the sirens will automatically go off at 4500 degree heat)
3 Needs another redstone output, just to activate pistons, destroying redstone circuitry, turning off reactor
4 another cancel
Also, would there be any way for me to display this all on the monitor I have above the computer?
I have no disk drives or anything like that, so all sides are open for redstone except top and front.
(as if i haven't asked enough =P) Would there also be a way for the program to automatically check for a redstone output on one side (idc which) so if the overheating gets too bad, it can pull up a screen on the monitor asking if you want to shut off the reactor or not? (it can use the same output as the one to manually turn on-off reactor in order to shut the reactor off)
Thanks to anyone who even looks at this post. I know it's quite wordy, and takes a while to get through. I would greatly appreciate help on this here =P Remember, I'm new to this (2 days, in fact)
so I won't understand much of lua or programming language.
Thanks, thanks, and thanks again!
#2
Posted 05 July 2012 - 04:43 AM
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
#3
Posted 05 July 2012 - 05:40 AM
#4
Posted 05 July 2012 - 06:49 AM
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry about the double copy post... I forgot to add this title (which was what I wanted in the first place) after I had already posted the other one.
Thanks for the info, I understood most of it.
I have some questions, however, just basic understanding things.
-- e, p = os.pullEvent() -- what does this string mean? I don't understand the os.pullEvent(), does it pull up the sub-menus?
-- if e == char then -- This would mean that if the input is "true" (or equal to) the character in the menu, then preform this action, correct?
-- if p == someChar then -- and lastly, I do not understand this line of code =( What is this mysterious p variable. The E would be my equivelant to input = read(), -- then -- if input == (code) then (do whatever), but what is this p? Is it simply another variable or version of Input (password, code, etc.)?
The last code has the same questions in it, exept for this one line:
--elseif p == subMenuKey then -- Once again with that darn p. If p is just another input term (as I am assuming for now, until
-- subMenu() -- conformation) then this code is saying (in continuation of elseif) that if the key/character typed is the submenu key, then it pulls up the submenu? --!! I really don't understand that last bit about the subMenu() !!--
Thanks once more for enduring the drudgery of this post. This information did really help, though, and for that I thank you.
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
#5
Posted 05 July 2012 - 07:10 AM
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry to post again, but late-night befuddled, hazy thinking has set in again, and I forgot to ask a couple questions.
I would like the last bit (the part about successfully starting the reactor) to automatically return to the reactor menu. Is there any way I can do this without having to press a button, or would it just be best to manually return? The way I look at it would be:
Its a loop inside a loop inside a loop inside a loop.
Reactor Mainframe --> Reactor Menu --> Choice of starting reactor or cancelling (wooh, only 2 choices here!) --> either manually returning to reactor menu (skipping the start reactor yes-no option) or automatically doing it. Would it be possible to just skip the start reactor screen entirely and go back to the reactor menu, cutting out the middle man?
On a completely unrelated note, the bottom coding (in your post) would be for the overall menu (or heirchy, if you like)? Where the coding says if this is a submenu key, then I would plug in the submenu coding, or the top coding, correct? If I needed a sub-menu inside a submenu, i would just plug in that keying again, correct?
Thanks for all the help you've shown. This is truly amazing, and I am extremely grateful for any help I can get.
#6
Posted 05 July 2012 - 12:45 PM
wowplayer101, on 05 July 2012 - 06:49 AM, said:
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
Aww thankies!
How have you hooked up your computer system to your power plant? Could I have a screenshot and explaination on how you did it?
#7
Posted 05 July 2012 - 12:55 PM
#8
Posted 05 July 2012 - 01:45 PM
Deathknight0897, on 05 July 2012 - 12:55 PM, said:
That wasn't a question but a suggestion. lol
#9
Posted 05 July 2012 - 07:34 PM
Thanks for the info, and as for the blast doors, I will be having something like that, and I will be using the temperature gauges to trip redstone. I have a Colored Light system set up (I'm using tekkit, so I have redpower) and Blue= Off/ stationary, dark green = very cool, light green= cool, yellow = rising temperatures, starts to trigger emergancy procedures, orange is overheating, triggers sirens and pulls up warning display, red = all sirens activate, emergancy doors close, secure the room. flashing red = iminant meltdown, and even if you can't stop it, it will have a blast sheild containing reinforced stone (harder than obsidion) obsidion, RS, obsidion, steel, obsidion, and iron. all of these layers have emergancy blast doors. Sound safe enough?
#10
Posted 05 July 2012 - 11:55 PM
wowplayer101, on 05 July 2012 - 07:34 PM, said:
Thanks for the info, and as for the blast doors, I will be having something like that, and I will be using the temperature gauges to trip redstone. I have a Colored Light system set up (I'm using tekkit, so I have redpower) and Blue= Off/ stationary, dark green = very cool, light green= cool, yellow = rising temperatures, starts to trigger emergancy procedures, orange is overheating, triggers sirens and pulls up warning display, red = all sirens activate, emergancy doors close, secure the room. flashing red = iminant meltdown, and even if you can't stop it, it will have a blast sheild containing reinforced stone (harder than obsidion) obsidion, RS, obsidion, steel, obsidion, and iron. all of these layers have emergancy blast doors. Sound safe enough?
You should create a secondary power plant well out of site for testing purposes and put this setup inside it then cause a meltdown and see how it goes.
You should place a big massive monitor in the control room that will display live status of the plant on it. I'm planning on it.
#11
Posted 06 July 2012 - 12:16 AM
wowplayer101, on 05 July 2012 - 06:49 AM, said:
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry about the double copy post... I forgot to add this title (which was what I wanted in the first place) after I had already posted the other one.
Thanks for the info, I understood most of it.
I have some questions, however, just basic understanding things.
-- e, p = os.pullEvent() -- what does this string mean? I don't understand the os.pullEvent(), does it pull up the sub-menus?
-- if e == char then -- This would mean that if the input is "true" (or equal to) the character in the menu, then preform this action, correct?
-- if p == someChar then -- and lastly, I do not understand this line of code =( What is this mysterious p variable. The E would be my equivelant to input = read(), -- then -- if input == (code) then (do whatever), but what is this p? Is it simply another variable or version of Input (password, code, etc.)?
The last code has the same questions in it, exept for this one line:
--elseif p == subMenuKey then -- Once again with that darn p. If p is just another input term (as I am assuming for now, until
-- subMenu() -- conformation) then this code is saying (in continuation of elseif) that if the key/character typed is the submenu key, then it pulls up the submenu? --!! I really don't understand that last bit about the subMenu() !!--
Thanks once more for enduring the drudgery of this post. This information did really help, though, and for that I thank you.
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
os.pullEvent() takes an event off of the event queue. Events are generated each time a key on the keyboard is pressed, redstone inputs change, a rednet message is received, and a few other things happen. read() actually uses this function and uses the events from pressing keys on the keyboard to create a string, which then gets returned after the user presses enter. In the use here, we are getting an event type "e" and the first parameter "p" from whatever it returns. You could call these anything you like. So here's our example event pull call:
e, p = os.pullEvent()
Now, when we reach that line, the computer will wait for an event to be triggered. Let's say we press the G key at that point. The function will return two values: a string naming the event type ("char" in this case) and the character we typed ("g" in this example). So, our next two lines were:
if e == "char" then if p == "g" then
As you can see, I've modified the psuedocode to match what we're doing in this example. 'e', the event type, is checked to determine whether we are dealing with a character or not ("char"). If we are, we want to find out which character was typed. So, we check the parameter ('p') to see if it was the "g" key that was pressed.
Now, the subMenu() line. Each submenu you want to use would be placed in its own function. See how the first block of psuedocode starts with "local function ..."? That's a function declaration. In our example, if we push the button for the submenu, the program will call the submenu function for whichever submenu we want (you'll need to set this up with a function for each submenu and call each one based on which key was pressed in the main menu). The function will clear the screen and draw the submenu options, then use the os.pullEvent() sequence just like the main menu, except that it will have its own actions for each key pressed. Once you are done with the submenu, you can simply use return to exit the submenu. If all of your menus are in loops, once the function returns, the main menu will clear the screen and draw itself again.
So to summarize, each menu you want should have a similar form:
- Clear the screen
- Draw the menu
- Pull events
- Act on chosen events
#12
Posted 06 July 2012 - 03:28 AM
Lyqyd, on 06 July 2012 - 12:16 AM, said:
wowplayer101, on 05 July 2012 - 06:49 AM, said:
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry about the double copy post... I forgot to add this title (which was what I wanted in the first place) after I had already posted the other one.
Thanks for the info, I understood most of it.
I have some questions, however, just basic understanding things.
-- e, p = os.pullEvent() -- what does this string mean? I don't understand the os.pullEvent(), does it pull up the sub-menus?
-- if e == char then -- This would mean that if the input is "true" (or equal to) the character in the menu, then preform this action, correct?
-- if p == someChar then -- and lastly, I do not understand this line of code =( What is this mysterious p variable. The E would be my equivelant to input = read(), -- then -- if input == (code) then (do whatever), but what is this p? Is it simply another variable or version of Input (password, code, etc.)?
The last code has the same questions in it, exept for this one line:
--elseif p == subMenuKey then -- Once again with that darn p. If p is just another input term (as I am assuming for now, until
-- subMenu() -- conformation) then this code is saying (in continuation of elseif) that if the key/character typed is the submenu key, then it pulls up the submenu? --!! I really don't understand that last bit about the subMenu() !!--
Thanks once more for enduring the drudgery of this post. This information did really help, though, and for that I thank you.
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
os.pullEvent() takes an event off of the event queue. Events are generated each time a key on the keyboard is pressed, redstone inputs change, a rednet message is received, and a few other things happen. read() actually uses this function and uses the events from pressing keys on the keyboard to create a string, which then gets returned after the user presses enter. In the use here, we are getting an event type "e" and the first parameter "p" from whatever it returns. You could call these anything you like. So here's our example event pull call:
e, p = os.pullEvent()
Now, when we reach that line, the computer will wait for an event to be triggered. Let's say we press the G key at that point. The function will return two values: a string naming the event type ("char" in this case) and the character we typed ("g" in this example). So, our next two lines were:
if e == "char" then if p == "g" then
As you can see, I've modified the psuedocode to match what we're doing in this example. 'e', the event type, is checked to determine whether we are dealing with a character or not ("char"). If we are, we want to find out which character was typed. So, we check the parameter ('p') to see if it was the "g" key that was pressed.
Now, the subMenu() line. Each submenu you want to use would be placed in its own function. See how the first block of psuedocode starts with "local function ..."? That's a function declaration. In our example, if we push the button for the submenu, the program will call the submenu function for whichever submenu we want (you'll need to set this up with a function for each submenu and call each one based on which key was pressed in the main menu). The function will clear the screen and draw the submenu options, then use the os.pullEvent() sequence just like the main menu, except that it will have its own actions for each key pressed. Once you are done with the submenu, you can simply use return to exit the submenu. If all of your menus are in loops, once the function returns, the main menu will clear the screen and draw itself again.
So to summarize, each menu you want should have a similar form:
- Clear the screen
- Draw the menu
- Pull events
- Act on chosen events
So if I just type Return after i want to go back a menu, it will return me? no funky os.'s or ()'s?
#13
Posted 06 July 2012 - 03:58 AM
Lyqyd, on 06 July 2012 - 12:16 AM, said:
wowplayer101, on 05 July 2012 - 06:49 AM, said:
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry about the double copy post... I forgot to add this title (which was what I wanted in the first place) after I had already posted the other one.
Thanks for the info, I understood most of it.
I have some questions, however, just basic understanding things.
-- e, p = os.pullEvent() -- what does this string mean? I don't understand the os.pullEvent(), does it pull up the sub-menus?
-- if e == char then -- This would mean that if the input is "true" (or equal to) the character in the menu, then preform this action, correct?
-- if p == someChar then -- and lastly, I do not understand this line of code =( What is this mysterious p variable. The E would be my equivelant to input = read(), -- then -- if input == (code) then (do whatever), but what is this p? Is it simply another variable or version of Input (password, code, etc.)?
The last code has the same questions in it, exept for this one line:
--elseif p == subMenuKey then -- Once again with that darn p. If p is just another input term (as I am assuming for now, until
-- subMenu() -- conformation) then this code is saying (in continuation of elseif) that if the key/character typed is the submenu key, then it pulls up the submenu? --!! I really don't understand that last bit about the subMenu() !!--
Thanks once more for enduring the drudgery of this post. This information did really help, though, and for that I thank you.
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
os.pullEvent() takes an event off of the event queue. Events are generated each time a key on the keyboard is pressed, redstone inputs change, a rednet message is received, and a few other things happen. read() actually uses this function and uses the events from pressing keys on the keyboard to create a string, which then gets returned after the user presses enter. In the use here, we are getting an event type "e" and the first parameter "p" from whatever it returns. You could call these anything you like. So here's our example event pull call:
e, p = os.pullEvent()
Now, when we reach that line, the computer will wait for an event to be triggered. Let's say we press the G key at that point. The function will return two values: a string naming the event type ("char" in this case) and the character we typed ("g" in this example). So, our next two lines were:
if e == "char" then if p == "g" then
As you can see, I've modified the psuedocode to match what we're doing in this example. 'e', the event type, is checked to determine whether we are dealing with a character or not ("char"). If we are, we want to find out which character was typed. So, we check the parameter ('p') to see if it was the "g" key that was pressed.
Now, the subMenu() line. Each submenu you want to use would be placed in its own function. See how the first block of psuedocode starts with "local function ..."? That's a function declaration. In our example, if we push the button for the submenu, the program will call the submenu function for whichever submenu we want (you'll need to set this up with a function for each submenu and call each one based on which key was pressed in the main menu). The function will clear the screen and draw the submenu options, then use the os.pullEvent() sequence just like the main menu, except that it will have its own actions for each key pressed. Once you are done with the submenu, you can simply use return to exit the submenu. If all of your menus are in loops, once the function returns, the main menu will clear the screen and draw itself again.
So to summarize, each menu you want should have a similar form:
- Clear the screen
- Draw the menu
- Pull events
- Act on chosen events
Also, I have another question. I have my main menu, then my reactor menu, and then a sequence for starting the Reactor. This in turn needs to automatically return to the Reactor menu (before it) Do i need to put that in a loop, or can I just type "Return" at the bottom of the sequence to bring up the Reactor Menu again?
#14
Posted 06 July 2012 - 04:42 AM
Lyqyd, on 06 July 2012 - 12:16 AM, said:
wowplayer101, on 05 July 2012 - 06:49 AM, said:
Lyqyd, on 05 July 2012 - 04:43 AM, said:
local function subMenu() while true do clearTheScreen() printTheSubMenu() e, p = os.pullEvent() if e == char then if p == someChar then performAction() elseif p == goBackChar then return end end end end while true do clearTheScreen() printTheMenu() e, p = os.pullEvent() if e == char then if p == someKey then doSomeStuff() elseif p == subMenuKey then subMenu() elseif p == exitChar then return else whineAboutInvalidOption() end end end
As far as the monitor usage goes, check the Peripheral API as well as the numerous tutorials and other posts inquiring about monitor usage. With the overheating pulling up a special menu: you'll be pulling events anyway for the menus (instead of using read(), if you use the method I suggested above), so just handle the redstone events appropriately.
Feel free to ask for clarification on any of this.
Sorry about the double copy post... I forgot to add this title (which was what I wanted in the first place) after I had already posted the other one.
Thanks for the info, I understood most of it.
I have some questions, however, just basic understanding things.
-- e, p = os.pullEvent() -- what does this string mean? I don't understand the os.pullEvent(), does it pull up the sub-menus?
-- if e == char then -- This would mean that if the input is "true" (or equal to) the character in the menu, then preform this action, correct?
-- if p == someChar then -- and lastly, I do not understand this line of code =( What is this mysterious p variable. The E would be my equivelant to input = read(), -- then -- if input == (code) then (do whatever), but what is this p? Is it simply another variable or version of Input (password, code, etc.)?
The last code has the same questions in it, exept for this one line:
--elseif p == subMenuKey then -- Once again with that darn p. If p is just another input term (as I am assuming for now, until
-- subMenu() -- conformation) then this code is saying (in continuation of elseif) that if the key/character typed is the submenu key, then it pulls up the submenu? --!! I really don't understand that last bit about the subMenu() !!--
Thanks once more for enduring the drudgery of this post. This information did really help, though, and for that I thank you.
As for HelenB, yes, you may certainly have my copy of the program, once I struggle through it and debug the whole thing.
os.pullEvent() takes an event off of the event queue. Events are generated each time a key on the keyboard is pressed, redstone inputs change, a rednet message is received, and a few other things happen. read() actually uses this function and uses the events from pressing keys on the keyboard to create a string, which then gets returned after the user presses enter. In the use here, we are getting an event type "e" and the first parameter "p" from whatever it returns. You could call these anything you like. So here's our example event pull call:
e, p = os.pullEvent()
Now, when we reach that line, the computer will wait for an event to be triggered. Let's say we press the G key at that point. The function will return two values: a string naming the event type ("char" in this case) and the character we typed ("g" in this example). So, our next two lines were:
if e == "char" then if p == "g" then
As you can see, I've modified the psuedocode to match what we're doing in this example. 'e', the event type, is checked to determine whether we are dealing with a character or not ("char"). If we are, we want to find out which character was typed. So, we check the parameter ('p') to see if it was the "g" key that was pressed.
Now, the subMenu() line. Each submenu you want to use would be placed in its own function. See how the first block of psuedocode starts with "local function ..."? That's a function declaration. In our example, if we push the button for the submenu, the program will call the submenu function for whichever submenu we want (you'll need to set this up with a function for each submenu and call each one based on which key was pressed in the main menu). The function will clear the screen and draw the submenu options, then use the os.pullEvent() sequence just like the main menu, except that it will have its own actions for each key pressed. Once you are done with the submenu, you can simply use return to exit the submenu. If all of your menus are in loops, once the function returns, the main menu will clear the screen and draw itself again.
So to summarize, each menu you want should have a similar form:
- Clear the screen
- Draw the menu
- Pull events
- Act on chosen events
Also, I keep having this weird error code, saying that the "end" on my last line needs to end the function of the submenu (on line one).
Help!
#15
Posted 06 July 2012 - 04:48 AM
#16
Posted 06 July 2012 - 03:19 PM
Lyqyd, on 06 July 2012 - 04:48 AM, said:
Is there a way to copy the code in-game?
#17
Posted 06 July 2012 - 05:19 PM
#18
Posted 06 July 2012 - 05:30 PM
Lyqyd, on 06 July 2012 - 05:19 PM, said:
Lyqyd, on 06 July 2012 - 05:19 PM, said:
#19
Posted 06 July 2012 - 05:32 PM
#20
Posted 06 July 2012 - 05:32 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











