Well I created a store, I know I know, big woop. And I know I shouldn't get any dead ends here but I keep getting these three errors, all the same saying: error: invalid expression
Heres the code, if you need any coments at all just ask and Ill try to do so A.S.A.P.
mob
Shopkeeper
verb
Talk()
set src in oview(2)
switch(input("Welcome to Ro-Town's General Shop. How may I help you?")in list("What do you have for sale?","No thanks just passing by."))
if ("What do you have for sale?")
switch(view("General Shop")in list("Energy Boost - 200.RT","Mega Energy Boost - 600.RT","Ultra Energy Boost - 1000.RT"))
if("Energy Boost - 200.RT")
switch(view("Buy one Energy Boost for 200.RT?")in list("Yes","No"))
if("Yes")
usr.RT-=200
usr << "You pay 200.RT for an Ultra Energy Boost."
switch(view("Will that be all?")in list("Yes","No"))
if("Yes")
alert("Thank you for shopping at the Robo Town General Shop, please come again.")
if("No")
Talk()
if("No")
Talk()
if("Mega Energy Boost - 600.RT")
switch(view("Buy one Mega Energy Boost for 600.RT?")in list("Yes","No"))
if("Yes")
usr.RT -= 600
usr<< "You pay 600.RT for an Ultra Energy Boost."
switch(input("Will that be all?")in list("Yes","No"))
if("Yes")
alert("Thank you for shopping at the Robo Town General Shop, please come again.")
if("No")
Talk()
if("No")
Talk()
if("Ultra Energy Boost - 1000.RT")
switch(view("Buy one Ultra Energy Boost for 100.RT?")in list("Yes","No"))
if("Yes")
usr.RT -= 1000
usr << "You pay 1000.RT for an Ultra Energy Boost."
switch(view("Will that be all?")in list("Yes","No"))
if("Yes")
alert(M"Thank you for shopping at the Robo Town General Shop, please come again.")
if("No")
Talk()
if("No")
Talk()
if("No thanks just passing by.")
alert("Have a nice day")
mob
var
RT=10000
////////////////////////////////////////////////////////////
//The errors are in the lines that say
switch(input("Will that be all?")in list("Yes","No"))
But I can't figure out what the problem is.
P.S, I realize that the user does not obtain an item in this code, Ill add that in later, I want to get over this bunp first. Thanks for any and or all help provided, The Conjuror. :-)
ID:261829
![]() Aug 26 2003, 1:15 pm
|
|
![]() Aug 26 2003, 1:16 pm
|
|
You're doing lots of switch(view( 's that don't make any sense as far as I can see.
|
Well whats supposed to happen is that the user selects what they want to buy, if its an energy thing it says are you sure? This happens for all of them. It then asks if that is all, they are all there for a reason, should they be inputs instead? If so I don't see the difference.
|
On a side note, start putting the DM tags around your code when you post some. It makes it easier to read for the people that are here to help you.
Resonating Light |