Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Jak wyciągnąć ID itemu na prywatnych serwerze?


Majkelmagic

Rekomendowane odpowiedzi

Opublikowano


import ui,app,chat,chr,net,player,item,skill,time,game,shop,chrmgr,thread

 

class OpenItemBotDialog(ui.ScriptWindow):

 

def __init__(self):

ui.ScriptWindow.__init__(self)

 

self.Board = ui.ThinBoard()

self.Board.SetSize(218, 250)

self.Board.SetCenterPosition()

self.Board.AddFlag("movable")

self.Board.Show()

 

self.comp = Component()

self.Header = self.comp.TextLine(self.Board, 'Open Item Bot', 65, 8, self.comp.RGB(255, 255, 0))

self.BarItems, self.ListBoxItems, ScrollItems = self.comp.ListBoxEx(self.Board, 10, 50, 170, 140)

self.SkillIdNameLabel = self.comp.TextLine(self.Board, 'ID: Name:', 16, 37, self.comp.RGB(255, 255, 255))

 

self.Close = self.comp.Button(self.Board, '', 'Close', 183, 8, self.Board.Hide, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')

self.Refresh = self.comp.Button(self.Board, '', 'Refresh', 163, 6, self.UpdateItemList, 'd:/ymir work/ui/game/guild/refresh_button_01.sub', 'd:/ymir work/ui/game/guild/refresh_button_02.sub', 'd:/ymir work/ui/game/guild/refresh_button_03.sub')

self.StartButton = self.comp.Button(self.Board, 'Open', '', 70, 205, self.StartOpenItems, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub')

 

self.UpdateItemList()

 

 

def UpdateItemList(self):

self.ListBoxItems.RemoveAllItems()

for i in xrange(player.INVENTORY_PAGE_SIZE*3):

ItemIndex = player.GetItemIndex(i)

if ItemIndex != 0:

ItemName = item.GetItemName(item.SelectItem(int(ItemIndex)))

self.ListBoxItems.AppendItem(Item(str(ItemIndex) + ' ' + ItemName))

 

def StartOpenItems(self):

ItemIndex = self.ListBoxItems.GetSelectedItem()

if ItemIndex:

pass

else:

chat.AppendChat(7, "[M2-BOB] No Item selected!")

return

 

id = int(ItemIndex.GetText().split(" ")[0])

thread.start_new_thread(self.OpenItems,(id,))

 

 

def OpenItems(self,id):

for i in xrange(player.INVENTORY_PAGE_SIZE*3):

if player.GetItemIndex(i) == id:

while(player.GetItemCount(i) > 0):

net.SendItemUsePacket(i)

time.sleep(0.01)

time.sleep(0.1)

 

class Item(ui.ListBoxEx.Item):

def __init__(self, fileName):

ui.ListBoxEx.Item.__init__(self)

self.canLoad=0

self.text=fileName

self.textLine=self.__CreateTextLine(fileName)

 

def __del__(self):

ui.ListBoxEx.Item.__del__(self)

 

def GetText(self):

return self.text

 

def SetSize(self, width, height):

ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)

 

def __CreateTextLine(self, fileName):

textLine=ui.TextLine()

textLine.SetParent(self)

textLine.SetPosition(0, 0)

textLine.SetText(fileName)

textLine.Show()

return textLine

 

class Component:

def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):

button = ui.Button()

if parent != None:

button.SetParent(parent)

button.SetPosition(x, y)

button.SetUpVisual(UpVisual)

button.SetOverVisual(OverVisual)

button.SetDownVisual(DownVisual)

button.SetText(buttonName)

button.SetToolTipText(tooltipText)

button.Show()

button.SetEvent(func)

return button

 

def HideButton(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):

button = ui.Button()

if parent != None:

button.SetParent(parent)

button.SetPosition(x, y)

button.SetUpVisual(UpVisual)

button.SetOverVisual(OverVisual)

button.SetDownVisual(DownVisual)

button.SetText(buttonName)

button.SetToolTipText(tooltipText)

button.SetEvent(func)

return button

 

def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual):

button = ui.ToggleButton()

if parent != None:

button.SetParent(parent)

button.SetPosition(x, y)

button.SetUpVisual(UpVisual)

button.SetOverVisual(OverVisual)

button.SetDownVisual(DownVisual)

button.SetText(buttonName)

button.SetToolTipText(tooltipText)

button.Show()

button.SetToggleUpEvent(funcUp)

button.SetToggleDownEvent(funcDown)

return button

 

def EditLine(self, parent, editlineText, x, y, width, heigh, max):

SlotBar = ui.SlotBar()

if parent != None:

SlotBar.SetParent(parent)

SlotBar.SetSize(width, heigh)

SlotBar.SetPosition(x, y)

SlotBar.Show()

Value = ui.EditLine()

Value.SetParent(SlotBar)

Value.SetSize(width, heigh)

Value.SetPosition(8, 2)

Value.SetMax(max)

Value.SetLimitWidth(width)

Value.SetMultiLine()

Value.SetText(editlineText)

Value.SetIMEFlag(3)

Value.Show()

return SlotBar, Value

 

def OnlyEditLine(self, parent, width, heigh, x, y, editlineText, max):

Value = ui.EditLine()

if parent != None:

Value.SetParent(parent)

Value.SetSize(width, heigh)

Value.SetPosition(x, y)

Value.SetMax(max)

Value.SetText(editlineText)

Value.SetNumberMode()

Value.Show()

return Value

 

def TextLine(self, parent, textlineText, x, y, color):

textline = ui.TextLine()

if parent != None:

textline.SetParent(parent)

textline.SetPosition(x, y)

if color != None:

textline.SetFontColor(color[0], color[1], color[2])

textline.SetText(textlineText)

textline.SetOutline()

textline.Show()

return textline

 

def RGB(self, r, g, B):

return (r*255, g*255, b*255)

 

def SliderBar(self, parent, sliderPos, func, x, y):

Slider = ui.SliderBar()

if parent != None:

Slider.SetParent(parent)

Slider.SetPosition(x, y)

Slider.SetSliderPos(sliderPos)

Slider.Show()

Slider.SetEvent(func)

return Slider

 

def ExpandedImage(self, parent, x, y, img):

image = ui.ExpandedImageBox()

if parent != None:

image.SetParent(parent)

image.SetPosition(x, y)

image.LoadImage(img)

image.Show()

return image

 

def ComboBoxFunc(self, parent, text, x, y, width, func):

combo = ui.ComboBox()

if parent != None:

combo.SetParent(parent)

combo.SetPosition(x, y)

combo.SetSize(width, 15)

combo.SetCurrentItem(text)

combo.SetEvent(func)

combo.Show()

return combo

 

def ComboBox(self, parent, text, x, y, width):

combo = ui.ComboBox()

if parent != None:

combo.SetParent(parent)

combo.SetPosition(x, y)

combo.SetSize(width, 15)

combo.SetCurrentItem(text)

combo.Show()

return combo

 

def ThinBoard(self, parent, moveable, x, y, width, heigh, center):

thin = ui.ThinBoard()

if parent != None:

thin.SetParent(parent)

if moveable == TRUE:

thin.AddFlag('movable')

thin.AddFlag('float')

thin.SetSize(width, heigh)

thin.SetPosition(x, y)

if center == TRUE:

thin.SetCenterPosition()

thin.Show()

return thin

 

def Gauge(self, parent, width, color, x, y):

gauge = ui.Gauge()

if parent != None:

gauge.SetParent(parent)

gauge.SetPosition(x, y)

gauge.MakeGauge(width, color)

gauge.Show()

return gauge

 

def ListBoxEx(self, parent, x, y, width, heigh):

bar = ui.Bar()

if parent != None:

bar.SetParent(parent)

bar.SetPosition(x, y)

bar.SetSize(width + 20, heigh)

bar.SetColor(1996488704)

bar.Show()

ListBox = ui.ListBoxEx()

ListBox.SetParent(bar)

ListBox.SetPosition(0, 0)

ListBox.SetViewItemCount(7)

ListBox.SetSize(width, heigh)

ListBox.Show()

scroll = ui.ScrollBar()

scroll.SetParent(bar)

scroll.SetPosition(width + 5, 0)

scroll.SetScrollBarSize(heigh)

scroll.Show()

ListBox.SetScrollBar(scroll)

return (bar, ListBox, scroll)

 

def ListBoxEx2(self, parent, x, y, width, heigh):

bar = ui.Bar()

if parent != None:

bar.SetParent(parent)

bar.SetPosition(x, y)

bar.SetSize(width + 20, heigh)

bar.SetColor(1996488704)

bar.Show()

ListBox = ui.ListBoxEx()

ListBox.SetParent(bar)

ListBox.SetPosition(0, 0)

ListBox.SetViewItemCount(5)

ListBox.SetSize(width, heigh)

ListBox.Show()

scroll = ui.ScrollBar()

scroll.SetParent(bar)

scroll.SetPosition(width + 5, 0)

scroll.SetScrollBarSize(heigh)

scroll.Show()

ListBox.SetScrollBar(scroll)

return (bar, ListBox, scroll)

 

def FileListBox(self, parent, x, y, width, heigh, count):

ListBox = ui.ListBoxEx()

ListBox.SetParent(parent)

ListBox.SetPosition(x, y)

ListBox.SetViewItemCount(count)

ListBox.SetSize(width, heigh)

ListBox.Show()

scroll = ui.ScrollBar()

scroll.SetParent(ListBox)

scroll.SetPosition(width - 20, 0)

scroll.SetScrollBarSize(heigh)

scroll.Show()

ListBox.SetScrollBar(scroll)

return ListBox, scroll

 

def ReadingListBox(self, parent, x, y, width, heigh, count):

bar = ui.Bar()

if parent != None:

bar.SetParent(parent)

bar.SetPosition(x, y)

bar.SetSize(width + 20, heigh)

bar.Show()

ListBox = ui.ListBoxEx()

ListBox.SetParent(bar)

ListBox.SetPosition(10, 13)

ListBox.SetViewItemCount(count)

ListBox.SetSize(width, heigh)

ListBox.Show()

return bar, ListBox

 

x = OpenItemBotDialog()

x.Show()

 

Opublikowano
import ui,app,chat,chr,net,player,item,skill,time,game,shop,chrmgr,thread

class OpenItemBotDialog(ui.ScriptWindow):

	def __init__(self):
		ui.ScriptWindow.__init__(self) 
		
		self.Board = ui.ThinBoard()
		self.Board.SetSize(218, 250)
		self.Board.SetCenterPosition()
		self.Board.AddFlag("movable")
		self.Board.Show()
		
		self.comp = Component()
		self.Header = self.comp.TextLine(self.Board, 'Open Item Bot', 65, 8, self.comp.RGB(255, 255, 0))
		self.BarItems, self.ListBoxItems, ScrollItems = self.comp.ListBoxEx(self.Board, 10, 50, 170, 140)
		self.SkillIdNameLabel = self.comp.TextLine(self.Board, 'ID:        Name:', 16, 37, self.comp.RGB(255, 255, 255))
		
		self.Close = self.comp.Button(self.Board, '', 'Close', 183, 8, self.Board.Hide, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
		self.Refresh = self.comp.Button(self.Board, '', 'Refresh', 163, 6, self.UpdateItemList, 'd:/ymir work/ui/game/guild/refresh_button_01.sub', 'd:/ymir work/ui/game/guild/refresh_button_02.sub', 'd:/ymir work/ui/game/guild/refresh_button_03.sub')
		self.StartButton = self.comp.Button(self.Board, 'Open', '', 70, 205, self.StartOpenItems, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub')

		self.UpdateItemList()
		

	def UpdateItemList(self):
		self.ListBoxItems.RemoveAllItems()
		for i in xrange(player.INVENTORY_PAGE_SIZE*3):
			ItemIndex = player.GetItemIndex(i)
			if ItemIndex != 0:
				ItemName = item.GetItemName(item.SelectItem(int(ItemIndex)))
				self.ListBoxItems.AppendItem(Item(str(ItemIndex) + '    ' + ItemName))
				
	def StartOpenItems(self):
		ItemIndex = self.ListBoxItems.GetSelectedItem()
		if ItemIndex:
			pass
		else:
			chat.AppendChat(7, "[M2-BOB] No Item selected!")
			return
			
		id = int(ItemIndex.GetText().split("    ")[0])
		thread.start_new_thread(self.OpenItems,(id,))

		
	def OpenItems(self,id):
		for i in xrange(player.INVENTORY_PAGE_SIZE*3):
			if player.GetItemIndex(i) == id:
				while(player.GetItemCount(i) > 0):
					net.SendItemUsePacket(i)
					time.sleep(0.01)
			time.sleep(0.1)

class Item(ui.ListBoxEx.Item):
	def __init__(self, fileName):
		ui.ListBoxEx.Item.__init__(self)
		self.canLoad=0
		self.text=fileName
		self.textLine=self.__CreateTextLine(fileName)          

	def __del__(self):
		ui.ListBoxEx.Item.__del__(self)

	def GetText(self):
		return self.text

	def SetSize(self, width, height):
		ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)

	def __CreateTextLine(self, fileName):
		textLine=ui.TextLine()
		textLine.SetParent(self)
		textLine.SetPosition(0, 0)
		textLine.SetText(fileName)
		textLine.Show()
		return textLine	
			
class Component:
	def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
		button = ui.Button()
		if parent != None:
			button.SetParent(parent)
		button.SetPosition(x, y)
		button.SetUpVisual(UpVisual)
		button.SetOverVisual(OverVisual)
		button.SetDownVisual(DownVisual)
		button.SetText(buttonName)
		button.SetToolTipText(tooltipText)
		button.Show()
		button.SetEvent(func)
		return button
		
	def HideButton(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
		button = ui.Button()
		if parent != None:
			button.SetParent(parent)
		button.SetPosition(x, y)
		button.SetUpVisual(UpVisual)
		button.SetOverVisual(OverVisual)
		button.SetDownVisual(DownVisual)
		button.SetText(buttonName)
		button.SetToolTipText(tooltipText)
		button.SetEvent(func)
		return button

	def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual):
		button = ui.ToggleButton()
		if parent != None:
			button.SetParent(parent)
		button.SetPosition(x, y)
		button.SetUpVisual(UpVisual)
		button.SetOverVisual(OverVisual)
		button.SetDownVisual(DownVisual)
		button.SetText(buttonName)
		button.SetToolTipText(tooltipText)
		button.Show()
		button.SetToggleUpEvent(funcUp)
		button.SetToggleDownEvent(funcDown)
		return button

	def EditLine(self, parent, editlineText, x, y, width, heigh, max):
		SlotBar = ui.SlotBar()
		if parent != None:
			SlotBar.SetParent(parent)
		SlotBar.SetSize(width, heigh)
		SlotBar.SetPosition(x, y)
		SlotBar.Show()
		Value = ui.EditLine()
		Value.SetParent(SlotBar)
		Value.SetSize(width, heigh)
		Value.SetPosition(8, 2)
		Value.SetMax(max)
		Value.SetLimitWidth(width)
		Value.SetMultiLine()
		Value.SetText(editlineText)
		Value.SetIMEFlag(3)
		Value.Show()
		return SlotBar, Value
		
	def OnlyEditLine(self, parent, width, heigh, x, y, editlineText, max):
		Value = ui.EditLine()
		if parent != None:
			Value.SetParent(parent)
		Value.SetSize(width, heigh)
		Value.SetPosition(x, y)
		Value.SetMax(max)
		Value.SetText(editlineText)
		Value.SetNumberMode()
		Value.Show()
		return Value

	def TextLine(self, parent, textlineText, x, y, color):
		textline = ui.TextLine()
		if parent != None:
			textline.SetParent(parent)
		textline.SetPosition(x, y)
		if color != None:
			textline.SetFontColor(color[0], color[1], color[2])
		textline.SetText(textlineText)
		textline.SetOutline()
		textline.Show()
		return textline

	def RGB(self, r, g, :
		return (r*255, g*255, b*255)

	def SliderBar(self, parent, sliderPos, func, x, y):
		Slider = ui.SliderBar()
		if parent != None:
			Slider.SetParent(parent)
		Slider.SetPosition(x, y)
		Slider.SetSliderPos(sliderPos)
		Slider.Show()
		Slider.SetEvent(func)
		return Slider

	def ExpandedImage(self, parent, x, y, img):
		image = ui.ExpandedImageBox()
		if parent != None:
			image.SetParent(parent)
		image.SetPosition(x, y)
		image.LoadImage(img)
		image.Show()
		return image
		
	def ComboBoxFunc(self, parent, text, x, y, width, func):
		combo = ui.ComboBox()
		if parent != None:
			combo.SetParent(parent)
		combo.SetPosition(x, y)
		combo.SetSize(width, 15)
		combo.SetCurrentItem(text)
		combo.SetEvent(func)
		combo.Show()
		return combo
		
	def ComboBox(self, parent, text, x, y, width):
		combo = ui.ComboBox()
		if parent != None:
			combo.SetParent(parent)
		combo.SetPosition(x, y)
		combo.SetSize(width, 15)
		combo.SetCurrentItem(text)
		combo.Show()
		return combo

	def ThinBoard(self, parent, moveable, x, y, width, heigh, center):
		thin = ui.ThinBoard()
		if parent != None:
			thin.SetParent(parent)
		if moveable == TRUE:
			thin.AddFlag('movable')
			thin.AddFlag('float')
		thin.SetSize(width, heigh)
		thin.SetPosition(x, y)
		if center == TRUE:
			thin.SetCenterPosition()
		thin.Show()
		return thin

	def Gauge(self, parent, width, color, x, y):
		gauge = ui.Gauge()
		if parent != None:
			gauge.SetParent(parent)
		gauge.SetPosition(x, y)
		gauge.MakeGauge(width, color)
		gauge.Show()
		return gauge
		
	def ListBoxEx(self, parent, x, y, width, heigh):
		bar = ui.Bar()
		if parent != None:
			bar.SetParent(parent)
		bar.SetPosition(x, y)
		bar.SetSize(width + 20, heigh)
		bar.SetColor(1996488704)
		bar.Show()
		ListBox = ui.ListBoxEx()
		ListBox.SetParent(bar)
		ListBox.SetPosition(0, 0)
		ListBox.SetViewItemCount(7)
		ListBox.SetSize(width, heigh)
		ListBox.Show()
		scroll = ui.ScrollBar()
		scroll.SetParent(bar)
		scroll.SetPosition(width + 5, 0)
		scroll.SetScrollBarSize(heigh)
		scroll.Show()
		ListBox.SetScrollBar(scroll)
		return (bar, ListBox, scroll)

	def ListBoxEx2(self, parent, x, y, width, heigh):
		bar = ui.Bar()
		if parent != None:
			bar.SetParent(parent)
		bar.SetPosition(x, y)
		bar.SetSize(width + 20, heigh)
		bar.SetColor(1996488704)
		bar.Show()
		ListBox = ui.ListBoxEx()
		ListBox.SetParent(bar)
		ListBox.SetPosition(0, 0)
		ListBox.SetViewItemCount(5)
		ListBox.SetSize(width, heigh)
		ListBox.Show()
		scroll = ui.ScrollBar()
		scroll.SetParent(bar)
		scroll.SetPosition(width + 5, 0)
		scroll.SetScrollBarSize(heigh)
		scroll.Show()
		ListBox.SetScrollBar(scroll)
		return (bar, ListBox, scroll)	
		
	def FileListBox(self, parent, x, y, width, heigh, count):
		ListBox = ui.ListBoxEx()
		ListBox.SetParent(parent)
		ListBox.SetPosition(x, y)
		ListBox.SetViewItemCount(count)
		ListBox.SetSize(width, heigh)
		ListBox.Show()
		scroll = ui.ScrollBar()
		scroll.SetParent(ListBox)
		scroll.SetPosition(width - 20, 0)
		scroll.SetScrollBarSize(heigh)
		scroll.Show()
		ListBox.SetScrollBar(scroll)
		return ListBox, scroll
		
	def ReadingListBox(self, parent, x, y, width, heigh, count):
		bar = ui.Bar()
		if parent != None:
			bar.SetParent(parent)
		bar.SetPosition(x, y)
		bar.SetSize(width + 20, heigh)
		bar.Show()
		ListBox = ui.ListBoxEx()
		ListBox.SetParent(bar)
		ListBox.SetPosition(10, 13)
		ListBox.SetViewItemCount(count)
		ListBox.SetSize(width, heigh)
		ListBox.Show()
		return bar, ListBox	
	
x = OpenItemBotDialog()
x.Show()

I teraz będzie miał zagadkę jak tego użyć hahaha xD  masz w mh sielu lub kag możliwość wyciągania id itemu  u siela na pelerynkach przeciagasz daną rzecz i wyciąga ci id a u kaga  masz coś tam info   kładziesz item na 1 slot i wyciąga ci id :) 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...