Page 1 of 1

Team gate scripts.

Posted: Fri Jun 23, 2006 8:33 am
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

Posted: Fri Jun 23, 2006 10:51 am
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);

Posted: Fri Jun 23, 2006 12:03 pm
by Poi
Thanks!