Problem description: Honestly, I was just writing a proc and found myself typing 'pick(/type/) in'- so; I know this isn't the correct behavior for pick(), but is there any existing proc allowing for this behavior? I was looking with no luck yet. If not, I'll have to work around it. |
Oct 9 2014, 12:08 pm
|
|
Perhaps typesof() which provide the path you entered and its subpaths.
|
Not what I was intending; I was trying to randomly select a entry from a list, but only one of a certain type.
In this specific case, I was trying to randomly select a type of mob from the world, to set a client's eye to. |
Couldn't you just do something like this?
proc http://puu.sh/c6b4T/49eddad46d.png |
I don't think there's a built-in way to do this. There's a pretty obvious workaround, though.
proc/pick_type(stuff[], type) |
obj/poo There's probably a better method for it, but if you compile this, the program should only output the names of those in the poo family. |
In response to NNAAAAHH
|
|
NNAAAAHH wrote:
Not what I was intending; I was trying to randomly select a entry from a list, but only one of a certain type. "type" isn't a physically existing atom, you wouldn't be able to set client.eye to it. |
In response to Ishuri
|
|
Ishuri wrote:
NNAAAAHH wrote: I don't think hes trying to return the type itself but objects of said type and randomly "pick" one of said objects to return of said type. for example: http://puu.sh/c6b4T/49eddad46d.png |
Thanks, I wad mainly asking if there were a built-in feature so to prevent needless processes and ultimately, needless use of resources. I'll likely submit a feature request and just keep to a work around, as suggested
|
Gokussj99 wrote:
Kaiochao wrote: > > proc/pick_type(stuff[], type) and ofcourse kaio gets the vote even though his code has errors :P That's why you don't just copy and paste. |