def GetEmptyItemPos(self, size): SITE_MAX_NUM = 4 # Total inventory number RET_SLOT = -1 TOTAL_SLOT = player.INVENTORY_PAGE_SIZE*SITE_MAX_NUM #Scp1453 SilentUpdates mtrx = {i : False for i in xrange(TOTAL_SLOT+10)} for i in range(TOTAL_SLOT,TOTAL_SLOT+10): #Scp1453 SilentUpdates mtrx[i] = True for i in xrange(TOTAL_SLOT): if player.GetItemCount(i) != 0 and mtrx[i] == False: item.SelectItem(player.GetItemIndex(i)) (trash, size_y) = item.GetItemSize() for x in xrange(size_y): mtrx[i+(5*x)] = True for i in xrange(TOTAL_SLOT): RET_SLOT = i for a in xrange(size): if mtrx[i+(5*a)] != False: RET_SLOT = -1 break if RET_SLOT != -1: break return RET_SLOT def UseItemSlot(self, slotIndex): if mouseModule.mouseController.isAttached(): mouseModule.mouseController.DeattachObject() item.SelectItem(safebox.GetItemID(self.__LocalPosToGlobalPos(slotIndex)))#TODO:slot use (w, h) = item.GetItemSize() emptyInvenSlots = self.GetEmptyItemPos(h) if emptyInvenSlots != -1: net.SendSafeboxCheckoutPacket(slotIndex+(45*self.curPageIndex), emptyInvenSlots)#Scp1453 SilentUpdates else: chat.AppendChat(chat.CHAT_TYPE_INFO, "Envanterinizde boş yer yok!") return