You can use += and -= to add/subtract from a value (purely based on your preference, but most people do that).
Besides that, the only thing that sticks out is the way you're forming your array. Rather than looping through an array, use it like a hash map.
PHP Code:
function onCreated()
{
this.setShape(1, 32, 32);
this.item.fireball = {"Fireball", "split_fireball", 30};
this.item.sword = {"Sword", "split_sword", 20};
this.item.bow = {"Bow", "split_bow", 10};
}
Then, to access it, you can do:
PHP Code:
temp.itemInfo = this.item.(@ selected);