Jump to content

Recommended Posts

i have one problem with uiswitch.py ....

switch work in game.

but in the syserr client:

0701 22:09:57364 :: Traceback (most recent call last):
0701 22:09:57364 ::   File "uiswitch.py", line 159, in OnUpdate
0701 22:09:57365 ::   File "uiswitch.py", line 139, in refresh
0701 22:09:57365 :: TypeError
0701 22:09:57376 :: :
0701 22:09:57376 :: an integer is required
0701 22:09:57376 ::

how can solve?

 

my uiswitch.py: http://pastebin.com/ddpTA4Sp

Link to comment
Share on other sites

  • Honorable Member

Of course because the "dstSlotPos" variable is None in some cases and not int.

Replace that line in "def refresh(self,dstSlotPos,srcSlotPos):" with this:

		try:
			attrSlot = [player.GetItemAttribute(dstSlotPos, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
		except TypeError:
			return

 

  • Love 2
Link to comment
Share on other sites

  • 10 months later...
On 1/7/2015 at 11:25 PM, xP3NG3Rx said:

Of course because the "dstSlotPos" variable is None in some cases and not int.

Replace that line in "def refresh(self,dstSlotPos,srcSlotPos):" with this:


		try:
			attrSlot = [player.GetItemAttribute(dstSlotPos, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
		except TypeError:
			return

 

i have this error 

Spoiler

0509 18:27:28288 :: Traceback (most recent call last):

0509 18:27:28288 ::   File "ui.py", line 1590, in OnSelectEmptySlot

0509 18:27:28288 ::   File "ui.py", line 89, in __call__

0509 18:27:28289 ::   File "ui.py", line 80, in __call__

0509 18:27:28289 ::   File "uiswitch.py", line 114, in __OnSelectEmptySlot

0509 18:27:28289 :: IndexError
0509 18:27:28289 :: : 
0509 18:27:28289 :: list index out of range
0509 18:27:28289 :: 

0509 18:27:28289 :: Traceback (most recent call last):

0509 18:27:28289 ::   File "uiswitch.py", line 163, in OnUpdate

0509 18:27:28289 ::   File "uiswitch.py", line 154, in refresh

0509 18:27:28290 :: IndexError
0509 18:27:28290 :: : 
0509 18:27:28290 :: list index out of range
0509 18:27:28290 :: 

 

Link to comment
Share on other sites

  • 2 months later...

and i have this problem

 

0509 18:27:28288 :: Traceback (most recent call last):

0509 18:27:28288 ::   File "ui.py", line 1590, in OnSelectEmptySlot

0509 18:27:28288 ::   File "ui.py", line 89, in __call__

0509 18:27:28289 ::   File "ui.py", line 80, in __call__

0509 18:27:28289 ::   File "uiswitch.py", line 114, in __OnSelectEmptySlot

0509 18:27:28289 :: IndexError
0509 18:27:28289 :: : 
0509 18:27:28289 :: list index out of range
0509 18:27:28289 :: 

0509 18:27:28289 :: Traceback (most recent call last):

0509 18:27:28289 ::   File "uiswitch.py", line 163, in OnUpdate

0509 18:27:28289 ::   File "uiswitch.py", line 154, in refresh

0509 18:27:28290 :: IndexError
0509 18:27:28290 :: : 
0509 18:27:28290 :: list index out of range
0509 18:27:28290 :: 

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
  • Premium
La 22.07.2016 la 20:45, Agator a spus:

and i have this problem

 

0509 18:27:28288 :: Traceback (most recent call last):

0509 18:27:28288 ::   File "ui.py", line 1590, in OnSelectEmptySlot

0509 18:27:28288 ::   File "ui.py", line 89, in __call__

0509 18:27:28289 ::   File "ui.py", line 80, in __call__

0509 18:27:28289 ::   File "uiswitch.py", line 114, in __OnSelectEmptySlot

0509 18:27:28289 :: IndexError
0509 18:27:28289 :: : 
0509 18:27:28289 :: list index out of range
0509 18:27:28289 :: 

0509 18:27:28289 :: Traceback (most recent call last):

0509 18:27:28289 ::   File "uiswitch.py", line 163, in OnUpdate

0509 18:27:28289 ::   File "uiswitch.py", line 154, in refresh

0509 18:27:28290 :: IndexError
0509 18:27:28290 :: : 
0509 18:27:28290 :: list index out of range
0509 18:27:28290 :: 

Old but the only thing you had to do was to:

 

search : 

for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM-2):

replace:

for i in xrange(0, 5):
  • Love 1
Link to comment
Share on other sites

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.