So here is that program. It is written to run under a converted POL 0.95 Distro scriptset but most objtype numbers will probably be the same for other versions od scriptsets as the graphic is the objtype number for most items. Pay particular attention to objtype 0x6203 as that is the teleporter item created with the .maketele command. That might be different in other scripsets but I don't know.
I hope this is helpful to someone.
Code: Select all
use uo;
use os;
program copytodespair(who)
var things, copieditem;
SendSysMessage(who, "Duplicating items to Despair.", color := 88);
things := ListObjectsInBox(0, 0, -10, 6143, 4095, 70, "britannia");
foreach item in things
sleepms(5);
SendSysMessage(who, "Examining objtype number " + item.objtype + " at " + item.x + ", " + item.y + ", " + item.z + ".", color := 88);
if(item.IsA(POLCLASS_DOOR))
copieditem := CreateItemCopyAtLocation(item.x, item.y, item.z, item, "britannia_alt");
endif
// You can add or remove items in the case list to fit your needs
case(item.objtype)
0xb20: // lamp post lit
0xb21: // lamp post unlit
0xb22: // lamp post lit
0xb23: // lamp post unlit
0xb24: // lamp post lit
0xb25: // lamp post unlit
0x1296: // street sign post
0x1297: // the various street signs
0x1298: // the various street signs
0x1299: // the various street signs
0x129a: // the various street signs
0x129b: // the various street signs
0x129c: // the various street signs
0x129d: // the various street signs
// The next item is the maketele teleporter
0x6203: copieditem := CreateItemCopyAtLocation(item.x, item.y, item.z, item, "britannia_alt");
endcase
// Change the realm destination to alt brit on the teleporters
if(item.objtype == 0x6203)
SetObjProperty(copieditem, "DestRealm", "britannia_alt");
endif
endforeach
SendSysMessage(who, "Done duplicating items to Despair.", color := 66);
endprogram
I know it isn't much but it's one of those nice timesavers that make things easier. The real muscle work is done by the CreateItemCopyAtLocation function which I didn't realize even existed. It must have been added after POL 0.92 because I have an old dupe item script that I used to use that performed the same function but addressed each item member one at a time. Yeah I know I look stupid for not knowing of this function. Oh well, I also don't know every entry in Roget's Thesaurus either.
Anyway, use it if you need it.
One note about the script I should mention, it is a use once script as it stands because it doesn't check if the item exists at the destination location. So if you run it more than once you will get duplicate items stacked on top of one another.