[Python] Sistem Report - Metin2 2016

Neconectat
Avatar utilizator
[A]ivory
Membru Club
Membru Club
Mesaje: 2084
Membru din: 06 Mar 2015
Reputație: #===============#
Nume anterior: ZyuX, SoLuS
#===============#


==================
[FOST] Moderator
===================
[FOST] Trial Moderator
==================
[FOST] Helper Avansat
===================
[FOST] Fost Lider Helperi
===================
[FOST] Fost Lider Trial Helperi
===================
[FOST] Helperi
===================
[FOST] Trial Helper
===================
Membru Clubul Just4Metin
===================
Status: Prefer să fiu criticat pentru ceea sunt!
Regat: Jinno
Mulţumiri acordate: 71  
Mulţumiri primite: 384  

[Python] Sistem Report - Metin2 2016

Mesaj de [A]ivory » 25 Dec 2016, 14:09

Imagine

Imagine

Imagine

Imagine
Despachetăm root.eix/epk și deschidem game.py.

Căutăm

Cod: Selectaţi tot

"CloseSafebox"			: self.CommandCloseSafebox,
Sub acea funcție adăugăm

Cod: Selectaţi tot

		
		"ReportLogin"			: self.ReportLogin,
		"Report"				: self.Report,
		"getinputbegin"                 : self.__Inputget1, 
		"getinputend"                   : self.__Inputget2,
Căutăm

Cod: Selectaţi tot

def OpenQuestWindow(self, skin, idx):
Și înlocuim cu asta

Cod: Selectaţi tot

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)
Căutăm

Cod: Selectaţi tot

	def __ProcessPreservedServerCommand(self):
		try:
			command = net.GetPreservedServerCommand()
			while command:
				print " __ProcessPreservedServerCommand", command
				self.serverCommander.Run(command)
				command = net.GetPreservedServerCommand()
		except RuntimeError, msg:
			dbg.TraceError(msg)
			return 0
Sub acea funcție adăugăm

Cod: Selectaţi tot

	def ReportLogin(self, id):
		constInfo.ReportLogin = int(id)
		
	def Report(self):
		net.SendQuestInputStringPacket(constInfo.ReportEntered)
		
	def __Inputget1(self):
		constInfo.INPUT = 1 

	def __Inputget2(self):
		constInfo.INPUT = 0
Salvăm game.py și apoi deschidem constinfo.py. În constinfo.py căutăm

Cod: Selectaţi tot

ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

ReportLogin = 0
ReportEntered = ""
INPUT = 0
Salvăm constinfo.py și deschidem uisystem.py. În uisystem.py căutăm

Cod: Selectaţi tot

SYSTEM_MENU_FOR_PORTAL = FALSE
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

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 EditLine2(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(2, 2)
		Value.SetMax(210)
		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, 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 / 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
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

	def RefreshMobile(self):
		if self.gameOptionDlg:
			self.gameOptionDlg.RefreshMobile()
		#self.optionDialog.RefreshMobile()
Și sub adăugăm

Cod: Selectaţi tot

	def __ClickHelpTwoButton(self):
		self.Close()
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.ReportWindowOpen))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.ReportWindowEnd))
		questionDialog.Open()
		self.questionDialog = questionDialog
        
	def ReportWindowOpen(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))
		
	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi regulamentul?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__KurallarPenceresiniAc))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__KurallarPenceresiniKapa))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __KurallarPenceresiniAc(self):
		self.KurallarOpen = ui.BoardWithTitleBar()
		self.KurallarOpen.SetSize(370, 375)
		self.KurallarOpen.SetCenterPosition()
		self.KurallarOpen.AddFlag('float')
		self.KurallarOpen.SetTitleName('Regulament')
		self.KurallarOpen.SetCloseEvent(self.__Kurallar_END)
		self.KurallarOpen.Show()
		self.ReportLogin.Hide()
		self.comp2 = Component()
		
		self.send = self.comp2.Button(self.KurallarOpen, 'Înapoi', ' ', 98, 310, self.ReportWindowOpens, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp2.Button(self.KurallarOpen, 'Închide', ' ', 98, 340, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.text1 = self.comp2.TextLine(self.KurallarOpen, '1-) Numele nu trebuie sã conþinã cuvinte obscene.', 17, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp2.TextLine(self.KurallarOpen, '2-) Fãrã nick-uri gen GMxTWIX sau orice nume de acest tip.', 17, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp2.TextLine(self.KurallarOpen, '3-) Nu cereþi iteme - se pedepseºte cu mute 12 ore.', 17, 74, self.comp.RGB(255, 255, 255))
		self.text4 = self.comp2.TextLine(self.KurallarOpen, '4-) Modul serverului este unul de tip pvm-hard.', 17, 89, self.comp.RGB(255, 255, 255))
		self.text5 = self.comp2.TextLine(self.KurallarOpen, '5-) Nu adresa cuvinte obscene celorlalþi jucãtori.', 17, 104, self.comp.RGB(255, 255, 255))	
		self.text6 = self.comp2.TextLine(self.KurallarOpen, '6-) Nu abuzaþi de modul de joc LIBER.', 17, 119, self.comp.RGB(255, 255, 255))
		self.text7 = self.comp2.TextLine(self.KurallarOpen, '7-) Bugurile se raporteazã în panoul de repot (ESC).', 17, 134, self.comp.RGB(255, 255, 255))
		self.text8 = self.comp2.TextLine(self.KurallarOpen, '8-) Nu daþi datele de logare nimãnui.', 17, 149, self.comp.RGB(255, 255, 255))
		self.text9 = self.comp2.TextLine(self.KurallarOpen, '9-) Nu abuzaþi de buguri.', 17, 164, self.comp.RGB(255, 255, 255))
		self.text10 = self.comp2.TextLine(self.KurallarOpen, '10-) Respectaþi/faceþi cu stricteþe ce vã cere GM-ul.', 17, 179, self.comp.RGB(255, 255, 255))
		self.text11 = self.comp2.TextLine(self.KurallarOpen, '', 17, 194, self.comp.RGB(255, 255, 255))
		self.text12 = self.comp2.TextLine(self.KurallarOpen, 'Vã mulþumim pentru cã v-aþi fãcut timp sã citiþi regulamentul nostru.', 17, 209, self.comp.RGB(255, 255, 255))
		self.text13 = self.comp2.TextLine(self.KurallarOpen, 'Respectã acest regulament ºi nu vei avea probleme.', 17, 224, self.comp.RGB(255, 255, 255))
		self.text14 = self.comp2.TextLine(self.KurallarOpen, '', 17, 239, self.comp.RGB(255, 255, 255))
		self.text15 = self.comp2.TextLine(self.KurallarOpen, '', 17, 254, self.comp.RGB(255, 255, 255))
		self.text16 = self.comp2.TextLine(self.KurallarOpen, 'Viziteazã -> www.orientalmt2.com.', 17, 269, self.comp.RGB(255, 255, 255))
	
	def __KurallarPenceresiniKapa(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar_END(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def WindowEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowOpens(self):
		import app
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.KurallarOpen.Hide()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))

	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		import event
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowEnd(self):
		self.Close()
		self.questionDialog.Close()
În uisystem.py alegem la Encoding - Encode in ANSI

Acum intrăm în locale_xx (depinde cum aveți voi) și deschidem systemdialog.py și înlocuim tot ce este acolo cu asta

Cod: Selectaţi tot

import uiScriptLocale

ROOT = "d:/ymir work/ui/public/"

window = {
	"name" : "SystemDialog",
	"style" : ("float",),

	"x" : (SCREEN_WIDTH  - 200) /2,
	"y" : (SCREEN_HEIGHT - 288) /2,

	"width" : 200,
	"height" : 320,

	"children" :
	(
		{
			"name" : "board",
			"type" : "thinboard",

			"x" : 0,
			"y" : 0,

			"width" : 200,
			"height" : 320,

			"children" :
			(
				{
					"name" : "help_button",
					"type" : "button",

					"x" : 10,
					"y" : 17,

					"text" : uiScriptLocale.SYSTEM_HELP,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "helptwo_button",
					"type" : "button",

					"x" : 10,
					"y" : 57,

					"text" : uiScriptLocale.SYSTEM_REPORT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "mall_button",
					"type" : "button",

					"x" : 10,
					"y" : 87,

					"text" : uiScriptLocale.SYSTEM_MALL,
					"text_color" : 0xffF8BF24,

					"default_image" : ROOT + "XLarge_Button_02.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_02.sub",
				},

				{
					"name" : "system_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 117,

					"text" : uiScriptLocale.SYSTEMOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "game_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 147,

					"text" : uiScriptLocale.GAMEOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "change_button",
					"type" : "button",

					"x" : 10,
					"y" : 177,

					"text" : uiScriptLocale.SYSTEM_CHANGE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "logout_button",
					"type" : "button",

					"x" : 10,
					"y" : 207,

					"text" : uiScriptLocale.SYSTEM_LOGOUT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "exit_button",
					"type" : "button",

					"x" : 10,
					"y" : 247,

					"text" : uiScriptLocale.SYSTEM_EXIT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "cancel_button",
					"type" : "button",

					"x" : 10,
					"y" : 277,

					"text" : uiScriptLocale.CANCEL,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
			),
		},
	),
}
Deschidem locale_interface.txt din locale_xx și căutăm

Cod: Selectaţi tot

SYSTEM_OPTION	Opþiuni sistem
Sub adăugăm

Cod: Selectaţi tot

SYSTEM_REPORT	Raporteazã
Quest:

Cod: Selectaţi tot

----------------------------------------------------
----- 	Server: OrientalMT2              	   -----
----- 	Author: [DEV]TWIX - SoLuS              -----
----------------------------------------------------

quest report begin
	state start begin
		function twix()
			pc.setqf("twix_work", get_time()+15)
		end
		when login begin
			cmdchat("ReportLogin "..q.getcurrentquestindex())
		end
		when button or info begin
			if party.is_party() then
				syschat("[OrientalMT 2] > Trebuie sã ieºi din grupã pentru a trimite acest mesaj.")
				return
			end
			if pc.is_polymorphed() then
				syschat("[OrientalMT 2] > Dacã eºti transformat nu poþi trimite acest mesaj.")
				return
			end
			if pc.get_map_index() == 113 then
				syschat("[OrientalMT 2] > Nu poþi trimite mesaje în aceastã hartã.")
				return
			end
			if pc.getqf("twix_work") <= get_time() then
				syschat("[OrientalMT 2] > Mesajul a fost trimis cu succes.")
				local reports = getinput("Report")
				local ac = io.open("/usr/home/game/share/locale/romania/quest/twix/report/reports.txt", "a+")
				ac:write("- "..pc.get_name()..": ")
				ac:write(reports..'\\n')
				ac:write(" ")
				ac:write(" ")
				ac:write('\\n')
				ac:close()
				report.twix()
			else
				syschat("[OrientalMT 2] > Poþi trimite mesaje o datã la 15 minute.")
				return
			end
		end
	end
end
În /usr/home/game/share/locale/romania/quest/ faceți un folder twix/report și puneți un txt sub numele reports.txt.

Deschideți quest_functions și adăugați

Cod: Selectaţi tot

getinput
Deschideți questlib.lua și căutați

Cod: Selectaţi tot

function input()
	return q.yield('input')
end
Sub acea funcție adăugați

Cod: Selectaţi tot

function getinput(par)
	cmdchat("getinputbegin")
	local ret = input(cmdchat(par))
	cmdchat("getinputend")
	return ret
end	
Ultima oară modificat 25 Dec 2016, 14:38 de către [A]ivory, modificat 1 dată în total.
These users thanked the author [A]ivory for the post (total 2):
hamasoulMihaiAdrian1999

Neconectat
Avatar utilizator
hamasoul
Mister Just4Metin
Mister Just4Metin
Mesaje: 781
Membru din: 03 Iun 2015
Status: Sunt bine mersi ^.^
Server Metin2: N-am
Regat: Chunjo
Mulţumiri acordate: 30  
Mulţumiri primite: 49  

Re: [Python] Sistem Report - Metin2 2016

Mesaj de hamasoul » 25 Dec 2016, 14:16

Deci nu cred =)).

Neconectat
Avatar utilizator
[A]ivory
Membru Club
Membru Club
Mesaje: 2084
Membru din: 06 Mar 2015
Reputație: #===============#
Nume anterior: ZyuX, SoLuS
#===============#


==================
[FOST] Moderator
===================
[FOST] Trial Moderator
==================
[FOST] Helper Avansat
===================
[FOST] Fost Lider Helperi
===================
[FOST] Fost Lider Trial Helperi
===================
[FOST] Helperi
===================
[FOST] Trial Helper
===================
Membru Clubul Just4Metin
===================
Status: Prefer să fiu criticat pentru ceea sunt!
Regat: Jinno
Mulţumiri acordate: 71  
Mulţumiri primite: 384  

Re: [Python] Sistem Report - Metin2 2016

Mesaj de [A]ivory » 25 Dec 2016, 14:39

hamasoul scrie:Deci nu cred =)).
Ce anume nu crezi?

Neconectat
Avatar utilizator
hamasoul
Mister Just4Metin
Mister Just4Metin
Mesaje: 781
Membru din: 03 Iun 2015
Status: Sunt bine mersi ^.^
Server Metin2: N-am
Regat: Chunjo
Mulţumiri acordate: 30  
Mulţumiri primite: 49  

Re: [Python] Sistem Report - Metin2 2016

Mesaj de hamasoul » 25 Dec 2016, 14:51

SoLuS scrie:
hamasoul scrie:Deci nu cred =)).
Ce anume nu crezi?
Ce ai jap pe net =))

Neconectat
Avatar utilizator
mystyle
Nivel 1
Nivel 1
Mesaje: 68
Membru din: 04 Feb 2014
Status: Sunt bine mersi ^.^
Server Metin2: In Curand
Regat: Jinno
Mulţumiri acordate: 0
Mulţumiri primite: 1  

Re: [Python] Sistem Report - Metin2 2016

Mesaj de mystyle » 03 Mar 2017, 15:38

Foarte folositor dar, ai uitat ceva :D ca sa faci limita de caractere maxime scrise in mesaj, Daca nu player scrie mai mult de 64 caractere in mesaj, ce este peste 64 nu le citeste nu le arata in reports.txt
Imagine

Neconectat
Avatar utilizator
[SA]Mihai
Nivel 1
Nivel 1
Mesaje: 52
Membru din: 13 Iul 2017
Status: La varsta mea imi permit orice.
Server Metin2: Metin2Pheonix
Regat: Chunjo
Mulţumiri acordate: 0
Mulţumiri primite: 0

Re: [Python] Sistem Report - Metin2 2016

Mesaj de [SA]Mihai » 14 Iul 2017, 19:01

Buna treaba , felicitari pentru munca depusa am sa il incerc si eu.

Neconectat
Avatar utilizator
JustBalvin
Nou Venit
Nou Venit
Mesaje: 11
Membru din: 05 Iul 2018
Status: Sunt bine mersi
Mulţumiri acordate: 1  
Mulţumiri primite: 0

Re: [Python] Sistem Report - Metin2 2016

Mesaj de JustBalvin » 11 Iul 2018, 21:33

[A]ivory scrie:
Imagine

Imagine

Imagine

Imagine
Despachetăm root.eix/epk și deschidem game.py.

Căutăm

Cod: Selectaţi tot

"CloseSafebox"			: self.CommandCloseSafebox,
Sub acea funcție adăugăm

Cod: Selectaţi tot

		
		"ReportLogin"			: self.ReportLogin,
		"Report"				: self.Report,
		"getinputbegin"                 : self.__Inputget1, 
		"getinputend"                   : self.__Inputget2,
Căutăm

Cod: Selectaţi tot

def OpenQuestWindow(self, skin, idx):
Și înlocuim cu asta

Cod: Selectaţi tot

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)
Căutăm

Cod: Selectaţi tot

	def __ProcessPreservedServerCommand(self):
		try:
			command = net.GetPreservedServerCommand()
			while command:
				print " __ProcessPreservedServerCommand", command
				self.serverCommander.Run(command)
				command = net.GetPreservedServerCommand()
		except RuntimeError, msg:
			dbg.TraceError(msg)
			return 0
Sub acea funcție adăugăm

Cod: Selectaţi tot

	def ReportLogin(self, id):
		constInfo.ReportLogin = int(id)
		
	def Report(self):
		net.SendQuestInputStringPacket(constInfo.ReportEntered)
		
	def __Inputget1(self):
		constInfo.INPUT = 1 

	def __Inputget2(self):
		constInfo.INPUT = 0
Salvăm game.py și apoi deschidem constinfo.py. În constinfo.py căutăm

Cod: Selectaţi tot

ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

ReportLogin = 0
ReportEntered = ""
INPUT = 0
Salvăm constinfo.py și deschidem uisystem.py. În uisystem.py căutăm

Cod: Selectaţi tot

SYSTEM_MENU_FOR_PORTAL = FALSE
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

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 EditLine2(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(2, 2)
		Value.SetMax(210)
		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, 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 / 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
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

	def RefreshMobile(self):
		if self.gameOptionDlg:
			self.gameOptionDlg.RefreshMobile()
		#self.optionDialog.RefreshMobile()
Și sub adăugăm

Cod: Selectaţi tot

	def __ClickHelpTwoButton(self):
		self.Close()
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.ReportWindowOpen))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.ReportWindowEnd))
		questionDialog.Open()
		self.questionDialog = questionDialog
        
	def ReportWindowOpen(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))
		
	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi regulamentul?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__KurallarPenceresiniAc))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__KurallarPenceresiniKapa))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __KurallarPenceresiniAc(self):
		self.KurallarOpen = ui.BoardWithTitleBar()
		self.KurallarOpen.SetSize(370, 375)
		self.KurallarOpen.SetCenterPosition()
		self.KurallarOpen.AddFlag('float')
		self.KurallarOpen.SetTitleName('Regulament')
		self.KurallarOpen.SetCloseEvent(self.__Kurallar_END)
		self.KurallarOpen.Show()
		self.ReportLogin.Hide()
		self.comp2 = Component()
		
		self.send = self.comp2.Button(self.KurallarOpen, 'Înapoi', ' ', 98, 310, self.ReportWindowOpens, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp2.Button(self.KurallarOpen, 'Închide', ' ', 98, 340, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.text1 = self.comp2.TextLine(self.KurallarOpen, '1-) Numele nu trebuie sã conþinã cuvinte obscene.', 17, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp2.TextLine(self.KurallarOpen, '2-) Fãrã nick-uri gen GMxTWIX sau orice nume de acest tip.', 17, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp2.TextLine(self.KurallarOpen, '3-) Nu cereþi iteme - se pedepseºte cu mute 12 ore.', 17, 74, self.comp.RGB(255, 255, 255))
		self.text4 = self.comp2.TextLine(self.KurallarOpen, '4-) Modul serverului este unul de tip pvm-hard.', 17, 89, self.comp.RGB(255, 255, 255))
		self.text5 = self.comp2.TextLine(self.KurallarOpen, '5-) Nu adresa cuvinte obscene celorlalþi jucãtori.', 17, 104, self.comp.RGB(255, 255, 255))	
		self.text6 = self.comp2.TextLine(self.KurallarOpen, '6-) Nu abuzaþi de modul de joc LIBER.', 17, 119, self.comp.RGB(255, 255, 255))
		self.text7 = self.comp2.TextLine(self.KurallarOpen, '7-) Bugurile se raporteazã în panoul de repot (ESC).', 17, 134, self.comp.RGB(255, 255, 255))
		self.text8 = self.comp2.TextLine(self.KurallarOpen, '8-) Nu daþi datele de logare nimãnui.', 17, 149, self.comp.RGB(255, 255, 255))
		self.text9 = self.comp2.TextLine(self.KurallarOpen, '9-) Nu abuzaþi de buguri.', 17, 164, self.comp.RGB(255, 255, 255))
		self.text10 = self.comp2.TextLine(self.KurallarOpen, '10-) Respectaþi/faceþi cu stricteþe ce vã cere GM-ul.', 17, 179, self.comp.RGB(255, 255, 255))
		self.text11 = self.comp2.TextLine(self.KurallarOpen, '', 17, 194, self.comp.RGB(255, 255, 255))
		self.text12 = self.comp2.TextLine(self.KurallarOpen, 'Vã mulþumim pentru cã v-aþi fãcut timp sã citiþi regulamentul nostru.', 17, 209, self.comp.RGB(255, 255, 255))
		self.text13 = self.comp2.TextLine(self.KurallarOpen, 'Respectã acest regulament ºi nu vei avea probleme.', 17, 224, self.comp.RGB(255, 255, 255))
		self.text14 = self.comp2.TextLine(self.KurallarOpen, '', 17, 239, self.comp.RGB(255, 255, 255))
		self.text15 = self.comp2.TextLine(self.KurallarOpen, '', 17, 254, self.comp.RGB(255, 255, 255))
		self.text16 = self.comp2.TextLine(self.KurallarOpen, 'Viziteazã -> www.orientalmt2.com.', 17, 269, self.comp.RGB(255, 255, 255))
	
	def __KurallarPenceresiniKapa(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar_END(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def WindowEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowOpens(self):
		import app
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.KurallarOpen.Hide()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))

	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		import event
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowEnd(self):
		self.Close()
		self.questionDialog.Close()
În uisystem.py alegem la Encoding - Encode in ANSI

Acum intrăm în locale_xx (depinde cum aveți voi) și deschidem systemdialog.py și înlocuim tot ce este acolo cu asta

Cod: Selectaţi tot

import uiScriptLocale

ROOT = "d:/ymir work/ui/public/"

window = {
	"name" : "SystemDialog",
	"style" : ("float",),

	"x" : (SCREEN_WIDTH  - 200) /2,
	"y" : (SCREEN_HEIGHT - 288) /2,

	"width" : 200,
	"height" : 320,

	"children" :
	(
		{
			"name" : "board",
			"type" : "thinboard",

			"x" : 0,
			"y" : 0,

			"width" : 200,
			"height" : 320,

			"children" :
			(
				{
					"name" : "help_button",
					"type" : "button",

					"x" : 10,
					"y" : 17,

					"text" : uiScriptLocale.SYSTEM_HELP,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "helptwo_button",
					"type" : "button",

					"x" : 10,
					"y" : 57,

					"text" : uiScriptLocale.SYSTEM_REPORT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "mall_button",
					"type" : "button",

					"x" : 10,
					"y" : 87,

					"text" : uiScriptLocale.SYSTEM_MALL,
					"text_color" : 0xffF8BF24,

					"default_image" : ROOT + "XLarge_Button_02.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_02.sub",
				},

				{
					"name" : "system_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 117,

					"text" : uiScriptLocale.SYSTEMOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "game_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 147,

					"text" : uiScriptLocale.GAMEOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "change_button",
					"type" : "button",

					"x" : 10,
					"y" : 177,

					"text" : uiScriptLocale.SYSTEM_CHANGE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "logout_button",
					"type" : "button",

					"x" : 10,
					"y" : 207,

					"text" : uiScriptLocale.SYSTEM_LOGOUT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "exit_button",
					"type" : "button",

					"x" : 10,
					"y" : 247,

					"text" : uiScriptLocale.SYSTEM_EXIT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "cancel_button",
					"type" : "button",

					"x" : 10,
					"y" : 277,

					"text" : uiScriptLocale.CANCEL,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
			),
		},
	),
}
Deschidem locale_interface.txt din locale_xx și căutăm

Cod: Selectaţi tot

SYSTEM_OPTION	Opþiuni sistem
Sub adăugăm

Cod: Selectaţi tot

SYSTEM_REPORT	Raporteazã
Quest:

Cod: Selectaţi tot

----------------------------------------------------
----- 	Server: OrientalMT2              	   -----
----- 	Author: [DEV]TWIX - SoLuS              -----
----------------------------------------------------

quest report begin
	state start begin
		function twix()
			pc.setqf("twix_work", get_time()+15)
		end
		when login begin
			cmdchat("ReportLogin "..q.getcurrentquestindex())
		end
		when button or info begin
			if party.is_party() then
				syschat("[OrientalMT 2] > Trebuie sã ieºi din grupã pentru a trimite acest mesaj.")
				return
			end
			if pc.is_polymorphed() then
				syschat("[OrientalMT 2] > Dacã eºti transformat nu poþi trimite acest mesaj.")
				return
			end
			if pc.get_map_index() == 113 then
				syschat("[OrientalMT 2] > Nu poþi trimite mesaje în aceastã hartã.")
				return
			end
			if pc.getqf("twix_work") <= get_time() then
				syschat("[OrientalMT 2] > Mesajul a fost trimis cu succes.")
				local reports = getinput("Report")
				local ac = io.open("/usr/home/game/share/locale/romania/quest/twix/report/reports.txt", "a+")
				ac:write("- "..pc.get_name()..": ")
				ac:write(reports..'\\n')
				ac:write(" ")
				ac:write(" ")
				ac:write('\\n')
				ac:close()
				report.twix()
			else
				syschat("[OrientalMT 2] > Poþi trimite mesaje o datã la 15 minute.")
				return
			end
		end
	end
end
În /usr/home/game/share/locale/romania/quest/ faceți un folder twix/report și puneți un txt sub numele reports.txt.

Deschideți quest_functions și adăugați

Cod: Selectaţi tot

getinput
Deschideți questlib.lua și căutați

Cod: Selectaţi tot

function input()
	return q.yield('input')
end
Sub acea funcție adăugați

Cod: Selectaţi tot

function getinput(par)
	cmdchat("getinputbegin")
	local ret = input(cmdchat(par))
	cmdchat("getinputend")
	return ret
end	

Primesc eroarea asta in sysser :
0711 22:24:09488 :: Unknown Server Command xmas_boom 1 | xmas_boom
0711 22:24:09622 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
0711 22:24:12903 :: Failed to load script file : locale/ro/ui/SystemDialog.py
0711 22:24:12985 ::
ui.py(line:2840) LoadScriptFile
system.py(line:192) execfile
system.py(line:163) Run
locale/ro/ui/SystemDialog.py(line:49) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.AttributeError'>:'module' object has no attribute 'SYSTEM_REPORT'

0711 22:24:12985 :: ============================================================================================================
0711 22:24:12985 :: Abort!!!!

Vreo idee?

Neconectat
Avatar utilizator
DAM0NN
Ţepar / Untrusted User
Mesaje: 148
Membru din: 11 Apr 2018
Localitate: Las Vegas .
Reputație: Membru Club ( 19 mai - 19 iunie )
Nume anterior: OCB1214
Status: #
Server Metin2: #
Regat: Chunjo
Mulţumiri acordate: 9  
Mulţumiri primite: 15  

Re: [Python] Sistem Report - Metin2 2016

Mesaj de DAM0NN » 18 Iul 2018, 14:08

JustBalvin scrie:
[A]ivory scrie:
Imagine

Imagine

Imagine

Imagine
Despachetăm root.eix/epk și deschidem game.py.

Căutăm

Cod: Selectaţi tot

"CloseSafebox"			: self.CommandCloseSafebox,
Sub acea funcție adăugăm

Cod: Selectaţi tot

		
		"ReportLogin"			: self.ReportLogin,
		"Report"				: self.Report,
		"getinputbegin"                 : self.__Inputget1, 
		"getinputend"                   : self.__Inputget2,
Căutăm

Cod: Selectaţi tot

def OpenQuestWindow(self, skin, idx):
Și înlocuim cu asta

Cod: Selectaţi tot

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)
Căutăm

Cod: Selectaţi tot

	def __ProcessPreservedServerCommand(self):
		try:
			command = net.GetPreservedServerCommand()
			while command:
				print " __ProcessPreservedServerCommand", command
				self.serverCommander.Run(command)
				command = net.GetPreservedServerCommand()
		except RuntimeError, msg:
			dbg.TraceError(msg)
			return 0
Sub acea funcție adăugăm

Cod: Selectaţi tot

	def ReportLogin(self, id):
		constInfo.ReportLogin = int(id)
		
	def Report(self):
		net.SendQuestInputStringPacket(constInfo.ReportEntered)
		
	def __Inputget1(self):
		constInfo.INPUT = 1 

	def __Inputget2(self):
		constInfo.INPUT = 0
Salvăm game.py și apoi deschidem constinfo.py. În constinfo.py căutăm

Cod: Selectaţi tot

ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

ReportLogin = 0
ReportEntered = ""
INPUT = 0
Salvăm constinfo.py și deschidem uisystem.py. În uisystem.py căutăm

Cod: Selectaţi tot

SYSTEM_MENU_FOR_PORTAL = FALSE
iar sub acea funcție adăugăm asta

Cod: Selectaţi tot

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 EditLine2(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(2, 2)
		Value.SetMax(210)
		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, 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 / 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
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
Și sub adăugăm

Cod: Selectaţi tot

self.GetChild("helptwo_button").SAFE_SetEvent(self.__ClickHelpTwoButton)
Căutăm

Cod: Selectaţi tot

	def RefreshMobile(self):
		if self.gameOptionDlg:
			self.gameOptionDlg.RefreshMobile()
		#self.optionDialog.RefreshMobile()
Și sub adăugăm

Cod: Selectaţi tot

	def __ClickHelpTwoButton(self):
		self.Close()
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.ReportWindowOpen))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.ReportWindowEnd))
		questionDialog.Open()
		self.questionDialog = questionDialog
        
	def ReportWindowOpen(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))
		
	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã deschizi regulamentul?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__KurallarPenceresiniAc))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__KurallarPenceresiniKapa))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __KurallarPenceresiniAc(self):
		self.KurallarOpen = ui.BoardWithTitleBar()
		self.KurallarOpen.SetSize(370, 375)
		self.KurallarOpen.SetCenterPosition()
		self.KurallarOpen.AddFlag('float')
		self.KurallarOpen.SetTitleName('Regulament')
		self.KurallarOpen.SetCloseEvent(self.__Kurallar_END)
		self.KurallarOpen.Show()
		self.ReportLogin.Hide()
		self.comp2 = Component()
		
		self.send = self.comp2.Button(self.KurallarOpen, 'Înapoi', ' ', 98, 310, self.ReportWindowOpens, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp2.Button(self.KurallarOpen, 'Închide', ' ', 98, 340, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.text1 = self.comp2.TextLine(self.KurallarOpen, '1-) Numele nu trebuie sã conþinã cuvinte obscene.', 17, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp2.TextLine(self.KurallarOpen, '2-) Fãrã nick-uri gen GMxTWIX sau orice nume de acest tip.', 17, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp2.TextLine(self.KurallarOpen, '3-) Nu cereþi iteme - se pedepseºte cu mute 12 ore.', 17, 74, self.comp.RGB(255, 255, 255))
		self.text4 = self.comp2.TextLine(self.KurallarOpen, '4-) Modul serverului este unul de tip pvm-hard.', 17, 89, self.comp.RGB(255, 255, 255))
		self.text5 = self.comp2.TextLine(self.KurallarOpen, '5-) Nu adresa cuvinte obscene celorlalþi jucãtori.', 17, 104, self.comp.RGB(255, 255, 255))	
		self.text6 = self.comp2.TextLine(self.KurallarOpen, '6-) Nu abuzaþi de modul de joc LIBER.', 17, 119, self.comp.RGB(255, 255, 255))
		self.text7 = self.comp2.TextLine(self.KurallarOpen, '7-) Bugurile se raporteazã în panoul de repot (ESC).', 17, 134, self.comp.RGB(255, 255, 255))
		self.text8 = self.comp2.TextLine(self.KurallarOpen, '8-) Nu daþi datele de logare nimãnui.', 17, 149, self.comp.RGB(255, 255, 255))
		self.text9 = self.comp2.TextLine(self.KurallarOpen, '9-) Nu abuzaþi de buguri.', 17, 164, self.comp.RGB(255, 255, 255))
		self.text10 = self.comp2.TextLine(self.KurallarOpen, '10-) Respectaþi/faceþi cu stricteþe ce vã cere GM-ul.', 17, 179, self.comp.RGB(255, 255, 255))
		self.text11 = self.comp2.TextLine(self.KurallarOpen, '', 17, 194, self.comp.RGB(255, 255, 255))
		self.text12 = self.comp2.TextLine(self.KurallarOpen, 'Vã mulþumim pentru cã v-aþi fãcut timp sã citiþi regulamentul nostru.', 17, 209, self.comp.RGB(255, 255, 255))
		self.text13 = self.comp2.TextLine(self.KurallarOpen, 'Respectã acest regulament ºi nu vei avea probleme.', 17, 224, self.comp.RGB(255, 255, 255))
		self.text14 = self.comp2.TextLine(self.KurallarOpen, '', 17, 239, self.comp.RGB(255, 255, 255))
		self.text15 = self.comp2.TextLine(self.KurallarOpen, '', 17, 254, self.comp.RGB(255, 255, 255))
		self.text16 = self.comp2.TextLine(self.KurallarOpen, 'Viziteazã -> www.orientalmt2.com.', 17, 269, self.comp.RGB(255, 255, 255))
	
	def __KurallarPenceresiniKapa(self):
		self.Close()
		self.questionDialog.Close()
	
	def __Kurallar_END(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()
		
	def WindowEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowOpens(self):
		import app
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin = ui.BoardWithTitleBar()
		self.ReportLogin.SetSize(400, 300)
		self.ReportLogin.SetCenterPosition()
		self.ReportLogin.AddFlag('float')
		self.ReportLogin.SetTitleName('Fereastrã de report')
		self.ReportLogin.SetCloseEvent(self.__ReportSend_FunctionsEND)
		self.ReportLogin.Show()
		self.KurallarOpen.Hide()
		self.comp = Component()

		self.send = self.comp.Button(self.ReportLogin, 'Trimite', '', 112, 202, self.__ReportSend_Functions, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kurallar = self.comp.Button(self.ReportLogin, 'Reguli', '', 112, 232, self.__Kurallar, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.kapat = self.comp.Button(self.ReportLogin, 'Închide', ' ', 112, 262, self.WindowEND, 'd:/ymir work/ui/public/XLarge_Button_01.sub', 'd:/ymir work/ui/public/XLarge_Button_02.sub', 'd:/ymir work/ui/public/XLarge_Button_03.sub')
		self.slotbar_reports, self.report = self.comp.EditLine2(self.ReportLogin, '', 76, 105, 250, 75, 305)
		self.text = self.comp.TextLine(self.ReportLogin, 'Orice bug gãsit sau orice jucãtor care încalcã regulamentul, te rog', 75, 45, self.comp.RGB(255, 255, 255))
		self.text2 = self.comp.TextLine(self.ReportLogin, 'sã faci un raport în spaþiul liber de mai jos.', 75, 59, self.comp.RGB(255, 255, 255))
		self.text3 = self.comp.TextLine(self.ReportLogin, 'Scrie mesajul care vrei sã fie trimis cãtre Echipã:', 95, 80, self.comp.RGB(255, 255, 255))

	def __ReportSend_Functions(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã trimiþi acest mesaj?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__GonderButonunuOnayladim))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__GonderButonunuOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __GonderButonunuOnayladim(self):
		import event
		report = self.report.GetText()
		if report == "":
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Nu poþi anula trimiterea mesajului.")
		elif len(report) < 30:
			self.Close()
			self.questionDialog.Close()
			import chat
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[OrientalMT 2] > Lungimea mesajului trebuie sã fie între 30 ºi 120 de caractere.")
		else:
			self.Close()
			self.questionDialog.Close()
			self.ReportLogin.Hide()
			event.QuestButtonClick(constInfo.ReportLogin)
			constInfo.ReportEntered = report
			
	def __GonderButonunuOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def __ReportSend_FunctionsEND(self):
		import uiCommon
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText("Eºti sigur cã vrei sã închizi fereastra de report?")
		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__PencereyiKapatMesaji))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.__PencereyiKapatMesajiOnaylamadim))
		questionDialog.Open()
		self.questionDialog = questionDialog
		
	def __PencereyiKapatMesaji(self):
		self.Close()
		self.questionDialog.Close()
		self.ReportLogin.Hide()
		self.KurallarOpen.Hide()
		
	def __PencereyiKapatMesajiOnaylamadim(self):
		self.Close()
		self.questionDialog.Close()

	def ReportWindowEnd(self):
		self.Close()
		self.questionDialog.Close()
În uisystem.py alegem la Encoding - Encode in ANSI

Acum intrăm în locale_xx (depinde cum aveți voi) și deschidem systemdialog.py și înlocuim tot ce este acolo cu asta

Cod: Selectaţi tot

import uiScriptLocale

ROOT = "d:/ymir work/ui/public/"

window = {
	"name" : "SystemDialog",
	"style" : ("float",),

	"x" : (SCREEN_WIDTH  - 200) /2,
	"y" : (SCREEN_HEIGHT - 288) /2,

	"width" : 200,
	"height" : 320,

	"children" :
	(
		{
			"name" : "board",
			"type" : "thinboard",

			"x" : 0,
			"y" : 0,

			"width" : 200,
			"height" : 320,

			"children" :
			(
				{
					"name" : "help_button",
					"type" : "button",

					"x" : 10,
					"y" : 17,

					"text" : uiScriptLocale.SYSTEM_HELP,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "helptwo_button",
					"type" : "button",

					"x" : 10,
					"y" : 57,

					"text" : uiScriptLocale.SYSTEM_REPORT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "mall_button",
					"type" : "button",

					"x" : 10,
					"y" : 87,

					"text" : uiScriptLocale.SYSTEM_MALL,
					"text_color" : 0xffF8BF24,

					"default_image" : ROOT + "XLarge_Button_02.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_02.sub",
				},

				{
					"name" : "system_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 117,

					"text" : uiScriptLocale.SYSTEMOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "game_option_button",
					"type" : "button",

					"x" : 10,
					"y" : 147,

					"text" : uiScriptLocale.GAMEOPTION_TITLE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "change_button",
					"type" : "button",

					"x" : 10,
					"y" : 177,

					"text" : uiScriptLocale.SYSTEM_CHANGE,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "logout_button",
					"type" : "button",

					"x" : 10,
					"y" : 207,

					"text" : uiScriptLocale.SYSTEM_LOGOUT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "exit_button",
					"type" : "button",

					"x" : 10,
					"y" : 247,

					"text" : uiScriptLocale.SYSTEM_EXIT,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
				{
					"name" : "cancel_button",
					"type" : "button",

					"x" : 10,
					"y" : 277,

					"text" : uiScriptLocale.CANCEL,

					"default_image" : ROOT + "XLarge_Button_01.sub",
					"over_image" : ROOT + "XLarge_Button_02.sub",
					"down_image" : ROOT + "XLarge_Button_03.sub",
				},
			),
		},
	),
}
Deschidem locale_interface.txt din locale_xx și căutăm

Cod: Selectaţi tot

SYSTEM_OPTION	Opþiuni sistem
Sub adăugăm

Cod: Selectaţi tot

SYSTEM_REPORT	Raporteazã
Quest:

Cod: Selectaţi tot

----------------------------------------------------
----- 	Server: OrientalMT2              	   -----
----- 	Author: [DEV]TWIX - SoLuS              -----
----------------------------------------------------

quest report begin
	state start begin
		function twix()
			pc.setqf("twix_work", get_time()+15)
		end
		when login begin
			cmdchat("ReportLogin "..q.getcurrentquestindex())
		end
		when button or info begin
			if party.is_party() then
				syschat("[OrientalMT 2] > Trebuie sã ieºi din grupã pentru a trimite acest mesaj.")
				return
			end
			if pc.is_polymorphed() then
				syschat("[OrientalMT 2] > Dacã eºti transformat nu poþi trimite acest mesaj.")
				return
			end
			if pc.get_map_index() == 113 then
				syschat("[OrientalMT 2] > Nu poþi trimite mesaje în aceastã hartã.")
				return
			end
			if pc.getqf("twix_work") <= get_time() then
				syschat("[OrientalMT 2] > Mesajul a fost trimis cu succes.")
				local reports = getinput("Report")
				local ac = io.open("/usr/home/game/share/locale/romania/quest/twix/report/reports.txt", "a+")
				ac:write("- "..pc.get_name()..": ")
				ac:write(reports..'\\n')
				ac:write(" ")
				ac:write(" ")
				ac:write('\\n')
				ac:close()
				report.twix()
			else
				syschat("[OrientalMT 2] > Poþi trimite mesaje o datã la 15 minute.")
				return
			end
		end
	end
end
În /usr/home/game/share/locale/romania/quest/ faceți un folder twix/report și puneți un txt sub numele reports.txt.

Deschideți quest_functions și adăugați

Cod: Selectaţi tot

getinput
Deschideți questlib.lua și căutați

Cod: Selectaţi tot

function input()
	return q.yield('input')
end
Sub acea funcție adăugați

Cod: Selectaţi tot

function getinput(par)
	cmdchat("getinputbegin")
	local ret = input(cmdchat(par))
	cmdchat("getinputend")
	return ret
end	

Primesc eroarea asta in sysser :
0711 22:24:09488 :: Unknown Server Command xmas_boom 1 | xmas_boom
0711 22:24:09622 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
0711 22:24:12903 :: Failed to load script file : locale/ro/ui/SystemDialog.py
0711 22:24:12985 ::
ui.py(line:2840) LoadScriptFile
system.py(line:192) execfile
system.py(line:163) Run
locale/ro/ui/SystemDialog.py(line:49) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.AttributeError'>:'module' object has no attribute 'SYSTEM_REPORT'

0711 22:24:12985 :: ============================================================================================================
0711 22:24:12985 :: Abort!!!!

Vreo idee?
Du-te în locale_game și adaugă SYSTEM_REPORT SISTEM RAPORT doar că apeși tab în loc de space între SYSTEM_REPORT ȘI SISTEM RAPORT
Imagine

Neconectat
Avatar utilizator
steamaccount
Nou Venit
Nou Venit
Mesaje: 16
Membru din: 14 Mai 2018
Mulţumiri acordate: 0
Mulţumiri primite: 0

Re: [Python] Sistem Report - Metin2 2016

Mesaj de steamaccount » 17 Dec 2018, 16:07

In syser client.
1217 16:06:09979 ::
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:26) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:24) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiSystem.py, line 298)

1217 16:06:09979 :: ============================================================================================================
1217 16:06:09979 :: Abort!!!!

Scrie răspuns

Înapoi la “Altele”