Team gate scripts.

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Team gate scripts.

Post by Poi »

I have fully operational team gate script, but there is only one problem with it, that can and i promise will be fixed,

1: I want to know how to check for an item(s) in the persons backpack(and/or sub backpack)

2: I want to know how to delete item(s) in the persons backpack

so the script will place a bag with items in it if they don't have the item in there backpack, and if they do have the item, it will delete it.

Current script:

Code: Select all

use uo;

program itemstone( who )
var pack1 := CreateitemInBackpack (who, 3702, 1);

CreateItemInContainer (pack1, 0x99a1, 1); 
CreateItemInContainer (pack1, 0x99a2, 1); 
CreateItemInContainer (pack1, 0x99a3, 1); 
CreateItemInContainer (pack1, 0x99a4, 1); 
CreateItemInContainer (pack1, 0x99a5, 1); 
CreateItemInContainer (pack1, 0x99a6, 1); 
CreateItemInContainer (pack1, 0x99a7, 1); 
CreateItemInContainer (pack1, 0x99a8, 1); 
CreateItemInContainer (pack1, 0x99a9, 100); 

endprogram
Burtonius

Post by Burtonius »

If I understand you right this should work

Code: Select all

var items := EnumerateItemsInContainer(who.backpack);

foreach thing in items
    if(thing.objtype = ####)// <---your item number
        //do your stuff
    endif
endforeach

//to destroy an item
DestroyItem(item);

//to remove some items from stack
SubtractAmount(item, amount);
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Thanks!
Post Reply