Jump to content

Recommended Posts

  • Premium
Can anyone tell me how can I make one Puchar def game.py in another py already tried these form but not one was
 
self.abrir = game.GameWindow()
self.abrir.abrirlogo()
 
 
game.GameWindow.abrirlogo()
 
x=game.GameWindow.abrirlogo()
x=game.GameWindow().abrirlogo()
Link to comment
https://metin2.dev/topic/6068-help-import-fuction-in-gamepy/
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Active+ Member

You can not use directly game function, so you need a hook

 

add your script under def __init__

self.Inithookabrir()
Add this function in your script

 

 

def Inithookabrir(self):
	global oldAbrir
	oldAbrir = game.GameWindow.abrirlogo
	game.GameWindow.abrirlogo = self.Abrir
 

and you use with like this

 

 

oldAbrir = 0
def Abrir(self):
	"""add Your functions"""
	
	global oldAbrir
	self.oldAbrir()
  • Premium

You can not use directly game function, so you need a hook

 

add your script under def __init__

self.Inithookabrir()
Add this function in your script

 

 

def Inithookabrir(self):
	global oldAbrir
	oldAbrir = game.GameWindow.abrirlogo
	game.GameWindow.abrirlogo = self.Abrir
 

and you use with like this

 

 

oldAbrir = 0
def Abrir(self):
	"""add Your functions"""
	
	global oldAbrir
	self.oldAbrir()
0323 13:01:48104 :: Traceback (most recent call last):
 
0323 13:01:48104 ::   File "ui.py", line 1022, in CallEvent
 
0323 13:01:48109 ::     
0323 13:01:48109 :: apply(self.eventFunc, self.eventArgs)
 
0323 13:01:48109 ::   File "Djssnob.py", line 58, in a_func
 
0323 13:01:48110 ::     
0323 13:01:48110 :: self.oldAbrir()
 
0323 13:01:48110 :: AttributeError
0323 13:01:48110 :: : 
0323 13:01:48110 :: 'Dialog1' object has no attribute 'oldAbrir'

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.