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

[Problem]Wlasny hack w pythonie


dziubdziubek:)

Rekomendowane odpowiedzi

Opublikowano

Cześć,

Piszę hacka do metina i chcę zrobić skill bota, skill1 to zmienna, która włącza lub wyłącza.

W OnUpdate:

global skill1
if skill1 == 1:
	if player.IsMountingHorse():
		net.SendChatPacket("/unmount")
		if skill.CanUseSkill(1):
			player.ClickSkillSlot(1)
		net.SendChatPacket("/user_horse_ride")
		else:
			if skill.CanUseSkill(1):
				player.ClickSkillSlot(1)

 

testuje na pl'u i Almantia, i nie działa.

Opublikowano

Proszę:

# Generated with Gui Editor by KaMeR1337 ; www.metin2mod.tk
import ui
import dbg
import app
import chat
import player
import chr
import locale
import net
import time
import skill

PickupStart = 0

autopot = 0

Maximum_MP = 0
Actual_MP = 0
Maximum_TP = 0
Actual_TP = 0

skill1 = 0
skill2 = 0
skill3 = 0
skill4 = 0
skill5 = 0
skill6 = 0

class Dialog1(ui.Window):

	def __init__(self):
		ui.Window.__init__(self)
		self.BuildWindow()

	def __del__(self):
		ui.Window.__del__(self)

	def BuildWindow(self):
		self.Board = ui.ThinBoard()
		self.Board.SetSize(150, 250)
		self.Board.SetCenterPosition()
		self.Board.AddFlag('movable')
		self.Board.AddFlag('float')
		self.Board.Show()
		self.__BuildKeyDict()
		self.comp = Component()

		self.pickupon = self.comp.Button(self.Board, 'Wlacz', '', 8, 24, self.pickupon_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.pickupoff = self.comp.Button(self.Board, 'Wylacz', '', 77, 25, self.pickupoff_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.spaceoff = self.comp.Button(self.Board, 'Wylacz', '', 79, 66, self.spaceoff_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.spaceon = self.comp.Button(self.Board, 'Wlacz', '', 10, 67, self.spaceon_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.autopoton = self.comp.Button(self.Board, 'Wlacz', '', 12, 106, self.autopoton_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.autopotoff = self.comp.Button(self.Board, 'Wylacz', '', 82, 106, self.autopotoff_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot1 = self.comp.ToggleButton(self.Board, 'Skill 1', '', 12, 150, (lambda arg = 'off': self.skillbot1_func(arg)), (lambda arg = 'on': self.skillbot1_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot2 = self.comp.ToggleButton(self.Board, 'Skill 2', '', 79, 150, (lambda arg = 'off': self.skillbot2_func(arg)), (lambda arg = 'on': self.skillbot2_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot3 = self.comp.ToggleButton(self.Board, 'Skill 3', '', 13, 174, (lambda arg = 'off': self.skillbot3_func(arg)), (lambda arg = 'on': self.skillbot3_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot4 = self.comp.ToggleButton(self.Board, 'Skill 4', '', 80, 175, (lambda arg = 'off': self.skillbot4_func(arg)), (lambda arg = 'on': self.skillbot4_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot5 = self.comp.ToggleButton(self.Board, 'Skill 5', '', 15, 199, (lambda arg = 'off': self.skillbot5_func(arg)), (lambda arg = 'on': self.skillbot5_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.skillbot6 = self.comp.ToggleButton(self.Board, 'Skill 6', '', 81, 200, (lambda arg = 'off': self.skillbot6_func(arg)), (lambda arg = 'on': self.skillbot6_func(arg)), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
		self.pickuptext = self.comp.TextLine(self.Board, 'Pickup', 56, 9, self.comp.RGB(255, 255, 255))
		self.spacetext = self.comp.TextLine(self.Board, 'Trzymaj spacje', 43, 48, self.comp.RGB(255, 255, 255))
		self.Autopottext = self.comp.TextLine(self.Board, 'Autopot', 12, 88, self.comp.RGB(255, 255, 255))
		self.Skillbottext = self.comp.TextLine(self.Board, 'Skill bot', 58, 131, self.comp.RGB(255, 255, 255))
	
	def pickupon_func(self):
		global PickupStart
		PickupStart = 1
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto pickup-wlaczony")
	
	def pickupoff_func(self):
		global PickupStart
		PickupStart = 0
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto pickup-wylaczony")
	
	def spaceoff_func(self):
		player.SetAttackKeyState(FALSE)
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto spacja-wylaczona")
	
	def spaceon_func(self):
		player.SetAttackKeyState(TRUE)
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto spacja-wlaczona")
	
	def autopoton_func(self):
		global autopot
		autopot = 1
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto poty-wlaczone")
	
	def autopotoff_func(self):
		global autopot
		autopot = 0
		chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Auto poty-wylaczone")
	
	def skillbot1_func(self, arg):
		if arg=='on':
			skill1 = 1
		elif arg=='off':
			skill1 = 0
	
	def skillbot2_func(self, arg):
		if arg=='on':
			skill2 = 1
		elif arg=='off':
			skill2 = 0
	
	def skillbot3_func(self, arg):
		if arg=='on':
			skill3 = 1
		elif arg=='off':
			skill3 = 0
	
	def skillbot4_func(self, arg):
		if arg=='on':
			skill4 = 1
		elif arg=='off':
			skill4 = 0
	
	def skillbot5_func(self, arg):
		if arg=='on':
			skill5 = 1
		elif arg=='off':
			skill5 = 0
	
	def skillbot6_func(self, arg):
		if arg=='on':
			skill6 = 1
		elif arg=='off':
			skill6 = 0
			
	def OnUpdate(self):
		if PickupStart == 1:
			player.PickCloseItem()
			
		if autopot == 1:
			global Maximum_TP
			global Actual_TP
			Maximum_TP = player.GetStatus(player.MAX_HP)
			Actual_TP = player.GetStatus(player.HP)
			if Maximum_TP != Actual_TP:
				for i in xrange(player.INVENTORY_PAGE_SIZE*2):
					ItemValue = player.GetItemIndex(i)
					if ItemValue == 27001 or ItemValue == 27002 or ItemValue == 27003:
						net.SendItemUsePacket(i)
			
			global Maximum_MP
			global Actual_MP
			Maximum_MP = player.GetStatus(player.MAX_SP)
			Actual_MP = player.GetStatus(player.SP)
			if Maximum_MP != Actual_MP:
				for i in xrange(player.INVENTORY_PAGE_SIZE*2):
					ItemValue = player.GetItemIndex(i)
					if ItemValue == 27004 or ItemValue == 27005 or ItemValue == 27006:
						net.SendItemUsePacket(i)
		
		global skill1
		if skill1 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(1):
					player.ClickSkillSlot(1)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(1):
					player.ClickSkillSlot(1)
			
		global skill2	
		if skill2 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(2):
					player.ClickSkillSlot(2)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(2):
					player.ClickSkillSlot(2)
			
		global skill3	
		if skill3 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(3):
					player.ClickSkillSlot(3)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(3):
					player.ClickSkillSlot(3)
			
		global skill4	
		if skill4 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(4):
					player.ClickSkillSlot(4)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(4):
					player.ClickSkillSlot(4)
		
		global skill5
		if skill5 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(5):
					player.ClickSkillSlot(5)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(5):
					player.ClickSkillSlot(5)
			
		global skill6	
		if skill6 == 1:
			if player.IsMountingHorse():
				net.SendChatPacket("/unmount")
				if skill.CanUseSkill(6):
					player.ClickSkillSlot(6)
				net.SendChatPacket("/user_horse_ride")
			else:
				if skill.CanUseSkill(6):
					player.ClickSkillSlot(6)
	
	
	def __BuildKeyDict(self):
		onPressKeyDict = {}
		onPressKeyDict[app.DIK_F5]	= lambda : self.OpenWindow()
		self.onPressKeyDict = onPressKeyDict
	
	def OnKeyDown(self, key):
		try:
			self.onPressKeyDict[key]()
		except KeyError:
			pass
		except:
			raise
		return TRUE
	
	def OpenWindow(self):
		if self.Board.IsShow():
			self.Board.Hide()
		else:
			self.Board.Show()
	
	def Close(self):
		self.Board.Hide()

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 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(1, 1)
		Value.SetMax(max)
		Value.SetLimitWidth(width)
		Value.SetMultiLine()
		Value.SetText(editlineText)
		Value.Show()
		return SlotBar, 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.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 / 100)
		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 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, heigh)
		bar.SetColor(0x77000000)
		bar.Show()
		ListBox=ui.ListBoxEx()
		ListBox.SetParent(bar)
		ListBox.SetPosition(0, 0)
		ListBox.SetSize(width, heigh)
		ListBox.Show()
		scroll = ui.ScrollBar()
		scroll.SetParent(ListBox)
		scroll.SetPosition(width-15, 0)
		scroll.SetScrollBarSize(heigh)
		scroll.Show()
		ListBox.SetScrollBar(scroll)
		return bar, ListBox

Dialog1().Show()

Opublikowano

syserr z pl'a:

0217 09:54:01251 :: KaMeR1337 Module Loaded
0217 09:54:01252 :: WebSite: www.metin2mod.tk
0217 09:54:01252 :: Contact: [email protected]
0217 09:55:04734 :: 1
0217 09:55:04736 :: 2
0217 09:55:04736 :: 3
0217 09:55:04737 :: 4
0217 09:55:04737 :: 5
0217 09:55:04738 :: 6
0217 09:55:04739 :: 7
0217 09:55:04739 :: 8
0217 09:55:04740 :: 9
0217 09:55:04740 :: 10
0217 09:55:04741 :: 11
0217 09:55:04741 :: 12
0217 09:55:04742 :: 13
0217 09:55:04742 :: 14
0217 09:55:04743 :: 15
0217 09:55:04744 :: 16
0217 09:55:04744 :: 17
0217 09:55:04745 :: 18
0217 09:55:04745 :: 19
0217 09:55:04746 :: 20
0217 09:55:04747 :: 21
0217 09:55:04747 :: 22
0217 09:55:04748 :: 23
0217 09:55:04748 :: 24
0217 09:55:04748 :: 25
0217 09:55:04749 :: 26
0217 09:55:04749 :: 27
0217 09:55:04750 :: 28
0217 09:55:04750 :: 29
0217 09:55:04751 :: 30
0217 09:55:04751 :: 31
0217 09:55:04752 :: 32
0217 09:55:04753 :: 33
0217 09:55:04754 :: 34
0217 09:55:04755 :: 35
0217 09:55:04756 :: 36
0217 09:55:04756 :: 37
0217 09:55:04757 :: 38
0217 09:55:04758 :: 39
0217 09:55:04758 :: 40
0217 09:55:04759 :: 41
0217 09:55:04760 :: 42
0217 09:55:04761 :: 43
0217 09:55:04762 :: 44
0217 09:55:04764 :: 45
0217 09:55:04765 :: 46
0217 09:55:18684 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
0217 09:55:20868 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0217 09:55:23682 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_2.mse) Error
0217 09:55:23737 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_3.mse) Error
0217 09:55:23793 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_4.mse) Error
0217 09:55:24312 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_2.mse) Error
0217 09:55:24313 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_3.mse) Error
0217 09:55:24315 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/pc/assassin/effect/poison_4.mse) Error
0217 09:55:26907 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_2.msa) ERROR
0217 09:55:27112 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_3.msa) ERROR
0217 09:55:27406 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_4.msa) ERROR
0217 09:55:27969 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_2.msa) ERROR
0217 09:55:27970 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_3.msa) ERROR
0217 09:55:27971 :: CRaceData::RegisterMotionData - LoadMotionData(c_szFileName=waithack/shaman/skill/pokroe_4.msa) ERROR

Opublikowano

Sprawdz:

global skill1

if skill1 == 1:

if player.IsMountingHorse():

net.SendChatPacket("/unmount")

if skill.CanUseSkill(1):

player.ClickSkillSlot(1)

net.SendChatPacket("/user_horse_ride")

else:

if skill.CanUseSkill(1):

player.ClickSkillSlot(1)

Dodaj odstep czasowy miedzy zsiadaniem, uzyciem skilla i wsiadaniem bo bedzie sie bugowalo.
Opublikowano

Dodałem opóźnienie, nadal nie działa ;/

global skill1
if skill1 == 1:
	if skill.CanUseSkill(1):
		if player.IsMountingHorse():
			net.SendChatPacket("/unmount")
			self.WaitingDelay(500)
			player.ClickSkillSlot(1)
			self.WaitingDelay(500)	
			net.SendChatPacket("/user_horse_ride")
		else:
			player.ClickSkillSlot(1)
Opublikowano

Zaznaczasz jakas postac (nawet siebie) jak uzywasz

player.ClickSkillSlot(1)
? Bo patrzac na inne buffboty zeby ta funkcja dzialala musi byc zaznaczona jakas postac (albo nawet twoja).

 

#EDIT

Masz tutaj uproszczonego skillbota dla wlasnej postaci:

NrSkilla=1
MojeVID=net.GetMainActorVID()
player.SetTarget(int(MojeVID))
player.ClickSkillSlot(int(NrSkilla)
Opublikowano

W końcu udało się, skille bierze, ale na surze wp czarowane ciągle używa, jak zrobić, żeby nie brało ciągle czarowanego ostrza?

Jak przywoływać konia wojskowego ?

W braniu skilla z konia wstawiłem opóźnienie app.Sleep, jak zrobić opóźnienie bez zatrzymywania głównego wątku gry?

Pelerynę męstwa używa się net.SendItemUsePacket(i) ? I jakie jest ItemValue?

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...