Jump to content

Recommended Posts

Hello guys.

 

What I wanted was that when you arrive at 00:00 the server sent a variable to the client that would be a open window (sorry i use google translate)

In Server i have something like this:

        function settings()
            local time = os.date ("%H")
            local number = 1
            if time >= "21" then
                cmdchat("command_name "..number)
                notice_all("Can open python window")
            elseif time >= "23" then
                notice_all("Dont Start")
            elseif time >= "24" then
                notice_all("Dont Start 1")
            end
        end

------------------------------------------------------------------

In Client i have something like this:

In game:

 

"command_name"            : self.command_name_python,

 

    def command_name_python(self, number):
        if not self.teste:
            import uitestewindow
            self.teste = uitestewindow.moon()
        self.teste.BuildWindow(number)

----------------------------------------------------------------------

in uitestewindow i have:

    def BuildWindow(self, number):
        self.number = number
        if self.number == 1:
            self.Board = ui.BoardWithTitleBar()
            self.Board.SetSize(80, 66)
            self.Board.SetPosition(1143,70)
            self.Board.SetTitleName('Bónus')
            self.Board.AddFlag('float')
            self.Board.Show()
            self.Button1 = ui.Button()
            self.Button1 .SetParent(self.Board)
            self.Button1 .SetPosition(19, 31)
            self.Button1 .SetUpVisual("d:/ymir work/ui/bonus_noturno/lua1.tga")
            self.Button1 .SetOverVisual("d:/ymir work/ui/bonus_noturno/lua2.tga")
            self.Button1 .SetDownVisual("d:/ymir work/ui/bonus_noturno/lua3.tga")
            self.Button1 .SetText("")
            self.Button1 .SetEvent(self.moon_func)
            self.Button1 .Show()

 

what i am doing wrong?

 

Link to comment
https://metin2.dev/topic/12727-quest-python-comunication/
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Small example here:

		i = int(number)
		
		x = [0,1,2,3,4,5,6,7,8,9,10] 

		if i == x[1] and i != x[0]:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "print number_vegas: [%s]" % int(i))
			pass
		elif i == x[2] and i != x[0]:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "print number_vegas: [%s]" % int(i))	
			pass

 

Link to comment
https://metin2.dev/topic/12727-quest-python-comunication/#findComment-72917
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.