Dean 84 Posted July 29, 2018 Share Posted July 29, 2018 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hi devs, I'd like to share a script I developed the other night whilst working on a project, this script is meant to improve the quality of life of Metin2 as often players find it hard to accurately tell the cooldown of skills and end up spamming their keyboards like many of us have. Preview: Without any further ado, let's dig right into coding this bad boy. We start with locale: Spoiler First you will have to unpack your locale and look for taskbar.py in your ui folder and look for the following: "name" : "quick_slot_1", ... "children" : And replace the content of "children" : ( ... ), with this: { "name" : "slot_1", "type" : "image", "x" : 3, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/1.sub", "children" : ( { "name" : "slot_1_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, { "name" : "slot_2", "type" : "image", "x" : 35, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/2.sub", "children" : ( { "name" : "slot_2_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, { "name" : "slot_3", "type" : "image", "x" : 67, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/3.sub", "children" : ( { "name" : "slot_3_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), },{ "name" : "slot_4", "type" : "image", "x" : 99, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/4.sub", "children" : ( { "name" : "slot_4_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, Then look for: "name" : "quick_slot_1", ... "children" : And replace the content of its "children" : ( ... ), with the following: { "name" : "slot_f1", "type" : "image", "x" : 3, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f1.sub", "children" : ( { "name" : "slot_f1_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, { "name" : "slot_f2", "type" : "image", "x" : 35, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f2.sub", "children" : ( { "name" : "slot_f2_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, { "name" : "slot_f3", "type" : "image", "x" : 67, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f3.sub", "children" : ( { "name" : "slot_f3_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), },{ "name" : "slot_f4", "type" : "image", "x" : 99, "y" : 3, "image" : "d:/ymir work/ui/game/taskbar/f4.sub", "children" : ( { "name" : "slot_f4_cd", "type" : "text", "x" : 0, "y" : 0, "horizontal_align" : "center", "vertical_align" : "center", "text" : "10", "fontname" : "Tahoma Bold:16", "r" : 1, "g" : 1, "b" : 0, "a" : 0, }, ), }, Now save your work in taskbar.py and pack your files. Now we shall move onto root part: version 1.0 Spoiler Next we'll move onto root so I need you to unpack your root files and look for uitaskbar.py Now I need you to look for the following line: self.quickslot = [] as you can see below: self.quickslot = [] self.quickslot.append(self.GetChild("quick_slot_1")) self.quickslot.append(self.GetChild("quick_slot_2")) And then enter the following block of code above it: self.cooldownText = [] self.cooldownText.append(self.GetChild("slot_1_cd")) self.cooldownText.append(self.GetChild("slot_2_cd")) self.cooldownText.append(self.GetChild("slot_3_cd")) self.cooldownText.append(self.GetChild("slot_4_cd")) self.cooldownText.append(self.GetChild("slot_f1_cd")) self.cooldownText.append(self.GetChild("slot_f2_cd")) self.cooldownText.append(self.GetChild("slot_f3_cd")) self.cooldownText.append(self.GetChild("slot_f4_cd")) for i in xrange(8): self.cooldownText[i-1].Hide() Note: Please pay attention to code indentation Afterwards you will need to search for: if player.IsSkillCoolTime(Position): and under it add the following: (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = coolTime-elapsedTime+cooldownDelay self.cooldownText[slotNumber].Show() self.cooldownText[slotNumber].SetText("%d" % cooldown) self.cooldownText[slotNumber].SetOutline() if cooldown < 10: self.cooldownText[slotNumber].SetPosition(7,0) elif cooldown > 9 and cooldown < 100: self.cooldownText[slotNumber].SetPosition(2,0) elif cooldown > 99: self.cooldownText[slotNumber].SetPosition(-1,0) Note: Please pay attention to code indentation Now make a new line under the whole code block of: if player.IsSkillCoolTime(Position): and add the following code: elif not player.IsSkillCoolTime(Position): self.cooldownText[slotNumber].Hide() Awesome! You should be good to go, now pack your root and head in for some testing! version 2.0 Spoiler Next we'll move onto root so I need you to unpack your root files and look for uitaskbar.py Now I need you to look for the following line: self.quickslot = [] as you can see below: self.quickslot = [] self.quickslot.append(self.GetChild("quick_slot_1")) self.quickslot.append(self.GetChild("quick_slot_2")) And then enter the following block of code above it: self.cooldownText = [] self.cooldownText.append(self.GetChild("slot_1_cd")) self.cooldownText.append(self.GetChild("slot_2_cd")) self.cooldownText.append(self.GetChild("slot_3_cd")) self.cooldownText.append(self.GetChild("slot_4_cd")) self.cooldownText.append(self.GetChild("slot_f1_cd")) self.cooldownText.append(self.GetChild("slot_f2_cd")) self.cooldownText.append(self.GetChild("slot_f3_cd")) self.cooldownText.append(self.GetChild("slot_f4_cd")) for i in xrange(8): self.cooldownText[i-1].Hide() Note: Please pay attention to code indentation Afterwards you will need to search for: def OnUpdate(self): And add the following block under self.tooltipEXP.Hide() startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber self.cooldownText[slotNumber].Hide() (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position): (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) if app.IsPressed(app.DIK_LALT): self.cooldownText[slotNumber].Hide() else: self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) self.cooldownText[slotNumber].SetPosition((7, 2, -1)[len(cooldown)-1], 0) self.cooldownText[slotNumber].Show() startNumber += 4 Note 1: Please pay attention to code indentation Note 2: Also if you have implemented this feature from version 1.0 then you will have to reverse engineer it and apply this version as it's more reliable. Now get your root files packed and give this bad boy a spin! If you encounter any bugs or you have suggestions please let me know! Changes: Spoiler — version 2.0 > Removed the whole script from function def RefreshQuickSlot(self): and added the updated block under def OnUpdate(self): as it's more reliable and fixes one of the bugs where the cooldown gets stuck. > Hid the cooldown text before it's processed by the if player.IsSkillCoolTime(Position): condition as opposed to previous version, for a cleaner code. > Added a new condition which will hide the cooldown text whilst holding down Left ALT. However because the cooldown is set per slot and the pages are overlapping, it also hides the cooldown from the 2nd skill page, but that is just a tiny detail which can be ignored until further improvements. Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 18 1 1 4 1 25 for brain_cells in xrange(brain): if brain_cells == 0: print("0x3703c7 Fatal error occurred. Please replace the brain.") break if brain_cells == "damaged": print("0x3703c7 Error occurred. Please repair damaged brain_cells") break print("brain_cells are at 100% capacity.") Link to comment Share on other sites More sharing options...
JarajTo 40 Posted July 29, 2018 Share Posted July 29, 2018 Nice idea, like in league of legends. I like it, thanks. 1 Link to comment Share on other sites More sharing options...
Werwolf94 2 Posted July 30, 2018 Share Posted July 30, 2018 That's a nice idea! But I think I found a bug (or I messed up something when I pasted your code to my files). When you go to another map the counters are freezing after you use a skill. Link to comment Share on other sites More sharing options...
kasko30 19 Posted August 1, 2018 Share Posted August 1, 2018 Great idea Thank you so much Link to comment Share on other sites More sharing options...
[Dev]Medo 4 Posted August 1, 2018 Share Posted August 1, 2018 very nice idea .. i love it perfectly working Link to comment Share on other sites More sharing options...
Dean 84 Posted August 2, 2018 Author Share Posted August 2, 2018 On 7/31/2018 at 2:32 AM, Werwolf94 said: That's a nice idea! But I think I found a bug (or I messed up something when I pasted your code to my files). When you go to another map the counters are freezing after you use a skill. Hi there Werwolf, I have tested the potential bug you mentioned and I failed to encounter it. The only aspect of the script which I'm still working on is the possibility to hide the cooldown whilst holding down Alt. It's not a bug, just a simple adjustment I'd like to add in the future to assure 100% functionability. Thank you all for the warm feedback, it gladdens me knowing my scripts are useful. Keep me posted if potential bugs arise. Cheers! 1 for brain_cells in xrange(brain): if brain_cells == 0: print("0x3703c7 Fatal error occurred. Please replace the brain.") break if brain_cells == "damaged": print("0x3703c7 Error occurred. Please repair damaged brain_cells") break print("brain_cells are at 100% capacity.") Link to comment Share on other sites More sharing options...
[Dev]Medo 4 Posted August 2, 2018 Share Posted August 2, 2018 same bug here ... 1 Link to comment Share on other sites More sharing options...
Dean 84 Posted August 2, 2018 Author Share Posted August 2, 2018 4 hours ago, [Dev]Medo said: same bug here ... Hi there Medo, could you record a video with the bug so I can get a better grasp of the issue and post it here? Thank you! for brain_cells in xrange(brain): if brain_cells == 0: print("0x3703c7 Fatal error occurred. Please replace the brain.") break if brain_cells == "damaged": print("0x3703c7 Error occurred. Please repair damaged brain_cells") break print("brain_cells are at 100% capacity.") Link to comment Share on other sites More sharing options...
Aerrow 41 Posted August 5, 2018 Share Posted August 5, 2018 Works very well, thanks! On 8/2/2018 at 6:03 AM, Dean said: Hi there Werwolf, I have tested the potential bug you mentioned and I failed to encounter it. The only aspect of the script which I'm still working on is the possibility to hide the cooldown whilst holding down Alt. It's not a bug, just a simple adjustment I'd like to add in the future to assure 100% functionability. Thank you all for the warm feedback, it gladdens me knowing my scripts are useful. Keep me posted if potential bugs arise. Cheers! And I solve your problem! First of all we don't need this: elif not player.IsSkillCoolTime(Position): self.cooldownText[slotNumber].Hide() Then search for this: slotNumber = i+startNumber And paste under this: self.cooldownText[slotNumber].Hide() That's all. 1 Link to comment Share on other sites More sharing options...
Werwolf94 2 Posted August 5, 2018 Share Posted August 5, 2018 Hi again! I updated the two Py file and the "bug" still appears in my client when I go to another map. In the video you can see when I go to an another map after that the cooldown text's are freezing. If I press Alt the counters are keep going down. Link to comment Share on other sites More sharing options...
Chritation 0 Posted August 8, 2018 Share Posted August 8, 2018 Hello, I have a similiar error like Werwolf94. For me the timers are stuck at 10. This is my syserr: 0809 00:26:48145 :: Traceback (most recent call last): 0809 00:26:48145 :: File "uiTaskBar.py", line 1007, in OnUpdate 0809 00:26:48145 :: File "uiTaskBar.py", line 823, in RefreshQuickSlot 0809 00:26:48146 :: AttributeError 0809 00:26:48146 :: : 0809 00:26:48146 :: 'TextLine' object has no attribute 'setText' 0809 00:26:48146 :: Link to comment Share on other sites More sharing options...
Shang 368 Posted August 8, 2018 Share Posted August 8, 2018 En 5/8/2018 a las 23:15, Werwolf94 dijo: Hi again! I updated the two Py file and the "bug" still appears in my client when I go to another map. In the video you can see when I go to an another map after that the cooldown text's are freezing. If I press Alt the counters are keep going down. Delete the uiTaskbar.py part from the guide. Find this in def __OnUpdate(self): if True == self.expGaugeBoard.IsIn(): self.tooltipEXP.Show() else: self.tooltipEXP.Hide() Add this under: startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position): (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) self.cooldownText[slotNumber].SetPosition((7, 2, -1)[len(cooldown) - 1],0) self.cooldownText[slotNumber].Show() else: self.cooldownText[slotNumber].Hide() startNumber += 4 2 Link to comment Share on other sites More sharing options...
Dean 84 Posted August 18, 2018 Author Share Posted August 18, 2018 Hello everyone. Thank you all for the warm feedback, it's been a pleasure reading all your replies. Now, I brought some changes to this feature to further improve it. Also I'd like to thank Shang and Aerrow for pointing out ways of improving the script. 3 for brain_cells in xrange(brain): if brain_cells == 0: print("0x3703c7 Fatal error occurred. Please replace the brain.") break if brain_cells == "damaged": print("0x3703c7 Error occurred. Please repair damaged brain_cells") break print("brain_cells are at 100% capacity.") Link to comment Share on other sites More sharing options...
Chriss 1921 Posted October 28, 2018 Share Posted October 28, 2018 (edited) I have a problem https://metin2.download/picture/V1QYiTZvTXcy269PeKM671DIhd5A0z8g/.jpg Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Blend 5 Posted October 31, 2018 Share Posted October 31, 2018 Hello guys, first sorry for my bad english.Thank you for share, i have just one reservation. Its a centering of string. Your centering is not good because if i have lenght > 1, i have the result more left. Here is my proposal to improvement startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position): (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) if len(cooldown) <= 1: self.cooldownText[slotNumber].SetPosition(8,0) else: self.cooldownText[slotNumber].SetPosition(8 - (len(cooldown) + 2), 0) self.cooldownText[slotNumber].Show() else: self.cooldownText[slotNumber].Hide() startNumber += 4 if len(cooldown) <= 1: self.cooldownText[slotNumber].SetPosition(8,0) else: self.cooldownText[slotNumber].SetPosition(8 - (len(cooldown) + 2),0) self.cooldownText[slotNumber].Show() EDIT: This is good if i have bold:16. If you use more bold, u must change SetPosition(8 - (len(cooldown) + 2), 0) to SetPosition(8 - (len(cooldown) + x), 0). If your bold is highest, x is highest too. How much? You must try. 1 Link to comment Share on other sites More sharing options...
Chriss 1921 Posted November 3, 2018 Share Posted November 3, 2018 (edited) On 10/28/2018 at 7:43 PM, Co0L said: I have a problem https://metin2.download/picture/V1QYiTZvTXcy269PeKM671DIhd5A0z8g/.jpg @Dean ??? Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Blend 5 Posted November 4, 2018 Share Posted November 4, 2018 6 hours ago, Co0L said: @Dean ??? I have the same problem :/ Link to comment Share on other sites More sharing options...
Dean 84 Posted December 7, 2018 Author Share Posted December 7, 2018 On 11/3/2018 at 11:10 PM, Co0L said: @Dean ??? On 11/4/2018 at 5:25 AM, Blend said: I have the same problem Hello to both, Sorry for late response. As for the problem at hand I've failed to replicate your issue on my side, unless you have set an actual cooldown to those potions you should not encounter that. So you might want to check that first and see if you find a way to fix it. TDLR: The piece of code I shared way way above it takes the active cooldown of a skill, if existent, and displays the actual timer which already runs in the background. The main reason of this release was to improve player's reaction have while using their skills as it gives you a better understanding when the skill will be available for next cast. for brain_cells in xrange(brain): if brain_cells == 0: print("0x3703c7 Fatal error occurred. Please replace the brain.") break if brain_cells == "damaged": print("0x3703c7 Error occurred. Please repair damaged brain_cells") break print("brain_cells are at 100% capacity.") Link to comment Share on other sites More sharing options...
Heathcliff 183 Posted April 6, 2020 Share Posted April 6, 2020 (edited) On 10/28/2018 at 6:43 PM, Co0L said: I have a problem https://metin2.download/picture/V1QYiTZvTXcy269PeKM671DIhd5A0z8g/.jpg For those who have the same problem. Instead of this: startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position): (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) self.cooldownText[slotNumber].SetPosition((7, 2, -1)[len(cooldown) - 1],0) self.cooldownText[slotNumber].Show() else: self.cooldownText[slotNumber].Hide() startNumber += 4 Use this: startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position) and player.SLOT_TYPE_SKILL == Type: (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) self.cooldownText[slotNumber].SetPosition((7, 2, -1)[len(cooldown) - 1],0) self.cooldownText[slotNumber].Show() else: self.cooldownText[slotNumber].Hide() startNumber += 4 Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
MEKA 9 Posted April 12, 2020 Share Posted April 12, 2020 Could you please throw ready files? Link to comment Share on other sites More sharing options...
MEKA 9 Posted April 21, 2020 Share Posted April 21, 2020 Help Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted April 21, 2020 Share Posted April 21, 2020 The installation of locale, is wrong. You're telling us to do the same thing 2 times with the same text. Just give us a ready .py file. Anyway, thanks for your idea. Link to comment Share on other sites More sharing options...
Premium Ulthar 3086 Posted June 23, 2020 Premium Share Posted June 23, 2020 my clien is instantly close when i log in. my syserr.txt 0624 00:23:07457 :: networkModule.py(line:208) SetSelectCharacterPhase system.py(line:130) __pack_import system.py(line:110) _process_result introSelect.py(line:30) <module> system.py(line:130) __pack_import system.py(line:110) _process_result interfaceModule.py(line:10) <module> system.py(line:130) __pack_import networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unexpected indent (uiTaskBar.py, line 437) 0624 00:23:07457 :: ============================================================================================================ 0624 00:23:07457 :: Abort!!!! Ulthar Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted June 24, 2020 Premium Share Posted June 24, 2020 (edited) @Ulthar Check your TABs in uiTaskBar.py at line 437 or above Edited June 24, 2020 by Nevisor Link to comment Share on other sites More sharing options...
Premium Ulthar 3086 Posted June 24, 2020 Premium Share Posted June 24, 2020 (edited) Thanks for answer @Nevisor Now i have an another bug....Imgur pic (look at the slot bar ) Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 1 Ulthar Link to comment Share on other sites More sharing options...
Recommended Posts