ID:173816
 
how do I check to see if one item is in a list, and, if it's not, add the item to it?

Also, I need to know how to check if multiple things are in a list, like checking if you are holding five certain items or something.
CoWdUdE7 wrote:
how do I check to see if one item is in a list, and, if it's not, add the item to it?

<list>.Find(<thing>)

Also, I need to know how to check if multiple things are in a list, like checking if you are holding five certain items or something.

var/Things=0
for(var/I in <list>)if(istype(I,<type>)Things++

That's a one line wonder! (Well two if you include the "Things" variable.)