Jump to content
metin2dev
Ekstasia2

Search the Community

Showing results for tags 'python'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • Announcements
    • Feedback
  • Metin2
    • General
    • Questions and Answers
    • 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

Categories

There are no results to display.

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


ICQ


Yahoo


Skype


Location

Found 142 results

  1. root/uiRefine.py root/constInfo.py Another idea: def OverInItem(self, slotIndex): import grp, nonplayer if not self.tooltipItem or slotIndex > TOOLTIP_DATA['slotIndex']: return slotVnum = TOOLTIP_DATA['materials'].__getitem__(slotIndex) self.tooltipItem.ClearToolTip() self.tooltipItem.AddItemData(slotVnum, 0, 0, 0, 0, player.INVENTORY) customInfoDropDict = \ { 27992 : (2061, 2062, 2063, 2065, 2068, 2069), 30190 : (2201, 2204, 2205), 50181 : (2312, 2314, 2402, 2091, 2092, 1901, 1092, 2307, 2493), } if slotVnum in customInfoDropDict: self.tooltipItem.AppendSpace(5) self.tooltipItem.AutoAppendTextLine(localeInfo.REFINE_ITEM_CAN_BE_DROPPED_FROM, grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)) for mobVnum in customInfoDropDict.get(slotVnum): self.tooltipItem.AutoAppendTextLine(nonplayer.GetMonsterName(mobVnum)) self.tooltipItem.AlignHorizonalCenter() self.tooltipItem.ShowToolTip()
  2. masodikbela

    [PyLUA++]Tradehouse

    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!
  3. 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
  4. FreeWar_official

    [PREVIEW] Controller Mode

    Premise:The system in question is integrated into the client through the use of existing libraries! it was enough to enable it through some modifications of the source and to define the various commands, make the installation very simple and intuitive I assure you! What can i do?It is expected that by the end of the realization of this system you can fully use the client "PG, game windows and maybe even chat", at the moment you can use the PG. Have you a release date?At the moment no, the work still requires the care of many details.Have a video about this system?This V 0.1 Alpha "DirectInput" This V 0.2 Alpha "XInput" This V 0.3 Alpha "New Functions" FEATURES: * Migration to XInput and abandonment of DirectInput support * Adding vibration vibration & low life "PS and Xbox Controller" * QuickSlot that can be recalled by pressing the O (PSX) or B (X360) button * Defined DeadZone "Analog" * Added Settings window "Under construction" * Added virtual keyboard to write in chat and more; * Added character selection via controller; * Addition of Auto-Select NPC / MOB / PG and with the pressure of X (PS) A (XBOX) its relative function; * Added quest and selection navigation;
  5. about: Random video with bug : https://youtu.be/zILVyU0YGHU?t=7479 look at the highlight effect of WP sura skills (taskbar) Problem: RefreshQuickSlot spam "ActivateSlot" find: self.selectSkillButtonList = [] under add: self.Jeaktivni = [] find: self.curSkillButton = 0 under add: self.Jeaktivni = 0 find: if constInfo.IS_AUTO_POTION(itemIndex): # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량 metinSocket = [player.GetItemMetinSocket(window, Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] if 0 != int(metinSocket[0]): slot.ActivateSlot(slotNumber) else: slot.DeactivateSlot(slotNumber) edit to: if constInfo.IS_AUTO_POTION(itemIndex): # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량 metinSocket = [player.GetItemMetinSocket(window, Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] if 0 != int(metinSocket[0]): if not slotNumber in self.Jeaktivni: slot.ActivateSlot(slotNumber) self.Jeaktivni.append(slotNumber) else: slot.DeactivateSlot(slotNumber) if slotNumber in self.Jeaktivni: self.Jeaktivni.remove(slotNumber) else: if slotNumber in self.Jeaktivni: self.Jeaktivni.remove(slotNumber) find: if player.IsSkillActive(Position): slot.ActivateSlot(slotNumber) edit to: if player.IsSkillActive(Position): if not slotNumber in self.Jeaktivni: slot.ActivateSlot(slotNumber) self.Jeaktivni.append(slotNumber) else: if slotNumber in self.Jeaktivni: slot.DeactivateSlot(slotNumber) self.Jeaktivni.remove(slotNumber)
  6. Hi fellas, Here are the official version of these classes: CMoveTextLine - Used in Yutnori CMoveImageBox - Used in MonsterCard, Rumi and CatchKing CMoveScaleImageBox - Used in Yutnori I already reversed them months ago except the CMoveScaleImageBox but yesterday I finished them coz they had a little problem, but now seems working well. What you must know, this release isn't stable, I just reversed them, and tested with the scripts what you will see, so I couldn't stress them, they may have problems. And I don't recommend to use the SetScalePivotCenter function, I don't know why but works a bit strange than the official, it needs something more during the texture load in. Video of them: PS: If I missed something just write a comment below.
  7. 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: Now we shall move onto root part: version 1.0 version 2.0 If you encounter any bugs or you have suggestions please let me know! Changes:
  8. 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: https://gyazo.com/63959d63b9acc7d4337e16de061ea747 Download : https://mega.nz/#!SZpDWBKB!EbBTPAThBjFZBuFCdvttRz5Yia4oYrAj5m4r0pNFe6U
  9. Hi Firends. I'm sorry, I don't know if this is opening up here. I have encountered a few problems in python. Client Syeserr.: https://paste2.org/C8NZxKwZ My Files.: https://mega.nz/#!NcFUkQqK!Xb-6e_LU4nMWa3eJEhWqhR8dbPdpWGAP5j5RbrfhGjc V.T.: https://www.virustotal.com/#/file/6da359ca518ec20ab6ae3942a4157bca59a500d6b8572e08df01d2bc645326a1/detection OfflineShop.: https://mega.nz/#!0ZUWAaJS!TPPm0i06JEK2ZKekWXErHx-aRJq6ILLIIPlKJG8fjiw V.T.: https://www.virustotal.com/#/file/cd33c7971cbcea939d007d715a99ca3b6c1027be502d1c4d1d7bccee88fc8958/detection
  10. xDiiZeRx

    Auction House

    Hello! I'm looking for someone who can coding, Auction House.
  11. Hi, I want to release shop with the new currency. Client: inventorywindow.py (locale/uiscript): You must replace this: "y" : SCREEN_HEIGHT - 37 - 565, "y" : SCREEN_HEIGHT - 37 - 589, 2x replace this: "height" : 565, "height" : 589, And replace this: ## Print { "name":"Money_Slot", "type":"button", "x":8, "y":28, "horizontal_align":"center", "vertical_align":"bottom", "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "children" : ( { "name":"Money_Icon", "type":"image", "x":-18, "y":2, "image":"d:/ymir work/ui/game/windows/money_icon.sub", }, { "name" : "Money", "type" : "text", "x" : 3, "y" : 3, "horizontal_align" : "right", "text_horizontal_align" : "right", "text" : "123456789", }, ), }, ## Print { "name":"Money_Slot", "type":"button", "x":8, "y":28+24, "horizontal_align":"center", "vertical_align":"bottom", "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "children" : ( { "name":"Money_Icon", "type":"image", "x":-18, "y":2, "image":"d:/ymir work/ui/game/windows/money_icon.sub", }, { "name" : "Money", "type" : "text", "x" : 3, "y" : 3, "horizontal_align" : "right", "text_horizontal_align" : "right", "text" : "123456789", }, ), }, ## Print { "name":"Premium_Slot", "type":"button", "x":8, "y":28, "horizontal_align":"center", "vertical_align":"bottom", "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "children" : ( { "name":"Premium_Icon", "type":"image", "x":-18, "y":2, "image":"d:/ymir work/ui/game/windows/money_icon.sub", }, { "name" : "Premium", "type" : "text", "x" : 3, "y" : 3, "horizontal_align" : "right", "text_horizontal_align" : "right", "text" : "123456789", }, ), }, game.py (root): In table "servercommandlist" you must add this lines: "GetInputStart" : self.GetInputStart, "GetInputStop" : self.GetInputStop, "GetInput" : self.GetInput, "SetQuestIndex" : self.QuestIndexShop, "SetIsNpc" : self.SetIsNpc, "SetPrice" : self.SetIsPrice, "NieMamPP" : self.NieMamPP, "setPP" : self.__setAchievementPoints, And add this lines under "servercommandlist" table: def NieMamPP(self): import uiShop self.wndShop = uiShop.ShopDialog() self.wndShop.NieMamPP() def __setAchievementPoints(self, points): constInfo.ACHIEVEMENT_POINTS = int(points) self.interface.wndInventory.UpdatePremiumInSlot() def SetIsPrice(self, value): self.interface.dlgShop.SetShopPrice(value) def SetIsNpc(self): constInfo.IsItemShop = 1 def QuestIndexShop(self, value): constInfo.IS_QUEST = int(value) def GetInputStart(self): constInfo.INPUT_IGNORE = 1 def GetInputStop(self): constInfo.INPUT_IGNORE = 0 def GetInput(self): net.SendQuestInputStringPacket(str(constInfo.INPUT_DATA)) constinfo.py (root): You must add this lines in the middle of the file: ACHIEVEMENT_POINTS = 0 IS_QUEST = 0 IsItemShop = 0 INPUT_IGNORE = 0 INPUT_DATA = "" uitooltip.py (root): You must replace this function: def SetShopItem(self, slotIndex): itemVnum = shop.GetItemID(slotIndex) if 0 == itemVnum: return price = shop.GetItemPrice(slotIndex) self.ClearToolTip() self.isShopItem = TRUE item.SelectItem(itemVnum) metinSlot = [] for i in xrange(player.METIN_SOCKET_MAX_NUM): metinSlot.append(shop.GetItemMetinSocket(slotIndex, i)) attrSlot = [] for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): attrSlot.append(shop.GetItemAttribute(slotIndex, i)) self.AddItemData(itemVnum, metinSlot, attrSlot) self.AppendPrice(price) def SetShopItem(self, slotIndex, addprice = 0, waltype = 0): itemVnum = shop.GetItemID(slotIndex) if 0 == itemVnum: return price = shop.GetItemPrice(slotIndex) self.ClearToolTip() self.isShopItem = TRUE item.SelectItem(itemVnum) metinSlot = [] for i in xrange(player.METIN_SOCKET_MAX_NUM): metinSlot.append(shop.GetItemMetinSocket(slotIndex, i)) attrSlot = [] for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): attrSlot.append(shop.GetItemAttribute(slotIndex, i)) self.AddItemData(itemVnum, metinSlot, attrSlot) if waltype == 0: self.AppendPrice(price) else: self.AppendSpace(5) self.AppendTextLine("Cena: %s TR" % (locale.NumberToMoneyString(addprice)[:-5]), self.SPECIAL_TITLE_COLOR) uiinventory.py (root): Under: def RefreshStatus(self): money = player.GetElk() self.wndMoney.SetText(locale.NumberToMoneyString(money)) Add: def UpdatePremiumInSlot(self): import constInfo value = str(constInfo.ACHIEVEMENT_POINTS) self.wndPremium.SetText(locale.NumberToMoneyString(value)[:-5] + " TR") Under: self.wndMoneySlot = 0 Add: self.wndPremium = 0 self.wndPremiumSlot = 0 Under: self.wndMoneySlot = self.GetChild("Money_Slot") Add: self.wndPremium = self.GetChild("Premium") self.wndPremiumSlot = self.GetChild("Premium_Slot") And replace this function: def SelectEmptySlot(self, selectedSlotPos): if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1: return selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos) if mouseModule.mouseController.isAttached(): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemCount = mouseModule.mouseController.GetAttachedItemCount() attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex() if player.SLOT_TYPE_INVENTORY == attachedSlotType: itemCount = player.GetItemCount(attachedSlotPos) attachedCount = mouseModule.mouseController.GetAttachedItemCount() self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount) if item.IsRefineScroll(attachedItemIndex): self.wndItem.SetUseMode(FALSE) elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType: mouseModule.mouseController.RunCallBack("INVENTORY") elif player.SLOT_TYPE_SHOP == attachedSlotType: if constInfo.IsItemShop == 0: net.SendShopBuyPacket(attachedSlotPos) else: import uiShop self.wndShop = uiShop.ShopDialog() self.wndShop.BuyFromIS(attachedSlotPos) elif player.SLOT_TYPE_SAFEBOX == attachedSlotType: if player.ITEM_MONEY == attachedItemIndex: net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount()) snd.PlaySound("sound/ui/money.wav") else: net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos) elif player.SLOT_TYPE_MALL == attachedSlotType: net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos) mouseModule.mouseController.DeattachObject() uishop.py (root): This file is too much editing, I give you the finished file. http://wklej.to/YR452 Server: Add shop, and then add items in this shop. In my system, a standard shop has id 15. Remember not to give the shop directly at NPC! Quest: http://wklej.to/T5Ild The price we give here: cmdchat("SetPrice 200|50|100|200|150|250|100|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0") Slots are separated by "|". The items we give here: local items = { [1]={71124, 1, 200}, [2]={71125, 1, 200}, [3]={71126, 1, 200}, [4]={71127, 1, 200}, [5]={71128, 1, 200}, } [slot_id]={item_id, item_count, item_price}, This guide and information contained in it things are by Teodor. Sorry for my english, I come from Polish. Greetings! Screen:
  12. As we work with maps we accumulate a large number of unused textures which end up making the client / pack downloads for our server bigger. For this reason I made this little python 2.7 script. It will read all the textureset files and the texture paths on it and copy to textureset_release/ only the textures that are actually being used by your maps, as listed in Settings.txt The folder where the script looks for Settings.txt files recursively is "maps/", change it at the start of the code if yours is different. Likewise, it will look for "textureset/" and "terrainmaps/", and create "textureset_release/". No files will be deleted. Disclaimer: The code is very ugly, I actually have no idea of python, I made this script looking at docs and based on my knowledge of other languages. If you actually know python I suggest you don't look at it to avoid hurting your eyes. import os import re import string import shutil import sys ct = 0 usedimg = [] usedsets = [] list = [] mapfolder = 'maps/' class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) def __exit__(self, etype, value, traceback): os.chdir(self.savedPath) def cleanValue(val): val = val.replace('\\', '/') val = val.strip(' \t\n"') val = val.lower() return val def copyFile(src, dest): try: shutil.copy(src, dest) # eg. src and dest are the same file except shutil.Error as e: print('Error: %s' % e) # eg. source or destination doesn't exist except IOError as e: print('Error: %s' % e.strerror) # Read the tab-separated value of a parameter "param" in all files named "fname" (can be an extension) in folder "folder" def SaveParams(param,fname,folder,list): for path, subdirs, files in os.walk(folder): for filename in files: if filename.lower() == fname.lower() or (fname.startswith('.') and filename.endswith (fname)): f = os.path.join(path, filename) with open(f, "rt") as current: for line in current: lcline = line.lower() lcparam = param.lower() if lcparam in lcline: # strip tabs and split values value = line.rstrip('\t\n') # get parameter value list.append(value) # Read a value with the order number "order" within a parameter block "block" in all files named "fname" (can be an extension) in folder "folder" which are also in list "compare" def SaveParamsFromBlock(block,order,fname,folder,list,compare): for path, subdirs, files in os.walk(folder): for filename in files: if filename in compare and (filename.lower() == fname.lower() or (fname.startswith('.') and filename.endswith (fname))): countblock = -1 f = os.path.join(path, filename) with open(f, "rt") as current: for line in current: lcline = line.lower() lcblock = block.lower() if countblock == order: list.append(line) countblock = -1 elif lcline.startswith(lcblock): countblock = 0 elif countblock >= 0: countblock = countblock + 1 # move to the client data folder with cd('..\client\data'): try: os.makedirs('terrainmaps_release') except: shutil.rmtree('terrainmaps_release') os.makedirs('terrainmaps_release') print "This script copies to terrainmaps_release only the textures which are actually listed in textureset files." print "The folder is emptied on each run. make_archive.py uses this folder as source for making the terrainmaps pack." print "This script is written to be run from the tools repo copy and assumes the client repo copy to be in the same base directory as tools" print "" select = raw_input("Press any key to start, e to exit") if str(select) == "e": sys.exit() # Get all the texturesets used in our maps SaveParams('TextureSet','Setting.txt','maps',usedsets) # Extract the filename part of the used TextureSet paths and write it back to the list for idx,val in enumerate(usedsets): val = cleanValue(val) parts = re.split('/', val.lower()) # check its actually a terrainmaps path usedsets[idx] = parts[-1] # Fetch a list of the textures used in the sets used SaveParamsFromBlock('Start Texture',0,'.txt','textureset',usedimg,usedsets) # Copy the textures used in textureset_release for idx,val in enumerate(usedimg): # check its actually a terrainmaps path if "terrainmaps" in val: val = cleanValue(val) val = val[len('d:/ymir work/terrainmaps/'):] usedimg[idx] = val.lower() srcPath = 'terrainmaps/' + usedimg[idx] destPath = 'terrainmaps_release/' + usedimg[idx] print "Copy " + srcPath + " to " + destPath if not os.path.isdir(os.path.dirname(destPath)): os.makedirs(os.path.dirname(destPath)) copyFile(srcPath, destPath) ct = ct + 1 print "Total " + str(ct) + " textures copied in terrainmaps_release" raw_input("Press any key to exit") As a bonus another python 2.7 script used to create the property/list file with all your prb, pre. Assumes a property/ folder at the location where you run it. import os import math count = 0 extensions = ('prb','prt','prd','pre','pra') with open("property/list", "w") as a: for path, subdirs, files in os.walk(r'property'): for filename in files: f = os.path.join(path, filename) if filename != "list" and filename !="reserve": extension = filename.split ('.')[-1] if (extension in extensions): a.write(str(f) + '\n') else: Print ("Strange file: " + f) count = count + 1 print 'Total: ' + str(count) + ' files listed on property/list!' raw_input("Press any key to exit") And finally another script to copy all your msa and motlist.txt files to a server/data folder that you can upload later to your server. It will only copy when files are different or not existing at the destination. It assumes a ../client/data/npc (and so on) and ../server/data/monster etc. structure, feel free to edit the paths in the scripts to your needs. import os import shutil from itertools import chain import filecmp pathList = [] count = 0 def copyFile(src, dest): try: shutil.copy(src, dest) return True # eg. src and dest are the same file except shutil.Error as e: print('Error: %s' % e) # eg. source or destination doesn't exist except IOError as e: print('Error: %s' % e.strerror) print "This script moves all the .msa and motlist.txt files from pc monster and npc client folders to the appropiate server folders, creating them if necessary." paths = ('../client/data/monster/', '../client/data/monster2/', '../client/data/npc/', '../client/data/npc2/', '../client/data/pc/', '../client/data/pc2/') for path, dirs, files in chain.from_iterable(os.walk(path) for path in paths): for filename in files: if filename.endswith('.msa') or filename.endswith('.txt'): realpath = path.replace('\\', '/') cfolder = os.path.split(realpath)[1] gfolder = 'monster' if ('/pc/' in realpath): gfolder = 'pc/' + realpath.split('/')[4] elif ('/pc2/' in realpath): gfolder = 'pc2/' + realpath.split('/')[4] else: # Check for duplicated non-pc folders existingpath = next((s for s in pathList if ('/' + cfolder) in s), None) if existingpath and existingpath.endswith(cfolder): if realpath != existingpath: print("Warning: duplicate folders " + realpath + " and " + existingpath + "!") pathList.remove(existingpath) break elif path not in pathList: pathList.append(realpath) else: pathList.append(realpath) spath = realpath + '/' + filename dpath = '../server/data/' + gfolder + '/' + cfolder # Create destination folder if not existing if not os.path.isdir(dpath): os.makedirs(dpath) dpath = dpath + '/' + filename # Copy file if destination is not existing or different if not os.path.exists(dpath) or not filecmp.cmp(spath,dpath): if copyFile(spath, dpath): print "Copied " + spath + " to " + dpath count = count + 1 print "Finished copying " + str(count) + " files!" raw_input("Press any key to exit") How to use: install python 2.7 anywhere on your hd (C:\Python27 for example), add this path to the system path, and save this code in a file named something.py, then run it by doubleclick Remember to change directory to wherever you have your client files.
  13. Hi everyone, In this thread I will show you how to use the compiled python files in the client. First of all we need to download Python 2.2 or 2.7 Python 2.2 download Python 2.7 download Let's start the tutorial: 1. Rename system.py to main.py or to anything you want, it doesn't matter. 2. Change these stuffs in main.py: Search for this: filename = name + '.py' Replace with this: filename = name + '.pyc' Search for this: newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name) Replace with this: newmodule = _process_result(marshal.loads(pack_file(filename,'rb').read()[8:]),name) Search for this: RunMainScript("prototype.py") Replace with this: RunMainScript("prototype.pyc") 3. Create a new file called system.py 4. Copy this to system.py: import pack import imp import marshal data = pack.Get('main.pyc') if data == None: raise IOError, 'Error happened...' if data[:4] != imp.get_magic(): raise ImportError, 'Error happened...' exec marshal.loads(data[8:]) 5. Let's continue with the compiling. Download this file and put to the Python 2.2 or 2.7 folder. Create a new folder called files and put all .py files from the root and the main.py to the folder. Drop the downloaded Compiler.py to the python.exe and wait few seconds, now it will compile the files. After the compiling finished copy back the .pyc files to the root and delete the old .py files. 6. Copy the system.py to the root. (Example picture) 7. Pack the root.eix/epk If you have any question or suggestion please just reply to this topic. Kind Regards, Sanchez
  14. Hello guys. I have the following code (everyone i think has the same): As you can see, it has vnum range (for example this: if vnum >= 16210 and vnum <= 16219) . I want to modify this function, to work, for EVERY vnum. I mean: if item.ARMOR_WRIST == subType or elif item.ARMOR_NECK == subType: or elif item.ARMOR_EAR == subType, to show which accessory material it has from the list (this is the list: 50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 50632, 50633, 50634, 50635, 50636, 50637, 50638). Can anyone help me? ACCESSORY_MATERIAL_LIST = [50623, 50624, 50625, 50626, 50627, 50628, 50629, 50630, 50631, 50632, 50633, 50634, 50635, 50636, 50637, 50638] JewelAccessoryInfos = [ # jewel wrist neck ear [ 50634, 14420, 16220, 17220 ], [ 50635, 14500, 16500, 17500 ], [ 50636, 14520, 16520, 17520 ], [ 50637, 14540, 16540, 17540 ], [ 50638, 14560, 16560, 17560 ], ] def GET_ACCESSORY_MATERIAL_VNUM(vnum, subType): ret = vnum item_base = (vnum / 10) * 10 for info in JewelAccessoryInfos: if item.ARMOR_WRIST == subType: if info[1] == item_base: return info[0] elif item.ARMOR_NECK == subType: if info[2] == item_base: return info[0] elif item.ARMOR_EAR == subType: if info[3] == item_base: return info[0] if vnum >= 16210 and vnum <= 16219: return 50625 if item.ARMOR_WRIST == subType: WRIST_ITEM_VNUM_BASE = 14000 ret -= WRIST_ITEM_VNUM_BASE elif item.ARMOR_NECK == subType: NECK_ITEM_VNUM_BASE = 16000 ret -= NECK_ITEM_VNUM_BASE elif item.ARMOR_EAR == subType: EAR_ITEM_VNUM_BASE = 17000 ret -= EAR_ITEM_VNUM_BASE type = ret/20 if type<0 or type>=len(ACCESSORY_MATERIAL_LIST): type = (ret-170) / 20 if type<0 or type>=len(ACCESSORY_MATERIAL_LIST): return 0 return ACCESSORY_MATERIAL_LIST[type]
  15. Hi there everyone, I'd like to share a small function which will give you a random name whilst creating a new character. This will only include the function and a list of names, so you will have to set the event on your own. Preview: The function which will most likely be put in introCreate.py import os import app #import the above lines if you don't have them already def __randomizeName(self): dir = os.path.dirname(os.path.abspath("introCreate.py")) list = open("%s\\names.list" % dir, "r").read().split("\n") rng = app.GetRandom(0, len(list)-1) randomName = list[rng] self.heroName.SetText("%s" % randomName) ## change variable 'heroName' with your editline's name Also place the attached file to this thread in the main directory of the client. (i.e: where the launcher is) names.list contains 150 names, if you ever need more names let me know so I can up the number or you can add more yourself, but do note you need to put each name as a new line so you won't mess up the function. That's all for now, hope you all have a great day! Cheers. names.list
  16. GitHub repository: https://github.com/Vegas007/Metin2-Extended-Modules-For-Script-Window
  17. Merhaba! for i in range(o-400000,o+400000): I am using such a loop, but this is causing the frost. I tried to use thread but the room does not work on metin2servers, how can we fix it? thanks for a lot
  18. MrMuniez

    open [Python]Auto Trade

    Hi. I want create simple python script to autotrade withother character. On this moment i finding player with nickname and starting trade. But i cant add all items to trade window. Heres my simple code: import ui,app,chat,chr,net,player,item,skill,time,game,shop,chrmgr,thread,event,exchange SWITCH_RARE_VNUM = 30270 start = 0 end = 2000000 SzamVID = 0 exslot = 0 for vid in range(start, end): if chr.GetInstanceType(vid) != 6: continue if chr.GetNameByVID(vid) == "DajSeNaLuz": SzamVID = vid break net.SendExchangeStartPacket(SzamVID) for i in range(0,90*2): if player.GetItemIndex(i) == SWITCH_RARE_VNUM: chat.AppendChat(chat.CHAT_TYPE_INFO, "Odłamek znaleziony") net.SendExchangeItemAddPacket(i, exslot) exslot += 1 net.SendExchangeAcceptPacket() I think problem is that i dont understant how to use net.SendExchangeItemAddPacket function. Somebody can explain what is wrong here?
  19. Special thanks for design and help: [url=https://metin2dev.org/board/index.php?/profile/12872-legolasofficial/]LegolasOfficial[/url] Download: https://mega.nz/#!pBUj0IoC!tYUbK3liAC5fSxxWQ1sWjUKypNFphPergj4lDZxk6RQ
  20. Fleon

    Multiple login saver

    Almost completed. What do you guys think? This will probably be also relased to the public, i completed the marking system now it is 100% working and it's fully client-launcher made, no server. This is for an old style server so it had to be easy to use and in-line with the current "metin2 official" style. Output from the script (to show the obfuscation, it is done with python27, base64 and struct. It is some decent premade algorithm.): Test2Dev:ztjYyuGW Account1:ztjYyuGW Account2:ztjYyuGW Account3:ztjYyuGW //They do NOT get displayed as x5 since it's a dict and the key "Account4" is taken just once, but still i shouldn't write them, will perform an earlier check. Account4:ztjYyuGW Account4:ztjYyuGW Account4:ztjYyuGW Account4:ztjYyuGW Account4:ztjYyuGW Account5:ztjYyuGW north:4crn3Q== It works with txt to dict conversion and vice versa.
  21. We're looking for a programmer to give us C++ and Python services for a Metin2 project. The service will be payed well. The pace of work will be high, so we need a professional people to work with us. High level of C++ and Python is needed to develop the work correctly. If you're interested on this job, leave a reply on this post or just send us a private message. Thank you! :)
  22. Hello, To extend NPC Shop to 80 Items follow these steps. ServerSide Open "common/length.h" and search: SHOP_HOST_ITEM_MAX_NUM = 40 Replace with: SHOP_HOST_ITEM_MAX_NUM = 80 In the same file search: SHOP_PRICELIST_MAX_NUM = 40 Replace with: SHOP_PRICELIST_MAX_NUM = 80 Now open "game/shop.cpp" and search: m_pGrid = M2_NEW CGrid(5, 9) Replace with: m_pGrid = M2_NEW CGrid(10, 9) Now open "game/shop_manager.cpp" and search: CGrid grid = CGrid(5, 9) Replace with: CGrid grid = CGrid(10, 9) Now compile Db File & Game File and ServerSide's steps complete. ClientSide NOTE: If you want Only NPC Shop's with 80 Items follow this guide, else if you want NPC Shop & Private Shop follow the Update Istruction. Extract "pack/uiscript" from your Client and open "shopdialog.py". Now reaplace all content with: Shopdialog.py ~ 80 Items Now create "shopdialog2.py" and insert this content: ShopDialog2 ~ 80 Items for Shop Ok, at this point you can compress your UiScript with the new file "shopdialog2.py". Extract "pack/root" from your Client and open "interfacemodule.py" Search this: self.dlgShop = uiShop.ShopDialog() self.dlgShop.LoadDialog() self.dlgShop.Hide() After add: self.dlgShop2 = uiShop.ShopDialog2() self.dlgShop2.LoadDialog() self.dlgShop2.Hide() Same file, search this: def OpenShopDialog(self, vid): self.wndInventory.Show() self.wndInventory.SetTop() self.dlgShop.Open(vid) self.dlgShop.SetTop() After add: def OpenShopDialog2(self, vid): self.wndInventory.Show() self.wndInventory.SetTop() self.dlgShop2.Open(vid) self.dlgShop2.SetTop() Now open "game.py" and Search: def StartShop(self, vid): self.interface.OpenShopDialog(vid) Replace with: def StartShop(self, vid): if chr.IsNPC(vid): self.interface.OpenShopDialog(vid) else: self.interface.OpenShopDialog2(vid) Now open "uishop.py" and Search: def Close(self): self.OnCloseQuestionDialog() shop.Close() net.SendShopEndPacket() self.CancelShopping() self.tooltipItem.HideToolTip() self.Hide() Replace with: def Close(self): self.OnCloseQuestionDialog() shop.Close() net.SendShopEndPacket() self.CancelShopping() self.Hide() Same file, search: def OnUpdate(self): USE_SHOP_LIMIT_RANGE = 1000 (x, y, z) = player.GetMainCharacterPosition() if abs(x - self.xShopStart) > USE_SHOP_LIMIT_RANGE or abs(y - self.yShopStart) > USE_SHOP_LIMIT_RANGE: self.Close() After add: UiShop.py ~ ShopDialog2 Now you can compress "root" file. #Update [24-02-15] Fixed Client Bug. Changes in "shop_manager.cpp" added. #Update [26-02-15] Added PrivateShop with 80 Items. NPC & PrivateShop with 80 Items ClientSide: Open "UserInterface/Packet.h" in you Binary Client Source and Search: SHOP_HOST_ITEM_MAX_NUM = 40 Replace with: SHOP_HOST_ITEM_MAX_NUM = 80 Now you can compile your Binary Source. Open your Client File and extract "pack/uiscript". Open "shopdialog.py" and replace all contentwith: Shopdialog.py ~ 80 Items Now open "privateshopbuilder.py" and replace all content with: PrivateShopBuilder ~ 80 Items Now you can compress your UiScript. Screen Private Shop: Et Voilà, we ended. Good work, Bye.
  23. Chyu ^^

    solved Stream module

    Hi devs, I've been looking a long time for a module called stream. In a client we can found it used like: stream.popupWindow.Close(), stream.SetSelectCharacterPhase(), stream.SetConnectInfo() and so much more. Where is a definition of this module? I've been lookin' in a binary sources but with no success, in Root aswell. Thanks.
  24. martysama0134

    [How-To] Metin2 & Cython

    Intro This release will explain how to "convert" your root .py files to .c ones. Actually, Cython only converts those files to pure CPython code. Download NOTE: ALL THE FILES HAVE BEEN MOVED TO HOW-TO-CYTHON-MT2. EDIT: As requested by many people, you can download the compatible and clean official cn root dated 20131228-0034 without further edits: rootCn_20131228-0034_edit.raruiscriptCn_20131228-0034.rarcN-serverinfo-edit.pyIs Cython really worth it?ProsAll the modules are compiled, and they can't be "extracted as .py" anymore.We can always disassemble the launcher with IDA, but the result will be pseudo-c code after waiting 6-8h of analyzing. Since we're not using .pyx files but directly .py ones, there's no "so much optimization".At least, 10% of performance increasing is guaranteed. ConsFor testing purposes, it's heavy to maintain. Everytime you try to re-compile your root files, you should wait 5-10 minutes.You can always use the uncythonized root (.py files) when you perform tests, and compile cython whenever you will make an update in your live server. The launcher's size will increase ~10mb. You can actually pack it to save space.If you directly use a .pyd (still 10mb), the launcher's size won't increase. VideoTutorial Credits Me (lollo_9_1/martysama0134)Night (OST suggestion)Random TestersWhat's New:v2.0The module's name check is now case-insensitive (colorInfo == colorinfo)Added a new function rootlib/uiscriptlib.getList() to retrieve a tuple of all the available cythonized modules.Now you can compile a uiscriptlib library from the uiscript*.py files! (implemented as __USE_EXTRA_CYTHON__)Added a sample ui.py containing the code to run uiscriptlib.
×