|
You last visited: Today at 11:03
Advertisement
[MOD]Easy-Chatblock + Kick
Discussion on [MOD]Easy-Chatblock + Kick within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
04/11/2011, 17:41
|
#16
|
elite*gold: 0
Join Date: Nov 2010
Posts: 165
Received Thanks: 313
|
sieht nice aus.
thanks given.
|
|
|
04/11/2011, 17:49
|
#17
|
elite*gold: 149
Join Date: Feb 2010
Posts: 1,298
Received Thanks: 346
|
Erstmal auch von mir ein Thanks, das ist echt nice
Aber irgendwie klappt es bei mir nicht Oo. Das Game stürtzt vor der Charackterauswahl ab...
In der root_pack.xml habe ich das drin stehen...
Code:
<File archivedPath="uichatblock.py" type="2"><![CDATA[Source\uichatblock.py]]></File>
<File archivedPath="chatblockdialog.py" type="2"><![CDATA[Source\uiscript\chatblockdialog.py]]></File>
</Action>
</Buildfile>
Ist das richtig?
Und in der uitarget.py steht das hier (höffentlich nicht zu lang  )
Code:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import locale
import constInfo
import uiChatBlock
class TargetBoard(ui.ThinBoard):
BUTTON_NAME_LIST = (
locale.TARGET_BUTTON_WHISPER,
locale.TARGET_BUTTON_EXCHANGE,
locale.TARGET_BUTTON_FIGHT,
locale.TARGET_BUTTON_ACCEPT_FIGHT,
locale.TARGET_BUTTON_AVENGE,
locale.TARGET_BUTTON_FRIEND,
locale.TARGET_BUTTON_INVITE_PARTY,
locale.TARGET_BUTTON_LEAVE_PARTY,
locale.TARGET_BUTTON_EXCLUDE,
locale.TARGET_BUTTON_INVITE_GUILD,
locale.TARGET_BUTTON_DISMOUNT,
locale.TARGET_BUTTON_EXIT_OBSERVER,
locale.TARGET_BUTTON_VIEW_EQUIPMENT,
locale.TARGET_BUTTON_REQUEST_ENTER_PARTY,
locale.TARGET_BUTTON_BUILDING_DESTROY,
locale.TARGET_BUTTON_EMOTION_ALLOW,
"Kick",
"ChatBlock",
)
GRADE_NAME = {
nonplayer.PAWN : locale.TARGET_LEVEL_PAWN,
nonplayer.S_PAWN : locale.TARGET_LEVEL_S_PAWN,
nonplayer.KNIGHT : locale.TARGET_LEVEL_KNIGHT,
nonplayer.S_KNIGHT : locale.TARGET_LEVEL_S_KNIGHT,
nonplayer.BOSS : locale.TARGET_LEVEL_BOSS,
nonplayer.KING : locale.TARGET_LEVEL_KING,
}
EXCHANGE_LIMIT_RANGE = 3000
def __init__(self):
ui.ThinBoard.__init__(self)
name = ui.TextLine()
name.SetParent(self)
name.SetDefaultFontName()
name.SetOutline()
name.Show()
hpGauge = ui.Gauge()
hpGauge.SetParent(self)
hpGauge.SetPosition(175, 17)
hpGauge.MakeGauge(130, "red")
hpGauge.SetWindowHorizontalAlignRight()
hpGauge.Hide()
closeButton = ui.Button()
closeButton.SetParent(self)
closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
closeButton.SetPosition(30, 13)
closeButton.SetWindowHorizontalAlignRight()
closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
closeButton.Show()
self.buttonDict = {}
self.showingButtonList = []
for buttonName in self.BUTTON_NAME_LIST:
button = ui.Button()
button.SetParent(self)
button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
button.SetWindowHorizontalAlignCenter()
button.SetText(buttonName)
button.Hide()
self.buttonDict[buttonName] = button
self.showingButtonList.append(button)
self.buttonDict[locale.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
self.buttonDict["Kick"].SetEvent(ui.__mem_func__(self.OnKick))
self.buttonDict["ChatBlock"].SetEvent(ui.__mem_func__(self.OnChatBlock)
self.buttonDict[locale.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
self.buttonDict[locale.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
self.buttonDict[locale.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
self.buttonDict[locale.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
self.buttonDict[locale.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
self.buttonDict[locale.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
self.buttonDict[locale.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))
self.buttonDict[locale.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
self.buttonDict[locale.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
self.buttonDict[locale.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
self.buttonDict[locale.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
self.buttonDict[locale.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
self.name = name
dlgChatBlock = uiChatBlock.ChatBlockDialog()
dlgChatBlock.LoadDialog()
dlgChatBlock.SetTitleName("ChatBlock")
dlgChatBlock.Hide()
self.dlgChatBlock = dlgChatBlock
self.hpGauge = hpGauge
self.closeButton = closeButton
self.nameString = 0
self.nameLength = 0
self.vid = 0
self.eventWhisper = None
self.isShowButton = FALSE
self.__Initialize()
self.ResetTargetBoard()
def __del__(self):
ui.ThinBoard.__del__(self)
print "===================================================== DESTROYED TARGET BOARD"
def __Initialize(self):
self.nameString = ""
self.nameLength = 0
self.vid = 0
self.isShowButton = FALSE
def Destroy(self):
self.dlgChatBlock.Destroy()
self.dlgChatBlock = 0
self.eventWhisper = None
self.closeButton = None
self.showingButtonList = None
self.buttonDict = None
self.name = None
self.hpGauge = None
self.__Initialize()
def OnPressedCloseButton(self):
player.ClearTarget()
self.Close()
def Close(self):
self.__Initialize()
self.Hide()
def Open(self, vid, name):
if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
if not player.IsSameEmpire(vid):
self.Hide()
return
if vid != self.GetTargetVID():
self.ResetTargetBoard()
self.SetTargetVID(vid)
self.SetTargetName(name)
if player.IsMainCharacterIndex(vid):
self.__ShowMainCharacterMenu()
elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
self.Hide()
else:
self.RefreshButton()
self.Show()
def Refresh(self):
if self.IsShow():
if self.IsShowButton():
self.RefreshButton()
def RefreshByVID(self, vid):
if vid == self.GetTargetVID():
self.Refresh()
def RefreshByName(self, name):
if name == self.GetTargetName():
self.Refresh()
def __ShowMainCharacterMenu(self):
canShow=0
self.HideAllButton()
if player.IsMountingHorse():
self.__ShowButton(locale.TARGET_BUTTON_DISMOUNT)
canShow=1
if player.IsObserverMode():
self.__ShowButton(locale.TARGET_BUTTON_EXIT_OBSERVER)
canShow=1
if canShow:
self.__ArrangeButtonPosition()
self.Show()
else:
self.Hide()
def SetWhisperEvent(self, event):
self.eventWhisper = event
def UpdatePosition(self):
self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)
def ResetTargetBoard(self):
for btn in self.buttonDict.values():
btn.Hide()
self.__Initialize()
self.name.SetPosition(0, 13)
self.name.SetHorizontalAlignCenter()
self.name.SetWindowHorizontalAlignCenter()
self.hpGauge.Hide()
self.SetSize(250, 40)
def SetTargetVID(self, vid):
self.vid = vid
def SetEnemyVID(self, vid):
self.SetTargetVID(vid)
name = chr.GetNameByVID(vid)
level = nonplayer.GetLevelByVID(vid)
grade = nonplayer.GetGradeByVID(vid)
nameFront = ""
if -1 != level:
nameFront += "Lv." + str(level) + " "
if self.GRADE_NAME.has_key(grade):
nameFront += "(" + self.GRADE_NAME[grade] + ") "
self.SetTargetName(nameFront + name)
def GetTargetVID(self):
return self.vid
def GetTargetName(self):
return self.nameString
def SetTargetName(self, name):
self.nameString = name
self.nameLength = len(name)
self.name.SetText(name)
def SetHP(self, hpPercentage):
if not self.hpGauge.IsShow():
self.name.SetPosition(23, 13)
self.name.SetWindowHorizontalAlignLeft()
self.name.SetHorizontalAlignLeft()
self.hpGauge.Show()
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
self.UpdatePosition()
self.hpGauge.SetPercentage(hpPercentage, 100)
def ShowDefaultButton(self):
self.isShowButton = TRUE
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])
for button in self.showingButtonList:
button.Show()
def HideAllButton(self):
self.isShowButton = FALSE
for button in self.showingButtonList:
button.Hide()
self.showingButtonList = []
def __ShowButton(self, name):
if not self.buttonDict.has_key(name):
return
self.buttonDict[name].Show()
self.showingButtonList.append(self.buttonDict[name])
def __HideButton(self, name):
if not self.buttonDict.has_key(name):
return
button = self.buttonDict[name]
button.Hide()
for btnInList in self.showingButtonList:
if btnInList == button:
self.showingButtonList.remove(button)
break
def OnWhisper(self):
if None != self.eventWhisper:
self.eventWhisper(self.nameString)
def OnExchange(self):
net.SendExchangeStartPacket(self.vid)
def OnPVP(self):
net.SendChatPacket("/pvp %d" % (self.vid))
def OnAppendToMessenger(self):
net.SendMessengerAddByVIDPacket(self.vid)
def OnPartyInvite(self):
net.SendPartyInvitePacket(self.vid)
def OnPartyExit(self):
net.SendPartyExitPacket()
def OnPartyRemove(self):
net.SendPartyRemovePacket(self.vid)
def __OnGuildAddMember(self):
net.SendGuildAddMemberPacket(self.vid)
def __OnDismount(self):
net.SendChatPacket("/unmount")
def __OnExitObserver(self):
net.SendChatPacket("/observer_exit")
def __OnViewEquipment(self):
net.SendChatPacket("/view_equip " + str(self.vid))
def __OnRequestParty(self):
net.SendChatPacket("/party_request " + str(self.vid))
def __OnDestroyBuilding(self):
net.SendChatPacket("/build d %d" % (self.vid))
def __OnEmotionAllow(self):
net.SendChatPacket("/emotion_allow %d" % (self.vid))
def OnPressEscapeKey(self):
self.OnPressedCloseButton()
return TRUE
def IsShowButton(self):
return self.isShowButton
def RefreshButton(self):
self.HideAllButton()
if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
#self.__ShowButton(locale.TARGET_BUTTON_BUILDING_DESTROY)
#self.__ArrangeButtonPosition()
return
if player.IsPVPInstance(self.vid) or player.IsObserverMode():
# PVP_INFO_SIZE_BUG_FIX
self.SetSize(200 + 7*self.nameLength, 40)
self.UpdatePosition()
# END_OF_PVP_INFO_SIZE_BUG_FIX
return
self.ShowDefaultButton()
if str(player.GetName())[0] == "[":
self.__ShowButton("Kick")
self.__ShowButton("ChatBlock")
if guild.MainPlayerHasAuthority(guild.AUTH_ADD_MEMBER):
if not guild.IsMemberByName(self.nameString):
if 0 == chr.GetGuildID(self.vid):
self.__ShowButton(locale.TARGET_BUTTON_INVITE_GUILD)
if not messenger.IsFriendByName(self.nameString):
self.__ShowButton(locale.TARGET_BUTTON_FRIEND)
if player.IsPartyMember(self.vid):
self.__HideButton(locale.TARGET_BUTTON_FIGHT)
if player.IsPartyLeader(self.vid):
self.__ShowButton(locale.TARGET_BUTTON_LEAVE_PARTY)
elif player.IsPartyLeader(player.GetMainCharacterIndex()):
self.__ShowButton(locale.TARGET_BUTTON_EXCLUDE)
else:
if player.IsPartyMember(player.GetMainCharacterIndex()):
if player.IsPartyLeader(player.GetMainCharacterIndex()):
self.__ShowButton(locale.TARGET_BUTTON_INVITE_PARTY)
else:
if chr.IsPartyMember(self.vid):
self.__ShowButton(locale.TARGET_BUTTON_REQUEST_ENTER_PARTY)
else:
self.__ShowButton(locale.TARGET_BUTTON_INVITE_PARTY)
if player.IsRevengeInstance(self.vid):
self.__HideButton(locale.TARGET_BUTTON_FIGHT)
self.__ShowButton(locale.TARGET_BUTTON_AVENGE)
elif player.IsChallengeInstance(self.vid):
self.__HideButton(locale.TARGET_BUTTON_FIGHT)
self.__ShowButton(locale.TARGET_BUTTON_ACCEPT_FIGHT)
elif player.IsCantFightInstance(self.vid):
self.__HideButton(locale.TARGET_BUTTON_FIGHT)
if not player.IsSameEmpire(self.vid):
self.__HideButton(locale.TARGET_BUTTON_INVITE_PARTY)
self.__HideButton(locale.TARGET_BUTTON_FRIEND)
self.__HideButton(locale.TARGET_BUTTON_FIGHT)
distance = player.GetCharacterDistance(self.vid)
if distance > self.EXCHANGE_LIMIT_RANGE:
self.__HideButton(locale.TARGET_BUTTON_EXCHANGE)
self.__ArrangeButtonPosition()
self.__ArrangeButtonPosition()
def __ArrangeButtonPosition(self):
showingButtonCount = len(self.showingButtonList)
pos = -(showingButtonCount / 2) * 68
if 0 == showingButtonCount % 2:
pos += 34
for button in self.showingButtonList:
button.SetPosition(pos, 33)
pos += 68
self.SetSize(max(150, showingButtonCount * 75), 65)
self.UpdatePosition()
def OnUpdate(self):
if self.isShowButton:
exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE]
distance = player.GetCharacterDistance(self.vid)
if distance < 0:
return
if exchangeButton.IsShow():
if distance > self.EXCHANGE_LIMIT_RANGE:
self.RefreshButton()
else:
if distance < self.EXCHANGE_LIMIT_RANGE:
self.RefreshButton()
def OnKick(self):
net.SendChatPacket("/dc " + str(chr.GetNameByVID(self.vid)))
def OnChatBlock(self):
#if os.path.exists('gm.txt') and os.path.isfile('gm.txt'):
if str(player.GetName())[0] == "[":
self.dlgChatBlock.SetTitleName("ChatBlock: " + str(chr.GetNameByVID(self.vid)))
self.dlgChatBlock.Open(str(chr.GetNameByVID(self.vid)))
Ich hoffe jemand kann mir helfen, wäre echt nett
|
|
|
04/11/2011, 18:15
|
#18
|
elite*gold: 190
Join Date: Nov 2008
Posts: 1,670
Received Thanks: 3,365
|
poste am besten mal den inhalt deiner syserr.txt, dann kann ich dir sagen, wo der fehler liegt.
@Lexico: maybe
|
|
|
04/11/2011, 18:18
|
#19
|
elite*gold: 149
Join Date: Feb 2010
Posts: 1,298
Received Thanks: 346
|
Okay, hier ist die syserr.txt...
Quote:
0411 17:46:03330 ::
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:18) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect_new.py(line:25) ?
system.py(line:130) __pack_import
networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 90)
0411 17:46:03330 :: ================================================== ================================================== ========
0411 17:46:03330 :: Abort!!!!
|
|
|
|
04/11/2011, 18:43
|
#20
|
elite*gold: 60
Join Date: May 2010
Posts: 766
Received Thanks: 1,025
|
i have the same syserr from critone
|
|
|
04/11/2011, 18:43
|
#21
|
elite*gold: 190
Join Date: Nov 2008
Posts: 1,670
Received Thanks: 3,365
|
ah, es ist ein fehler meinerseits. es fehlt in zeile 89 der uitarget.py eine klammer.
geh einfach ans ende von zeile 89 und mach ) hin.
|
|
|
04/11/2011, 18:46
|
#22
|
elite*gold: 60
Join Date: May 2010
Posts: 766
Received Thanks: 1,025
|
how to fix?
if you release your uitarget.py i can compare with my and see where is the problem
|
|
|
04/11/2011, 18:55
|
#23
|
elite*gold: 0
Join Date: Mar 2010
Posts: 14
Received Thanks: 1
|
danke
|
|
|
04/11/2011, 19:13
|
#24
|
elite*gold: 149
Join Date: Feb 2010
Posts: 1,298
Received Thanks: 346
|
Jetzt schließt sich das Spiel nach dem Ladebalken  XD
Vieleicht kanst du mir da auch helfen...wäre nett
syseer.txt:
Quote:
LoadScriptFile - exceptions.IOError:No file or directory
0411 19:10:30053 :: ================================================== ================================================== ========
0411 19:10:30053 :: Abort!!!!
0411 19:10:30053 ::
uiChatBlock.py(line:19) LoadDialog
ui.py(line:2517) LoadScriptFile
exception.py(line:36) Abort
MoneyDialog.LoadDialog.LoadScript - exceptions.SystemExit:
0411 19:10:30053 :: ================================================== ================================================== ========
0411 19:10:30053 :: Abort!!!!
|
|
|
|
04/11/2011, 19:51
|
#25
|
elite*gold: 3
Join Date: Oct 2010
Posts: 390
Received Thanks: 463
|
also bei mir gehts jetzt! richtig gut man sau geil
#THX give!
|
|
|
04/11/2011, 20:01
|
#26
|
elite*gold: 140
Join Date: Mar 2009
Posts: 1,345
Received Thanks: 194
|
Nice thx
Das ist echt hilfreich, gleich mal einbauen und testen.
|
|
|
04/11/2011, 20:42
|
#27
|
elite*gold: 190
Join Date: Nov 2008
Posts: 1,670
Received Thanks: 3,365
|
Quote:
Originally Posted by Critone
Jetzt schließt sich das Spiel nach dem Ladebalken  XD
Vieleicht kanst du mir da auch helfen...wäre nett
syseer.txt:
|
das heißt, dass die datei UIScript/chatblockDialog.py nicht existiert.
überprüfe das am besten nochmal (eben hast du ja was aus der repack-xml gepostet, es sieht so aus, als ob du chatblockDialog.py nicht in das uiscript-archiv, sondern auch ins root-archiv gepackt hättest).
|
|
|
04/11/2011, 20:45
|
#28
|
elite*gold: 60
Join Date: May 2010
Posts: 766
Received Thanks: 1,025
|
if you dont put this
Der Dialog muss auch wieder entladen werden können, also sucht nach
Code:
def Destroy(self):
und schreibt darunter
Code:
self.dlgChatBlock.Destroy()
self.dlgChatBlock = 0
the script work 100%
|
|
|
04/11/2011, 20:48
|
#29
|
elite*gold: 190
Join Date: Nov 2008
Posts: 1,670
Received Thanks: 3,365
|
Quote:
Originally Posted by Lexico
if you dont put this
Der Dialog muss auch wieder entladen werden können, also sucht nach
Code:
def Destroy(self):
und schreibt darunter
Code:
self.dlgChatBlock.Destroy()
self.dlgChatBlock = 0
the script work 100%
|
yes, you can leave it out, it´s not necessary to unload it.
|
|
|
04/11/2011, 21:04
|
#30
|
elite*gold: 32
Join Date: Dec 2010
Posts: 1,294
Received Thanks: 862
|
Das woltle ich dich gerade fragen 
Nice sache echt!
|
|
|
 |
|
Similar Threads
|
help me leute chatblock
03/27/2011 - Metin2 Private Server - 3 Replies
Hallo leute ich will jemand chatblock geben und es geht ned obwoll ich alles richtig mache und er kann weiter schreiben kann mir vill jemand helfen?
|
Chatblock direkt..
01/18/2011 - Metin2 Private Server - 5 Replies
Hey,
Bei Metin2.DE bekommt man ja direkt einen Chatblock wenn man z.B. die Namen der Yangseller in den Chat schreibt. Nun ist meine Frage wie die das eingestellt haben bzw. ob das eine neue Funktion der '10er Files ist? Hat jemand eine Idee :D?
|
Chatblock umgehen?
09/29/2010 - Metin2 - 4 Replies
Hey Com..
wollte schon immer mal wissen , ob man nen chatblock umgehen kann..
ich frage mich , wo das gespeichert wird.. kann man am client rumspielen ?
das man trotz chatblock einfach weiter schreiben kann?
|
ChatBlock wegmachen ?
07/13/2010 - Metin2 Private Server - 2 Replies
Kann man einen Chatblock machen wolte nämlich nur 10 Stunden machen habe jetzt 102 Tage pls help
|
Chatblock entnehmen
01/16/2010 - Metin2 Private Server - 3 Replies
Welchen befehl brauche ich um den chatblock zu entnehmen von einem spieler?
Bitte um schnelle antwort thx
|
All times are GMT +1. The time now is 11:04.
|
|