You could use invslot if its a static"ly?" placed item. What I'm getting at is that you aren't equipping and unequipping the item when you are also picking something up. So the ammy is always in an inventory slot, for this procedure we'll go with invslot 1. PS I'm doing this in the browser so the standards are off and it may not compile.
Simba Code:
procedure DTMfailsafe; // Added this after I made AmmyThing...
var
x,y,AmmyDTM: integer;
begin
AmmyDTM:= jkashdfklajsdlkgjaoqiwueryoz12312asdfqw3; //Fake dtm... should have been declared in a SetDTM procedure
if (FindDTM(AmmyDTM, x, y, MIx1, MIy1, MIx2, MIy2)) then
Mouse(x,y,3,4,False); // Moves the mouse to the DTM and right clicks
WaitOption('eleport', 550);
if (isMoving) then
writeln('we have successfully teleported using DTMfailsafe');
end;
procedure AmmyThing;
var
X,Y: Integer;
begin
if InvMouse(1,mouse_right) then
waitOption(eleport, 550);
if not(isMoving) then
Writeln('we have been unsuccessful in using AmmyThing to teleport, trying failsafe: DTMfailsafe');
DTMfailsafe; // You should probably have a failsafe using a dtm, I'll make a short one that has potential
end;
Like I said I did this in browser so I'm not even sure if any part of it will compile, but to my knowledge it seems decent for what your asking.
EDIT: You ninjad me while I was writing this...