Moin,
Mein Problem ist das wenn ich meinen Ingame Swichbot Öffne Und ihn Wieder Schließe Kann Ich Ihn nicht Mehr Öffnen Nur Wenn ich Den Clienten Neustarte:
PHP Code:
import chat
import item
import net
import player
import snd
import locale
import shop
import ui
import uiTip
class SwitchBotDialog(ui.ThinBoard):
def __init__(self):
ui.ThinBoard.__init__(self)
self.LoadSwitchbotDialog()
def __del__(self):
ui.ThinBoard.__del__(self)
def Destroy(self):
self.Hide()
return TRUE
def Bonuschangevalue(self):
global Boniswitchvalue
for i in xrange(player.INVENTORY_PAGE_SIZE*2):
itemIndex = player.GetItemIndex(i)
item.SelectItem(itemIndex)
ItemValue = player.GetItemIndex(i)
if item.IsAntiFlag(74112) and item.IsFlag(8196) and item.GetItemSubType() == 18:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Gegenstand verzaubern liegt auf Value: " + str(ItemValue))
Boniswitchvalue = int(ItemValue)
elif str(item.GetItemName()) == "Gegenstand verzaubern":
chat.AppendChat(chat.CHAT_TYPE_INFO, "Gegenstand verzaubern liegt auf Value: " + str(ItemValue))
Boniswitchvalue = int(ItemValue)
global Boniswitchvalue2
for i1 in xrange(player.INVENTORY_PAGE_SIZE*2):
itemIndex1 = player.GetItemIndex(i1)
item.SelectItem(itemIndex1)
ItemValue1 = player.GetItemIndex(i1)
if item.IsAntiFlag(33152) and item.IsFlag(24576) and item.GetItemSubType() == 10:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Gegenstand segnen liegt auf Value: " + str(ItemValue1))
Boniswitchvalue2 = int(ItemValue1)
break
elif str(item.GetItemName()) == "Gegenstand segnen":
chat.AppendChat(chat.CHAT_TYPE_INFO, "Gegenstand segnen liegt auf Value: " + str(ItemValue1))
Boniswitchvalue2 = int(ItemValue1)
break
def __BreakSwitching(self):
global SwitchButton
if SwitchButton == 1:
self.LastChange.SetText("Switchvorgang wurde abgebrochen")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
else:
self.Hide()
def __BreakSwitching7(self):
global SwitchButton7
if SwitchButton7 == 1:
self.LastChange.SetText("Switchvorgang wurde abgebrochen")
self.Switchtingabbruch7.SetText("6/7 Abbrechen")
SwitchButton7 = 0
def StartSwitchBot(self):
global SwitchButton
global SwitchButton7
if SwitchButton7 != 1:
SwitchButton = 1
self.LastChange.SetText("Switchvorgang gestartet")
self.Switchtingabbruchbutton.SetText("Switchen Stoppen")
self.__Switchtingdialog()
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Entweder 1-5 oder 6/7 nicht beides")
def StartSwitchBot7(self):
global SwitchButton
global SwitchButton7
if SwitchButton != 1:
SwitchButton7 = 1
self.LastChange.SetText("Switchvorgang gestartet (6/7)")
self.__Switchtingdialog7()
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, "Entweder 1-5 oder 6/7 nicht beides")
def __Switchtingdialog7(self):
global BoniSwitchvalue2
global Bonus5
global Bonus6
global SwitchButton7
Slot = self.Slotbar.GetText()
val6, bon6 = player.GetItemAttribute((int(Slot)), 5) #(itemposition, atrribute)
val7, bon7 = player.GetItemAttribute((int(Slot)), 6) #(itemposition, atrribute)
Switchvalue = Boniswitchvalue2
Search5 = self.Bvalue6.GetText()
Search6 = self.Bvalue7.GetText()
DELAY_SEC = 0.3
#6 Bonus switchen:
if SwitchButton7 == 1:
if (int(Bonus6) == 0) and (val6 == int(Bonus5) and bon6 >= int(Search5) or (val7 == int(Bonus5) and bon7 >= int(Search5))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
SwitchButton7 = 0
#7 Bonis switchen:
elif (int(Bonus6) != 0) and (val6 == int(Bonus5) and bon6 >= int(Search5) or (val7 == int(Bonus5) and bon7 >= int(Search5))) and ((val6 == int(Bonus6) and bon6 >= int(Search6)) or (val7 == int(Bonus6) and bon7 >= int(Search6))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
SwitchButton7 = 0
elif Bonus5 == 0:
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
self.LastChange.SetText("Switchvorgang (6/7) wurde abgebrochen")
chat.AppendChat(chat.CHAT_TYPE_INFO, "Bitte trage Bonis ein oder trage sie")
chat.AppendChat(chat.CHAT_TYPE_INFO, "der Reihenfolge nach richtig ein!")
else:
self.WaitingDelay = WaitingDialog()
self.WaitingDelay.Open(float(DELAY_SEC))
self.WaitingDelay.SAFE_SetTimeOverEvent(self.__Switchtingdialog7)
for eachSlot in xrange(player.INVENTORY_PAGE_SIZE*2):
itemVNum = player.GetItemIndex(eachSlot)
if itemVNum == int(Switchvalue):
net.SendItemUseToItemPacket(eachSlot, (int(Slot)))
break
if player.GetItemCountByVnum(int(Switchvalue)) <= 1:
for eachSlot in xrange(shop.SHOP_SLOT_COUNT):
getShopItemID = shop.GetItemID(eachSlot)
if getShopItemID == int(Switchvalue) and not itemVNum == int(Switchvalue):
net.SendShopBuyPacket(eachSlot)
#1 Bonus switchen:
if SwitchButton == 1:
if (int(Bonus1) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
#2 Bonis switchen:
elif (int(Bonus2) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
#3 Bonis switchen:
elif (int(Bonus3) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
#4 Bonis switchen:
elif (int(Bonus4) == 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))) and ((val0 == int(Bonus3) and bon0 >= int(Search3)) or (val1 == int(Bonus3) and bon1 >= int(Search3)) or (val2 == int(Bonus3) and bon2 >= int(Search3)) or (val3 == int(Bonus3) and bon3 >= int(Search3)) or (val4 == int(Bonus3) and bon4 >= int(Search3))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
#5 Bonis switchen:
elif (int(Bonus4) != 0) and (val0 == int(Bonus0) and bon0 >= int(Search0) or (val1 == int(Bonus0) and bon1 >= int(Search0)) or (val2 == int(Bonus0) and bon2 >= int(Search0)) or (val3 == int(Bonus0) and bon3 >= int(Search0)) or (val4 == int(Bonus0) and bon4 >= int(Search0))) and ((val0 == int(Bonus1) and bon0 >= int(Search1)) or (val1 == int(Bonus1) and bon1 >= int(Search1)) or (val2 == int(Bonus1) and bon2 >= int(Search1)) or (val3 == int(Bonus1) and bon3 >= int(Search1)) or (val4 == int(Bonus1) and bon4 >= int(Search1))) and ((val0 == int(Bonus2) and bon0 >= int(Search2)) or (val1 == int(Bonus2) and bon1 >= int(Search2)) or (val2 == int(Bonus2) and bon2 >= int(Search2)) or (val3 == int(Bonus2) and bon3 >= int(Search2)) or (val4 == int(Bonus2) and bon4 >= int(Search2))) and ((val0 == int(Bonus3) and bon0 >= int(Search3)) or (val1 == int(Bonus3) and bon1 >= int(Search3)) or (val2 == int(Bonus3) and bon2 >= int(Search3)) or (val3 == int(Bonus3) and bon3 >= int(Search3)) or (val4 == int(Bonus3) and bon4 >= int(Search3))) and ((val0 == int(Bonus4) and bon0 >= int(Search4)) or (val1 == int(Bonus4) and bon1 >= int(Search4)) or (val2 == int(Bonus4) and bon2 >= int(Search4)) or (val3 == int(Bonus4) and bon3 >= int(Search4)) or (val4 == int(Bonus4) and bon4 >= int(Search4))):
self.BoardMessage.SetTip("Switching erfolgreich")
self.BoardMessage.SetTop()
self.LastChange.SetText("Switchbot sucessfull")
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
elif Bonus0 == 0:
self.Switchtingabbruchbutton.SetText("Abbrechen")
SwitchButton = 0
self.LastChange.SetText("Switchvorgang wurde abgebrochen")
chat.AppendChat(chat.CHAT_TYPE_INFO, "Bitte trage Bonis ein oder trage sie")
chat.AppendChat(chat.CHAT_TYPE_INFO, "der Reihenfolge nach richtig ein!")
else:
self.WaitingDelay = WaitingDialog()
self.WaitingDelay.Open(float(DELAY_SEC))
self.WaitingDelay.SAFE_SetTimeOverEvent(self.__Switchtingdialog)
for eachSlot in xrange(player.INVENTORY_PAGE_SIZE*2):
itemVNum = player.GetItemIndex(eachSlot)
if itemVNum == int(Switchvalue):
net.SendItemUseToItemPacket(eachSlot, (int(Slot)))
break
if player.GetItemCountByVnum(int(Switchvalue)) <= 1:
for eachSlot in xrange(shop.SHOP_SLOT_COUNT):
getShopItemID = shop.GetItemID(eachSlot)
if getShopItemID == int(Switchvalue) and not itemVNum == int(Switchvalue):
net.SendShopBuyPacket(eachSlot)
def __Resetbonusall(self):
global Bonus0
global Bonus1
global Bonus2
global Bonus3
global Bonus4
Bonus0 = 0
Bonus1 = 0
Bonus2 = 0
Bonus3 = 0
Bonus4 = 0
self.Bvalue1.SetText("0")
self.Bvalue2.SetText("0")
self.Bvalue3.SetText("0")
self.Bvalue4.SetText("0")
self.Bvalue5.SetText("0")
self.Bonus1Attr.SetText("-")
self.Bonus2Attr.SetText("-")
self.Bonus3Attr.SetText("-")
self.Bonus4Attr.SetText("-")
self.Bonus5Attr.SetText("-")
self.LastChange.SetText("Deleted saved Bonis")
def __Wish_1_Option(self):
global Bonus0
global PRESSWISH0
PRESSWISH0 = 1
self.BonusListBox = FileListDialog()
def __Wish_2_Option(self):
global Bonus1
global PRESSWISH1
PRESSWISH1 = 1
self.BonusListBox = FileListDialog()
def __Wish_3_Option(self):
global Bonus2
global PRESSWISH2
PRESSWISH2 = 1
self.BonusListBox = FileListDialog()
def __Wish_4_Option(self):
global Bonus3
global PRESSWISH3
PRESSWISH3 = 1
self.BonusListBox = FileListDialog()
def __Wish_5_Option(self):
global Bonus4
global PRESSWISH4
PRESSWISH4 = 1
self.BonusListBox = FileListDialog()
def __Wish_6_Option(self):
global Bonus5
global PRESSWISH5
PRESSWISH5 = 1
self.BonusListBox = FileListDialog()
def __Wish_7_Option(self):
global Bonus6
global PRESSWISH6
PRESSWISH6 = 1
self.BonusListBox = FileListDialog()
def OnUpdate(self):
global Bonus0
global Bonus1
global Bonus2
global Bonus3
global Bonus4
global Bonus5
global Bonus6
if self.Bonus1Attr.GetText() != str(BonusListe[int(Bonus0)]) and int(Bonus0) != 0:
self.Bonus1Attr.SetText(str(BonusListe[int(Bonus0)]))
elif self.Bonus1Attr.GetText() != "" and int(Bonus0) == 0:
self.Bonus1Attr.SetText("-")
if self.Bonus2Attr.GetText() != str(BonusListe[int(Bonus1)]) and int(Bonus1) != 0:
self.Bonus2Attr.SetText(str(BonusListe[int(Bonus1)]))
elif self.Bonus2Attr.GetText() != "" and int(Bonus1) == 0:
self.Bonus2Attr.SetText("-")
if self.Bonus3Attr.GetText() != str(BonusListe[int(Bonus2)]) and int(Bonus2) != 0:
self.Bonus3Attr.SetText(str(BonusListe[int(Bonus2)]))
elif self.Bonus3Attr.GetText() != "" and int(Bonus2) == 0:
self.Bonus3Attr.SetText("-")
if self.Bonus4Attr.GetText() != str(BonusListe[int(Bonus3)]) and int(Bonus3) != 0:
self.Bonus4Attr.SetText(str(BonusListe[int(Bonus3)]))
elif self.Bonus4Attr.GetText() != "" and int(Bonus3) == 0:
self.Bonus4Attr.SetText("-")
if self.Bonus5Attr.GetText() != str(BonusListe[int(Bonus4)]) and int(Bonus4) != 0:
self.Bonus5Attr.SetText(str(BonusListe[int(Bonus4)]))
elif self.Bonus5Attr.GetText() != "" and int(Bonus4) == 0:
self.Bonus5Attr.SetText("-")
if self.Bonus6Attr.GetText() != str(BonusListe[int(Bonus5)]) and int(Bonus5) != 0:
self.Bonus6Attr.SetText(str(BonusListe[int(Bonus5)]))
elif self.Bonus6Attr.GetText() != "" and int(Bonus5) == 0:
self.Bonus6Attr.SetText("-")
if self.Bonus7Attr.GetText() != str(BonusListe[int(Bonus6)]) and int(Bonus6) != 0:
self.Bonus7Attr.SetText(str(BonusListe[int(Bonus6)]))
elif self.Bonus7Attr.GetText() != "" and int(Bonus6) == 0:
self.Bonus7Attr.SetText("-")
if self.Bonus1Var.GetText() != self.Bvalue1.GetText():
self.Bonus1Var.SetText(str(self.Bvalue1.GetText()))
if self.Bonus2Var.GetText() != self.Bvalue2.GetText():
self.Bonus2Var.SetText(str(self.Bvalue2.GetText()))
if self.Bonus3Var.GetText() != self.Bvalue3.GetText():
self.Bonus3Var.SetText(str(self.Bvalue3.GetText()))
if self.Bonus4Var.GetText() != self.Bvalue4.GetText():
self.Bonus4Var.SetText(str(self.Bvalue4.GetText()))
if self.Bonus5Var.GetText() != self.Bvalue5.GetText():
self.Bonus5Var.SetText(str(self.Bvalue5.GetText()))
if self.Bonus6Var.GetText() != self.Bvalue6.GetText():
self.Bonus6Var.SetText(str(self.Bvalue6.GetText()))
if self.Bonus7Var.GetText() != self.Bvalue7.GetText():
self.Bonus7Var.SetText(str(self.Bvalue7.GetText()))
Python Problem!!! 08/22/2012 - Metin2 - 2 Replies HeyHo ich bins mal wieder mit einem Python Problem xD undzwar wollte ich einfach mal wissen wie man VID's über eine gnaze map scannen kann =) ich kriege es nur so hin das ich alle VID's in sichtweite gefasst kriege bitte um hilfe!!!:handsdown::handsdown:
Python Problem 08/09/2012 - Metin2 - 2 Replies Wollte mal eine frage an die Python kenne stellen ich habe ein Problem wollte mal mit Python in metin2 anfangen und wollte etwas ganz leichtes machen aber pustekuchen es funzt nicht.....
import chat
chat.AppendChat(chat.CHAT_TYPE_NOTICE, "Metin2 ")
Python Problem :S 07/12/2012 - Metin2 Private Server - 8 Replies Haillo, wie euch schon mein Thread "vorraussagt" habe ich einen Python Problem.
Das Problem ist folgendes, ich habe einen neuen Button eingebaut wenn ich jedoch auf dem Button drücke (Funktion eingebunden) passiert rein garnichts.
Die Syserr sagt lediglich folgendes aus:
0709 16:40:40787 :: Traceback (most recent call last):
0709 16:40:40788 :: File "ui.py", line 1006, in CallEvent
0709 16:40:40788 :: File "ui.py", line 87, in __call__
[PROBLEM]Python Uhr 03/18/2012 - General Coding - 3 Replies Hallo, Ich habe solch ein Script
lt = time.localtime()
jahr,monat,tag,stunde,minute,sekunde = lt
zeit = "%02i:%02i:%02i" % (stunde, minute, sekunde)
Nun mache ich z.b.
"text" : zeit,
Python Problem. 10/29/2011 - Metin2 Private Server - 4 Replies Hey Leute. Ich wollte gerade Python auf Freebsd 8.2 installieren nach dem Tut.
http://www.elitepvpers.com/forum/metin2-pserver-g uides-strategies/937110-how2-python-f-r-alles.html
Nach make install clean kommt ein Fenster ich gehe auf Close doch nun kommt.
Horny# cd /usr/ports/lang/python
Horny# make install clean
===> Installing for python-2.7,2
===> python-2.7,2 depends on file: /usr/local/bin/python2.7 - not found