Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Tasho

  1. Python - your opinions

    no data types In every language exist data types, but in Python the declaration happens automatically when you assign a value to a variable not need to specify which type to be like int, float, string etc..and you can do assignation with another data type just with operator '=', without killing language like C++ assignation between std::vector & std::map, here is more easy. no semicolons The semicolon here does not do anything, but exist and can be used with no problems, does let you use to denote the end of a statement if you are including more than one statement on a line. import command does not distinguish python includes and my includes (like C do by "" and <>) #include and import are quite different, C/C++ is a compiled language, C++ you do #include <library> and in Python you have this syntax for import the content of another program file in your own. (i can't explain it very good the difference because have no-sense) Two or more physical lines may be joined into logical lines using backslash characters (\) - backslash . JesusHere =\ { [....] } As i said don't try to search difference between 2 languages which both are amazing in them way, Python was choosed by YMIR for write the GUI Engine because is a easy language and flexible instead of C++ or any variants, if you are good at C/C++, you can easily learn Python in some weeks because that is more easy than it.. Some difference between them are: Python uses Garbage Collection whereas C++ does not. C++ is a statically typed language, while Python is a dynamically typed language. Python is easier to use than C++. Python is run through an interpreter, whilst C++ is pre-compiled. Hence, C++ is faster than Python. C++ supports pointers and incredible memory management. Python supports very fast development and rapid, continuous language development. Python has less backwards compatibility. Majority of all applications are built from C++. Majority of all 3D applications offer Python access to their API's. Python code tends to be 5 to 10 times shorter than that written in C++. In Python, there is no need to declare types explicitly. Smaller code size in Python leads to leads to "rapid prototyping", which offers speed of development. Python requires an engine to run. Python is interpreted each time it runs. Python is hard to install on a Windows box and thus makes distribution of the program problematic. C++ is a pure binary that links to existing libraries to assist the coding. In Python, variables are in scope even outside the loops in which they are first instantiated. In Python, a function may accept an argument of any type, and return a value of any type, without any kind of declaration beforehand. Python provides flexibility in calling functions and returning values. Python looks cleaner, is object oriented, and still maintains a little strictness about types. @difference-between-cplusplus-and-python
  2. c++ Notice System With Timer

    That's why metin2 is cancerous community..we stole code/ideas from another guys and put inside without any mention or thanks for it, doesn't importantly if you post free or not. 1. 2. 3. There are more.. You know very well about what i'm talking, already there exist more guys which take system a, b from C and make some changes and adapt it for another things. I don't will talk about the rest of code which is already non-sense, already all people can see it. Look: Already you and this guy stole the same concept of call event and check real time from Tournament PvP and do some changes, great coders. Good luck "Developer of future."
  3. open Python problem gui

    Variable names can't start with a number (in more languages), you have to change the names for self.1 & self.1_func.
  4. Hi there comunity, today I was a little bored and an idea came to mind, what if I made a replica of the interface from League of Legends for Metin2. So this is the result: I just want to know what do you think and if you think that I need to continue with it.
  5. open Asking developers

    I think he talk about this video. You can't block it 100%.
  6. open Need help

    Already YMIR did that just for codePage (locale.cfg) as 949 < locale/ymir. ../root/uiMiniMap.py # Search for: def SetMapName(self, mapName): if 949==app.GetDefaultCodePage(): try: self.board.SetTitleName(localeInfo.MINIMAP_ZONE_NAME_DICT[mapName]) except: pass # Replace with: def SetMapName(self, mapName): self.board.SetTitleName(localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, uiScriptLocale.ZONE_MAP)) If you want to add more maps there exist a dictionary MINIMAP_ZONE_NAME_DICT on localeInfo,the key should be name of map (atlasInfo.txt) and value is your map name. MINIMAP_ZONE_NAME_DICT = \ { "metin2_map_n_flame_dragon" : MAP_FLAME_DUNGEON, # ..locale/en/locale_game.txt }
  7. open Reset skill group

    I'm not a quester but these are really basic shits which you have to know before write something, you have 'quests which you sell' on that forum, that's very bad. You called x3 times say_title(item_name). You use say("") for make a new row empty, already exist '[ENTER]'. You use item vnum 71002, instead of use item.get_vnum(). For questions like Yes, No already exist 'locale.yes, locale.no'. Why you guys start to put ";" at the end of function or returns? Did you know for what is that or just put it and want to look different than another ones? 'Semi-colons in Lua are generally only required when writing multiple statements on a line, stop use it if don't know how is working, you should learn a bit from Lua documentation before write any code and stop do things which others do. Have fun.
  8. python [Py] Root 02.02.2018

    @GostMan Stop using fake account. You are the most of *dum.... from here, because you didn't really understand the sarcasm which @tierrilopes created it, a guy say on first page: "i can write better the code of official and things which containing a lot a lines I can do on one line.", but he doesn't have idea about coding. And from here start some examples from us and make fun about situation, what's your problem? Oh let me know..you are frustrated because you don't understand how it's working the code from us examples? Don't try to look smart than us because you aren't, don't come with examples of another language if there's all about Python. That one line here is called as "comprehension python list". For simple conditions is ok to use it, but on that case from the previous replies for multiple function to be called doesn't look very good and should stay on normally style. I'm not sure but you are looking like a romanian which didn't eat nothing since a lot a time. You should stop do spam without sense after some weeks just because you are frustrated, if all people do that which all what they don't like it and hate it what happens with community? If I hate something from guys which talking on some topics should I check now all topics and go and say them "yo guys, you are *dum...? Was ok if you was registered when we was had that discussion, not after some weeks. Have fun.
  9. open Quest count kill

    All quests. TRUNCATE TABLE player.quest; Specific quest. DELETE FROM player.quest WHERE szName = 'name_quest'; Navicat -> Any database -> CTRL + Q -> CTRL + V -> Run
  10. Stop to kill Lua please. function right_item() return item.get_vnum() >= 85001 and item.get_vnum() <= 85024 end And don't reply if you don't understand what exactly he want. function CanTakeItem(itemVnum) local table_items = { 14500, 12000, 18000 } for _, v in pairs(table_items) do if v == itemVnum then return true end end return false end -- when npc_id.take with questName.CanTakeItem(item.get_vnum()) begin
  11. [Preview]Map1 (Jinno) - World of Alvenar

    Looks good, but if i'm not mistake there are some textures & trees & objects from Metin2Global. << client was leaked If you really used them for build this map you can say a simple thanks to @Ace.
  12. Is here someone who can make this feature?

    MINI_WAYPOINT_IMAGE_COUNT = 12 ..\Client\src\UserInterface\PythonMiniMap.h You should replace your xrange with start = 1 Good job.
  13. Get skill count - New Pet System

    I don't know nothing about how it's working that pet, but i think you can do something like that on python, not sure. uiPetSystem.py import uiToolTip [..............] ################################### g_PetSkillSlotAvailableDict = {} def GetPetSkillSlot(): return len([slot for slot in g_PetSkillSlotAvailableDict.values() if slot]) ################################### def SetSkill(self, slot, idx, lv): if int(idx) != -1: [..............] g_PetSkillSlotAvailableDict.update({int(slot) : int(idx) != -1}) ################################### uiToolTip.py from uiPetSystem import GetPetSkillSlot self.AppendTextLine('(%d)' % GetPetSkillSlot(), self.NORMAL_COLOR) game.py self.__BuildDebugInfo() ############################### import uiPetSystem uiPetSystem.g_PetSkillSlotAvailableDict.clear() That's a shit thing to do it on python, because you can't see the length of it until you didn't call SetSkill << and for that i think you have to use item, so for tooltip will be bad.
  14. The method has_key() returns true if a given key is available in the dictionary, otherwise it returns a false. You have tuple not a dictionary, so you should do something like: if number in tupleArgs: [....] Or maybe your code is expecting a dictionary and getting a tuple instead. Upload the file on https://mega.nz/, i can't download them from attachments.
  15. open quest kill count in database

    . UPDATE = The UPDATE statement is used to modify the existing records in a table. INSERT = The INSERT INTO statement is used to insert new records in a table. You trying to update field id <which doesn't exist> First one you need to do INSERT and after that UPDATE, there are many solutions for that, but i would like that one: INSERT ... ON DUPLICATE KEY UPDATE local quantidade = pc.getqf("total_players") mysql_direct_query(string.format("INSERT INTO player.kill_system (id, quantidade) VALUES(%d, %d) ON DUPLICATE KEY UPDATE quantidade = quantidade + %d;", pc.get_player_id(), quantidade, quantidade)); If you specify an ON DUPLICATE KEY UPDATE clause and a row to be inserted would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row occurs.
  16. Speak the guy with a fake account and talk about clean code and check vegas profile and search the old topics with shit releases and trying to make something, good job.
  17. python Fantasy Loading Gage Name

    # import constInfo - at the beginning of the file def GetChName(percentage): name = constInfo.loadingname return name[:(len(name) * percentage) / 100] And please stop to use turkish name for variables when you share something, looks very creepy..
  18. python [Py] Root 02.02.2018

    No isn't, please post the code for both list to SetEvent (metin2), and i will show you what "perfectly is".
  19. python [Py] Root 02.02.2018

    Ok then, maybe i'm noob. Put the final code (for metin2, not print function) to SetEvent on the both list (self.SelectBtnNameList, self.SelectBtnFaceList) with good arguments, like that. I think you don't understand how exactly need to work, please read again every row from my output.
  20. python [Py] Root 02.02.2018

    Add the self.SelectBtnFaceList on print too,, and run it, you will get a loop of x60 times (repeat x2 same thing), when need just x30 times. - Run it: http://tpcg.io/C4Vv2s Do you think that's a good loop? what's about that eventList items? Read with careful how should be output on my image.
  21. python [Py] Root 02.02.2018

    That's not related with what he request. Doesn't looks exactly with what we need, and your loop will be very bad, repeat it x30 times for each one, and don't to the same. (http://tpcg.io/C4Vv2s) That's like how should be. # No comprehension for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)): for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out'): (srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) # Comprehension [(srcNameList.SetEvent(eventKey, eventName), srcFaceList.SetEvent(eventKey, eventName)) for eventKey, (srcNameList, srcFaceList) in enumerate(zip(self.SelectBtnNameList, self.SelectBtnFaceList)) for eventName in ('mouse_click', 'mouse_over_in', 'mouse_over_out')] Thanks @VegaS PS: Let's don't make another replies about that. Let's go on https://metin2dev.org/board/index.php?/forum/34-offtopic/ and make one topic and we can talk 24/7 about that.
  22. python [Py] Root 02.02.2018

    Syntax In linguistics, syntax (/ˈsɪntæks/[1][2]) is the set of rules, principles, and processes that govern the structure of sentences in a given language, specifically word order and punctuation. The term syntax is also used to refer to the study of such principles and processes.[3] String In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is generally understood as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. A string may also denote more general arrays or other sequence (or list) data types and structures. SYNTAX != STRING I'm sure you are a better than gf developers...
  23. First one, thanks for release. Here are some tips wich you can use on future. total_elements = sum(1 for line in open('rename_log')) total_elements = len(open('rename_log').readlines()) element.replace(str.upper(extension), str.lower(extension)) element.replace(extension.upper(), extension.lower()) print("Total renamed files: {0}".format(str(total_elements))) That's totally a bit unfriendly, the str.format() detected automatically the data type of argument, you don't have to convert it as string. Also you don't need to enumerate your arguments as {0} {1} etc, you can do that only if you have more arguments and you get stuck. Should look like: print("Total renamed files: {}".format(total_elements)) return(extension) Why you return something (outside of loop) if you don't use the result? global extension global lenght Why you use global variables when you can declare them inside of your class FileManager? class FileManager: def __init__(self): self.length = 3 # Set here the size of the extension, default 3. self.extension = str() def Main(self): pass def GetExtension(self): pass def GetLogFile(self): pass def RenameFile(self): pass Instance = FileManager() Instance.Main() Good luck on future and i hope you will use these small tips.