mob
verb
Test(msg as text,num as num)
var/getin = new/list("[msg] {name=msg;power=num;}")
for(var/T = 0, T<100, T++)
if(testlist[T["power"]]>num)
continue
else
testlist[T] += getin
var/list
testlist[100]
Problem description:
Okay, so I suck at lists, I'm trying to make it so when I add a name and power amount, it will order itself in the list from strongest to weakest with no more than 100 entries.
With the code above, I get a runtime error:
runtime error: bad index
proc name: Test (/mob/verb/Test)
source file: Arrancar.dm,7
usr: Guest-1450962619 (/mob)
src: Guest-1450962619 (/mob)
call stack:
Guest-1450962619 (/mob): Test("Name One", 100)
I'm not even sure if this is even close to what I am meant to do to order the list like that lol. I fail when it comes to lists. :/