hey bin leider noch blutiger Pythonanfänger :D weiß jemand wie man in Python schreibt, dass ein Item auf einem bestimmten Slot nach einer bestimmten Zeit fallen gelassen wird ? (soll für eine art biobug sein)
mfg Syrinx
mfg Syrinx
import ui
#uiLernBoard
class lernWindow(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.LoadBoard()
def LoadBoard(self):
self.Board= ui.Board()
self.Board.SetSize(300,300)
self.Board.SetCenterPosition()
self.Board.AddFlag("movable")
self.Board.AddFlag("float")
self.Board.Show()
def __del__(self):
self.Hide()
return TRUE
def Destroy(self):
self.Board.Show()
def Close(self):
self.Destroy()
onPressKeyDict[app.DIK_F10] = lambda : self.__HalloWelt()
onPressKeyDict[app.DIK_F11] = lambda : self.OpenBoardByNoa()
def __HalloWelt(self):
net.SendChatPacket("Hier komme ich!")
def OpenBoardByNoa(self):
self.LernBoard = uiLernBoard.LernWindow()
self.LernBoard.Show()
Syserr?Quote:
Beim ladebildschirm hängt es, hier den script
funktionenPHP Code:import ui
#uiLernBoard
class lernWindow(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.LoadBoard()
def LoadBoard(self):
self.Board= ui.Board()
self.Board.SetSize(300,300)
self.Board.SetCenterPosition()
self.Board.AddFlag("movable")
self.Board.AddFlag("float")
self.Board.Show()
def __del__(self):
self.Hide()
return TRUE
def Destroy(self):
self.Board.Show()
def Close(self):
self.Destroy()
PHP Code:onPressKeyDict[app.DIK_F10] = lambda : self.__HalloWelt()
onPressKeyDict[app.DIK_F11] = lambda : self.OpenBoardByNoa()
PHP Code:def __HalloWelt(self):
net.SendChatPacket("Hier komme ich!")
def OpenBoardByNoa(self):
self.LernBoard = uiLernBoard.LernWindow()
self.LernBoard.Show()
0406 04:59:24745 :: 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.
0406 04:59:25953 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/etc/buff/drugup_green.mse) Error
0406 04:59:25954 :: CInstanceBase::RegisterEffect(eEftType=108, c_szEftAttachBone=, c_szEftName=d:/ymir work/effect/etc/buff/drugup_green.mse, isCache=0) - Error
0406 04:59:25965 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/etc/buff/prestige6.mse) Error
0406 04:59:25965 :: CInstanceBase::RegisterEffect(eEftType=116, c_szEftAttachBone=, c_szEftName=d:/ymir work/effect/etc/buff/prestige6.mse, isCache=0) - Error
0406 04:59:32697 :: Traceback (most recent call last):
0406 04:59:32697 :: File "networkModule.py", line 231, in SetGamePhase
0406 04:59:32697 :: File "system.py", line 130, in __pack_import
0406 04:59:32697 :: File "system.py", line 110, in _process_result
0406 04:59:32697 :: File "game.py", line 28, in ?
0406 04:59:32698 :: File "system.py", line 137, in __pack_import
0406 04:59:32698 :: ImportError
0406 04:59:32698 :: :
0406 04:59:32698 :: No module named uiLernBoard
0406 04:59:32698 ::
er sagt das uiLernBoard.py nicht existiert bzw er kann jedenfalls nicht finden. Entweder du hast es nicht gepackt oder das spackt wegen der groß und klein Schreibung wieder rum :)Quote:
habe die Datei im root Verzeichnis, habe sie auch gepackt.PHP Code:0406 04:59:24745 :: 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.
0406 04:59:25953 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/etc/buff/drugup_green.mse) Error
0406 04:59:25954 :: CInstanceBase::RegisterEffect(eEftType=108, c_szEftAttachBone=, c_szEftName=d:/ymir work/effect/etc/buff/drugup_green.mse, isCache=0) - Error
0406 04:59:25965 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/etc/buff/prestige6.mse) Error
0406 04:59:25965 :: CInstanceBase::RegisterEffect(eEftType=116, c_szEftAttachBone=, c_szEftName=d:/ymir work/effect/etc/buff/prestige6.mse, isCache=0) - Error
0406 04:59:32697 :: Traceback (most recent call last):
0406 04:59:32697 :: File "networkModule.py", line 231, in SetGamePhase
0406 04:59:32697 :: File "system.py", line 130, in __pack_import
0406 04:59:32697 :: File "system.py", line 110, in _process_result
0406 04:59:32697 :: File "game.py", line 28, in ?
0406 04:59:32698 :: File "system.py", line 137, in __pack_import
0406 04:59:32698 :: ImportError
0406 04:59:32698 :: :
0406 04:59:32698 :: No module named uiLernBoard
0406 04:59:32698 ::
Quote:
Raised when an import statement fails to find the module definition or when a from ... import fails to find a name that is to be imported.
def OpenBoardByNoa(self):
self.LernBoard = uiLernBoard.LernWindow()
self.LernBoard.Show()
import uiLernBoard
Richtig, zuerst sollte man Python lernen und dann auf Metin2 umsteigen, mit 1% Python wissen kann man nichts anfangen.Quote:
Ja klar, aber du erklärst in deinem Tutorial wichtige Sachen nicht exakt/ falsch, dadurch prägt sich einer der das jetzt liest ein und wundert sich dann wenn er irgendwo anders eine andere Bedeutung dafür findet...
def x():
return 7
# Abgekürzt so:
x=lambda: 7
def pow(x,y):
return x**y
# Abgekürzt so:
pow = lambda x,y: x**y
ich hab mit questen auch bei 0 angefagen ohne vorher lua zu lernenQuote:
Richtig, zuerst sollte man Python lernen und dann auf Metin2 umsteigen, mit 1% Python wissen kann man nichts anfangen.
btw:
Wie soll ein kompletter Anfänger wissen was lambda bedeutet ?Code:def x(): return 7 # Abgekürzt so: x=lambda: 7 def pow(x,y): return x**y # Abgekürzt so: pow = lambda x,y: x**y
Quote:
No module named uiLernBoard