How do I get a spawner to recognize when Items are inside of a box?
For example if I wanted to make a transporter which would take an item from one box and /add/TAKEN to another box..
How can this be done?
To access things inside of containers you can use the GETONNEARBY keyword with the 'searchcontainers' argument set to true.
QUOTE |
- added the 'GETONNEARBY,range,name[,type][,searchcontainers],property' keyword that can be used to get or test properties on nearby items or mobiles. This can be used in property assignments or property tests. If more than one of the specified object is found, it will only return the value from one.
For example, to test to see if someone has placed the longsword named "Grizzleblag" on the ground near the spawner you could use a condition test like
GETONNEARBY,1,Grizzleblag,longsword,visible=true
Or you could get the size of a pile of gold in a nearby container with
SENDMSG/{GETONNEARBY,1,,gold,true,amount} gold pieces are in the container
|
Unfortunately, there is no way to ADD an existing item (other than TAKEN or GIVEN items).
Normally you would use the ADD keyword to add a spawned item. There are special keywords like GIVEN and TAKEN that let you refer to certain non-spawned items, but no general keyword that lets you refer to arbitrary non-spawned items.
That would be a useful feature for the kind of situation that you describe.
I will put in a new keyword that will let you do this. Something like
ITEM,serial
So you could use that anywhere that you would normally be able to use loot keywords like TAKEN, or ARMOR.
So, for example, to take an existing item from a nearby container and drop it into a players bankbox would look like
SETONCARRIED,,bankbox,equippedonly/ADD/ITEM,{GETONNEARBY,1,,gold,true,serial}
added to the latest beta 3.22