ID:148621
 
I am having a problem with my shopkeeper code, and need help. Here's all the errors:

loading WorldofWizards.dme
WorldofWizards.dm:168:error: usr: missing comma ',' or right-paren ')'
WorldofWizards.dm:168:error: usr: expected end of statement
WorldofWizards.dm:176:error: ): expected }
WorldofWizards.dm:164:error: location of top-most unmatched {
WorldofWizards.dm:176:error: ): expected }
WorldofWizards.dm:163:error: location of top-most unmatched {
WorldofWizards.dm:176:error: ): expected }
WorldofWizards.dm:162:error: location of top-most unmatched {

WorldofWizards.dmb - 8 errors, 0 warnings (double-click on an error to jump to it)

Code:

mob
IrishShop
icon = 'NPCs.dmi'
icon_state = "irish"
Click()
switch(alert("What do you want to buy?",,"Wand, 50 gold","Robes, 20 gold"))
if("Wand, 50 gold") // Error
if(usr.money >= 50) // Error
usr << "You buy a wand for 50 gold" // Error
usr.wanduse = pick(
usr.wanduse = "Charms"
prob(25)
usr.wanduse = "Curses" // Error x2
prob(20)
usr.wanduse = "Murder"
prob(5)
usr.wanduse = "Summoning"
prob(2)
usr.wanduse = "Transfiguration"
prob(50)
) // Error x2
You forgot the ,'s at the end of each line...

mob
IrishShop
icon = 'NPCs.dmi'
icon_state = "irish"
Click()
switch(alert("What do you want to buy?",,"Wand, 50 gold","Robes, 20 gold"))
if("Wand, 50 gold") // Error
if(usr.money >= 50) // Error
usr << "You buy a wand for 50 gold" // Error
usr.wanduse = pick(
usr.wanduse = "Charms",
prob(25)
usr.wanduse = "Curses", // Error x2
prob(20)
usr.wanduse = "Murder",
prob(5)
usr.wanduse = "Summoning",
prob(2)
usr.wanduse = "Transfiguration",
prob(50)
) // Error x2
In response to Nick231
Now I get:

loading WorldofWizards.dme
WorldofWizards.dm:167:error::missing expression
WorldofWizards.dm:168:error::missing expression
WorldofWizards.dm:170:error::missing expression
WorldofWizards.dm:172:error::missing expression
WorldofWizards.dm:174:error::missing expression
WorldofWizards.dm:176:error::invalid expression

WorldofWizards.dmb - 6 errors, 0 warnings (double-click on an error to jump to it)

from:

mob
IrishShop
icon = 'NPCs.dmi'
icon_state = "irish"
Click()
switch(alert("What do you want to buy?",,"Wand, 50 gold","Robes, 20 gold"))
if("Wand, 50 gold") // Error
if(usr.money >= 50) // Error
usr << "You buy a wand for 50 gold" // Error
usr.wanduse = pick(
usr.wanduse = "Charms",
prob(25) // Error (second time)
usr.wanduse = "Curses", // Error x2: Error(second time)
prob(20)
usr.wanduse = "Murder", // error (second time)
prob(5)
usr.wanduse = "Summoning", // error (second time)
prob(2)
usr.wanduse = "Transfiguration",// error (second time)
prob(50)
) // Error x2 error(second time)
.

This is harder.