Fethi Polat 1
Fethi Polat
xranzei 1
xranzei
Bvural41 1
Bvural41
kralhakan2009 1
kralhakan2009
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Vahsi Uzman 1
Vahsi Uzman
Cannn6161 1
Cannn6161
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

[Python] Depo<=>Envanter

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

help
Kod:
0418 09:31:38129 :: Traceback (most recent call last):

0418 09:31:38129 ::   File "ui.py", line 1539, in OnUnselectItemSlot

0418 09:31:38130 ::   File "ui.py", line 135, in __call__

0418 09:31:38130 ::   File "ui.py", line 126, in __call__

0418 09:31:38131 ::   File "uiInventory.py", line 1775, in UseItemSlot

0418 09:31:38131 ::   File "uiInventory.py", line 1780, in __UseItem

0418 09:31:38131 ::   File "interfaceModule.py", line 851, in AttachInvenItemToOtherWindowSlot

0418 09:31:38131 ::   File "uiSafebox.py", line 501, in AttachItemFromInventory

0418 09:31:38132 :: NameError
0418 09:31:38132 :: : 
0418 09:31:38132 :: global name 'item' is not defined
0418 09:31:38132 ::
import item add
 



Depo açıkken sağ tık ile envanterde ki itemlerinizi depoya, depodaki itemleri sağ tık ile envanterinize alabilirsiniz.

interfacemodule.py

[CODE lang="python" title="Arat"]def GetInventoryPageIndex(self):[/CODE]


[CODE lang="python" title="üstüne ekle"] def AttachItemFromSafebox(self, slotIndex, itemIndex):
if self.wndInventory and self.wndInventory.IsShow():
self.wndInventory.AttachItemFromSafebox(slotIndex, itemIndex)

return True

def AttachInvenItemToOtherWindowSlot(self, slotWindow, slotIndex):
if self.wndSafebox and self.wndSafebox.IsShow():
return self.wndSafebox.AttachItemFromInventory(slotWindow, slotIndex)

return False[/CODE]


uiinventory.py


[CODE lang="python" title="Arat"]def __UseItem(self, slotIndex):[/CODE]


[CODE lang="python" title="üstüne ekle"] def __GetCurrentItemGrid(self):
itemGrid = [[False for slot in xrange(player.INVENTORY_PAGE_SIZE)] for page in xrange(player.INVENTORY_PAGE_COUNT)]

for page in xrange(player.INVENTORY_PAGE_COUNT):
for slot in xrange(player.INVENTORY_PAGE_SIZE):
itemVnum = player.GetItemIndex(slot + page * player.INVENTORY_PAGE_SIZE)
if itemVnum <> 0:
(w, h) = item.GetItemSize(item.SelectItem(itemVnum))
for i in xrange(h):
itemGrid[page][slot + i * 5] = True

return itemGrid

def __FindEmptyCellForSize(self, itemGrid, size):
for page in xrange(player.INVENTORY_PAGE_COUNT):
for slot in xrange(player.INVENTORY_PAGE_SIZE):
if itemGrid[page][slot] == False:
possible = True
for i in xrange(size):
p = slot + (i * 5)

try:
if itemGrid[page][p] == True:
possible = False
break
except IndexError:
possible = False
break

if possible:
return slot + page * player.INVENTORY_PAGE_SIZE

return -1

def AttachItemFromSafebox(self, slotIndex, itemIndex):
itemGrid = self.__GetCurrentItemGrid()

if item.GetItemType(item.SelectItem(itemIndex)) == item.ITEM_TYPE_DS:
return

emptySlotIndex = self.__FindEmptyCellForSize(itemGrid, item.GetItemSize()[1])
if emptySlotIndex <> -1:
net.SendSafeboxCheckoutPacket(slotIndex, player.INVENTORY, emptySlotIndex)

return True[/CODE]

[CODE lang="python" title="Arat"] def __UseItem(self, slotIndex):
ItemVNum = player.GetItemIndex(slotIndex)
item.SelectItem(ItemVNum)[/CODE]

[CODE lang="python" title="Değiş"] def __UseItem(self, slotIndex):
if self.interface and self.interface.AttachInvenItemToOtherWindowSlot(player.INVENTORY, slotIndex):
return
ItemVNum = player.GetItemIndex(slotIndex)
item.SelectItem(ItemVNum)[/CODE]


uisafebox.py

İmportlarda item yoksa ekle

[CODE lang="python" title="Arat"]class SafeboxWindow(ui.ScriptWindow):[/CODE]


[CODE lang="python" title="tekrar arat"]def UseItemSlot(self, slotIndex):[/CODE]

[CODE lang="python" title="Değiş"] def __GetCurrentItemGrid(self):
itemGrid = [[False for cell in xrange(safebox.SAFEBOX_PAGE_SIZE)] for page in xrange(self.pagecount)]

for page in xrange(self.pagecount):
for slot in xrange(safebox.SAFEBOX_PAGE_SIZE):
itemVnum = safebox.GetItemID(slot + page * safebox.SAFEBOX_PAGE_SIZE)
if itemVnum <> 0:
item.SelectItem(itemVnum)
(w, h) = item.GetItemSize()
for i in xrange(h):
itemGrid[page][slot + i * safebox.SAFEBOX_SLOT_X_COUNT] = True

return itemGrid

def __FindEmptyCellForSize(self, itemGrid, size):
for page in xrange(self.pagecount):
for slot in xrange(safebox.SAFEBOX_PAGE_SIZE):
if itemGrid[page][slot] == False:
possible = True
for i in xrange(size):
p = slot + safebox.SAFEBOX_SLOT_X_COUNT * i
try:
if itemGrid[page][p] == True:
possible = False
break
except IndexError:
possible = False
break

if possible:
return slot + page * safebox.SAFEBOX_PAGE_SIZE

return -1

def AttachItemFromInventory(self, slotWindow, slotIndex):
attachedItemID = player.GetItemIndex(slotWindow, slotIndex)
item.SelectItem(attachedItemID)
if item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX):
return False

itemGrid = self.__GetCurrentItemGrid()

item.SelectItem(attachedItemID)
emptySafeboxSlot = self.__FindEmptyCellForSize(itemGrid, item.GetItemSize()[1])
if emptySafeboxSlot == -1 or item.GetItemType() == item.ITEM_TYPE_ELK:
return False

net.SendSafeboxCheckinPacket(slotWindow, slotIndex, emptySafeboxSlot)
return True

def UseItemSlot(self, slotIndex):
if mouseModule.mouseController.isAttached():
mouseModule.mouseController.DeattachObject()

if self.interface:
globalSlotIndex = self.__LocalPosToGlobalPos(slotIndex)
self.interface.AttachItemFromSafebox(globalSlotIndex, safebox.GetItemID(globalSlotIndex))[/CODE]

İyi kullanımlar iyi forumlar..

not: eğer pagecount ile ilgili sysser alıyorsanız verdiğim kodlarda ki self.pagecount kısmını self.pageCount olarak değiştirin.

çok küsel
 
help
Kod:
0423 22:02:45757 :: Traceback (most recent call last):

0423 22:02:45757 ::   File "ui.py", line 1539, in OnUnselectItemSlot

0423 22:02:45757 ::   File "ui.py", line 135, in __call__

0423 22:02:45758 ::   File "ui.py", line 126, in __call__

0423 22:02:45758 ::   File "uiSafebox.py", line 520, in UseItemSlot

0423 22:02:45759 :: AttributeError
0423 22:02:45759 :: : 
0423 22:02:45759 :: 'SafeboxWindow' object has no attribute 'interface'
 
Teşekkürler
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst