I mean I've set up a choicebox.
msg = "What would you like to do first?"
title = "Economy v1.0"
choices = ["Check your bank balance",
"Check the value of the stocks",
"Check what stocks you own",
"Buy stocks",
"Sell Stocks",
"Move to the next day.",
"Exit"]
choice = eg.choicebox(msg, title, choices)
But now I'd like to know how I get it to do something when a choice is selected. The tutorial on the website didn't give much help, and all the things I've experimented with haven't worked.
I tried to do this first:
if choice == choice[0]:
#do stuff
if choice == choice[1]:
#do more stuff
...
When I selected a choice, nothing happened.
So then I tried this:
if choice == "Buy Stocks":
#do stuff
if choice == "Sell Stocks":
#do stuff
...
But that didn't work either. I have tried a range of other things, but I'm not entirely sure what the choicebox returns, and what variable it stores it in. Could someone help me out here?