I accidentally junked my spear of pestilence today, after noticing a wooden spear in inv, and typing "junk spear."
Thanks to Maniac I got it back, but I got to thinking how I can protect against it happening again. Some people just don't junk things. Well, that's not really practical... if you run areas like EU where most of the mobs are astrals, and all the items drop to the ground and you have to use "get all" to sift through them. Dropping them instead of junking them only leads to massive piles of crap at the mob for the next pop, and the game performance is effected by the amount of objects in memory after a while. Here is how you can code around it with mudlet...
Pattern: ^junk(.+)$
Proc:
if matches[2] == " spear" then
echo("DO NOT JUNK!!")
elseif matches[2] == " winter" then
echo("DO NOT JUNK!!")
elseif matches[2] == " hell" then
echo("DO NOT JUNK!!")
elseif matches[2] == " blade" then
echo("DO NOT JUNK!!")
elseif matches[2] == " sword" then
echo("DO NOT JUNK!!")
elseif matches[2] == " souls" then
echo("DO NOT JUNK!!")
elseif matches[2] == " elite" then
echo("DO NOT JUNK!!")
elseif matches[2] == " sphairai" then
echo("DO NOT JUNK!!")
else
send("junk"..matches[2])
end
Now this is fairly light protection... theoretically you could grab matches[2], then "names" it to get the full item name... ie, names matches[2] then match it against a list of items names you aren't allowed to junk, or store the names of your items in a database table. That would be the ultimate protection. However those items which you usually have in inv, like weapons, keychains, flux etc you could protect quickly with this approach.
Ideally the game wouldn't allow you to junk PERSONAL items, or items with a rune/clasp attached... forcing you to abandon them on the ground or drop them at the dump to get rid of them.