ID:1384738
 
(See the best response by Super Saiyan X.)
Problem description:
If I have a mob type mob/moster or mob/player, for example, how could I create a var / for / as, etc. statement that includes only mobs of those types in an input? For example:


Code:
obj/pm
icon='HUD.dmi'
icon_state="pm"
layer=900
New(client/c)
screen_loc="3,2"
c.screen+=src
Click()
var/playerM=input("Who would you like to private message?","PM") as mob in world


...or...

obj/magic/tame
Click()
var/R=45
var/obj/magic/greenstaff/G=locate() in usr.contents
var/mob/monster/M=input("What would you like to tame?","Tame") as mob in oview(10)


.......?

Currently both of these codes allow me to find any mob in world or oview(10), respectively.

Any insights? Is this so basic that I'm just missing it?
I don't think there's a built-in automatic filter that specific for input(). You'll have to just make a list and filter it yourself.
Best response
verb arguments and input() are atomic-only. They can only be base /area, /turf, /obj or /mob.

However, you can create a procedure to build such a list and return it.

proc
makeList()
. = list()
for(var/mob/player/p) .+=p