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


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.


Found 25 results

  1. 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
  2. Special thanks for design and help: [url=https://metin2dev.org/board/index.php?/profile/12872-legolasofficial/]LegolasOfficial[/url] Download: https://mega.nz/#!pBUj0IoC!tYUbK3liAC5fSxxWQ1sWjUKypNFphPergj4lDZxk6RQ
  3. This release is just information about fish event. I just made the class from their binary files. Some functions are not still accessible yet because of define flags. class FishEventGridSlotWindow(Window): def __init__(self): Window.__init__(self) self.startIndex = 0 def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterFishEventGridSlotWindow(self, layer) def ArrangeSlot(self, startIndex, xCount, yCount, xSize, ySize, xBlank, yBlank): self.startIndex = startIndex wndMgr.ArrangeSlot(self.hWnd, startIndex, xCount, yCount, xSize, ySize, xBlank, yBlank) def GetStartIndex(self): return self.startIndex # The newest compiled binary file is not contain this function yet. (ENABLE_FISH_EVENT) def SetPickedAreaRender(self, unkArg1): pass Best Regards Ken
  4. 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!
  5. 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:
  6. open introselect.py Search: self.destGauge = [ float(valueHTH) / 380, float(valueINT) / 380, float(valueSTR) / 380, float(valueDEX) / 380 ] Change: self.destGauge = [ float(valueHTH) / 90, # max stat float(valueINT) / 90, # max stat float(valueSTR) / 90, # max stat float(valueDEX) / 90 # max stat ] open introcreate.py Search: float(self.stat[0])/float(statSummary), float(self.stat[1])/float(statSummary), float(self.stat[2])/float(statSummary), float(self.stat[3])/float(statSummary), Change: float(self.stat[0])/90, #max stat float(self.stat[1])/90, #max stat float(self.stat[2])/90, #max stat float(self.stat[3])/90, #max stat http://i.imgur.com/mOcKPC0.png http://i.imgur.com/agkXwuC.png Best Regards Rideas
  7. Hi, I'd like to share with you my script for generating property for Trees, Buildings, Effects and Dungeon Blocks. Because adding per one each time is so long. Features: - crc32 of file - skip LOD file (gr2) - adjustable shadow output - if .mdatr is in the same folder it will be included Script: Video: IMPORTANT: Put this script in same folder with gr2/spt/mse files then run IT REQUIRE PYTHON 2.7.x batchPropertyV2.py
  8. Perhaps it will be useful for some people for various systems. Have fun. # onPressKeyDict[app.DIK_F5] = lambda : self.Print() # For test function @root/game.py def Print(self): import app, chat list = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" # Set list maxStr = 10 # Set the maximum number of characters k = "" for v in xrange(maxStr): k = k + list[app.GetRandom(0, len(list) - 1)] chat.AppendChat(chat.CHAT_TYPE_INFO, "Result word: %s" % str(k))
  9. Conversation between me and vegas: [21:18:22] ####:: VegaS are you here? [21:18:31] VegaS™: Yes. [21:19:09] ####: Man, some people sell your title system what was public on tur****. [21:22:14] ####:: https://i.gyazo.com/feeb2dcc47adbed5c87f0e6dda867f7f.png [21:22:22] ####:: Here is this shit what he sell. [21:28:33] ####:: Shit all resellers , dude . [21:34:50] VegaS™: There are many whores in this area, so best bet would be to post this system because some hookers make money from him unjustly. So send them harlots that vegas has big dick and that will fuck all in the ass. This system has a crappy code, you can keep the recycle bin, is the first version of shit. I apologize for what my clients who bought this system, but I'll make updates to it and will be more advanced. I can not enter metin2dev this time because my account is suspended for a short period of time, but I will return very soon, remember that. Why has reached this release online? Since titlesystem first version had over 35 buyers from title and I sold at all retarded. But now these latest systems and will not sell than some people you know for a long time and know 100% that they are not whores. Latest systems are stored for each client, I know 100% who I was because when you reach for resellers or free. And remember one thing: - I Will never sell any system or any other things for Romanian people, if someone tries to sell it or mean it's fucking scammer, and if u see Something scammer who sell my works, you can report this to me. Soon it ready new website, where there will be all new systems sales and presentations. ^^ Go on metin2dev and post system and send them the message that I told you. (sorry for my english) Here is informations about system: Download: https://mega.nz/#!3BAnEZJQ!QKo35FCxVr8AFjatiVk7KX2DmN62Pj14VHJQZ9tpyR0 Have fun, scammer ^^ #request close topic, so much spam xD
  10. Hey Guys, Since this is my first post i want to release a little module i wrote 5 minutes ago. First of all this is for everybody who hates sockets(like me) and don't want to use item_proto for Shinings/Effects whatever. The Code is quiet "crappy" but it is working flawlessly. So lets get started. You wanna create something like this where you declare your maps to store the vnum and effectfilepath #include <map> #ifndef ShiningSettings_H #define ShiningSettings_H 1 extern std::map<int, char*> shiningdata; extern std::map<int, char*>::iterator shiningit; #endif Then you wanna create your function for your python module #include "StdAfx.h" #include "ShiningSettings.h" PyObject* addEffect(PyObject* poSelf, PyObject* poArgs) { int vnum; char* effectpath; if(!PyTuple_GetInteger(poArgs, 0, &vnum)) { return Py_BuildException(); } if(!PyTuple_GetString(poArgs, 1, &effectpath)) { return Py_BuildException(); } if(!shiningdata.count(vnum)){ shiningdata[vnum] = effectpath; } return Py_BuildNone(); } void initShining() { static PyMethodDef s_methods[] = { { "Add", addEffect, METH_VARARGS }, { NULL, NULL }, }; Py_InitModule("Shining", s_methods); } Make also sure you start your function in UserInterface.cpp bool RunMainScript(CPythonLauncher& pyLauncher, const char* lpCmdLine){ //Otherfunctions initShining(); } AND in stdafx.h add this void initShining(); After that open up your InstanceBase.cpp and define your early declared maps also include boost algorithm Just copy this at the start of the file #include "boost/algorithm/string.hpp" std::map<int, char*> shiningdata; std::map<int, char*>::iterator shiningit; Then search for if (12010 <= vnum && vnum <= 12049) and copy the following code after the if-clause if(!shiningdata.empty()){ for (shiningit=shiningdata.begin(); shiningit!=shiningdata.end(); shiningit++) if (shiningit->first == vnum) { std::string substr(shiningit->second); std::vector<string> chars; boost::split(chars, substr, boost::is_any_of("#")); for(std::vector<string>::size_type i = 0; i != chars.size(); i++) { __AttachEffectToArmours(chars[i]); } } } } This will split after a # for multiple shining attached to one amour. Then you need to declare and define a function in InstanceBaseEffect.cpp and InstanceBase.h InstanceBaseEffect.cpp DWORD CInstanceBase::__AttachEffectToArmours(string effectfilename) { const char * effectpath = effectfilename.c_str(); CEffectManager::Instance().RegisterEffect(effectpath, false, false); return m_GraphicThingInstance.AttachEffectByName(0, "Bip01", effectpath); } Again if you wish you can modify it. I already hardcoded the bonename and the boneindex. In InstanceBase.h Search for this: protected: DWORD __AttachEffect(UINT eEftType); DWORD __AttachEffectToArmours(string effectfilename); void __DetachEffect(DWORD dwEID); Replace with this: protected: DWORD __AttachEffect(UINT eEftType); DWORD __AttachEffectToArmours(string effectfilename); DWORD __AttachEffect(char filename[128]); void __DetachEffect(DWORD dwEID); Oh Yeah watch out that your filename is no longer than 128 characters. Last but not least: Create a Python Script in your root Folder (call it whatever you like) import Shining ##Modded Version # Implemented Delim for C++ # delimiter : # EffectTable = { 11290 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11291 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11292 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11293 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11294 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11295 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11296 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11297 : ["d:/ymir work/pc/common/effect/armor/grun_shining.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11298 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11299 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11259 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11269 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"] } def LoadEffectTable(): for effect in EffectTable: for i in range(len(EffectTable[effect])): vnum = effect effectpath = EffectTable[effect][i] Shining.Add(vnum, effectpath) As you can see 2 Shinings are seperated with an "#". Last but no least import your file in your game and add the following line under the python constructor effecttable.LoadEffectTable() I Hope i didn't forgot anything
  11. 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: https://mega.nz/#!CYJVib4L!bziTs5iK-R8dznmtAbBt3E2y93xyuCV0gZLV1MHdlPs And here is part rest for how to add grade:
  12. [File: Src/Game/common/service.h] #define ENABLE_HIDE_NAME_PLAYER [File: Src/Game/common/length.h] //#1.) Search: enum EOnIdleEvents { ON_IDLE_NONE, ON_IDLE_GENERAL, ON_IDLE_MAX_NUM }; //#2.) Add bellow: #ifdef ENABLE_HIDE_NAME_PLAYER enum ETypeEventOX { EVENT_OX_MAP = 113, EVENT_OX_FLAG = 0, }; #endif [File: Src/Game/affect.h] //#1.) Search: AFFECT_BLEND, //#2.) Add bellow: #ifdef ENABLE_HIDE_NAME_PLAYER AFFECT_HIDE_NAME, #endif [File: Src/game/input_login.cpp] //#1.) Search: if (ch->GetHorseLevel() > 0) { DWORD pid = ch->GetPlayerID(); if (pid != 0 && CHorseNameManager::instance().GetHorseName(pid) == NULL) db_clientdesc->DBPacket(HEADER_GD_REQ_HORSE_NAME, 0, &pid, sizeof(DWORD)); ch->SetHorseLevel(ch->GetHorseLevel()); ch->SkillLevelPacket(); } //#2.) Add bellow: // ------------------------------------------------------------------------ // // This function is loaded when you enter in map ox // // You need to activate loaded functions with /e enable_hide_player 1 // // You need to activate command before start event // // ------------------------------------------------------------------------ // #ifdef ENABLE_HIDE_NAME_PLAYER DWORD dwHidePlayer = quest::CQuestManager::instance().GetEventFlag("enable_hide_player"); // e enable_hide_player value (0 - disable / 1 - activate) if (dwHidePlayer > EVENT_OX_FLAG) { if (ch->GetMapIndex() == EVENT_OX_MAP) { if (!ch->FindAffect(AFFECT_HIDE_NAME)) { ch->ChatPacket(CHAT_TYPE_COMMAND, "hide_player_state"); ch->AddAffect(AFFECT_HIDE_NAME, 0, 0, AFF_NONE, 60*60*24*7, 0, true, false); } } } #endif //#1.) Search: if (ch->GetGMLevel() == GM_PLAYER) ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); //#2.) Delete and replaced with: // ------------------------------------------------------------------------ // // When event ox is finished and teleport you in your home, name players // // will return back ! // // ------------------------------------------------------------------------ // if (ch->GetGMLevel() == GM_PLAYER) #ifdef ENABLE_HIDE_NAME_PLAYER ch->RemoveAffect(AFFECT_HIDE_NAME); ch->ChatPacket(CHAT_TYPE_COMMAND, "show_player_state"); #endif ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [File: Client/root/game.py] //#1.) Search: "ShowMeMallPassword" : self.AskMallPassword, //#2.) Add bellow: "hide_player_state" : self.__Player_HideState, "show_player_state" : self.__Player_ShowState, //#1.) Search: def AskMallPassword(self): self.interface.AskMallPassword() //#2.) Add bellow: def __Player_HideState(self): # Function is loaded when you are start flag enable_hide_player 1 and when you are enter in map ox. import uiGameOption self.szGetVegasModule = uiGameOption.OptionDialog() self.szGetVegasModule.__OnClickAlwaysShowNameOffButton() # Hide player name #self.szGetVegasModule.__OnClickViewChatOffButton() # Hide chat def __Player_ShowState(self): #// Function is loaded when event is finished import uiGameOption self.szGetVegasModule = uiGameOption.OptionDialog() # Show player name self.szGetVegasModule.__OnClickAlwaysShowNameOnButton() #self.szGetVegasModule.__OnClickViewChatOnButton() # Show chat ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Here is loaded function for people have < 40k (no source) quest ox_hide_state begin state start begin when login with pc.get_map_index() == 113 begin if game.get_event_flag("enable_hide_player") > 0 then cmdchat("hide_player_state") end end when logout with pc.get_map_index() == 113 begin if game.get_event_flag("enable_hide_player") > 0 then cmdchat("show_player_state") end end end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Other thing about block: [File: Client/root/game.py] //#1.) Search: def ShowName(self): self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) //#2.) Delete and replaced with: def ShowName(self): import background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: chat.AppendChat(chat.CHAT_TYPE_INFO, constInfo.EVENT_OX_WARNING_ALT) else: self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) [File: Client/root/uiGameOption.py] //#1.) Search: def __OnClickAlwaysShowNameOnButton(self): systemSetting.SetAlwaysShowNameFlag(True) self.RefreshAlwaysShowName() def __OnClickAlwaysShowNameOffButton(self): systemSetting.SetAlwaysShowNameFlag(False) self.RefreshAlwaysShowName() //#2.) Delete and replaced with: def __OnClickAlwaysShowNameOnButton(self): import uiCommon, background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: self.wndPopup = uiCommon.PopupDialog() self.wndPopup.SetText(constInfo.EVENT_OX_WARNING_ON) self.wndPopup.Open() else: systemSetting.SetAlwaysShowNameFlag(True) self.RefreshAlwaysShowName() def __OnClickAlwaysShowNameOffButton(self): import uiCommon, background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: self.wndPopup = uiCommon.PopupDialog() self.wndPopup.SetText(constInfo.EVENT_OX_WARNING_OFF) self.wndPopup.Open() else: systemSetting.SetAlwaysShowNameFlag(False) self.RefreshAlwaysShowName() [File: Client/root/uiGameOption.py] //#1.) Search: CHRNAME_COLOR_INDEX = 0 //#2.) Add bellow: ################################################## HIDE PLAYER NAME - START ###################################################################### ###################################################################################################################################################### ENABLE_HIDE_NAME_PLAYER = 1 # Enable check [0 - disable / 1 - enabled] EVENT_OX_MAPNAME = "season1/metin2_map_oxevent" # Name map EVENT_OX_WARNING_ALT = "You can not do this during the event!" # Message when you press key [ALT] from keyboard. EVENT_OX_WARNING_ON = "You can display the name of the player during the event ox!" # Message loaded from gameOption when you -> Name Always (Show). EVENT_OX_WARNING_OFF = "You can disable the name of the player during the event ox!" # Message loaded from gameOption when you -> Name Always (Hide). ################################################## HIDE PLAYER NAME - STOP ####################################################################### ###################################################################################################################################################### PS: I not tested, i only write for other friend because he say me to help with this. - http://image.prntscr.com/image/f12be8a99a9647c7a5347d237df31fe4.png
  13. Hi everyone, Microsoft 3 years ago in 2011 released the first version of the Python Tools for Visual Studio and they are still working on it,. Now everybody thinking how is it better to use Visual Studio instead of Notepad++? My opinions are: Better Syntax highlighting IntelliSense Many useful options like these: Go To Definition, Find All References Visual Studio GUI is amazing, It's dream to work with it Example of the Syntax highlighting: Example of the Find All References: Example of the IntelliSense: How to download & install: Go to the Python Tools for Visual Studio Codeplex page and follow the tutorial or just follow these steps: 1. Download Visual Studio, Express version does not supported! 2. Install PTVS for for your Visual Studio version: 2010, 2012, 2013 3. Install Python 2.7 That's all, now you are ready to import the py files: Extract root, locale and uiscript or anything you wan't and separate them to folders. Example: Open Visual Studio and create a new project using the "From Existing Python code" option. On the next window add the path of the 3 folders. Now click on Next and select Python 2.7 from the dropdown list. That's all, now Visual Studio creating your new project with the added files. If you have any question or suggestion, please just reply to this topic. Kind Regards, Sanchez
  14. Hi Metin2Dev. I'm here for post a simple checkfiles on client. Go go to root / intrologin.py Here is the script: Best Regards, Mr.Slime
  15. Hi Guys So, I saw a script which is delete *.py *.mix ... the bad files in the game folder. I thought about it and created a script which check ALL FOLDER AND ALL FILES CURRENT DIRECTORY and compare WITH A PATCHLIST. Let's check: ########################## ###>>>coded by Nexus<<<### ########################## import urllib.request import os import threading repeattime = 2 url = 'http://exapmle.com/patcher/patchlist.txt' backslash = '' curdir= (os.getcwd()) #the web list response = urllib.request.urlopen(url) data = response.read() # a `bytes` object text = data.decode('utf-8') # a `str`; this step can't be used if data is binary lines = text.split('n') protectedfiles = [line.strip() for line in lines] for x in protectedfiles: gfullfile= (curdir + backslash + x.split(';')[0]) protectedfiles [protectedfiles.index(x)] = gfullfile # ##ha-ha-ha #save your self by the self-delete or the usr config files protectedfiles.append(curdir + backslash + "config.cfg") allcurrentfile=[] def again(): for path, subdirs, files in os.walk(curdir): for name in files: onefile = (os.path.join(path, name)) if onefile not in protectedfiles: os.remove(onefile) threading.Timer(repeattime, again).start() again() protectedfiles.append(curdir + backslash + "CONFIG.CFG") this is necessary, because this file created by the config.exe , and this file storage the like the sound volume, screen resolution. (you couldn't patching this file) so the script is check the files by the patchlist, my patchlist look as: excxy.pyc;0c1759a0 etcyx.py;e626408e THE FILE + HASH (in between ';') you change the patchlist url here: url = 'http://exapmle.com/patcher/patchlist.txt' and the repeattime means the how often repeat the checking. the script DELETE the file if it doesn't listed. HUH, don't be afraid ,not long.
  16. Hi metin2dev today i wanna release a little function to convert in the easyest way number in pointed number string. Ex: From :150000000 In : 150.000.000 It's very usefull if you need to create a new coins manage interface like that: Here the full commented code: def splittedvalue(value): x = value x_list = list(x) #convert string in list x_list.reverse() #reverse list for the right point if len(x)%3 == 0: #checking how many point must insert.If there is not rest, point -1 to avoid .100.500 count_point = len(x)/3-1 else: count_point = len(x)/3 for point in range(0,count_point): #insert the points in the right place x_list.insert((3*int(point+1)+point),".") x_list.reverse() #reverse again the list as begining x_list = "".join(x_list) #reconvert list in string return x_list #finally return string value with point Reguards Luzzo
  17. Backup your source code with this script ... my source code include(client, server, tools, extern) which there size exactly = 4.69 GB (5,044,632,548 bytes) after compressing size of archive = 32.5 MB (34,117,184 bytes) but you must first install WinRar archiver which you can download it from here http://filehippo.com/download_winrar_32/ or from here http://www.softpedia.com/get/Compression-tools/WinRAR.shtml#download import os , shutil, sys from os import path , system ignored = [".sdf",".opensdf", "",".pch", ".vcproj", ".tlog", ".log", ".exe", ".Release", ".obj", ".sbr", ".bak", ".ipch", ".pdb", ".cod", ".lastbuildstate", ".bsc" ,".res", ".idb" ,".cache", ".htm", ".cmd"] ignoreddirs = ["MfcDebug", "Release", "Debug","ipch","bin","obj", "Distribute", ".tlog", ".*cmd"] bCMD = "temp.cmd" i = 0 def comperess_writer(foldername): if not os.listdir(foldername): print("Error: %s folder is empty \nsystem will close the script now"%(foldername)) system("pause")# this is an optinal command if you want to see what is going on return x = open(bCMD, 'w') x.write('set path="C:\Program Files\WinRAR\";%path% c:/Program Files/WinRAR/\n') x.write('Rar.exe a -ac -r -m5 -esh -mc12t -ep1 ') i = 0 while i <= (len(ignoreddirs) - 1): x.write(' -x\*%s\*'%(ignoreddirs[i])) i += 1 x.write(" \"Backup\" ") chkdict = {} setdef = chkdict.setdefault for root, dirs, files in os.walk(foldername): for file in files: ext = path.splitext(file)[1] if ext in chkdict or ext in ignored: continue print("%s" % setdef(ext,ext)) x.write(foldername + "\*%s " % setdef(ext,ext)) x.write(" *makefile *Depend *readme *tags\npause") x.close() type = yes_no("Do you want to backup now?", "yes") if type == True: comperess() exit() def comperess(): os.system(bCMD) os.remove(bCMD) def yes_no(question, default="yes"): valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False} if default is None: prompt = " [y/n] " elif default == "yes": prompt = " [Y/n] " elif default == "no": prompt = " [y/N] " else: raise ValueError("invalid default answer: '%s'" % default) sys.stdout.write(question + prompt) choice = raw_input().lower() if default is not None and choice == '': return valid[default] if choice in valid: return valid[choice] else: sys.stdout.write("Please respond with 'yes' or 'no' ", "(or 'y' or 'n').\n") def main(): global i if i == 0: print ("Hello This is Auto Backup program\nfor Metin2 C++ source code") print ("type the number of the command you want to execute") print ("1:Comperess\n2:Exit") type = raw_input("Type Number:") type = int(type) if type == 1: folder = raw_input("Folder Name:") if not os.path.isdir(folder): exit() comperess_writer(folder) if type == 2: exit() else: i +=1 os.system("cls") print ("Please Type 1 or 2") main() main() #updated --> fixed the archiving problem "archiving very folder in the current folder" #updated --> more compressing plus cleaning attributes after finishing
  18. 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.
  19. 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 Resthea.eu, 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 = Image.open("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 Resthea.eu, qentinios Old video with system: https://www.youtube.com/watch?v=sz1njy6sBqQ Download: Without skyboxes: https://www.mediafire.com/?edtdz50gc4tzmqj With skyboxes: https://www.mediafire.com/?y14v0yir24tqbvv
  20. Hi. Today I want to show you my script, which i write while ago, and which help me with FreeBSD and Metin2 server. It's a script/system which do our commands like normal commandline but, it also contains usefull stuff e.g: We can create safe backup of our files through simple command "create backup of mysql", we can also upload this backup to another web hosting. We can run our server just writing "run ch 1" or "run 5 channels" We can install e.g apache22 just through write command "install apache22" And there are no differences when we write Run or run or RUN There are also no differences when we write e.g 'delete logs' or 'Delete all of the LoGs ' The possibilities are many but I don't know if you'll like it In this topic i give you a simple script which will install this system http://pastebin.com/XQTRgpMj or #!/usr/local/bin python3.3 #-*- coding" utf-8 -*- #------------------------------------------------- #Made by Deucalion #Hello, it's installation script to Russell system #This script will: # -python3.3 ~ Install one of the newest python versions # -pymysql ~ Install library to connecting mysql with python # -Russell ~ Download all system # -----------MySQL--------------- # create database Russell; # Use Russell; # DROP TABLE IF EXISTS `lang`; # CREATE TABLE `lang` ( # `Language` varchar(20) NOT NULL, # PRIMARY KEY (`Language`) # ) ENGINE=InnoDB DEFAULT CHARSET=latin1; # DROP TABLE IF EXISTS `privilages`; # CREATE TABLE `privilages` ( # `id` varchar(20) NOT NULL DEFAULT '0', # `login` varchar(20) NOT NULL, # `password` varchar(20) NOT NULL, # `name` varchar(20) NOT NULL, # PRIMARY KEY (`id`) # ) ENGINE=InnoDB DEFAULT CHARSET=latin1; import os def install(): print ("Do you want to update your ports?") choice= input("write y/n: ") if choice == 'n': pass elif choice == 'y': os.system("portsnap fetch update") print ("Do you want to install this system?") choice= input("write y/n: ") if choice == 'n': return elif choice == 'y': print ("Do you have already installed python3.3?") choice_python=input("write y/n: ") if choice_python == 'y': pass else: os.system("cd /usr/ports/lang/python33 && make all install clean -DBATCH") os.system("sleep 2") print ("I installed python 3.3") print ("Do you have already installed pymysql for python3.3?") choice_pymysql=input("write y/n: ") if choice_pymysql == 'y': pass else: os.system("sleep 2") os.system("cd / && fetch http://sysforum.tk/system/Makefile") os.system("mv /Makefile /usr/ports/databases/py-pymysql") os.system("cd /usr/ports/databases/py-pymysql/ && make all install clean -DBATCH") os.system("sleep 2") print ("I installed pymysql") os.system("sleep 2") os.system("cd / && fetch http://sysforum.tk/system/Russell.tar.gz") os.system("cd / && tar zxvf Russell.tar.gz") print ("I extracted system") os.system("cd /bin && echo /usr/local/bin/python3.3 /Russell/Russell.pyc >> russell") os.system("chmod -r 0555 /bin/russell") print ("Done, now you can run it by write 'russell' in commandline but") print ("first you must write into Russel.lang in MySQL your language") print ("for now are 2 language available English or Polish") print ("") print ("Regards") return "Deucalion" print (install()) It will install python 3.3, library pymysql and download my script/system --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- System I call him just Russell Like i write he will do our command, bu the best is this that when we don't want e.g run server , just check proccess, so when we write 'ps' he will do a standard UNIX command . Some example commands: Convert item_proto - It will be convert our item_proto from sql to txt Convert mob_proto - It will be convert our mob_proto from sql to txt Delete logs - It will be delete logs from our channels Run server - It will be run all cores and channels Run auth - It will be run auth/DB Run 5 channels - It will be run all cores for 5 channels Reset 2 channel - It will be reset only second channel and his all cores Run/stop/reset ch1 / channel 1/ - It will be run/stop/reset our first channel and this is exception becouse he will always run/stop/reset also db and auth Add/show/delete notes - We can write some notes , view them or delete them Update system/freebsd - It will be upgrade our system Restart/reboot system - It will be reset our FreeBSD Create backup of mysql, create backup of all files contains(mysql,files of Metin2 and Russells files) - Create backup and next he will ask us, if we want upload to our second hosting. He create backup with actually datetime We can also create backup e.g only account or player database by e.g 'create backup of player' Some example screens: For now are only two languages Polish and English, but the english is not the best ;/ You can chose language in MySQL Installation You must just run installation script by python e.g copy it to main directory to file 'russell_installation.py' and run by command python russell_instalation.py after installation you must create database in MySQL by this query create database Russell; Use Russell; DROP TABLE IF EXISTS `lang`; CREATE TABLE `lang` ( `Language` varchar(20) NOT NULL, PRIMARY KEY (`Language`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `privilages`; CREATE TABLE `privilages` ( `id` varchar(20) NOT NULL DEFAULT '0', `login` varchar(20) NOT NULL, `password` varchar(20) NOT NULL, `name` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; In Russell.lang (MySQL) you must write English or Polish it depends on your language and in the end you must configure Config.py you must edit your ftp account and if you have another user or password to local user, you must also edit it #UPDATE --------------------------------------------------------------------------------------------------------------------------- -Some fixes with converter proto sql to txt -Added new config options -Some changes in install script To download update you must download this archive to main directory on the server and extract it. http://sysforum.tk/system/Russell.tar.gz or use new install script --------------------------------------------------------------------------------------------------------------------------- #UPDATE2 -------------------------------------------------------------------------------------------------------------------------- -New converters for item_proto e.g command: "convert item_proto from xml to sql" "convert item_proto from xml to txt" -Now you can connect commands with 'and' e.g: "delete logs and create backup" or "shutdown ch1 and ps" -fixed turning on for 1 core per channel -added update function -some litle fixes -now you can also downlaod backup from another host -in config you can set encoding for column 'name' in item_proto default it's latin1 -------------------------------------------------------------------------------------------------------------------------- If you want i will be grateful for a help with translate, you can help me by correct my mistakes in EnglishTable.py and English.py If you will want this system, i will update it, and improve it I think that it's all, sorry for my english, i know that it's bad but if you have any question just ask Regards Deucalion
  21. Hello, I will explain how you can have 24 slots item in exchange/trade dialog. ServerSide Open your "game/exchange.cpp" in Source File and search: m_pGrid = M2_NEW CGrid(4,3); Replace with: m_pGrid = M2_NEW CGrid(6,4); Open "game/exchange.h" and search: EXCHANGE_ITEM_MAX_NUM = 12 Replace with: EXCHANGE_ITEM_MAX_NUM = 24 Now you can compile your Game File. ClientSide Open "UserInterface/PythonExchange.h" from your Binary Source files and search: EXCHANGE_ITEM_MAX_NUM = 12 Replace with: EXCHANGE_ITEM_MAX_NUM = 24 Now you can compile your Client Binary. Extract "pack/uiscript" from your Client and open "exchangedialog.py", replace all content with: ExchangeDialog.py ~ 24 Slot Item Now you can compress your UiScript. Screen: Good work, Bye.
  22. #FIRST YEAH Hi Guys, Just a Simple "python Security script". Just include the file in your root for example and import in prototype.py. Its really not a big deal. Somebody asked for it. And you have to have Python 2.7 Code: import subprocess import app import threading import os import time Evil_ProcessList = ["notepad++.exe"] Evil_FileNameList = [".sdsd",".asd",".asds"] class SuperUnsecureAndNotEnoughProtectionOfferingScript(object): def __init__(self): self.LoadSuperUnsecureSystem() def __del__(self): pass def LoadSuperUnsecureSystem(self): while 1: self.CheckForEvilFiles() self.CheckForEvilProcesses() def KillProcess(self, processname): try: os.system("taskkill /f /im %s" % processname) except: app.Exit() def DeleteFile(self, filename): try: os.remove(filename) except IOError: app.Exit() def CheckForEvilFiles(self): for file in os.listdir(os.getcwd()): for filename in Evil_FileNameList: if file.endswith(filename): self.DeleteFile(file) def CheckForEvilProcesses(self): for evil in Evil_ProcessList: if evil in subprocess.Popen("tasklist", stdout=subprocess.PIPE, shell=False).communicate()[0]: self.KillProcess(evil) if __name__ == '__main__': threading.Thread(target=SuperUnsecureAndNotEnoughProtectionOfferingScript, args=()).start()
  23. Sorry, cheats aren't supported here. -- Rumor
  24. Hello, While i was surfing at the internet i saw something interesting. It's a python script which does this work: You can create a python file in your web space and import it Source: http://blog.dowski.com/2008/07/31/customizing-the-python-import-system/
  25. Hi i know someone wonder that. I just trying to explain to your about how to make. newDictionary = {} newDictionary.setdefault(0,{}) You are create new dictionary in our newDictionary. Argument Explain : First Argument is a number (integer). That's mean newDictionary[number] Second argument mean which data structure : Dictionary ( {} ) , Array ( [] ) Best Regards Ellie