ID:2140414
 
Code:
mob/EXP/verb
Single_Battle()
set category = "EXP"
alert("How many pokemon?","Select Pokemon","1","2","3","4","5","6")
if("1")
if("2")
if("3")
if("4")
if("5")
if("6")


Problem description:

Is this right so far? I havnt used byond in a long time. Making a small program
instead of alert use
switch(input(src,"","") in list("1","2","3"))


or

mob/verb/Test()
count
. = input(src,"","") as num
if(!. || . > 6) goto count
// . = the value chosen.
Thank you
    Single_Battle()
set category = "EXP"
switch(input(src,"Trainer battle or Wild?","Select") in list("Trainer","Wild"))
if("Trainer")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
if("2")
if("3")
if("4")
if("5")
if("6")
if("Wild")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
if("2")
if("3")
if("4")
if("5")
if("6")

Invalid expression, empty switch statement
Those if statements are empty and you need to tab everything after line 3 once.
Keep in mind that alert() and input() are simply procs that return a value.

The fact that switch() is sometimes used on them directly is purely coincidence and is not required to use their return value.

That is to say, you can use them without switch(). Their return value can be stored in a variable like any other proc that returns a value.

Sometimes it's much clearer not to use a switch(), especially if you're asking for a number in a range:
// in some player proc

// get a list of integers from 1 to 6
// (this could be extracted into a global proc)
var list/options = new (6)
for(var/i = 1 to length(options))
options[i] = i

// ask for one of them
var choice = input(src, ...) as null|anything in options

// handle the case where the player chose to cancel the input
if(choice == null) return

// now [choice] is an integer from 1 to 6.
mob/EXP/verb
Single_Battle()
set category = "EXP"
switch(input(src,"Trainer battle or Wild?","Select") in list("Trainer","Wild"))
if("Trainer")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
if("2")
if("3")
if("4")
if("5")
if("6")
else("Wild")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
if("2")
if("3")
if("4")
if("5")
if("6")

Line 14:Expected expression
It still does not let me choose between trainer or wild so that should rule the 'if's being blank out

and if i change the else back to if then it gives me line 13 invalid expression
In response to Demonheroexcell
I suggest learning the syntax of dm and also learning what procs take what arguments and what they return, kaiochao's example is the best.

mob/EXP/verb/Single_Battle()
set category = "EXP"
switch(input(src,"Trainer battle or Wild?","Select") in list("Trainer","Wild"))
if("Trainer")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
world << "do stuff here."
if("2")
world << "do stuff here."
if("3")
world << "do stuff here."
if("4")
world << "do stuff here."
if("5")
world << "do stuff here."
if("6")
world << "do stuff here."
if("Wild")
switch(input(src,"How many Pokemon?","Select number") in list("1","2","3","4","5","6"))
if("1")
world << "do stuff here."
if("2")
world << "do stuff here."
if("3")
world << "do stuff here."
if("4")
world << "do stuff here."
if("5")
world << "do stuff here."
if("6")
world << "do stuff here."
In response to Demonheroexcell
else("Wild")

This isn't valid syntax. It's either else or if("Wild").

DM will complain if you have empty if() statements. It's not necessarily because you structured it incorrectly.