class ModuleNextBackpackOpener:
BPID = range (0xb25,0xb38+1);#contains ID's for ALL BP and bags
BPID+= [0x1726,0x1727,0x173d,0x173e,0x1CAE,0x1CAF];
def getName(self):
return "Next Backpack Opener"
def getVersion(self):
return "1.0";
def getFunDef(self,nr):
if (nr==0): return (0,5000,self.open);
return ();
def getConfigParam(self,nr):
#Can't figure out the number of the BP you have open? Check the auto looter to see which ones are open.
if (nr==0): return ('backpackNumber','Def:All; Integer:Only does this for BP# (first=1)')
return ();
def open(self,params):
totCont = 16;
for contNr in range(totCont):#check each open container
cont=tareader.readContainer(contNr);
if cont['flagOnOff']:#if container is open
try: bpNum = int(params['backpackNumber'])-1;
except: bpNum = -1;
print bpNum,contNr;
if (bpNum == -1 or contNr == bpNum) and cont['itemsInside'] >= cont['size']:
for itemNr in range(cont['itemsInside']-1,-1,-1):#Go backwards through items
item=tareader.readContainerItem(contNr,itemNr);
if self.BPID.count(item['objectId']) !=0:#if items is a backpack
tasender.openContainerFromContainer (item['objectId'],0x40+contNr,itemNr,contNr);
return();
return();
tibiaauto.registerPlugin(ModuleNextBackpackOpener);