Jump to content

an integer is required


Recommended Posts

Hi guys, I have a problem I can not solve:


 

1003 20:27:28537 :: SYSERR:   File "networkModule.py", line 231, in SetGamePhase

1003 20:27:28538 :: SYSERR:   File "game.py", line 91, in __init__

1003 20:27:28539 :: SYSERR:   File "interfaceModule.py", line 341, in MakeInterface

1003 20:27:28540 :: SYSERR:   File "interfaceModule.py", line 198, in __MakeWindows

1003 20:27:28540 :: SYSERR:   File "uiInventory.py", line 274, in __init__

1003 20:27:28540 :: SYSERR:   File "uiInventory.py", line 417, in __LoadWindow

1003 20:27:28541 :: SYSERR:   File "uiInventory.py", line 486, in SetInventoryPage

1003 20:27:28541 :: SYSERR:   File "uiInventory.py", line 557, in RefreshBagSlotWindow

1003 20:27:28541 :: SYSERR: TypeError
1003 20:27:28542 :: SYSERR: : 
1003 20:27:28542 :: SYSERR: an integer is required

 


 

def RefreshBagSlotWindow(self):
        is_activated = 0
        getItemVNum=player.GetItemIndex
        getItemCount=player.GetItemCount
        setItemVNum=self.wndItem.SetItemSlot
        
        for i in xrange(player.INVENTORY_PAGE_SIZE):
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
            itemCount = getItemCount(slotNumber)
            if 0 == itemCount:
                self.wndItem.ClearSlot(i)
                continue
            elif 1 == itemCount:
                itemCount = 0
                    
            itemVnum = getItemVNum(slotNumber)
            setItemVNum(i, itemVnum, itemCount)
            if itemVnum == 0 and slotNumber in self.liHighlightedItems:
                self.liHightlightedItems.remove(slotNumber)
                
            if constInfo.IS_AUTO_POTION(itemVnum):
                metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
                    
                        
                isActivated = 0 != metinSocket[0]
                                                               

                if isActivated:
                    self.wndItem.ActivateSlot(i)
                    potionType = 0;
                    if constInfo.IS_AUTO_POTION_HP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_HP
                    elif constInfo.IS_AUTO_POTION_SP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_SP
                    
                    usedAmount = int(metinSocket[1])
                    totalAmount = int(metinSocket[2])
                    player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))

                else:
                    self.wndItem.DeactivateSlot(i)
            else:
                self.wndItem.DeactivateSlot(i)
                                
        self.__RefreshHighlights()
        if app.ENABLE_SASH_SYSTEM:
            slotNumberChecked = 0
                    
            for j in xrange(sash.WINDOW_MAX_MATERIALS):
                (isHere, iCell) = sash.GetAttachedItem(j)
                if isHere:
                    if iCell == slotNumber:
                        self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
                        if not slotNumber in self.listAttachedSashs:
                            self.listAttachedSashs.append(slotNumber)
                                
                        slotNumberChecked = 1
                    else:
                        if slotNumber in self.listAttachedSashs and not slotNumberChecked:
                            self.wndItem.DeactivateSlot(i)
                            self.listAttachedSashs.remove(slotNumber)
            self.wndItem.RefreshSlot()

        if self.wndBelt:
            self.wndBelt.RefreshSlot()

 

How can I fix it?

Thanks in advance :)

Link to comment
Share on other sites

  • Developer

try to change "i" with "index" , I think that "i" is something else.

 

replace this :

Spoiler

	for i in xrange(player.INVENTORY_PAGE_SIZE):
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
            itemCount = getItemCount(slotNumber)
            if 0 == itemCount:
                self.wndItem.ClearSlot(i)
                continue
            elif 1 == itemCount:
                itemCount = 0
                    
            itemVnum = getItemVNum(slotNumber)
            setItemVNum(i, itemVnum, itemCount)
            if itemVnum == 0 and slotNumber in self.liHighlightedItems:
                self.liHightlightedItems.remove(slotNumber)
                
            if constInfo.IS_AUTO_POTION(itemVnum):
                metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
                    
                        
                isActivated = 0 != metinSocket[0]
                                                               

                if isActivated:
                    self.wndItem.ActivateSlot(i)
                    potionType = 0;
                    if constInfo.IS_AUTO_POTION_HP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_HP
                    elif constInfo.IS_AUTO_POTION_SP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_SP
                    
                    usedAmount = int(metinSocket[1])
                    totalAmount = int(metinSocket[2])
                    player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))

                else:
                    self.wndItem.DeactivateSlot(i)
            else:
                self.wndItem.DeactivateSlot(i)

 

 

 

with this :

Spoiler

	for index in xrange(player.INVENTORY_PAGE_SIZE):
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(index)
            itemCount = getItemCount(slotNumber)
            if 0 == itemCount:
                self.wndItem.ClearSlot(index)
                continue
            elif 1 == itemCount:
                itemCount = 0
                    
            itemVnum = getItemVNum(slotNumber)
            setItemVNum(index, itemVnum, itemCount)
            if itemVnum == 0 and slotNumber in self.liHighlightedItems:
                self.liHightlightedItems.remove(slotNumber)
                
            if constInfo.IS_AUTO_POTION(itemVnum):
                metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
                    
                        
                isActivated = 0 != metinSocket[0]
                                                               

                if isActivated:
                    self.wndItem.ActivateSlot(index)
                    potionType = 0;
                    if constInfo.IS_AUTO_POTION_HP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_HP
                    elif constInfo.IS_AUTO_POTION_SP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_SP
                    
                    usedAmount = int(metinSocket[1])
                    totalAmount = int(metinSocket[2])
                    player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(index))

                else:
                    self.wndItem.DeactivateSlot(index)
            else:
                self.wndItem.DeactivateSlot(index)

 

  • Metin2 Dev 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.