ID:267881
 
I'm in need of a extreme newbie coding...I think.

Anyhow, I need to make lists.

EXAMPLE:

statpanel("Skills")
statpanel("Items")

obj/items/gold
obj/skills/powerpunch

I need everything that's in obj/skills in 'Skills', and everything that's in obj/items in 'Items'.

How?
I don't know exactly why you would want to do this, but here it is:

var
Items = new/list()
Skills= new/list()
proc
AllItems()
for(var/obj/items/I in world)
Items += I
AllSkills()
for(var/obj/skills/S in world)
Skills += S


This will add all the items in the world to Items, and all the skills in the world to Skills.

~Ease~
In response to Ease
Nono.
Thats not what I ment.

Look...
EXAMPLE

statpanel("Swords")
statpanel("Armor")

obj/armor/bronze
obj/swords/iron

I want in SWORDS every obj/swords listed that is IN usr.contents!
I want in ARMOR every obj/armor listed that is IN usr.contents!
In response to Phoenix Man
Just change world to usr.contents. :P

~Ease~
In response to Phoenix Man
This should work for what you want I even provided examples for the Get() procs, etc:

mob
var
list
Swords=list()
Armor=list()
Stat()
statpanel("Swords",src.Swords)
statpanel("Armor",src.Armor)

obj
proc
Get()
swords
DblClick()
..()
if(src in oview(1,usr)
spawn()
src.Get(usr)
Get(mob/User)
User.Swords.Add(src)
bronze
icon='sword_bronze.dmi'
iron
icon='sword_iron.dmi'
armor
DblClick()
..()
if(src in oview(1,usr)
spawn()
src.Get(usr)
Get(mob/User)
User.Armor.Add(src)
leather
icon='armor_leather.dmi'
mail
icon='armor_mail.dmi'