Search the Community

Showing results for tags 'python' in content posted in Programming / Scripts.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Temporary category
    • Temporary forum
  • Community
    • Announcements
    • Feedback
  • Metin2
    • General
    • Questions and Answers
    • Frequently Asked Questions
    • Guides & HowTo
    • Design
    • Private Servers
    • Services
    • Videos
  • Releases
    • General
    • Tools
    • Programming / Scripts
    • Quests
    • Binaries & Clients / Serverfiles
    • 3D Models
    • 2D Graphics
    • Operating Systems
  • Safe Zone
    • Offtopic
    • Games Talk
    • Music / Videos / Art
  • M2 Project's Help & Questions
  • M2 Project's M2P
  • M2 Project's Ideas


There are no results to display.

There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL






Found 66 results

  1. Hello, came by to share something simple yet helpful for players, someone requested me this feature that allows you to input money with k format on the pick money dialog window, this will enable you to input “1kk” instead of “1000000” Hope it comes in handy for who is planning to use it. GitHub Repository:
  2. Hello everyone. It's a good day to share an old code with you. First of all you need to know: I don't help to install it. Don't even take the contact with me about it. The whole code is written by me, and reversed from official binaries. At the beginning do a backup for your files(srcs+pys) and READ CAREFULLY the readme. W/o brain.exe please close this tab, or your browser, thank you for your understanding. Preview: Download.exe Enjoy & #h4v3fun, pngr
  3. masodikbela

    Hi there Devs, I would like to share my "little" system. If you aren't interested in the introduction/preview etc. and you just want to download it and put in to your server, just scroll down until the "[How-To] Set up" subtitle. The story Firstly let me tell this system's story. I've got an idea one year before, that it would be good if the players would be able to put their items into a "global" system where they could see the other player's items, and they could buy it for DC or gold (that time I worked with the latest vanilla core (not with the source)). Then in the following 8 days I made it (it took about 80-90 working hours). Originally the system was created for one of my friend's server. but this server has never started, and nobody used this system. After some mounts I've decided to publish it on the Hungarian forum, because it won't worth to work on it for long hours if nobody uses it and its just collecting dust on my computer. Then I've published it on the 2nd of December, 2014. After some time I've decided to translate it into English and I've got a new idea for a new feature. This feature was: the trade system (I will explain its working later). This idea inspired by one of the players (from a server where this system was able to use). He told me that it would be better if they could set the gold price via an item (what's value is very high). Then with more than 180 working hours (totally) behind my back I'm here. Overview [How-To] Set up Customizing the tradehouse Questions and Answers Notes changelog: 19th of August, 2015: I publicated the tradehouse here. my toDo list: add logging for the system (the released version don't log the actions in the tradehouse) Thanks for reading the topic, if you have any problem/remark feel free to ask it here or write me a PM. Have a good day!
  4. There are a lot of people which had problem with localeInfo because korean-characters and bad encoding, there's a clean file with refactored code. Removed all the code which isn't used like korean characters < bad encoding [runmain error / crash](editors problem) and more checks. Removed over 500 lines unused. Removed function mapping(**kwargs) and use constructor of dict > dict(**kwarg) which is same (**kwarg let you take arbitrary number of keyword arguments). Removed function CutMoneyString because is used just when locale is HongKong, CIBN. Removed check IsYMIR from function LoadLocaleData which load locale as locale/ymir or locale/we_korea. Removed GUILD_MARK_NOT_ENOUGH_LEVEL, GUILD_HEADQUARTER, GUILD_FACILITY, GUILD_OBJECT, MAP_TRENT02, MAP_WL, MAP_NUSLUCK, MAP_TREE2, LOGIN_FAILURE_WEB_BLOCK, LOGIN_FAILURE_BLOCK_LOGIN, CHANNEL_NOTIFY_FULL, now they're readed directly from locale_game.txt. Removed declared global variables. Removed checks for declaring LOCALE_FILE_NAME, FN_GM_MARK and use current path. Removed korean functions/lists/dictionaries/characters GetAuxiliaryWordType, JOBINFO_DATA_LIST, dictSingleWord, dictDoubleWord, etc. Removed unused things: locale mapping, 'all' list etc. Removed IN_GAME_SHOP_ENABLE declaration, should be declared inside of constInfo directly. Removed checks (locale path) - 949, 932 == app.GetDefaultCodePage(), IsHONGKONG, IsNEWCIBN() or IsCIBN10() from declaration of functions like (NumberToMoneyString, NumberToSecondaryCoinString, ...),now they're declared directly from old style (IsEUROPE() and not IsWE_KOREA() and not IsYMIR()). Added custom string format(format_string, *args, **kwargs) instead of %. (old-style). Added new checks inside of LoadLocaleFile for security: Check if token3 (token1=original_string, token2=return-string, token3=function) function name exist in our types (SA, SNA, SAA, SAN) then try to call it. Check if string line have no tabs. Diff-checker: (856 Removals + 301 Additions) Download link
  5. ### 0.1 Root / # 1. Search: def OnLogin(self, groupIndex ... # 1. After: member.Online() self.OnRefreshList() # 1. Add: if not name in constInfo.ALREADY_NOTIFY_LIST: self.onlinePopup = uiCommon.OnlinePopup() self.onlinePopup.SetUserName(name) self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name) self.onlinePopup.SlideIn() constInfo.ALREADY_NOTIFY_LIST.append(name) # 1.1 After: def OnLogin(... Add: def OpenWhisper(self, eventType, userName): self.whisperButtonEvent(userName) ### 0.2 Root / # 2. Add: ALREADY_NOTIFY_LIST = [] ### 0.3 Root / # 3 Search: class Board(Window): (....) # 3 REPLACE this class with: class Board(Window): CORNER_WIDTH = 32 CORNER_HEIGHT = 32 LINE_WIDTH = 128 LINE_HEIGHT = 128 LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 BASE_PATH = "d:/ymir work/ui/pattern" IMAGES = { 'CORNER' : { 0 : "Board_Corner_LeftTop", 1 : "Board_Corner_LeftBottom", 2 : "Board_Corner_RightTop", 3 : "Board_Corner_RightBottom" }, 'BAR' : { 0 : "Board_Line_Left", 1 : "Board_Line_Right", 2 : "Board_Line_Top", 3 : "Board_Line_Bottom" }, 'FILL' : "Board_Base" } def __init__(self, layer = "UI"): Window.__init__(self, layer) self.skipMaxCheck = False self.MakeBoard() def MakeBoard(self): CornerFileNames = [ ] LineFileNames = [ ] for imageDictKey in (['CORNER', 'BAR']): for x in xrange(len(self.IMAGES[imageDictKey])): if imageDictKey == "CORNER": CornerFileNames.append("%s/%s.tga" % (self.BASE_PATH, self.IMAGES[imageDictKey][x])) elif imageDictKey == "BAR": LineFileNames.append("%s/%s.tga" % (self.BASE_PATH, self.IMAGES[imageDictKey][x])) self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag("not_pick") Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag("not_pick") Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage("%s/%s.tga" % (self.BASE_PATH, self.IMAGES['FILL'])) self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() def __del__(self): Window.__del__(self) def SetSize(self, width, height): if not self.skipMaxCheck: width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) # 3 AFTER CLASS BOARD ADD THIS CLASS: class BorderB(Board): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 BASE_PATH = "d:/ymir work/ui/pattern" IMAGES = { 'CORNER' : { 0 : "border_b_left_top", 1 : "border_b_left_bottom", 2 : "border_b_right_top", 3 : "border_b_right_bottom" }, 'BAR' : { 0 : "border_b_left", 1 : "border_b_right", 2 : "border_b_top", 3 : "border_b_bottom" }, 'FILL' : "border_b_center" } def __init__(self): Board.__init__(self) self.eventFunc = { "MOUSE_LEFT_BUTTON_UP" : None, } self.eventArgs = { "MOUSE_LEFT_BUTTON_UP" : None, } def __del__(self): Board.__del__(self) self.eventFunc = None self.eventArgs = None def SetSize(self, width, height): Board.SetSize(self, width, height) def SetEvent(self, func, *args) : result = self.eventFunc.has_key(args[0]) if result : self.eventFunc[args[0]] = func self.eventArgs[args[0]] = args else : print "[ERROR] SetEvent, Can`t Find has_key : %s" % args[0] def OnMouseLeftButtonUp(self): if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] : apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"]) ### 0.4 Root / # 4 Add this to the end of file: ### (Check if you have in this file import app ) class OnlinePopup(ui.BorderB): def __init__(self): ui.BorderB.__init__(self) self.isActiveSlide = False self.isActiveSlideOut = False self.endTime = 0 self.wndWidth = 0 self.textLine = ui.TextLine() self.textLine.SetParent(self) self.textLine.SetWindowHorizontalAlignCenter() self.textLine.SetWindowVerticalAlignCenter() self.textLine.SetHorizontalAlignCenter() self.textLine.SetVerticalAlignCenter() self.textLine.SetPosition(13, 0) self.textLine.Show() self.onlineImage = ui.ImageBox() self.onlineImage.SetParent(self) self.onlineImage.SetPosition(8, 8) self.onlineImage.LoadImage("d:/ymir work/ui/game/windows/messenger_list_online.sub") self.onlineImage.Show() def __del__(self): ui.BorderB.__del__(self) def SlideIn(self): self.SetTop() self.Show() self.isActiveSlide = True self.endTime = app.GetGlobalTimeStamp() + 5 def Close(self): self.Hide() def Destroy(self): self.Close() def SetUserName(self, name): self.textLine.SetText("Player %s is online." % str(name)) self.wndWidth = self.textLine.GetTextSize()[0] + 40 self.SetSize(self.wndWidth, 25) self.SetPosition(-self.wndWidth, wndMgr.GetScreenHeight() - 200) def OnUpdate(self): if self.isActiveSlide and self.isActiveSlide == True: x, y = self.GetLocalPosition() if x < 0: self.SetPosition(x + 4, y) if self.endTime - app.GetGlobalTimeStamp() <= 0 and self.isActiveSlideOut == False and self.isActiveSlide == True: self.isActiveSlide = False self.isActiveSlideOut = True if self.isActiveSlideOut and self.isActiveSlideOut == True: x, y = self.GetLocalPosition() if x > -(self.wndWidth): self.SetPosition(x - 4, y) if x <= -(self.wndWidth): self.isActiveSlideOut = False self.Close() ######## Please write in topic If i forgot something. ######## Images for board:!O1ZjmQxY!tKJdWNXRP6Wgb3DGxzdFRNV9U-bfRIStwnq3ETd6gKo
  6. Auto refine option when you upgrade the item with SCROLL or on NPC. I did all checks like example : When you have just one scroll in inventory, refine window will be close. When the item is already maximum upgrade. (+8 to +9 just in case will be succes) and more .. Preview: Download :!SZpDWBKB!EbBTPAThBjFZBuFCdvttRz5Yia4oYrAj5m4r0pNFe6U
  7. Before: After:
  8. Hello cowboys, since i was at job and i was bored while coding in other languages, i thought would be funny if i code something in Python, so an idea came in mind, doing a general text file loader for parsing different data, with different structs, normal variables, groups and lists, like ymir idea for parsing the files (.mse, .msa, .msm, .txt like mob_drop_item.txt, group.txt, etc) This tool can be used everywhere, for metin2 or else, i wrote this from scratch using ymir idea, also you can run it in any version of Python. If you use this for metin2, change USING_METIN2_CLIENT to True. benchmark.txt Full source repository:
  9. Hello everyone, is my first release and it is something that many people already have, but for those who do not have it, I share it. Image: click here Then, let's start. root/ root/ root/ root/ locale_xx/locale/xx/ui/ locale_xx/locale/xx/locale_interface.txt uiscript ---> Create a new file with this name and paste this: One extra step: locale_xx/locale/xx/ui/ or uiscript/ or uiscript/ If you have this error: InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'ImageBox' object has no attribute 'SetEvent' Then: open root/ If you do not have ENABLE_CHEQUE_SYSTEM and ENABLE_GEM_SYSTEM in your src client, then delete those parts of the code or open: UserInterface/PythonApplicationModule.cpp: I recommend putting this as long as you have cheque_system and gem_system (otherwise the interface is a little ugly) I hope it serves some people, greetings!!
  10. Hello guys! Another premium video for metin2dev members,please enjoy! Complete Python Bootcamp Go from zero to hero in Python 3 ~2.54GB
  11. root/ import time def GetCurrentServerTime24H(cur_time_stamp=app.GetGlobalTimeStamp()): ''' Convert server timestamp to 24-hour. ''' hours = (cur_time_stamp / 60) / 60 % 24 minutes = (cur_time_stamp / 60) % 60 seconds = cur_time_stamp % 60 return "{:02}:{:02}:{:02}".format(hours, minutes, seconds) def GetCurrentServerTime12H(format_code='%H:%M:%S', format_code_12h='%I:%M:%S %p'): ''' Convert server timestamp to 12-hour AM/PM. ''' time_object = time.strptime(GetCurrentServerTime24H(), format_code) time_output = time.strftime(format_code_12h, time_object) return time_output How-To-Use: < import localeInfo self.timeTextLine.SetText(localeInfo.GetCurrentServerTime12H()) # 06:00:08 PM self.timeTextLine.SetText(localeInfo.GetCurrentServerTime12H()) # 04:30:56 AM self.timeTextLine.SetText(localeInfo.GetCurrentServerTime24H()) # 21:05:03
  12. I saw a guy who sells shit, so I decided to fuck 15 minutes of my life and time and do it free for you with my code shit because i write fast. Link download:!CYJVib4L!bziTs5iK-R8dznmtAbBt3E2y93xyuCV0gZLV1MHdlPs And here is part rest for how to add grade:
  13. Hi this is timer for python. Like queue in gamesource.
  14. Github repository:
  15. I added two years ago a small function that allow you to make a struct like C++ for different purposes. # Example #1 pack = ui.RegisterStructClass('a b c')(15, {}, []) pack.a += 50 pack.b.update({0: 250}) pack.c.append(100) print (pack.a, pack.b, pack.c) # Example #2. def Transfer(self, p): print(p.szName, p.lX, p.lY) self.Transfer(ui.RegisterStructClass('szName lX lY')(GetName(), GetX(), GetY())) # Example #3. config = ui.RegisterStructClass('width height default_size_dict rank_list text')(450, 300, {'w': 400, 'h': 500}, [1, 2, 3], 'Metin2') print ( config.width, config.height, config.text, config.default_size_dict.get('w'), config.default_size_dict.get('h'), config.rank_list ) Repository:
  16. Hey everyone, it's a nice day to share something I just wrote Grid class in python language. You can use it as fast moving into the window with this or something else. Usage: from grid import Grid import item import chat grid = Grid(width=5, height=9) item.SelectItem(11299) (width, height) = item.GetItemSize() available_position = grid.find_blank(width, height) if available_position == -1: chat.AppendChat(chat.CHAT_TYPE_INFO, "There is no available position.") return chat.AppendChat(chat.CHAT_TYPE_INFO, "Available position is %d" % (available_position)) Best Regards Ken
  17. Hellow, I want to share my work, I've created 2 year ago, for my old server (Resthea). So, what is it exacly? It's python libraries and code that allow us to have many environment (clouds, light settings, flare and so on) on one map. By default, you can have only one environment for each map. How does it work? Well, once every 30 seconds (you can configure that time) checks our coordinates and compare it to jpg file, which size is the same as map size. Diffrent colors mean diffrent msenv file. What this pack contains? possibility to add up to 16777215 areas with diffrent environment on every map. possibility to add diffrent music on these areas possibility to add random snow on these areas 28 ready skyboxes possibility to choose skyboxes quality possibility to configure the time script refreshes possibility to add special xmas configuration easy configuration via text file code is easy to modify bugfix for night and snow systems Disadvantages: not so optimal solution .jpg format has indirect coloring between two colors, which sometimes could lead to problems xmas song probably doesn't work (I haven't got time to fix it) lots of redundant libraries, because i've uploaded whole Lib folder descriptions how to add this are in polish, you can use google translate , if you wish i can translate it too. Screens: Code sample: def __SpecialEnvironmentEnable(self, Env, Resthea, SnowEnable, NightEnable, ConfigTime, ConfigSkybox, XmasEvent): ### START OF ENVIRONMENT MODULE, qentinios self.Env = Env self.Resthea = Resthea self.SnowEnable = SnowEnable self.NightEnable = NightEnable self.ConfigTime = ConfigTime self.ConfigSkybox = ConfigSkybox self.XmasEvent = XmasEvent czass = str(time.ctime()) sekundy = czass[17:19] bg = background.GetCurrentMapName() if ConfigTime == 0: try: ConfigTime = int(linecache.getline("config.cfg", 2)) except: chat.AppendChat(chat.CHAT_TYPE_INFO, "Error while changing environment") chat.AppendChat(chat.CHAT_TYPE_INFO, "Cannot open file: config.cfg") if ConfigTime == -1: return map = ( "metin2_map_4_wiatry", "metin2_map_krance_swiata", "metin2_map_srodziemie", "metin2_map_resthea", ) if bg in map and sekundy != Env: if ConfigTime == 5 and int(sekundy) in (5,10,15,20,25,30,35,40,45,50,55,00): self.Env = sekundy pass elif ConfigTime == 15 and int(sekundy) in (15,30,45,00): self.Env = sekundy pass elif ConfigTime == 30 and int(sekundy) in (30,00): self.Env = sekundy pass elif ConfigTime == 60 and int(sekundy) == 30: pass else: if ConfigTime not in (-1,5,15,30,60) and int(sekundy) == 30: chat.AppendChat(chat.CHAT_TYPE_INFO, "Error while changing environment") chat.AppendChat(chat.CHAT_TYPE_INFO, "Wrong data: " + ConfigTime + ", config.cfg, line 2") self.Env = sekundy return else: return minuty = czass[14:16] godziny = czass[11:13] czas = int(godziny + minuty) try: im ="msenv/" + bg + ".jpg") except: chat.AppendChat(chat.CHAT_TYPE_INFO, "Error while changing environment") chat.AppendChat(chat.CHAT_TYPE_INFO, "Cannot open file: " + "msenv/" + bg + ".jpg") return (x, y, z) = player.GetMainCharacterPosition() x = int(x/100) y = int(y/100) try: color = str(im.getpixel((int(x),int(y)))) except: chat.AppendChat(chat.CHAT_TYPE_INFO, "Error while changing environment") chat.AppendChat(chat.CHAT_TYPE_INFO, "Not exist pixel: " + str(x) + ", " + str(y) + "; " + "msenv/" + bg + ".jpg") return #Skybox config if ConfigSkybox == "0": try: ConfigSkybox = linecache.getline("config.cfg", 5) except: ConfigSkybox = "_1k" if ConfigSkybox in ("_512n","_1kn","_1.5kn"): ConfigSkybox = ConfigSkybox[:-1] if ConfigSkybox not in ("_512","_1k","_1.5k"): ConfigSkybox = "_1k" #End of skybox config #Xmas event if XmasEvent == -1: try: XmasEvent = int(linecache.getline("config.cfg", 8)) except: XmasEvent = 0 if XmasEvent == 1: ColorList={ #Color (RGB) 1 : ("(255, 255, 255)", "(241, 255, 158)", "(254, 0, 0)", "(0, 255, 127)", "(158, 255, 248)", "(253, 254, 62)", "(255, 176, 63)", "(222, 255, 0)", "(95, 255, 0)", "(50, 121, 19)", "(95, 192, 35)", "(214, 214, 214)", "(148, 0, 0)", "(142, 142, 142)", "(251, 165, 0)"), #Msenv 2 : ("snowm02", "map_n_desert_01", "fire_low", "white_sky", "default", "rainy", "sand_mountain", "vanilia_white", "trent", "trent02", "vanilia", "snowm02", "fire_low", "default", "desert_cloud"), #Mp3 3 : ("christmas/4w/xmas", "christmas/4w/xmas", "christmas/4w/xmas", "christmas/4w/xmas", "christmas/4w/xmas", "christmas/krance/xmas", "christmas/krance/xmas", "christmas/krance/xmas", "christmas/krance/xmas", "christmas/krance/xmas", "christmas/srodziemie/xmas", "christmas/srodziemie/xmas", "christmas/srodziemie/xmas", "christmas/resthea/xmas", "christmas/resthea/xmas_wyspa"), #Snow 4 : (1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1) } #End of Xmas event else: ColorList={ #Color (RGB) 1 : ("(255, 255, 255)", "(241, 255, 158)", "(254, 0, 0)", "(0, 255, 127)", "(158, 255, 248)", "(253, 254, 62)", "(255, 176, 63)", "(222, 255, 0)", "(95, 255, 0)", "(50, 121, 19)", "(95, 192, 35)", "(214, 214, 214)", "(148, 0, 0)", "(142, 142, 142)", "(251, 165, 0)"), #Msenv 2 : ("snowm02", "map_n_desert_01", "fire_low", "white_sky", "default", "rainy", "sand_mountain", "vanilia_white", "trent", "trent02", "vanilia", "snowm02", "fire_low", "default", "desert_cloud"), #Mp3 3 : ("4w/lodowa", "4w/pustynia", "4w/ognista", "4w/orki", "4w/srodek", "krance/przeklete", "krance/pustynia", "krance/swiatynia", "krance/las", "krance/las2", "srodziemie/trawa", "srodziemie/lodowa", "srodziemie/ognista", "resthea/trawa", "resthea/wyspa"), #Snow 4 : (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0) } i = 0 Colors = ColorList[1] length = len(Colors) for ColorItem in xrange(length): if color == Colors[ColorItem]: #START OF SNOW EFFECT Snow = ColorList[4] if SnowEnable != 1: if Snow[ColorItem] == 1 and int(minuty) in (2,7,12,17,22,27,32,37,42,47,52,57) and int(sekundy) in (00,01,30,31): random = app.GetRandom(1,3) if random == 1: background.EnableSnow(1) else: background.EnableSnow(0) if Snow[ColorItem] == 0: background.EnableSnow(0) #END OF SNOW EFFECT if Resthea == color: break #START OF MUSIC MODULE Music = ColorList[3] if app.IsExistFile("BGM/" + Music[ColorItem] + ".mp3")==1: if musicInfo.fieldMusic != "": snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) musicInfo.fieldMusic = (Music[ColorItem] + ".mp3") snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) else: if musicInfo.fieldMusic != "": snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) musicInfo.fieldMusic=musicInfo.METIN2THEMA snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) #END OF MUSIC MODULE Msenv = ColorList[2] if NightEnable == 1 and self.__IsXMasMap(): background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT) background.SetEnvironmentData(1) else: background.RegisterEnvironmentData(1, "d:/ymir work/environment/" + Msenv[ColorItem] + ConfigSkybox + ".msenv") background.SetEnvironmentData(1) self.Resthea = color break else: i = i+1 if i == length: background.SetEnvironmentData(0) snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic) musicInfo.fieldMusic=musicInfo.METIN2THEMA snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) self.Resthea = color ### END OF ENVIRONMENT MODULE, qentinios Old video with system: Download: Without skyboxes: With skyboxes:
  18. Abel(Tiger)


    I think they forgot to cythonize =)) I don't recommend to use that code, is ugly ...!Ixl0nLZa!61VOx87EA9zBUiNAHD-poUZnaIx3VZr6RVgqUT3LZu4
  19. Builtin Debug Formatter A simple debug class which is used for output the messages for debugging. The class doesn't need to be called, we've added the functions into built-in functions. The purpose was to ease the work of developers. What's the difference between them? Using the new method: TraceError("str", 1, 4.0, (31, 22), [100, 200], True) Tracef("str", 1, 4.0, (31, 22), [100, 200], True) LogBox("str", 1, 4.0, (31, 22), [100, 200], True) sys_err("str", 1, 4.0, (31, 22), [100, 200], True) # No import needed, is a built-in function, you can call it everywhere. # The function sys_err or TraceError doing the same thing. # Allow to pass unlimited argument-lines, no data types check, can be everything you want: <int, float, string, tuple, list, boolean>. Using the old method: import dbg dbg.TraceError("just_one_string_allowed") dbg.Tracef("just_one_string_allowed") dbg.LogBox("just_one_string_allowed") # Need to import the module dbg every time in every file where you want to use it. # Allow to pass just one argument-line which need to be string, otherwise nothing happen. Built-In-Functions: Built in or inbuilt function are that type of functions which are already defined or created in a program or in programming framework. User don’t need to create these type of functions. User or developer can directly use built in function by only call it. This function is built into an application and can it can be accessed by end-users with simply call it. How-It-Works: TraceError(args) - function prints the given arguments to the text stream file syserr.txt Tracef(args) - function prints the given arguments to the console window (screen) while executable is compiled in a debug mode. LogBox(args) - function prints the given arguments to the dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. sys_err(args) - same as TraceError. How-To-Call-Ex : sys_err('warning', 'error', 'unknown') << 415 17:8:1130 :: warning << 415 17:8:1130 :: error << 415 17:8:1130 :: unknown sys_err(100/2==50, 'set value to {}'.format(25)) << 415 17:6:1083 :: True << 415 17:6:1083 :: set value to 25 sys_err([45, 100], (200, 1500, 32), 42.8, 500, "donald-trump", False) << 415 17:8:1094 :: [45, 100] << 415 17:8:1094 :: (200, 1500, 32) << 415 17:8:1094 :: 42.8 << 415 17:8:1094 :: 500 << 415 17:8:1094 :: donald-trump << 415 17:8:1094 :: False sys_err("what-you-want") << 415 17:8:1072 :: what-you-want GitHub repository:
  20. Hello, today I will give you this login interface, which is very similar to WoM2. It's coded by me, good luck Original interface(WoM2): My interface: Photo1: Photo2: Download: 1.!AhOzstvwiFbCa_hZFTG57aD_mTU 2. btw: configuration in root/ SERVER_IP = "" CH1_PORT = 21000 CH2_PORT = 22000 CH3_PORT = 23000 CH4_PORT = 24000 PORT_AUTH = 31009 NUME_SERVER = "Andy"
  21. Get bonus name from tooltip affect dictionary as string, ignore the %value% and function SA, SNA etc. Ignore the dump.txt &, is just to test how function works. Just follow tutorial from How-To-use import localeInfo import item # FormatBonusNameString print localeInfo.FormatBonusNameString(item.APPLY_RESIST_SWORD) # FormatBonusNameDict for bonusIndex, bonusName in localeInfo.FormatBonusNameDict().iteritems(): print '{:d}: {:s}'.format(bonusIndex, bonusName) GitHub repository:
  22. sakincali58k9


    Hi everyone. good uses. Link
  23. There's just a smart python module which i did for fun, for a friend, no support for implementation. Enjoy. Github repository:
  24. Someone wondered if I could do this script for him, i don't know the reason (maybe 4 find and extract some things), enjoy. Full repository: #! /usr/bin/env python ''' MIT License Copyright (c) 2018 VegaS LINK PREVIEW : Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' __author__ = "VegaS" __date__ = "2018-11-30" __consignee__ = '#Mithras' __version__ = "0.1.6" import os import sys import re import time import shutil import operator import string import functools from datetime import datetime as dt ''' How-To-use: cd ../ location_file_name.msm ''' class ReadMSM_SourceSkin: BACKUP_FOLDER_NAME = 'backup' OUTPUT_FILE_NAME = 'result.txt' PATTERN_STRING_WHITESPACE = string.whitespace[1] GROUP_MEMBER_MAX_NUM = 5 PATH_STRING_NAME = 'PathName' SOURCE_SKIN_STRING_NAME = 'SourceSkin' SPECIAL_PATH_STRING_NAME = 'SpecialPath' def __init__(self): self.outputList = [] # Contains the command-line arguments passed to the script. self.srcReadFileName = sys.argv[1] def __GetDateTime(self): return'%d-%m-%Y %H-%M-%S_{file_name}').format(file_name = self.srcReadFileName) # Return a string representing the date, controlled by an explicit format string. def __GetDirectoryName(self): return os.path.dirname('{:s}/{:s}/{:s}'.format(os.getcwd(), self.BACKUP_FOLDER_NAME, self.OUTPUT_FILE_NAME)) # Return the directory name of pathname path. def __FindStringByPattern(self, string, pattern='''(?<=")\s*[^']+?\s*(?=")'''): # A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a particular string # matches a given regular expression (or if a given regular expression matches a particular string, which comes down to the same thing). strResult =, string) if strResult: return return str() def __FindStringByLine(self, lines, string, pattern=r'(^|[^\w]){}([^\w]|$)', msmGroupDict={}): tokens = [] for index, value in enumerate(lines): value = functools.reduce(lambda k, v: k.replace(v, '\0'), self.PATTERN_STRING_WHITESPACE, value) # Recompile the lines and search by unique strings. if bool(, re.IGNORECASE), value)): if string is self.PATH_STRING_NAME: return value elif string is self.SOURCE_SKIN_STRING_NAME: strExceptLine = lines.__getitem__(operator.isub(index, self.GROUP_MEMBER_MAX_NUM - 2)).strip(self.PATTERN_STRING_WHITESPACE) tokens.append((value, strExceptLine if self.SPECIAL_PATH_STRING_NAME in strExceptLine else None)) return tuple(tokens) def __OnResult(self): textLineTuple = ( '[*] Filename: {:s}\n'.format(self.srcReadFileName), '[*] {:s} count: [{:d}]'.format(self.SOURCE_SKIN_STRING_NAME, len(self.outputList)) ) if self.outputList: if os.path.exists(self.OUTPUT_FILE_NAME): # Recursive directory creation function. Like mkdir(), but makes all intermediate-level directories needed to contain the leaf directory. if not os.path.exists(self.BACKUP_FOLDER_NAME): os.makedirs(self.BACKUP_FOLDER_NAME) # Recursively move a file or directory (src) to another location (dst). destFileName = '{:s}/{:s}'.format(self.__GetDirectoryName(), self.__GetDateTime()) shutil.move('{:s}/{:s}'.format(os.getcwd(), self.OUTPUT_FILE_NAME), destFileName) textLineTuple += tuple('\n[*] Generated a backup for old {:s} in {:s}.'.format(self.OUTPUT_FILE_NAME, destFileName)) with open(self.OUTPUT_FILE_NAME, 'a+') as fp: fp.write(self.PATTERN_STRING_WHITESPACE.join(self.outputList)) # Returns a string in which the string elements of sequence have been joined by str separator. print functools.reduce(lambda k, v: operator.iadd(k, v), textLineTuple) # Same as join method. def Initialize(self): try: lines = open(self.srcReadFileName, "r").readlines() except IOError: print ("Can't load file: {:s}".format(self.srcReadFileName)) return for sourceSkin, specialPath in self.__FindStringByLine(lines, self.SOURCE_SKIN_STRING_NAME): strPathName = self.__FindStringByPattern(self.__FindStringByLine(lines, self.PATH_STRING_NAME)) strSourceSkin = self.__FindStringByPattern(sourceSkin) if specialPath: strPathName = self.__FindStringByPattern(specialPath) self.outputList.append(operator.iadd(strPathName, strSourceSkin)) self.__OnResult() Instance = ReadMSM_SourceSkin() Instance.Initialize()