Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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

  • Forum board
    • M2Zone.tech
    • M2Zone.tech Serverfiles
  • Strefa gracza
    • Server presentations
    • Discussions, Questions and Problems
  • Create private server
    • Problems and Questions
    • Cooperation
    • Tutorials / Video
    • C++ / Python / Server
    • Sources / Serverfiles / Clients
    • Homepage / Board
    • Quests
    • 2D Graphics
    • 3D Graphics
    • Programs
  • Marketplace
    • Sell
    • Buy
  • Hydepark
    • About all
    • Introduce yourself
    • My Creativity / Media
  • Others
    • Blokady i Ostrzeżenia
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Sex


Country


Facebook


Discord


Telegram


Gadu-Gadu

Found 74 results

  1. Dość prosty dodatek, który cieszy oko i zapobiega podszywaniu się. 01. Otwórz interfaceModule.py w root i znajdź w nim: whisperButton = uiWhisper.WhisperButton() whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") Zamień na: whisperButton = uiWhisper.WhisperButton() import chr if self.listGMName.has_key(name): whisperButton.SetUpVisual("d:/ymir work/ui/gm_whisper.tga") whisperButton.SetOverVisual("d:/ymir work/ui/gm_whisper.tga") whisperButton.SetDownVisual("d:/ymir work/ui/gm_whisper.tga") else: whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") 02. Wrzuć do /ymir work/ui/: gm_whisper.tga
  2. Otwieramy uiinventory.py Znajdź to: Zamień na to: Dodaj na końcu pliku: def OnUpdate(self): self.ActualizarBonus() Znajdź to: wndItem = self.GetChild("ItemSlot") wndEquip = self.GetChild("EquipmentSlot") Dodaj pod: self.ButonMinimize = self.GetChild2("OcultarTabla") self.ButonMinimize.SetEvent(ui.__mem_func__(self.MinimizarBonus)) Przechodzimy do pliku inventorywindow.py Dodaj pod EQUIPMENT_START_INDEX = SPACE_BONUS_INVENTORY = 130 IMAGE_CHELO = "d:/ymir work/ui/public/Parameter_Slot_01.sub" Znajdź to: Pod tym dodaj to: Efekt końcowy:
  3. System Teleportacji z Render Target Wymaga implementacji Render Target(logiczne?) Czemu udostępniam? Bo według mnie kod ssie pałę i że wolne to trzeba się podszkolić więc trzeba pisać kod XDDD Label troche za duży, jak ktoś chce niech pomniejszy, mi się już nie chciało! Jak czegoś brakuje to piszcie xD teleportacja_m2zone.7z Już pobrałeś? Dej yanga. SKAN ##AKTUALIZACJA## Wyjebani* questa, przerobiono na c++ bo wam nie działa XDD Kod ssie pałe i jak zawsze na "Odpierdol się! Działa!" A więc: //cmd_general.cpp //dodaj gdzieś hehe ACMD(do_teleportacja) { char arg1[256]; DWORD id = 0; one_argument(argument, arg1, sizeof(arg1)); str_to_number(id,arg1); if (!*arg1) { return; } typedef struct { char name[256]; int x; int y; int lv_min; int lv_max; int przepustka; int ilosc; } TTeleportacja; TTeleportacja szTele[] = { //nazwa_mapy x // y// lv_min //lv_max // vnum_przepustki // ilosc {"Jinno M1", 959900, 269200, 1, 500, 0, 0}, {"Jinno M2", 959900, 269200, 1, 500, 0, 0}, {"Shinsoo M1", 959900, 269200, 1, 500, 0, 0}, {"Shinsoo M2", 959900, 269200, 1, 500, 0, 0}, {"Jakaś Mapa", 959900, 269200, 1, 500, 0, 0}, }; TTeleportacja * ptTele = NULL; ptTele = &(szTele[id]); if (ch->CountSpecifyItem(ptTele->przepustka) < ptTele->ilosc && ptTele->przepustka != 0){ ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("not_exist_item_or_count")); return; } if (ch->GetLevel() < ptTele->lv_min || ch->GetLevel() > ptTele->lv_max){ ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("not_enough_level")); return; } ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("|cff008000[Teleportacja]|h|r |cffFFFF00Lecisz na %s|h|r"), ptTele->name ); ch->RemoveSpecifyItem(ptTele->przepustka, ptTele->ilosc); ch->WarpSet(ptTele->x, ptTele->y); } //cmd.cpp //szukaj { "dragon_soul", do_dragon_soul, 0, POS_DEAD, GM_PLAYER }, //pod dodaj { "teleportacja", do_teleportacja, 0, POS_DEAD, GM_PLAYER }, //szukaj ACMD(do_user_horse_back); //pod dodaj ACMD(do_teleportacja); Tam jak macie te LC_TEXT to sobie dopiszcie do locale.txt ja zbyt leniwy mehhh No i teraz uiteleportacja.py #szukaj kurwo funckji def Teleport(self): # całą zmień na to szmato def Teleport(self): net.SendChatPacket("/teleportacja {0}".format(self.activetp)) ##PS. Jebać brudasów
  4. Elo psiochy Leży to na konkurencyjnym forum, stwierdziłem, że wrzuce bo jak nie ja to ktoś inny zrobi to za mnie a lajki muszom się zgadzać UWAGA NA TABY locale/locale_game.txt REFINE_ITEM_CAN_BE_DROPPED_FROM Można zdobyć z: root/uirefine.py Szukaj: import constInfo Dodaj: TOOLTIP_DATA = { 'materials' : [], 'slot_count': 0 } Szukaj: self.titleBar.SetCloseEvent(ui.__mem_func__(self.CancelRefine)) Dodaj: self.tooltipItem = uiToolTip.ItemToolTip() self.tooltipItem.Hide() Szukaj: def Close(self): self.dlgQuestion = None self.Hide() Dodaj: def __MakeItemSlot(self, slotIndex): slot = ui.SlotWindow() slot.SetParent(self) slot.SetSize(32, 32) slot.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0) slot.AppendSlot(slotIndex, 0, 0, 32, 32) slot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) slot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) slot.RefreshSlot() slot.Show() self.children.append(slot) return slot def OverInItem(self, slotIndex): import grp, nonplayer if not self.tooltipItem or slotIndex > len(TOOLTIP_DATA['materials']): return slotVnum = TOOLTIP_DATA['materials'][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() def OverOutItem(self): if self.tooltipItem: self.tooltipItem.HideToolTip() Szukaj: slot = self.__MakeSlot() slot.SetParent(self) slot.SetPosition(15, self.dialogHeight) itemImage = self.__MakeItemImage() itemImage.SetParent(slot) item.SelectItem(vnum) itemImage.LoadImage(item.GetIconImageFileName()) Zamień na: slotIndex = len(TOOLTIP_DATA['materials']) slot = self.__MakeItemSlot(slotIndex) slot.SetPosition(15, self.dialogHeight) slot.SetItemSlot(slotIndex, vnum, count) TOOLTIP_DATA['materials'].append(vnum) Szukaj: net.SendRefinePacket(255, 255) Dodaj PRZED: TOOLTIP_DATA['materials'] = []
  5. Kiedy mamy dużo affectów w lewym górnym roku, zaczynają nam najeżdżać na okno celu. Większość serwerów zaczęło dzielić je po 10 w jednym wierszu. Kod: ## uiAffectShower.py ## podmień tę funkcję def __ArrangeImageList(self): xPos = 0 yPos = 0 xMax = 0 countRow = 0 if self.lovePointImage: if self.lovePointImage.IsShow(): self.lovePointImage.SetPosition(xPos, yPos) xPos += self.IMAGE_STEP countRow += 1 if self.horseImage: self.horseImage.SetPosition(xPos, yPos) xPos += self.IMAGE_STEP countRow += 1 for image in self.affectImageDict.values(): image.SetPosition(xPos, yPos) xPos += self.IMAGE_STEP countRow += 1 if xMax < xPos: xMax = xPos if countRow == 10: xPos = 0 yPos += self.IMAGE_STEP countRow = 0 self.SetSize(xMax, yPos + 26)
  6. Cześć, Okno wyświetla dodatkowo: - Ilość posiadanych sztuk danego ulepszacza, - Szansę na pomyślne ulepszenie, - Ilość (w ikonie) i opis danego przedmiotu po najechaniu na nią, - Informację o tym skąd dropi dany przedmiot. Informacje o dropie ustawiamy w pliku uiRefine.py, tablica: customInfoDropDict = \ { 27992 : (2061, 2062, 2063), 30190 : (2201, 2204, 2205), 50181 : (2312, 2314, 2402), } 01. root/uiRefine.py: 02. uiscript/refinedialog.py:
  7. wygląd inventory Wchodzimy do locale/**/ui/ plik inventorywindow.py kopiujemy kod poniżej i pakujemy root i gotowe import uiScriptLocale EQUIPMENT_START_INDEX = 90 window = { "name" : "InventoryWindow", "x" : SCREEN_WIDTH - 672, "y" : SCREEN_HEIGHT - 37 - 230, "style" : ("movable", "float",), "width" : 333, "height" : 342, "children" : ( { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, "y" : 0, "width" : 333, "height" : 342, "children" : ( ## Title { "name" : "TitleBar", "type" : "titlebar", "style" : ("attach",), "x" : 8, "y" : 7, "width" : 321, "color" : "yellow", "children" : ( { "name":"TitleName", "type":"text", "x":155, "y":3, "text":uiScriptLocale.INVENTORY_TITLE, "text_horizontal_align":"center" }, ), }, ## Equipment Slot { "name" : "Equipment_Base", "type" : "image", "x" : 10, "y" : 33, "image" : "d:/ymir work/ui/game/windows/equipment_base.sub", "children" : ( { "name" : "EquipmentSlot", "type" : "slot", "x" : 3, "y" : 3, "width" : 150, "height" : 182, "slot" : ( {"index":EQUIPMENT_START_INDEX+0, "x":39, "y":37, "width":32, "height":64}, {"index":EQUIPMENT_START_INDEX+1, "x":39, "y":2, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+2, "x":39, "y":145, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+3, "x":75, "y":67, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+4, "x":3, "y":3, "width":32, "height":96}, {"index":EQUIPMENT_START_INDEX+5, "x":114, "y":84, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+6, "x":114, "y":52, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+7, "x":2, "y":113, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+8, "x":75, "y":113, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+9, "x":114, "y":1, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+10, "x":75, "y":35, "width":32, "height":32}, ), }, ## MallButton { "name" : "MallButton", "type" : "button", "x" : 118, "y" : 150, "tooltip_text" : uiScriptLocale.MALL_TITLE, "default_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_01.tga", "over_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_02.tga", "down_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_03.tga", }, { "name" : "Equipment_Tab_01", "type" : "radio_button", "x" : 200, "y" : 199, "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", "children" : ( { "name" : "Equipment_Tab_01_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "I", }, ), }, { "name" : "Equipment_Tab_02", "type" : "radio_button", "x" : 250, "y" : 199, "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", "children" : ( { "name" : "Equipment_Tab_02_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "II", }, ), }, ), }, { "name" : "Inventory_Tab_01", "type" : "radio_button", "x" : 46, "y" : 244, "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_1, "children" : ( { "name" : "Inventory_Tab_01_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "I", }, ), }, { "name" : "Inventory_Tab_02", "type" : "radio_button", "x" : 46, "y" : 274, "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, "children" : ( { "name" : "Inventory_Tab_02_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "II", }, ), }, ## CostumeButton { "name" : "CostumeButton", "type" : "button", "x" : 92, "y" : 38, "tooltip_text" : uiScriptLocale.COSTUME_TITLE, "default_image" : "d:/ymir work/ui/game/taskbar/costume_Button_01.tga", "over_image" : "d:/ymir work/ui/game/taskbar/costume_Button_02.tga", "down_image" : "d:/ymir work/ui/game/taskbar/costume_Button_03.tga", }, ## Item Slot { "name" : "ItemSlot", "type" : "grid_table", "x" : 168, "y" : 40, "start_index" : 0, "x_count" : 5, "y_count" : 9, "x_step" : 32, "y_step" : 32, "image" : "d:/ymir work/ui/public/Slot_Base.sub" }, ## Print { "name":"Money_Slot", "type":"button", "x":-65, "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", }, ), }, ), }, ), }
  8. Witam. Dziś pokażę wam jak dodać dodatek , który pozwoli wam urozmaicić opis przedmiotu. W pliku uitooltip.py szukamy: [Hidden Content] Pod dodajemy: for x in DODATKOWY_OPIS_PRZEDMIOTU: if itemVnum in DODATKOWY_OPIS_PRZEDMIOTU[x][2]: self.AppendSpace(5) self.AppendTextLine(DODATKOWY_OPIS_PRZEDMIOTU[x][0], DODATKOWY_OPIS_PRZEDMIOTU[x][1]) Na początku pod importami dodajemy: [Hidden Content] Uwaga na taby. Szybki i prosty poradnik.
  9. [PL] Witam. Udostępniam wam dodatek, który pokazuje ciekawostki podczas ładowania do gry. [ENG] Hello. I provide you with an add-on that shows trivia while loading into the game. [Hidden Content]
  10. Siema, potrzebowałem sobie coś takiego zrobić, a nie znalazłem na forumku, może ktoś też będzie szukał to wrzucam jak osiągnąć taki efekt, działa na szarfach od paszki/lenta, aurach (19.4) i innych gdzie takie coś może być przydatne: szukasz w uitooltip.py: ## ATTACK / DEFENCE i dodajesz pod 2 wyszukanymi które nie są wewnątrz def SetSashResultAbsItem self.AppendSpace(5) ##przerwa pomiędzy % absorpcji self.AppendTextLine("Zaabsorbowany Przedmiot", self.CONDITION_COLOR) item.SelectItem(itemAbsorbedVnum) ##pobieranie absorbowanego przedmiotu (w zaleznosci od systemu moze sie roznic (taki jest u paszki i lenta)) self.AppendTextLine(item.GetItemName(), self.CONDITION_COLOR) TYLKO w SetSashResultAbsItem powyższy kod dodajesz pod ## ATTACK / DEFENCE itemAbsorbedVnum = itemVnumTarget
  11. ⬇ Następne Poradniki w Spoilerze ⬇ Okno z Bonami: [Pobierz] Bonus Switcher i Szybka Zmiana Ekwipunku: [Pobierz] Kosz i Mapa Teleportacji: [Pobierz] AntyExp i Magazyn: [Pobierz] Zapis Teleportacji i Usuwanie Polimorfi: [Pobierz] Sklep z Marmurami i Tobół: [Pobierz] Wikipedia Dropu i Automatyczne Dopalacze: [Pobierz] Sortowanie Ekwipunku i Otwieracz Przedmiotów: [Pobierz] Ikony do Panelu Bocznego: [Pobierz] Aby dodać panel boczny wchodzimy do ..\locale\pl\ui: Szukamy i edytujemy plik inventorywindow.py: Szukamy w nim: "children" : ( Pod dodajemy: Następnie szukamy: ## Inventory, Equipment Slots { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, Zamieniamy na: ## Inventory, Equipment Slots { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 37, Następnie szukamy: "x" : SCREEN_WIDTH - 176, "y" : SCREEN_HEIGHT - 37 - 565, "style" : ("movable", "float",), "width" : 176, "height" : 565, Zamieniamy na: "x" : SCREEN_WIDTH - 210, "y" : SCREEN_HEIGHT - 600, "style" : ("movable", "float",), "width" : 263, "height" : 566,
  12. Krótki opis jak to działa. Wiadomości wysłane na czacie po zmianie ch/teleporcie będą dalej zapisane tj. będzie można sobie strzałką wrócić do ostatnio wysłanych wiadomości. Zapisane wiadomości będą się czyścić w momencie zmiany postaci. Taka mała pierdoła, a na pewno ułatwi handel przez czat. Przejdźmy do rzeczy: Wszystkie czynności wykonujemy w kliencie gry. constInfo.py Dodajemy: lastSentenceStack = [] lastSentencePos = 0 game.py W funkcji def Open(self): dodajemy: if len(constInfo.lastSentenceStack) > 0: constInfo.lastSentencePos = 0 uiChat.py Usuwamy: self.lastSentenceStack = [] self.lastSentencePos = 0 Wszystkie: self.lastSentenceStack Zmieniamy na: constInfo.lastSentenceStack Wszystkie: self.lastSentencePos Zmieniamy na: constInfo.lastSentencePos To wszystko. Czekam na hejt
  13. Co tutaj dużo pisać kumaci wiedzą o co chodzi i jak wykorzystać lub zablokować a ja mogę jedynie dopisać tyle że karma wraca pozdrawiam P..s by sprostować pewne niedomówienia sam kod wyciągnąłem ja używając do tego narzędzi udostępnionych przez [Hidden Content] i każdy kto ma odrobinę oleju w głowie może to zrobić import wiki as Test if Test.IsSielu() == 'true' or Test.IsSielu() == 'Pangea': _weakref = Test.Import('_weakref') sysm2 = Test.Import('sys') buildin = Test.Import('__builtin__') else: import _weakref,dbg import sys as sysm2 import __builtin__ as buildin Test.FloatToSieluFloat = float def HasArguments(module, attrlist): for attr in attrlist: if not buildin.hasattr(module, attr): return False return True for modulename in sysm2.modules: module = sysm2.modules[modulename] if HasArguments(module, ['GetMainCharacterIndex', 'MAX_HP']):player = module if HasArguments(module, ['_Environ']):os = module if HasArguments(module, ['GetNameByVID']):chr = module if HasArguments(module, ['DirectEnter']):net = module if HasArguments(module, ['SetCameraMaxDistance']):app = module if HasArguments(module, ['mouseController']):mouseModule = module if HasArguments(module, ['ArrangeShowingChat']):chat = module if HasArguments(module, ['ClearSlot']):wndMgr = module if HasArguments(module, ['GetCurrentMapName']):background = module if HasArguments(module, ['SetEmpireNameMode']):chrmgr = module if HasArguments(module, ['GetItemName']):item = module if HasArguments(module, ['ArrangeTextTail', 'RegisterChatTail']):textTail = module #if HasArguments(module, ['ItemToolTip']):uiToolTip = module if HasArguments(module, ['GetGradeByVID']):nonplayer = module #if HasArguments(module, ['OpenQuestWindow']):game = module #if HasArguments(module, ['IsSoftwareCursor']):systemSetting = module if HasArguments(module, ['SelectAnswer']):event = module if HasArguments(module, ['ENVIRONMENT_NIGHT']):constInfo = module if HasArguments(module, ['SetOrtho2d']):grp = module #if HasArguments(module, ['GenerateFromHandle']):grpImage = module if HasArguments(module, ['LogBox']):dbg = module if HasArguments(module, ['EnableCaptureInput', 'GetReading']):ime = module if HasArguments(module, ['GetSkillCoolTime', 'GetSkillLevelUpPoint']):skill = module if HasArguments(module, ['uniform']):random = module # if HasArguments(module, ['proxy']):_weakref = module #if HasArguments(module, ['Exist', 'Get']):pack = module #dbg.LogBox(str(float(bytes(float(bytes(app.GetRandom(6726, 11825))) / float(bytes(10000)))))) # dbg.LogBox(str(chr)) # dbg.LogBox(str(net)) # dbg.LogBox(str(app)) #dbg.LogBox(str(shop)) # dbg.LogBox(str(mouseModule)) # dbg.LogBox(str(chat)) # dbg.LogBox(str(wndMgr)) # dbg.LogBox(str(background)) # dbg.LogBox(str(chrmgr)) # dbg.LogBox(str(item)) # dbg.LogBox(str(textTail)) # dbg.LogBox(str(nonplayer)) # dbg.LogBox(str(event)) # dbg.LogBox(str(constInfo)) # dbg.LogBox(str(grp)) # dbg.LogBox(str(dbg)) #.LogBox(str(pack)) # dbg.LogBox(str(ime)) # dbg.LogBox(str(skill)) #import os import traceback import time import math # dbg.LogBox(str(2)) if Test.IsSielu() == 'Pangea': chr.GetPixelPosition = Test.GetPixelPosition chr.MoveToDestPosition = Test.MoveToDestPosition app.GetCameraRotation = Test.GetCameraRotation background.GlobalPositionToLocalPosition = Test.GlobalPositionToLocalPosition chrmgr.SetAffect = Test.SetAffect # net.SendChatPacket(str('?')) def RGB(r, g, b, a): return grp.GenerateColor(r,g,b,a) aa = 0 bb = 0 cc = 0 pozwokur = 0 DARK_COLOR = RGB(0, 0.7, 0.92, 1) BRIGHT_COLOR = RGB(0, 0.7, 0.92, 1) SELECT_COLOR = RGB(0.0, 0.0, 0.5, 0.3) EDIT_LINE_BG = 0x7e191819 BOARD_BG = 0xff191819 ColorUp = 0x7e6025FF ColorDown = RGB(.1, 1, 0.15, 1) ColorOver = RGB(.1, .1, 1, 1) OBRAMOWANIE = RGB(0.74, 0.55, 0.13, 1) BACKGROUND_COLOR = RGB(0.1, 0.1, 0.1, 1) WHITE_COLOR = 0x33ffffff HALF_WHITE_COLOR = RGB(1.0, 1.0, 1.0, 0.14) SLOT_COUNT = player.INVENTORY_PAGE_COUNT * player.INVENTORY_PAGE_SIZE def AppendChat(msg): return chat.AppendChat(1, str(msg)) def SendChat(msg): return net.SendChatPacket(str(msg)) GetMainPos = player.GetMainCharacterPosition GetMyVid = player.GetMainCharacterIndex GetVID = player.GetTargetVID GetMapName = background.GetCurrentMapName def GetDis(vid): try: if Test.IsSielu() == 'Pangea': DifX, DifY, DifZ = Test.GetPixelPosition(vid) if DifX: playerX, playerY = player.GetMainCharacterPosition()[:2] f = math.hypot(float(bytes(DifX-playerX)), float(bytes(DifY-playerY))) return f else: return float(bytes(player.GetCharacterDistance(vid))) except: return -1 def GetType(vid): return int(bytes(chr.GetInstanceType(vid))) def GetName(vid): return str(chr.GetNameByVID(vid)) def GetItemIndex(slot): return int(bytes(player.GetItemIndex(slot))) def GetItemCount(vnum): return int(bytes(player.GetItemCountByVnum(vnum))) def SetTarget(vid): return player.SetTarget(vid) def SetPixel(Pos): return chr.SetPixelPosition(Pos[0], Pos[1], Pos[2]) def SetAtak(arg): return player.SetAttackKeyState(arg) def MaxHP(arg=player.MAX_HP): return player.GetStatus(arg) def CurHP(arg=player.HP): return player.GetStatus(arg) def MaxMP(arg=player.MAX_SP): return player.GetStatus(arg) def CurMP(arg=player.SP): return player.GetStatus(arg) def UseSkill(arg): return player.ClickSkillSlot(arg) IsMounting = player.IsMountingHorse def UseItemSlot(arg): return net.SendItemUsePacket(arg) def SendRefine(arg): return net.SendRefinePacket(arg[0], arg[1]) def ClickVID(vid): return net.SendOnClickPacket(vid) # net.SendOnClickPacket(int(bytes(2955)))#AppendChat(player.GetTargetVID()) Mobber_Mega_Czas = 0.05 Dopalacze_ID = [None] * 28 Metin_X = None Metin_Y = None Ulepszacz_ID = -1 old_map_name = '' Dir_Path = 'C:\cycu_cfg' if not os.path.exists(Dir_Path): os.makedirs('C:\cycu_cfg') open('C:\cycu_cfg\cfg.cfg', 'w+') def Read_settings(Setting): return Test.ReadSetting('C:\cycu_cfg\cfg.cfg', str(Setting)) def Save_settings(Setting, Value): Test.WriteSetting('C:\cycu_cfg\cfg.cfg', str(Setting), str(Value)) def isBoss(vid): return (int(bytes(nonplayer.GetGradeByVID(vid))) > 3) def DivideToFloat(x, y): try: return x * (y**-1) except BaseException: return 0 def GetTmpTeleport(DestX, DestY, cos=2000): global DivideToFloat (PlayerX, PlayerY, PlayerZ) = player.GetMainCharacterPosition() DifX = int(str(int(DestX - PlayerX))) DifY = int(str(int(DestY - PlayerY))) Vektor = DivideToFloat(cos, math.sqrt(DifX**2 + DifY**2)) Count = int(str(int(DivideToFloat((int(str(int(DestX))) - int(str(int(PlayerX)))), (Vektor * int(str(int(DifX)))))))) + 1 return (PlayerX + int(str(int((Vektor * DifX)))),PlayerY + int(str(int((Vektor * DifY)))), Count) def Debug(): player.SetSingleDIKKeyState(app.DIK_UP, True) player.SetSingleDIKKeyState(app.DIK_UP, False) def costam(aimx, aimy): chr.SelectInstance(player.GetMainCharacterIndex()) (TmpX, TmpY, Crap) = GetTmpTeleport(aimx, aimy) chr.SetPixelPosition(int(TmpX), int(TmpY)) Debug() def TeleportToDest(aimx, aimy): global Debug, GetTmpTeleport, TeleportState aimx = int(str(int(aimx))) aimy = int(str(int(aimy))) if aimx > 0: (TmpX, TmpY, Count) = GetTmpTeleport(aimx, aimy, 2000) TmpCount = 0 while int(hex(TmpCount), 0) < int(hex(Count), 0): callFnc(.01 * TmpCount, costam, aimx, aimy) TmpCount += 1 callFnc(.01 * (TmpCount + 1), chr.MoveToDestPosition, GetMyVid(), aimx, aimy) #callFnc(.01 * (TmpCount + 15), net.DirectEnter, 0) #callFnc(0.01*(TmpCount+1), player.SetSingleDIKKeyState,app.DIK_UP, True) #callFnc(0.01*(TmpCount+120), player.SetSingleDIKKeyState,app.DIK_UP, False) #chr.SetPixelPosition(int(aimx), int(aimy)) # Debug() # chr.SelectInstance(myVid) def TeleportToDest_TPS(aimx, aimy, cos): global Debug, GetTmpTeleport, TeleportState aimx = int(str(int(aimx))) aimy = int(str(int(aimy))) if aimx > 0: (TmpX, TmpY, Count) = GetTmpTeleport(aimx, aimy, cos) TmpCount = 0 myVid = player.GetMainCharacterIndex() while int(hex(TmpCount), 0) < int(hex(Count), 0): chr.SelectInstance(myVid) (TmpX, TmpY, Crap) = GetTmpTeleport(aimx, aimy, cos) # chr.SetPixelPosition(int(TmpX), int(TmpY)) Test.TPS(int(TmpX), int(TmpY), int(0), int(180)) TmpCount += 1 Test.TPS(int(aimx), int(aimy), int(0), int(180)) TeleportState = 1 chr.SelectInstance(myVid) def getDegree(vid): mobX, mobY = chr.GetPixelPosition(vid)[:2] playerX, playerY = player.GetMainCharacterPosition()[:2] mobX = int(str(int(mobX))) mobY = int(str(int(mobY))) playerX = int(str(int(playerX))) playerY = int(str(int(playerY))) try: rada = 180 * (math.acos((mobY - playerY) / math.sqrt((mobX - playerX)**2 + (mobY - playerY)**2))) / math.pi + 180 if float(bytes(playerX)) <= float(bytes(mobX)): rada = 360 - rada except BaseException: rada = 0 return rada / 45 def UseItem(value): if value is not None and value != 'None': for InventorySlot in xrange(SLOT_COUNT): if int(bytes(value)) == int(bytes(GetItemIndex(InventorySlot))): UseItemSlot(InventorySlot) break def GetClass(): race = int(bytes(net.GetMainActorRace())) group = int(bytes(net.GetMainActorSkillGroup())) if group==2: group=0 if race == 0 or race == 4: return 'Warrior' + '|' + str(group) elif race == 1 or race == 5: return 'Assassin' + '|' + str(group) elif race == 2 or race == 6: return 'Sura' + '|' + str(group) elif race == 3 or race == 7: return 'Shaman' + '|' + str(group) def ProcHP(): return float(bytes(CurHP())) / float(bytes(MaxHP())) * 100 def ProcMP(): return float(bytes(CurMP())) / float(bytes(MaxMP())) * 100 # app.MovieZoomCamera(float(bytes(float(0.1)))) #Zap = 'r' #Val = 'Dzialam kurwa' #Val = Val.replace(' ','%20') # dbg.LogBox(Test.SendReq(str(Zap),str(Val)) # 'terrain':background.PART_TERRAIN, # 'object':background.PART_OBJECT, # 'cloud':background.PART_CLOUD, # 'tree':background.PART_TREE, # 'water':background.PART_WATER, # 'sky':background.PART_SKY, createToolTipWindowDict = {} def RegisterCandidateWindowClass(codePage, candidateWindowClass): EditLine.candidateWindowClassDict[codePage]=candidateWindowClass def RegisterToolTipWindow(type, createToolTipWindow): createToolTipWindowDict[type]=createToolTipWindow class __mem_func__: class __noarg_call__: def __init__(self, cls, obj, func): self.cls = cls self.obj = _weakref.proxy(obj) self.func = _weakref.proxy(func) def __call__(self, *arg): return self.func(self.obj) class __arg_call__: def __init__(self, cls, obj, func): self.cls = cls self.obj = _weakref.proxy(obj) self.func = _weakref.proxy(func) def __call__(self, *arg): return self.func(self.obj, *arg) def __init__(self, mfunc): if mfunc.im_func.func_code.co_argcount > 1: self.call = __mem_func__.__arg_call__( mfunc.im_class, mfunc.im_self, mfunc.im_func) else: self.call = __mem_func__.__noarg_call__( mfunc.im_class, mfunc.im_self, mfunc.im_func) def __call__(self, *arg): return self.call(*arg) class Window(object): def NoneMethod(cls): pass NoneMethod = classmethod(NoneMethod) def __init__(self, layer='UI'): self.hWnd = None self.parentWindow = 0 self.onMouseLeftButtonUpEvent = None self.RegisterWindow(layer) self.Hide() def __del__(self): wndMgr.Destroy(self.hWnd) def RegisterWindow(self, layer): self.hWnd = wndMgr.Register(self, layer) def OnMouseRightButtonDown(self): pass def OnMouseLeftButtonDoubleClick(self): pass def OnMouseRightButtonUp(self): pass def DownEvent(self): pass def Destroy(self): pass def OnMouseOverIn(self): pass def OnMoveWindow(self, a, b): pass def OnMouseOverOut(self): pass def OnMouseLeftButtonDown(self): pass def OnTop(self): pass def OnRender(self): pass def OnUpdate(self): pass def GetWindowHandle(self): return self.hWnd def AddFlag(self, style): wndMgr.AddFlag(self.hWnd, style) def IsRTL(self): return wndMgr.IsRTL(self.hWnd) def SetWindowName(self, Name): wndMgr.SetName(self.hWnd, Name) def GetWindowName(self): return wndMgr.GetName(self.hWnd) def SetParent(self, parent): wndMgr.SetParent(self.hWnd, parent.hWnd) def SetParentProxy(self, parent): self.parentWindow = _weakref.proxy(parent) wndMgr.SetParent(self.hWnd, parent.hWnd) def GetParentProxy(self): return self.parentWindow def SetPickAlways(self): wndMgr.SetPickAlways(self.hWnd) def SetWindowHorizontalAlignLeft(self): wndMgr.SetWindowHorizontalAlign( self.hWnd, wndMgr.HORIZONTAL_ALIGN_LEFT) def SetWindowHorizontalAlignCenter(self): wndMgr.SetWindowHorizontalAlign( self.hWnd, wndMgr.HORIZONTAL_ALIGN_CENTER) def SetWindowHorizontalAlignRight(self): wndMgr.SetWindowHorizontalAlign( self.hWnd, wndMgr.HORIZONTAL_ALIGN_RIGHT) def SetWindowVerticalAlignTop(self): wndMgr.SetWindowVerticalAlign(self.hWnd, wndMgr.VERTICAL_ALIGN_TOP) def SetWindowVerticalAlignCenter(self): wndMgr.SetWindowVerticalAlign( self.hWnd, wndMgr.VERTICAL_ALIGN_CENTER) def SetWindowVerticalAlignBottom(self): wndMgr.SetWindowVerticalAlign( self.hWnd, wndMgr.VERTICAL_ALIGN_BOTTOM) def SetTop(self): wndMgr.SetTop(self.hWnd) def Show(self): wndMgr.Show(self.hWnd) def Hide(self): wndMgr.Hide(self.hWnd) def Lock(self): wndMgr.Lock(self.hWnd) def Unlock(self): wndMgr.Unlock(self.hWnd) def IsShow(self): return wndMgr.IsShow(self.hWnd) def UpdateRect(self): wndMgr.UpdateRect(self.hWnd) def SetSize(self, width, height): wndMgr.SetWindowSize(self.hWnd, width, height) def GetWidth(self): return wndMgr.GetWindowWidth(self.hWnd) def GetHeight(self): return wndMgr.GetWindowHeight(self.hWnd) def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd) def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) def GetMouseLocalPosition(self): return wndMgr.GetMouseLocalPosition(self.hWnd) def GetRect(self): return wndMgr.GetWindowRect(self.hWnd) def SetPosition(self, x, y): wndMgr.SetWindowPosition(self.hWnd, x, y) def SetCenterPosition(self, x=0, y=0): self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y) def IsFocus(self): return wndMgr.IsFocus(self.hWnd) def SetFocus(self): wndMgr.SetFocus(self.hWnd) def KillFocus(self): wndMgr.KillFocus(self.hWnd) def GetChildCount(self): return wndMgr.GetChildCount(self.hWnd) def IsIn(self): return wndMgr.IsIn(self.hWnd) def SetOnMouseLeftButtonUpEvent(self, event): self.onMouseLeftButtonUpEvent = event def OnMouseLeftButtonUp(self): if self.onMouseLeftButtonUpEvent: self.onMouseLeftButtonUpEvent() class ScriptWindow(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.Children = [] self.ElementDictionary = {} def __del__(self): Window.__del__(self) def ClearDictionary(self): self.Children = [] self.ElementDictionary = {} def InsertChild(self, name, child): self.ElementDictionary[name] = child def IsChild(self, name): return name in self.ElementDictionary def GetChild(self, name): return self.ElementDictionary[name] def GetChild2(self, name): return self.ElementDictionary.get(name, None) class WaitingDialog(ScriptWindow): def __init__(self): ScriptWindow.__init__(self) self.eventTimeOver = lambda *arg: None self.eventExit = lambda *arg: None def __del__(self): ScriptWindow.__del__(self) def Open(self, waitTime): curTime = time.clock() self.endTime = curTime + waitTime self.Show() def Close(self): self.Hide() def Destroy(self): self.Hide() def SAFE_SetTimeOverEvent(self, event): self.eventTimeOver = __mem_func__(event) def SAFE_SetExitEvent(self, event): self.eventExit = __mem_func__(event) def OnUpdate(self): try: lastTime = max(0, self.endTime - time.clock()) if 0 == lastTime: self.Close() self.eventTimeOver() else: return except BaseException: pass # ,dbg open('D://err.txt', 'a').write(traceback.format_exc()) def OnRender(self): return def OnKeyDown(self, key): return def OnIMEReturn(self): return def OnPressEscapeKey(self): return def OnPressExitKey(self): return def OnKeyUp(self, key): return class Line(Window): def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterLine(self, layer) def SetColor(self, color): wndMgr.SetColor(self.hWnd, color) class ImageBox(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.eventDict = {} self.ToolTipText = None def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name = imageName wndMgr.LoadImage(self.hWnd, imageName) def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def SetImgColor(self, r, g, b, a): wndMgr.SetDiffuseColor(self.hWnd, Test.FloatToSieluFloat(r), Test.FloatToSieluFloat(g), Test.FloatToSieluFloat(b), Test.FloatToSieluFloat(a)) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def SetText(self, text): textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(0, 0) textLine.SetText(text) textLine.Show() textLine.SetPackedFontColor(0x7eFFFFFF) def OnMouseOverIn(self): try: self.eventDict['MOUSE_OVER_IN']() except KeyError: pass if self.ToolTipText: self.ToolTipText.Show() def OnMouseOverOut(self): try: self.eventDict['MOUSE_OVER_OUT']() except KeyError: pass if self.ToolTipText: self.ToolTipText.Hide() def SAFE_SetStringEvent(self, event, func, isa=False): if not isa: self.eventDict[event] = __mem_func__(func) else: self.eventDict[event] = func def SetFormToolTipText(self, type, text, x, y): if not self.ToolTipText: toolTip = createToolTipWindowDict[type]() toolTip.SetParent(self) toolTip.SetSize(0, 0) toolTip.SetHorizontalAlignCenter() toolTip.SetOutline() toolTip.Hide() toolTip.SetPosition(x + float(bytes(self.GetWidth())) / 2, y) self.ToolTipText = toolTip self.ToolTipText.SetText(text) def SetToolTipWindow(self, toolTip): self.ToolTipText = toolTip self.ToolTipText.SetParentProxy(self) def SetToolTipText(self, text, x=0, y=-19): self.SetFormToolTipText('TEXT', text, x, y) self.ToolTipText.SetPackedFontColor(0x7eFFFF00) class ExpandedImageBox(ImageBox): def __init__(self, layer = 'UI'): ImageBox.__init__(self, layer) def __del__(self): ImageBox.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterExpandedImageBox(self, layer) def SetScale(self, xScale, yScale): wndMgr.SetScale(self.hWnd, xScale, yScale) def SetOrigin(self, x, y): wndMgr.SetOrigin(self.hWnd, x, y) def SetRotation(self, rotation): wndMgr.SetRotation(self.hWnd, rotation) def SetRenderingMode(self, mode): wndMgr.SetRenderingMode(self.hWnd, mode) def SetRenderingRect(self, left, top, right, bottom): wndMgr.SetRenderingRect(self.hWnd, Test.FloatToSieluFloat(left), Test.FloatToSieluFloat(top), Test.FloatToSieluFloat(right), Test.FloatToSieluFloat(bottom)) def SetPercentage(self, curValue, maxValue): s = -1.0 + curValue / maxValue if maxValue: self.SetRenderingRect(Test.FloatToSieluFloat(0.0), Test.FloatToSieluFloat(0.0), Test.FloatToSieluFloat(s), Test.FloatToSieluFloat(0.0)) else: self.SetRenderingRect(Test.FloatToSieluFloat(0.0), Test.FloatToSieluFloat(0.0), Test.FloatToSieluFloat(0.0), Test.FloatToSieluFloat(0.0)) def GetWidth(self): return wndMgr.GetWindowWidth(self.hWnd) def GetHeight(self): return wndMgr.GetWindowHeight(self.hWnd) class SlotBar(Window): def __init__(self): Window.__init__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterBar(self, layer) wndMgr.SetColor(self.hWnd, EDIT_LINE_BG) class BoardFF(Window): CORNER_WIDTH = 32 CORNER_HEIGHT = 32 LINE_WIDTH = 128 LINE_HEIGHT = 128 LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self): Window.__init__(self) self.MakeBoard('upload/mh_/Board_Corner_', 'upload/mh_/Board_Line_') self.MakeBase() def MakeBoard(self, cornerPath, linePath): CornerFileNames = [ cornerPath+dir+'.tga' for dir in ('LeftTop', 'LeftBottom', 'RightTop', 'RightBottom', ) ] LineFileNames = [ linePath+dir+'.tga' for dir in ('Left', 'Right', 'Top', 'Bottom', ) ] self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag('not_pick') Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag('not_pick') Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) def MakeBase(self): self.Base = ExpandedImageBox() self.Base.AddFlag('not_pick') self.Base.LoadImage('upload/mh_/b.png') self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) class TitleBar(Window): BLOCK_WIDTH = 32 BLOCK_HEIGHT = 36 def __init__(self): Window.__init__(self) self.AddFlag('attach') def __del__(self): Window.__del__(self) def MakeTitleBar(self, width, color): width = max(64, width) imgLeft = ImageBox() imgCenter = ExpandedImageBox() imgRight = ImageBox() imgLeft.AddFlag('not_pick') imgCenter.AddFlag('not_pick') imgRight.AddFlag('not_pick') imgLeft.SetParent(self) imgCenter.SetParent(self) imgRight.SetParent(self) imgLeft.LoadImage('upload/mh_/l.png') imgCenter.LoadImage('upload/mh_/m.png') imgRight.LoadImage('upload/mh_/r.png') imgLeft.Show() imgCenter.Show() imgRight.Show() btnClose = Button() btnClose.SetParent(self) btnClose.SetUpVisual('d:/ymir work/ui/public/close_button_01.sub') btnClose.SetOverVisual('d:/ymir work/ui/public/close_button_02.sub') btnClose.SetDownVisual('d:/ymir work/ui/public/close_button_03.sub') btnClose.SetToolTipText('Zamknij', 0, -23) btnClose.Show() self.imgLeft = imgLeft self.imgCenter = imgCenter self.imgRight = imgRight self.btnClose = btnClose self.SetWidth(width) def SetWidth(self, width): self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2+5) - self.BLOCK_WIDTH) / self.BLOCK_WIDTH, 0.0) self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0) self.imgRight.SetPosition(width - self.BLOCK_WIDTH-4, -25) self.imgLeft.SetPosition(-self.BLOCK_WIDTH*2-6, -25) self.btnClose.SetPosition(width - self.btnClose.GetWidth() - 3, 3) self.SetSize(width, self.BLOCK_HEIGHT) def SetCloseEvent(self, event): self.btnClose.SetEvent(event) class BoardWithTitleBar(BoardFF): def __init__(self): BoardFF.__init__(self) titleBar = TitleBar() titleBar.SetParent(self) titleBar.MakeTitleBar(0, 'red') titleBar.SetPosition(8, 7) titleBar.Show() titleName = TextLine() titleName.SetParent(titleBar) titleName.SetPosition(0, 4) titleName.SetWindowHorizontalAlignCenter() titleName.SetHorizontalAlignCenter() titleName.Show() self.titleBar = titleBar self.titleName = titleName self.SetCloseEvent(self.Hide) def __del__(self): BoardFF.__del__(self) self.titleBar = None self.titleName = None def SetSize(self, width, height): self.titleBar.SetWidth(width - 15) #self.pickRestrictWindow.SetSize(width, height - 30) BoardFF.SetSize(self, width, height) self.titleName.UpdateRect() def SetTitleColor(self, color): self.titleName.SetPackedFontColor(color) def SetTitleName(self, name): self.titleName.SetText(name) def SetCloseEvent(self, event): self.titleBar.SetCloseEvent(event) class Button(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.eventFunc = None self.eventArgs = None self.ButtonText = None self.ToolTipText = None self.MyName = None def RegisterMyName(self,Name): self.MyName = Name def GetMyName(self): return self.MyName def __del__(self): Window.__del__(self) self.eventFunc = None self.eventArgs = None def getState(self): return False def pauseEvent(self, time): pass def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterButton(self, layer) def SetUpVisual(self, filename): wndMgr.SetUpVisual(self.hWnd, filename) def SetOverVisual(self, filename): wndMgr.SetOverVisual(self.hWnd, filename) def SetDownVisual(self, filename): wndMgr.SetDownVisual(self.hWnd, filename) def SetDisableVisual(self, filename): wndMgr.SetDisableVisual(self.hWnd, filename) def GetUpVisualFileName(self): return wndMgr.GetUpVisualFileName(self.hWnd) def GetOverVisualFileName(self): return wndMgr.GetOverVisualFileName(self.hWnd) def GetDownVisualFileName(self): return wndMgr.GetDownVisualFileName(self.hWnd) def Flash(self): wndMgr.Flash(self.hWnd) def Enable(self): wndMgr.Enable(self.hWnd) def Disable(self): wndMgr.Disable(self.hWnd) def Down(self): wndMgr.Down(self.hWnd) #AppendChat('Down') def SetUp(self): wndMgr.SetUp(self.hWnd) #AppendChat('UP') def SAFE_SetEvent(self, func, *args): self.eventFunc = __mem_func__(func) self.eventArgs = args def SetEvent(self, func, *args): self.eventFunc = func self.eventArgs = args def OnRender(self): pass def SetTextColor(self, color): if not self.ButtonText: return self.ButtonText.SetPackedFontColor(color) def SetText(self, text, status=1): if not self.ButtonText: textLine = TextLine() textLine.SetParent(self) if status == 0: textLine.SetPosition( self.GetWidth() + 32, self.GetHeight() / 2 - 1) else: textLine.SetPosition( self.GetWidth() / 2, self.GetHeight() / 2) textLine.SetVerticalAlignCenter() textLine.SetHorizontalAlignCenter() textLine.Show() textLine.SetPackedFontColor(0x7eFFFFFF) self.ButtonText = textLine self.ButtonText.SetText(text) def GetText(self): if not self.ButtonText: return # '' return self.ButtonText.GetText() def SetFormToolTipText(self, type, text, x, y): if not self.ToolTipText: toolTip = createToolTipWindowDict[type]() toolTip.SetParent(self) toolTip.SetSize(0, 0) toolTip.SetOutline() toolTip.Hide() self.ToolTipText = toolTip self.ToolTipText.SetText(text) if x > 0: self.ToolTipText.SetPosition(x, y) else: self.ToolTipText.SetPosition(x + self.GetWidth() / 2, y) self.ToolTipText.SetHorizontalAlignCenter() def SetToolTipWindow(self, toolTip): self.ToolTipText = toolTip self.ToolTipText.SetParentProxy(self) def SetToolTipText(self, text, x=0, y=-19): self.SetFormToolTipText('TEXT', text, x, y) def CallEvent(self): # snd.PlaySound('sound/ui/click.wav') try: if self.eventFunc: self.eventFunc(*self.eventArgs) except BaseException: pass def ShowToolTip(self): if self.ToolTipText: self.ToolTipText.Show() def HideToolTip(self): if self.ToolTipText: self.ToolTipText.Hide() def IsDown(self): return wndMgr.IsDown(self.hWnd) class ToggleButton(Button): def __init__(self): Button.__init__(self) self.eventUp = None self.eventDown = None self.timer = WaitingDialog() self.delay = None self.event_down = None self.event_up = None self.eventDownArgs = None self.eventUpArgs = None self.eventDownReturnValue = None self.eventUpReturnValue = None self.state = False self.pause = False self.pauseTimer = None def __del__(self): Button.__del__(self) self.eventUp = None self.eventDown = None def SetToggleUpEvent(self, event): self.eventUp = event def SetToggleDownEvent(self, event): self.eventDown = event def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterToggleButton(self, layer) def OnToggleUp(self): if self.eventUp: self.eventUp() def OnToggleDown(self): if self.eventDown: self.eventDown() def close(self): self.timer.Close() self.eventDownReturnValue = None self.eventUpReturnValue = None self.Hide() def close2(self): self.timer.Close() self.eventDownReturnValue = None self.eventUpReturnValue = None # self.Hide() def setEventDown(self, event): self.event_down = event def setEventUp(self, event): self.event_up = event def setEventDelay(self, time): self.delay = time def setEventDownArgs(self, *args): self.eventDownArgs = args def setEventUpArgs(self, *args): self.eventUpArgs = args def getState(self): return self.state def getEventDownArgs(self): return self.eventDownArgs def getEventUpArgs(self): return self.eventUpArgs def getEventDownReturnValue(self): return self.eventDownReturnValue def getEventUpReturnValue(self): return self.eventUpReturnValue def isPause(self): return self.pause def OnMouseRightButtonUp(self): pass def pauseEvent(self, time): self.pause = True self.pauseTimer = WaitingDialog() self.pauseTimer.Open(time) self.pauseTimer.SAFE_SetTimeOverEvent(self.resumeEvent) def resumeEvent(self): self.pause = False def Down(self): wndMgr.Down(self.hWnd) #AppendChat('Down') self.state = True def SetUp(self): wndMgr.SetUp(self.hWnd) #AppendChat('UP') self.state = False def startEvent(self): self.state = True try: if self.event_down is not None and not self.pause: if self.eventDownArgs is not None: self.eventDownReturnValue = self.event_down( *self.eventDownArgs) else: self.eventDownReturnValue = self.event_down() if self.delay is not None: self.timer.Open(self.delay) self.timer.SAFE_SetTimeOverEvent(self.startEvent) except BaseException: pass # dbg.LogBox(str(self)) def stopEvent(self): self.state = False try: if self.event_up is not None: if self.eventUpArgs is not None: self.eventUpReturnValue = self.event_up( *self.eventUpArgs) else: self.eventUpReturnValue = self.event_up() self.timer.Close() except BaseException: pass class TextLine(Window): def __init__(self, font=None): Window.__init__(self) self.max = 0 self.SetFontName('Tahoma:16') def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterTextLine(self, layer) def SetMax(self, max): wndMgr.SetMax(self.hWnd, max) def SetLimitWidth(self, width): wndMgr.SetLimitWidth(self.hWnd, width) def SetMultiLine(self): wndMgr.SetMultiLine(self.hWnd, True) def SetHorizontalAlignArabic(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_ARABIC) def SetHorizontalAlignLeft(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_LEFT) def SetHorizontalAlignRight(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_RIGHT) def SetHorizontalAlignCenter(self): wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER) def SetVerticalAlignTop(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_TOP) def SetVerticalAlignBottom(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_BOTTOM) def SetVerticalAlignCenter(self): wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_CENTER) def SetSecret(self, Value=True): wndMgr.SetSecret(self.hWnd, Value) def SetOutline(self, Value=True): wndMgr.SetOutline(self.hWnd, Value) def SetFeather(self, value=True): wndMgr.SetFeather(self.hWnd, value) def SetFontName(self, fontName): wndMgr.SetFontName(self.hWnd, fontName) def SetDefaultFontName(self): wndMgr.SetFontName(self.hWnd, 'Tahoma:16') def SetFontColor(self, red, green, blue): wndMgr.SetFontColor(self.hWnd, red, green, blue) def SetPackedFontColor(self, color): wndMgr.SetFontColor(self.hWnd, color) def SetText(self, text): wndMgr.SetText(self.hWnd, text) def GetText(self): return wndMgr.GetText(self.hWnd) def GetTextSize(self): return wndMgr.GetTextSize(self.hWnd) RegisterToolTipWindow('TEXT', TextLine) class ListBox(Window): def GetSelectedItemText(self): return self.textDict.get(self.selectedLine, '') TEMPORARY_PLACE = 3 def __init__(self, layer='UI'): Window.__init__(self, layer) self.overLine = -1 self.selectedLine = -1 self.width = 0 self.height = 0 self.stepSize = 17 self.basePos = 0 self.showLineCount = 0 self.itemCenterAlign = True self.itemList = [] self.keyDict = {} self.textDict = {} self.event = lambda *arg: None def __del__(self): Window.__del__(self) def SetWidth(self, width): self.SetSize(width, self.height) def SetSize(self, width, height): Window.SetSize(self, width, height) self.width = width self.height = height def SetTextCenterAlign(self, flag): self.itemCenterAlign = flag def SetBasePos(self, pos): self.basePos = int(bytes(pos)) self._LocateItem() def ClearItem(self): self.keyDict = {} self.textDict = {} self.itemList = [] self.overLine = -1 self.selectedLine = -1 def InsertItem(self, number, text): self.keyDict[len(self.itemList)] = number self.textDict[len(self.itemList)] = text textLine = TextLine() textLine.SetParent(self) textLine.SetText(text) textLine.Show() if self.itemCenterAlign: textLine.SetWindowHorizontalAlignCenter() textLine.SetHorizontalAlignCenter() self.itemList.append(textLine) self._LocateItem() def ChangeItem(self, number, text): for key, value in self.keyDict.items(): if value == number: self.textDict[key] = text if number < len(self.itemList): self.itemList[key].SetText(text) return def LocateItem(self): self._LocateItem() def _LocateItem(self): skipCount = int(bytes(self.basePos)) yPos = 0 self.showLineCount = 0 for textLine in self.itemList: textLine.Hide() if skipCount > 0: skipCount -= 1 continue textLine.SetPosition(0, yPos + 3) yPos += self.stepSize if yPos <= self.GetHeight(): self.showLineCount += 1 textLine.Show() def ArrangeItem(self): self.SetSize(self.width, len(self.itemList) * self.stepSize) self._LocateItem() def GetViewItemCount(self): return int(self.GetHeight() / self.stepSize) def GetItemCount(self): return len(self.itemList) def SetEvent(self, event): self.event = event def SelectItem(self, line): if line not in self.keyDict: return if line == self.selectedLine: return self.selectedLine = line self.event(self.keyDict.get(line, 0), self.textDict.get(line, 'None')) def GetSelectedItem(self): return self.keyDict.get(self.selectedLine, 0) def OnMouseLeftButtonDown(self): if self.overLine < 0: return def OnMouseLeftButtonUp(self): if self.overLine >= 0: self.SelectItem(self.overLine + self.basePos) def OnUpdate(self): self.overLine = -1 if self.IsIn(): x, y = self.GetGlobalPosition() height = self.GetHeight() xMouse, yMouse = wndMgr.GetMousePosition() if yMouse - y < height - 1: self.overLine = (yMouse - y) / self.stepSize if self.overLine < 0: self.overLine = -1 if self.overLine >= len(self.itemList): self.overLine = -1 def OnRender(self): xRender, yRender = self.GetGlobalPosition() yRender -= self.TEMPORARY_PLACE widthRender = self.width heightRender = self.height + self.TEMPORARY_PLACE * 2 if -1 != self.overLine: grp.SetColor(HALF_WHITE_COLOR) grp.RenderBar(xRender + 2, yRender + self.overLine * self.stepSize + 4, self.width - 3, self.stepSize) if -1 != self.selectedLine: if self.selectedLine >= self.basePos: if self.selectedLine - self.basePos < self.showLineCount: grp.SetColor(SELECT_COLOR) grp.RenderBar(xRender + 2, yRender + (self.selectedLine - self.basePos) * self.stepSize + 4, self.width - 3, self.stepSize) class CallFnc: def __init__(self, time, fnc, *args): self.event = fnc self.eventArgs = args self.state = False self.timer = WaitingDialog() self.timer.Open(time) self.timer.SAFE_SetTimeOverEvent(self.startEvent) def close(self): self.state = True self.timer.Close() def startEvent(self): if self.event is not None: if self.eventArgs is not None: self.event(*self.eventArgs) else: self.event() self.close() class Box(Window): def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterBox(self, layer) def SetColor(self, color): wndMgr.SetColor(self.hWnd, color) class Bar(Window): def ButtonClose(self): button = CoolButton() button.SetParent(self) button.SetEvent(lambda x=self: x.Hide()) button.SetPosition(self.GetWidth()-18, 0) button.SetSize(18, 18) button.Show() button.SetToolTipText('Zamknij', 0, -23) button.SetText('[X]') self.button = button def ButtonPyt(self, text): button = CoolButton() button.SetParent(self) button.SetPosition(self.GetWidth()-18, 20) button.SetSize(18, 18) button.Show() button.SetToolTipText(text, 0, -53) button.SetText('[?]') self.button2 = button def OnRunMouseWheel(self, x): pass def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterBar(self, layer) def SetColor(self, color): wndMgr.SetColor(self.hWnd, color) def OnUpdate(self): pass class Line(Window): def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterLine(self, layer) def SetColor(self, color): wndMgr.SetColor(self.hWnd, color) class EditLine(TextLine): candidateWindowClassDict = {} def __init__(self): TextLine.__init__(self) ime.EnablePaste(1) self.eventReturn = Window.NoneMethod self.eventEscape = Window.NoneMethod self.eventTab = None self.eventKillFocus = None self.eventUpdate = None self.numberMode = False self.useIME = True self.bCodePage = False self.candidateWindowClass = None self.candidateWindow = None self.eventLeft = None self.eventRight = None self.readingWnd = ReadingWnd() self.readingWnd.Hide() self.SetWindowName('NONAME_EditLine') def __del__(self): TextLine.__del__(self) self.eventReturn = Window.NoneMethod self.eventEscape = Window.NoneMethod self.eventTab = None self.eventLeft = None self.eventRight = None def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterTextLine(self, layer) def SAFE_SetReturnEvent(self, event): self.eventReturn = __mem_func__(event) def SetReturnEvent(self, event): self.eventReturn = event def SetEscapeEvent(self, event): self.eventEscape = event def SetTabEvent(self, event): self.eventTab = event def SetLeftEvent(self, event): self.eventLeft = event def SetRightEvent(self, event): self.eventRight = event def SetKillFocusEvent(self, event): self.eventKillFocus = event def SetUpdateEvent(self, event): self.eventUpdate = event def SetMax(self, max): self.max = max wndMgr.SetMax(self.hWnd, self.max) ime.SetMax(self.max) self.SetUserMax(self.max) def SetUserMax(self, max): self.userMax = max ime.SetUserMax(self.userMax) def SetNumberMode(self): self.numberMode = True def SetIMEFlag(self, flag): self.useIME = flag def SetText(self, text): wndMgr.SetText(self.hWnd, text) wndMgr.SetFontColor(self.hWnd, 0xFFFFFFFF) if self.IsFocus(): ime.SetText(text) def Enable(self): wndMgr.ShowCursor(self.hWnd) def Disable(self): wndMgr.HideCursor(self.hWnd) def SetEndPosition(self): ime.MoveEnd() def OnSetFocus(self): Text = self.GetText() ime.SetText(Text) ime.SetMax(self.max) ime.SetUserMax(self.userMax) ime.SetCursorPosition(-1) if self.numberMode: ime.SetNumberMode() else: ime.SetStringMode() ime.EnableCaptureInput() if self.useIME: ime.EnableIME() else: ime.DisableIME() wndMgr.ShowCursor(self.hWnd, True) def OnKillFocus(self): self.SetText(ime.GetText(self.bCodePage)) self.OnIMECloseReadingWnd() ime.DisableIME() ime.DisableCaptureInput() wndMgr.HideCursor(self.hWnd) if self.eventKillFocus: self.eventKillFocus() def OnIMEOpenCandidateList(self): self.candidateWindow.Show() self.candidateWindow.Clear() self.candidateWindow.Refresh() gx, gy = self.GetGlobalPosition() self.candidateWindow.SetCandidatePosition(gx, gy, len(self.GetText())) return True def OnIMEOpenReadingWnd(self): gx, gy = self.GetGlobalPosition() textlen = len(self.GetText()) - 2 reading = ime.GetReading() readinglen = len(reading) self.readingWnd.SetReadingPosition(gx + textlen * 6 - 24 - readinglen * 6, gy) self.readingWnd.SetText(reading) if ime.GetReadingError() == 0: self.readingWnd.SetTextColor(0xffff0000) else: self.readingWnd.SetTextColor(0xffff0000) self.readingWnd.SetSize(readinglen * 6 + 4, 19) self.readingWnd.Show() return True def OnIMECloseReadingWnd(self): self.readingWnd.Hide() return True def OnIMEUpdate(self): TextLine.SetText(self, ime.GetText(self.bCodePage)) if self.eventUpdate: self.eventUpdate() def OnIMETab(self): if self.eventTab: self.eventTab() return True return False def OnIMEReturn(self): self.eventReturn() return True def OnPressEscapeKey(self): self.eventEscape() return True def OnKeyDown(self, key): #key = int(bytes(int(key))) #if 59 == key: # return False #if 60 == key: # return False #if 61 == key: # return False #if 62 == key: # return False #if 63 == key: # return False #if 64 == key: # return False #if 65 == key: # return False #if 66 == key: # return False #if 56 == key: # return False #if app.DIK_SYSRQ == key: # return False #if 29 == key: # return False if app.DIK_V == key: if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL): self.SetText(self.GetText().replace('','')) ime.PasteTextFromClipBoard() return True def OnKeyUp(self, key): key = int(bytes(int(key))) if 59 == key: return False if 60 == key: return False if 61 == key: return False if 62 == key: return False if 63 == key: return False if 64 == key: return False if 65 == key: return False if 66 == key: return False if 56 == key: return False if app.DIK_SYSRQ == key: return False if 29 == key: return False return True def OnIMEKeyDown(self, key): key = int(bytes(int(key))) if 37 == key: if len(self.GetText()) == 0 and self.eventLeft: self.eventLeft() return True ime.MoveLeft() return True # Right if 39 == key: if len(self.GetText()) == 0 and self.eventRight: self.eventRight() return True ime.MoveRight() return True # Home if 36 == key: ime.MoveHome() return True # End if 35 == key: ime.MoveEnd() return True # Delete if 8 == key: TextLine.SetText(self, ime.GetText(self.bCodePage)) return True return True def OnMouseLeftButtonDown(self): if False == self.IsIn(): return False self.SetFocus() PixelPosition = wndMgr.GetCursorPosition(self.hWnd) ime.SetCursorPosition(PixelPosition) class ReadingWnd(Bar): def __init__(self): Bar.__init__(self, 'TOP_MOST') self.__BuildText() self.SetSize(80, 19) self.Show() def __del__(self): Bar.__del__(self) def __BuildText(self): self.text = TextLine() self.text.SetParent(self) self.text.SetPosition(4, 3) self.text.Show() def SetText(self, text): self.text.SetText(text) def SetReadingPosition(self, x, y): xPos = x + 2 yPos = y - self.GetHeight() - 2 self.SetPosition(xPos, yPos) def SetTextColor(self, color): self.text.SetPackedFontColor(color) class DragButton(Button): def __init__(self): Button.__init__(self) self.AddFlag('movable') self.callbackEnable = True self.eventMove = lambda: None def __del__(self): Button.__del__(self) self.eventMove = lambda: None def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterDragButton(self, layer) def SetMoveEvent(self, event): self.eventMove = event def SetRestrictMovementArea(self, x, y, width, height): wndMgr.SetRestrictMovementArea(self.hWnd, x, y, width, height) def TurnOnCallBack(self): self.callbackEnable = True def TurnOffCallBack(self): self.callbackEnable = False def OnMove(self): if self.callbackEnable: self.eventMove() class ListBoxEx(Window): class Item(Window): def __init__(self): Window.__init__(self) def __del__(self): Window.__del__(self) def SetParent(self, parent): Window.SetParent(self, parent) self.parent = _weakref.proxy(parent) def OnMouseLeftButtonDown(self): self.parent.SelectItem(self) def OnRender(self): if self.parent.GetSelectedItem() == self: self.OnSelectedRender() def OnSelectedRender(self): x = self.GetGlobalPosition()[0] y = self.GetGlobalPosition()[1] grp.SetColor(0x80808080) grp.RenderBar(x, y, self.GetWidth(), self.GetHeight()) def __init__(self): Window.__init__(self) self.viewItemCount = 10 self.basePos = 0 self.itemHeight = 16 self.itemStep = 20 self.selItem = None self.itemList = [] self.onSelectItemEvent = lambda *arg: None self.itemWidth = 100 self.scrollBar = None self.UpdateSize() def Setiw(self, x): self.itemWidth = x def __del__(self): Window.__del__(self) def UpdateSize(self): height = self.itemStep * self.__GetViewItemCount() self.SetSize(self.itemWidth, height) def IsEmpty(self): if len(self.itemList) == 0: return 1 return 0 def SetItemStep(self, itemStep): self.itemStep = itemStep self.UpdateSize() def SetItemSize(self, itemWidth, itemHeight): self.itemWidth = itemWidth self.itemHeight = itemHeight self.UpdateSize() def SetViewItemCount(self, viewItemCount): self.viewItemCount = viewItemCount def SetSelectEvent(self, event): self.onSelectItemEvent = event def SetBasePos(self, basePos): for oldItem in self.itemList[int(bytes(int(self.basePos))):int( bytes(int(self.basePos))) + int(bytes(int(self.viewItemCount)))]: oldItem.Hide() self.basePos = basePos pos = basePos for newItem in self.itemList[int(bytes(int(self.basePos))):int( bytes(int(self.basePos))) + int(bytes(int(self.viewItemCount)))]: x = self.GetItemViewCoord(pos, newItem.GetWidth())[0] y = self.GetItemViewCoord(pos, newItem.GetWidth())[1] newItem.SetPosition(x, y) newItem.Show() pos += 1 def GetItemIndex(self, argItem): return self.itemList.index(argItem) def GetSelectedItem(self): return self.selItem def SelectIndex(self, index): if index >= len(self.itemList) or index < 0: self.selItem = None return try: self.selItem = self.itemList[index] except BaseException: pass def SelectItem(self, selItem): try: self.selItem = selItem self.onSelectItemEvent(selItem) # self.SetBasePos(0) except BaseException: pass def RemoveAllItems(self): self.selItem = None self.itemList = [] if self.scrollBar: self.scrollBar.SetPos(0) def RemoveItem(self, delItem): if delItem == self.selItem: self.selItem = None self.itemList.remove(delItem) def AppendItem(self, newItem): newItem.SetParent(self) newItem.SetSize(self.itemWidth, self.itemHeight) pos = len(self.itemList) if self.__IsInViewRange(pos): x = self.GetItemViewCoord(pos, newItem.GetWidth())[0] y = self.GetItemViewCoord(pos, newItem.GetWidth())[1] newItem.SetPosition(x, y) newItem.Show() else: newItem.Hide() self.itemList.append(newItem) def SetScrollBar(self, scrollBar): scrollBar.SetScrollEvent(__mem_func__(self.__OnScroll)) self.scrollBar = scrollBar def __OnScroll(self): self.SetBasePos( float(bytes(self.scrollBar.GetPos() * self.__GetScrollLen()))) def __GetScrollLen(self): scrollLen = self.__GetItemCount() - self.__GetViewItemCount() if scrollLen < 0: return 0 return scrollLen def __GetViewItemCount(self): return self.viewItemCount def __GetItemCount(self): return len(self.itemList) def GetItemViewCoord(self, pos, itemWidth): return (0, (pos - self.basePos) * self.itemStep) def __IsInViewRange(self, pos): if pos < self.basePos: return 0 if pos >= self.basePos + self.viewItemCount: return 0 return 1 class SlotWindow(Window): def __init__(self): Window.__init__(self) self.StartIndex = 0 self.eventSelectEmptySlot = None self.eventSelectItemSlot = None self.eventUnselectEmptySlot = None self.eventUnselectItemSlot = None self.eventUseSlot = None self.eventOverInItem = None self.eventOverOutItem = None self.eventPressedSlotButton = None self.eventOverInItem2 = None self.eventOverInItem3 = None def __del__(self): Window.__del__(self) self.eventSelectEmptySlot = None self.eventSelectItemSlot = None self.eventUnselectEmptySlot = None self.eventUnselectItemSlot = None self.eventUseSlot = None self.eventOverInItem = None self.eventOverOutItem = None self.eventPressedSlotButton = None self.eventOverInItem2 = None self.eventOverInItem3 = None def CreateList(self, count): self.List = [None] * count def ReturnList(self): return self.List def ChangeInList(self, pos, vnum): self.List[pos-1] = vnum def SetOverInItemEvent2(self, event): self.eventOverInItem2 = event def SetOverInItemEvent3(self, event): self.eventOverInItem3 = event def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterSlotWindow(self, layer) def SetSlotStyle(self, style): wndMgr.SetSlotStyle(self.hWnd, style) def HasSlot(self, slotIndex): return wndMgr.HasSlot(self.hWnd, slotIndex) def SetSlotBaseImage(self, imageFileName, r, g, b, a): wndMgr.SetSlotBaseImage(self.hWnd, imageFileName, Test.FloatToSieluFloat(r), Test.FloatToSieluFloat(g), Test.FloatToSieluFloat(b), Test.FloatToSieluFloat(a)) def SetSlotBaseImageScale(self, imageFileName, r, g, b, a, sx, sy): wndMgr.SetSlotBaseImageScale( self.hWnd, imageFileName, r, g, b, a, sx, sy) def SetCoverButton(self, slotIndex, upName='d:/ymir work/ui/public/slot_cover_button_01.sub', overName='d:/ymir work/ui/public/slot_cover_button_02.sub', downName='d:/ymir work/ui/public/slot_cover_button_03.sub', disableName='d:/ymir work/ui/public/slot_cover_button_04.sub', LeftButtonEnable=False, RightButtonEnable=True): wndMgr.SetCoverButton(self.hWnd, slotIndex, upName, overName, downName, disableName, LeftButtonEnable, RightButtonEnable) def EnableCoverButton(self, slotIndex): wndMgr.EnableCoverButton(self.hWnd, slotIndex) def DisableCoverButton(self, slotIndex): wndMgr.DisableCoverButton(self.hWnd, slotIndex) def SetAlwaysRenderCoverButton(self, slotIndex, bAlwaysRender=True): wndMgr.SetAlwaysRenderCoverButton( self.hWnd, slotIndex, bAlwaysRender) def AppendSlotButton(self, upName, overName, downName): wndMgr.AppendSlotButton(self.hWnd, upName, overName, downName) def ShowSlotButton(self, slotNumber): wndMgr.ShowSlotButton(self.hWnd, slotNumber) def HideAllSlotButton(self): wndMgr.HideAllSlotButton(self.hWnd) def AppendRequirementSignImage(self, filename): wndMgr.AppendRequirementSignImage(self.hWnd, filename) def ShowRequirementSign(self, slotNumber): wndMgr.ShowRequirementSign(self.hWnd, slotNumber) def HideRequirementSign(self, slotNumber): wndMgr.HideRequirementSign(self.hWnd, slotNumber) def ActivateSlot(self, slotNumber): wndMgr.ActivateSlot(self.hWnd, slotNumber) def DeactivateSlot(self, slotNumber): wndMgr.DeactivateSlot(self.hWnd, slotNumber) def ActivateAcceSlot(self, slotNumber): wndMgr.ActivateAcceSlot(self.hWnd, slotNumber) def DeactivateAcceSlot(self, slotNumber): wndMgr.DeactivateAcceSlot(self.hWnd, slotNumber) def ShowSlotBaseImage(self, slotNumber): wndMgr.ShowSlotBaseImage(self.hWnd, slotNumber) def HideSlotBaseImage(self, slotNumber): wndMgr.HideSlotBaseImage(self.hWnd, slotNumber) def SAFE_SetButtonEvent(self, button, state, event): if 'LEFT' == button: if 'EMPTY' == state: self.eventSelectEmptySlot = __mem_func__(event) elif 'EXIST' == state: self.eventSelectItemSlot = __mem_func__(event) elif 'ALWAYS' == state: self.eventSelectEmptySlot = __mem_func__(event) self.eventSelectItemSlot = __mem_func__(event) elif 'RIGHT' == button: if 'EMPTY' == state: self.eventUnselectEmptySlot = __mem_func__(event) elif 'EXIST' == state: self.eventUnselectItemSlot = __mem_func__(event) elif 'ALWAYS' == state: self.eventUnselectEmptySlot = __mem_func__(event) self.eventUnselectItemSlot = __mem_func__(event) def SetSelectEmptySlotEvent(self, empty): self.eventSelectEmptySlot = empty def SetSelectItemSlotEvent(self, item): self.eventSelectItemSlot = item def SetUnselectEmptySlotEvent(self, empty): self.eventUnselectEmptySlot = empty def SetUnselectItemSlotEvent(self, item): self.eventUnselectItemSlot = item def SetUseSlotEvent(self, use): self.eventUseSlot = use def SetOverInItemEvent(self, event): self.eventOverInItem = event def SetOverOutItemEvent(self, event): self.eventOverOutItem = event def SetPressedSlotButtonEvent(self, event): self.eventPressedSlotButton = event def GetSlotCount(self): return wndMgr.GetSlotCount(self.hWnd) def SetUseMode(self, flag): wndMgr.SetUseMode(self.hWnd, flag) def SetUsableItem(self, flag): wndMgr.SetUsableItem(self.hWnd, flag) # Slot def SetSlotCoolTime(self, slotIndex, coolTime, elapsedTime=0.0): wndMgr.SetSlotCoolTime(self.hWnd, slotIndex, coolTime, elapsedTime) def DisableSlot(self, slotIndex): wndMgr.DisableSlot(self.hWnd, slotIndex) def EnableSlot(self, slotIndex): wndMgr.EnableSlot(self.hWnd, slotIndex) def LockSlot(self, slotIndex): wndMgr.LockSlot(self.hWnd, slotIndex) def UnlockSlot(self, slotIndex): wndMgr.UnlockSlot(self.hWnd, slotIndex) def RefreshSlot(self): wndMgr.RefreshSlot(self.hWnd) def ClearSlot(self, slotNumber): wndMgr.ClearSlot(self.hWnd, slotNumber) def ClearAllSlot(self): wndMgr.ClearAllSlot(self.hWnd) def AppendSlot(self, index, x, y, width, height): wndMgr.AppendSlot(self.hWnd, index, x, y, width, height) def SetSlot(self, slotIndex, itemIndex, width, height, icon, diffuseColor=(1.0, 1.0, 1.0, 1.0)): wndMgr.SetSlot(self.hWnd, slotIndex, itemIndex, width, height, icon, diffuseColor) def SetSlotScale(self, slotIndex, itemIndex, width, height, icon, sx, sy, diffuseColor=(1.0, 1.0, 1.0, 1.0)): wndMgr.SetSlotScale(self.hWnd, slotIndex, itemIndex, width, height, icon, diffuseColor, sx, sy) def SetSlotCount(self, slotNumber, count): wndMgr.SetSlotCount(self.hWnd, slotNumber, count) def SetSlotCountNew(self, slotNumber, grade, count): wndMgr.SetSlotCountNew(self.hWnd, slotNumber, grade, count) def SetCardSlot(self, renderingSlotNumber, CardIndex, cardIcon, diffuseColor=(1.0, 1.0, 1.0, 1.0)): if 0 == CardIndex or None == CardIndex: wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) return item.SelectItem(CardIndex) (width, height) = item.GetItemSize() wndMgr.SetCardSlot(self.hWnd, renderingSlotNumber, CardIndex, width, height, cardIcon, diffuseColor) def SetItemSlot(self, renderingSlotNumber, ItemIndex, ItemCount=0, diffuseColor=(Test.FloatToSieluFloat(1.0), Test.FloatToSieluFloat(1.0), Test.FloatToSieluFloat(1.0), Test.FloatToSieluFloat(1.0)), id=0): ItemIndex = int(bytes(ItemIndex)) if 0 == ItemIndex or None == ItemIndex: wndMgr.ClearSlot(self.hWnd, int(bytes(renderingSlotNumber))) return item.SelectItem(ItemIndex) itemIcon = item.GetIconImage() item.SelectItem(ItemIndex) (width, height) = item.GetItemSize() wndMgr.SetSlot(self.hWnd, int(bytes(renderingSlotNumber)),int(bytes(ItemIndex)), int(bytes(width)), int(bytes(height)), itemIcon, diffuseColor) wndMgr.SetSlotCount(self.hWnd, int(bytes(renderingSlotNumber)), int(bytes(ItemCount))) self.ChangeInList(renderingSlotNumber, ItemIndex) #wndMgr.SetSlotID(self.hWnd, int(bytes(renderingSlotNumber)), int(bytes(id))) def SetPetSkillSlot(self, renderingSlotNumber,skillIndex, skillLevel, sx=1.0, sy=1.0): skillIcon = petskill.GetIconImage(skillIndex) if 0 == skillIcon: wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) return petskill.SetSkillSlot(renderingSlotNumber, skillIndex) if sx != 1.0: wndMgr.SetSlotScale(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon, (1.0, 1.0, 1.0, 1.0), sx, sy) else: wndMgr.SetSlot(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon) wndMgr.SetSlotCount(self.hWnd, renderingSlotNumber, skillLevel) def SetSkillSlot(self, renderingSlotNumber, skillIndex, skillLevel): skillIcon = skill.GetIconImage(skillIndex) if 0 == skillIcon: wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) return wndMgr.SetSlot(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon) wndMgr.SetSlotCount(self.hWnd, renderingSlotNumber, skillLevel) def SetSkillSlotNew(self, renderingSlotNumber, skillIndex, skillGrade, skillLevel): skillIcon = skill.GetIconImageNew(skillIndex, skillGrade) if 0 == skillIcon: wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) return wndMgr.SetSlot(self.hWnd, renderingSlotNumber, skillIndex, 1, 1, skillIcon) def SetEmotionSlot(self, renderingSlotNumber, emotionIndex): import player icon = player.GetEmotionIconImage(emotionIndex) if 0 == icon: wndMgr.ClearSlot(self.hWnd, renderingSlotNumber) return wndMgr.SetSlot(self.hWnd, renderingSlotNumber, emotionIndex, 1, 1, icon) # Event def OnSelectEmptySlot(self, slotNumber): if self.eventSelectEmptySlot: self.eventSelectEmptySlot(slotNumber) def OnSelectItemSlot(self, slotNumber): if self.eventSelectItemSlot: self.eventSelectItemSlot(slotNumber) def OnUnselectEmptySlot(self, slotNumber): if self.eventUnselectEmptySlot: self.eventUnselectEmptySlot(slotNumber) def OnUnselectItemSlot(self, slotNumber): if self.eventUnselectItemSlot: self.eventUnselectItemSlot(slotNumber) def OnUseSlot(self, slotNumber): if self.eventUseSlot: self.eventUseSlot(slotNumber) def OnOverInItem(self, slotNumber, vnum=0, itemID=0): if self.eventOverInItem: self.eventOverInItem(slotNumber) if self.eventOverInItem2 and vnum > 0: self.eventOverInItem2(vnum) if self.eventOverInItem3 and itemID > 0: self.eventOverInItem3(itemID) def OnOverOutItem(self): if self.eventOverOutItem: self.eventOverOutItem() def OnPressedSlotButton(self, slotNumber): if self.eventPressedSlotButton: self.eventPressedSlotButton(slotNumber) def GetStartIndex(self): return 0 class GridSlotWindow(SlotWindow): def __init__(self): SlotWindow.__init__(self) self.startIndex = 0 def __del__(self): SlotWindow.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterGridSlotWindow(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) self.startIndex = StartIndex self.CreateList(xCount*yCount) def GetStartIndex(self): return self.startIndex class ComboBox(Window): class ListBoxWithBoard(ListBoxEx): def __init__(self, layer): ListBoxEx.__init__(self, layer) def OnRender(self): xRender = self.GetGlobalPosition()[0] yRender = self.GetGlobalPosition()[1] yRender -= self.TEMPORARY_PLACE widthRender = self.width heightRender = self.height + self.TEMPORARY_PLACE * 2 grp.SetColor(BACKGROUND_COLOR) grp.RenderBar(xRender, yRender, widthRender, heightRender) grp.SetColor(DARK_COLOR) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.RenderLine(xRender, yRender + heightRender - 1, widthRender, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) ListBoxEx.OnRender(self) def __init__(self): Window.__init__(self) self.x = 0 self.y = 0 self.width = 0 self.height = 0 self.isSelected = False self.isOver = False self.isListOpened = False self.event = lambda *arg: None self.enable = True self.textLine = MakeTextLine(self) self.listBox = self.ListBoxWithBoard('TOP_MOST') self.listBox.SetPickAlways() self.listBox.SetParent(self) self.listBox.SetEvent(__mem_func__(self.OnSelectItem)) self.listBox.Hide() def __del__(self): Window.__del__(self) def Destroy(self): self.textLine = None self.listBox = None def SetPosition(self, x, y): Window.SetPosition(self, x, y) self.x = x self.y = y self.__ArrangeListBox() def SetSize(self, width, height): Window.SetSize(self, width, height) self.width = width self.height = height self.textLine.UpdateRect() self.__ArrangeListBox() def __ArrangeListBox(self): self.listBox.SetPosition(0, self.height + 5) self.listBox.SetWidth(self.width) def Enable(self): self.enable = True def Disable(self): self.enable = False self.textLine.SetText('') self.CloseListBox() def SetEvent(self, event): self.event = event def ClearItem(self): self.CloseListBox() self.listBox.ClearItem() def InsertItem(self, index, name): self.listBox.InsertItem(index, name) self.listBox.ArrangeItem() def GetCurrentText(self): return self.textLine.GetText() def SetCurrentItem(self, text): self.textLine.SetText(text) def SelectItem(self, key): self.listBox.SelectItem(key) # def OnSelectItem(self, index, name): # self.CloseListBox() # self.event(index) def OnSelectItem(self, index, name): # self.SetCurrentItem(name) self.CloseListBox() self.event(index) def CloseListBox(self): self.isListOpened = False self.listBox.Hide() def OnMouseLeftButtonDown(self): if not self.enable: return self.isSelected = True def OnMouseLeftButtonUp(self): if not self.enable: return self.isSelected = False if self.isListOpened: self.CloseListBox() else: if self.listBox.GetItemCount() > 0: self.isListOpened = True self.listBox.Show() self.__ArrangeListBox() def OnUpdate(self): if not self.enable: return if self.IsIn(): self.isOver = True else: self.isOver = False def OnRender(self): self.x = self.GetGlobalPosition()[0] self.y = self.GetGlobalPosition()[1] xRender = self.x yRender = self.y widthRender = self.width heightRender = self.height grp.SetColor(BACKGROUND_COLOR) grp.RenderBar(xRender, yRender, widthRender, heightRender) grp.SetColor(DARK_COLOR) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.RenderLine(xRender, yRender + heightRender - 1, widthRender, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) if self.isOver: grp.SetColor(HALF_WHITE_COLOR) grp.RenderBar(xRender + 2, yRender + 3, self.width - 3, heightRender - 5) if self.isSelected: grp.SetColor(WHITE_COLOR) grp.RenderBar(xRender + 2, yRender + 3, self.width - 3, heightRender - 5) class ScrollBar(Window): SCROLLBAR_WIDTH = 17 SCROLLBAR_MIDDLE_HEIGHT = 9 SCROLLBAR_BUTTON_WIDTH = 17 SCROLLBAR_BUTTON_HEIGHT = 17 MIDDLE_BAR_POS = 5 MIDDLE_BAR_UPPER_PLACE = 3 MIDDLE_BAR_DOWNER_PLACE = 4 TEMP_SPACE = MIDDLE_BAR_UPPER_PLACE + MIDDLE_BAR_DOWNER_PLACE class MiddleBar(DragButton): def __init__(self): DragButton.__init__(self) self.AddFlag('movable') # self.AddFlag('restrict_x') def MakeImage(self): top = ImageBox() top.SetParent(self) top.LoadImage('d:/ymir work/ui/pattern/ScrollBar_Top.tga') top.SetPosition(0, 0) top.AddFlag('not_pick') top.Show() bottom = ImageBox() bottom.SetParent(self) bottom.LoadImage( 'd:/ymir work/ui/pattern/ScrollBar_Bottom.tga') bottom.AddFlag('not_pick') bottom.Show() middle = ImageBox() middle.SetParent(self) middle.LoadImage( 'd:/ymir work/ui/pattern/ScrollBar_Middle.tga') middle.SetPosition(0, 4) middle.AddFlag('not_pick') middle.Show() self.top = top self.bottom = bottom self.middle = middle def SetSize(self, height): height = max(12, height) DragButton.SetSize(self, 10, height) self.bottom.SetPosition(0, height - 4) height -= 4 * 3 #self.middle.SetRenderingRect(0, 0, 0, float(height)/4.0) def __init__(self): Window.__init__(self) self.pageSize = 1 self.curPos = 0.0 self.eventScroll = lambda *arg: None self.lockFlag = False self.scrollStep = 0.20 self.CreateScrollBar() def __del__(self): Window.__del__(self) def CreateScrollBar(self): barSlot = Bar() barSlot.SetParent(self) barSlot.AddFlag('not_pick') barSlot.Show() # middleBar = self.MiddleBar() # middleBar.SetParent(self) # middleBar.SetMoveEvent(__mem_func__(self.OnMove)) # middleBar.Show() # middleBar.MakeImage() # middleBar.SetSize(12) # upButton = Button() # upButton.SetParent(self) # upButton.SetEvent(__mem_func__(self.OnUp)) # upButton.SetUpVisual('d:/ymir work/ui/public/scrollbar_up_button_01.sub') # upButton.SetOverVisual('d:/ymir work/ui/public/scrollbar_up_button_02.sub') # upButton.SetDownVisual('d:/ymir work/ui/public/scrollbar_up_button_03.sub') # upButton.Show() # downButton = Button() # downButton.SetParent(self) # downButton.SetEvent(__mem_func__(self.OnDown)) # downButton.SetUpVisual('d:/ymir work/ui/public/scrollbar_down_button_01.sub') # downButton.SetOverVisual('d:/ymir work/ui/public/scrollbar_down_button_02.sub') # downButton.SetDownVisual('d:/ymir work/ui/public/scrollbar_down_button_03.sub') # downButton.Show() # self.upButton = upButton # self.downButton = downButton # self.middleBar = middleBar # self.barSlot = barSlot # self.SCROLLBAR_WIDTH = self.upButton.GetWidth() # self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() # self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() # self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() barSlot = Bar() barSlot.SetParent(self) barSlot.AddFlag('not_pick') barSlot.Show() middleBar = self.MiddleBar() middleBar.SetParent(self) middleBar.SetMoveEvent(__mem_func__(self.OnMove)) middleBar.Show() middleBar.SetUpVisual('d:/ymir work/ui/public/scrollbar_thin_middle_button_01.sub') middleBar.SetOverVisual('d:/ymir work/ui/public/scrollbar_thin_middle_button_02.sub') middleBar.SetDownVisual('d:/ymir work/ui/public/scrollbar_thin_middle_button_03.sub') upButton = Button() upButton.SetParent(self) upButton.SetUpVisual('d:/ymir work/ui/public/scrollbar_thin_up_button_01.sub') upButton.SetOverVisual('d:/ymir work/ui/public/scrollbar_thin_up_button_02.sub') upButton.SetDownVisual('d:/ymir work/ui/public/scrollbar_thin_up_button_03.sub') upButton.SetEvent(__mem_func__(self.OnUp)) upButton.Show() downButton = Button() downButton.SetParent(self) downButton.SetUpVisual('d:/ymir work/ui/public/scrollbar_thin_down_button_01.sub') downButton.SetOverVisual('d:/ymir work/ui/public/scrollbar_thin_down_button_02.sub') downButton.SetDownVisual('d:/ymir work/ui/public/scrollbar_thin_down_button_03.sub') downButton.SetEvent(__mem_func__(self.OnDown)) downButton.Show() self.middleBar = middleBar self.upButton = upButton self.downButton = downButton #self.barSlot = barSlot self.SCROLLBAR_WIDTH = self.upButton.GetWidth() self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() self.MIDDLE_BAR_POS = 0 self.MIDDLE_BAR_UPPER_PLACE = 0 self.MIDDLE_BAR_DOWNER_PLACE = 0 self.TEMP_SPACE = 0 def Destroy(self): self.middleBar = None self.upButton = None self.downButton = None self.eventScroll = lambda *arg: None def SetScrollEvent(self, event): self.eventScroll = event def SetMiddleBarSize(self, pageScale): realHeight = self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT * 2 self.SCROLLBAR_MIDDLE_HEIGHT = int(pageScale * float(realHeight)) self.middleBar.SetSize(self.SCROLLBAR_MIDDLE_HEIGHT) self.pageSize = (self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT * 2) - self.SCROLLBAR_MIDDLE_HEIGHT - (self.TEMP_SPACE) def SetScrollBarSize(self, height): self.pageSize = (height - self.SCROLLBAR_BUTTON_HEIGHT * 2) - self.SCROLLBAR_MIDDLE_HEIGHT - (self.TEMP_SPACE) self.SetSize(self.SCROLLBAR_WIDTH, height) self.upButton.SetPosition(0, 0) self.downButton.SetPosition(0, height - self.SCROLLBAR_BUTTON_HEIGHT) self.middleBar.SetRestrictMovementArea(self.MIDDLE_BAR_POS, self.SCROLLBAR_BUTTON_HEIGHT + self.MIDDLE_BAR_UPPER_PLACE, self.MIDDLE_BAR_POS + 2, height - self.SCROLLBAR_BUTTON_HEIGHT * 2 - self.TEMP_SPACE) self.middleBar.SetPosition(self.MIDDLE_BAR_POS, 0) # self.UpdateBarSlot() def UpdateBarSlot(self): self.barSlot.SetPosition(0, self.SCROLLBAR_BUTTON_HEIGHT) self.barSlot.SetSize( self.GetWidth() - 2, self.GetHeight() - self.SCROLLBAR_BUTTON_HEIGHT * 2 - 2) def GetPos(self): return self.curPos def SetPos(self, pos): pos = max(0.0, pos) pos = min(1.0, pos) newPos = float(self.pageSize) * pos self.middleBar.SetPosition(self.MIDDLE_BAR_POS, int( newPos) + self.SCROLLBAR_BUTTON_HEIGHT + self.MIDDLE_BAR_UPPER_PLACE) self.OnMove() def SetScrollStep(self, step): self.scrollStep = step def GetScrollStep(self): return self.scrollStep def OnRunMouseWheel(self, x): # pass if int(bytes(x)) < 0: # if cur self.SetPos(self.curPos+0.11) #app.ZoomCamera(app.CAMERA_TO_NEGATIVE) else: self.SetPos(self.curPos-0.11) def OnUp(self): self.SetPos(self.curPos - self.scrollStep) def OnDown(self): self.SetPos(self.curPos + self.scrollStep) def OnMove(self): if self.lockFlag: return if 0 == self.pageSize: return yLocal = self.middleBar.GetLocalPosition()[1] x_ = (yLocal - self.SCROLLBAR_BUTTON_HEIGHT - self.MIDDLE_BAR_UPPER_PLACE) x__ = float(self.pageSize) - 1 self.curPos = float(bytes(x_)) / float(bytes(x__)) self.eventScroll() def OnMouseLeftButtonDown(self): (xMouseLocalPosition, yMouseLocalPosition) = self.GetMouseLocalPosition() pickedPos = yMouseLocalPosition - self.SCROLLBAR_BUTTON_HEIGHT - self.SCROLLBAR_MIDDLE_HEIGHT / 2 newPos = float(pickedPos) / float(self.pageSize) self.SetPos(newPos) def LockScroll(self): self.lockFlag = True def UnlockScroll(self): self.lockFlag = False class ThinScrollBar(ScrollBar): def CreateScrollBar(self): middleBar = self.MiddleBar() middleBar.SetParent(self) middleBar.SetMoveEvent(__mem_func__(self.OnMove)) middleBar.Show() middleBar.SetUpVisual( 'd:/ymir work/ui/public/scrollbar_thin_middle_button_01.sub') middleBar.SetOverVisual( 'd:/ymir work/ui/public/scrollbar_thin_middle_button_02.sub') middleBar.SetDownVisual( 'd:/ymir work/ui/public/scrollbar_thin_middle_button_03.sub') upButton = Button() upButton.SetParent(self) upButton.SetUpVisual( 'd:/ymir work/ui/public/scrollbar_thin_up_button_01.sub') upButton.SetOverVisual( 'd:/ymir work/ui/public/scrollbar_thin_up_button_02.sub') upButton.SetDownVisual( 'd:/ymir work/ui/public/scrollbar_thin_up_button_03.sub') upButton.SetEvent(__mem_func__(self.OnUp)) upButton.Show() downButton = Button() downButton.SetParent(self) downButton.SetUpVisual( 'd:/ymir work/ui/public/scrollbar_thin_down_button_01.sub') downButton.SetOverVisual( 'd:/ymir work/ui/public/scrollbar_thin_down_button_02.sub') downButton.SetDownVisual( 'd:/ymir work/ui/public/scrollbar_thin_down_button_03.sub') downButton.SetEvent(__mem_func__(self.OnDown)) downButton.Show() self.middleBar = middleBar self.upButton = upButton self.downButton = downButton self.SCROLLBAR_WIDTH = self.upButton.GetWidth() self.SCROLLBAR_MIDDLE_HEIGHT = self.middleBar.GetHeight() self.SCROLLBAR_BUTTON_WIDTH = self.upButton.GetWidth() self.SCROLLBAR_BUTTON_HEIGHT = self.upButton.GetHeight() self.MIDDLE_BAR_POS = 0 self.MIDDLE_BAR_UPPER_PLACE = 0 self.MIDDLE_BAR_DOWNER_PLACE = 0 self.TEMP_SPACE = 0 class ThinBoard(Window): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.51) LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self, layer='UI'): Window.__init__(self, layer) CornerFileNames = ['d:/ymir work/ui/pattern/ThinBoard_Corner_' + dir + '.tga' for dir in ['LeftTop', 'LeftBottom', 'RightTop', 'RightBottom']] LineFileNames = ['d:/ymir work/ui/pattern/ThinBoard_Line_' + dir + '.tga' for dir in ['Left', 'Right', 'Top', 'Bottom']] self.Corners = [] for fileName in CornerFileNames: Corner = ImageBox() Corner.AddFlag('attach') Corner.AddFlag('not_pick') Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ImageBox() Line.AddFlag('attach') Line.AddFlag('not_pick') Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) Base = Bar() Base.SetParent(self) Base.AddFlag('attach') Base.AddFlag('not_pick') Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) Base.SetColor(self.BOARD_COLOR) Base.Show() self.Base = Base self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH * 2, width) height = max(self.CORNER_HEIGHT * 2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition( width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition( width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition( self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float( (height - self.CORNER_HEIGHT * 2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float( (width - self.CORNER_WIDTH * 2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect( 0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect( 0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect( 0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect( 0, 0, horizontalShowingPercentage, 0) self.Base.SetSize(width - self.CORNER_WIDTH * 2, height - self.CORNER_HEIGHT * 2) def ShowInternal(self): self.Base.Show() for wnd in self.Lines: wnd.Show() for wnd in self.Corners: wnd.Show() def HideInternal(self): self.Base.Hide() for wnd in self.Lines: wnd.Hide() for wnd in self.Corners: wnd.Hide() class ToolTip(Bar): TOOL_TIP_WIDTH = 250 TOOL_TIP_HEIGHT = 10 TEXT_LINE_HEIGHT = 17 TITLE_COLOR = 0x7effff00 FONT_COLOR = 0x7eff00ff def __init__(self, width=TOOL_TIP_WIDTH, isPickable=False): Bar.__init__(self, 'TOP_MOST') if isPickable: pass else: self.AddFlag('not_pick') self.AddFlag('float') self.SetColor(0x66000000) self.followFlag = True self.toolTipWidth = width self.ClearToolTip() self.txt = 0 def __del__(self): Bar.__del__(self) def ClearToolTip(self): self.toolTipHeight = 12 self.childrenList = [] def AppendHorizontalLine(self): for i in xrange(2): horizontalLine = Line() horizontalLine.SetParent(self) horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i) horizontalLine.SetWindowHorizontalAlignCenter() horizontalLine.SetSize(150, 0) horizontalLine.Show() if 0 == i: horizontalLine.SetColor(0x7e555555) else: horizontalLine.SetColor(0x7e000000) self.childrenList.append(horizontalLine) self.toolTipHeight += 11 self.ResizeToolTip() def AlignHorizonalCenter(self): for child in self.childrenList: (x, y) = child.GetLocalPosition() child.SetPosition(self.toolTipWidth / 2, y) self.ResizeToolTip() def AppendTextLine(self, text, color=FONT_COLOR): textLine = TextLine() textLine.SetParent(self) textLine.SetFontName('Tahoma:16') textLine.SetPackedFontColor(color) textLine.SetText(text) textLine.SetOutline() textLine.SetFeather(False) textLine.SetPosition(self.toolTipWidth / 2, self.toolTipHeight) textLine.SetHorizontalAlignCenter() textLine.Show() self.toolTipHeight += self.TEXT_LINE_HEIGHT self.childrenList.append(textLine) self.ResizeToolTip() return textLine def AppendImage(self, image): itemImage = ImageBox() itemImage.SetParent(self) itemImage.LoadImage(image) itemImage.SetPosition(15, self.toolTipHeight) itemImage.Show() self.childrenList.append(itemImage) self.toolTipHeight += itemImage.GetHeight() + 4 self.ResizeToolTip() return itemImage def ResizeToolTip(self): self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight) def OnUpdate(self): self.SetPosition(wndMgr.GetMousePosition()[ 0] - self.toolTipWidth / 2, wndMgr.GetMousePosition()[1] + 60) class AniImageBox(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.eventEndFrame = None def __del__(self): Window.__del__(self) self.eventEndFrame = None def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterAniImageBox(self, layer) def SetDelay(self, delay): wndMgr.SetDelay(self.hWnd, float(bytes(float(delay)))) def AppendImage(self, filename): wndMgr.AppendImage(self.hWnd, filename) def AppendImageScale(self, filename, scale_x, scale_y): wndMgr.AppendImageScale(self.hWnd, filename, scale_x, scale_y) def SetPercentage(self, curValue, maxValue): wndMgr.SetRenderingRect( self.hWnd, 0.0, 0.0, -1.0 + float(curValue) / float(maxValue), 0.0) def ResetFrame(self): wndMgr.ResetFrame(self.hWnd) def SetOnEndFrame(self, event): self.eventEndFrame = event def OnEndFrame(self): if self.eventEndFrame: self.eventEndFrame() class DropDown(Window): dropped = 0 dropstat = 0 width = 0 height = 0 maxh = 30 OnChange = None class Item(Window): TEMPORARY_PLACE = 0 width = 0 height = 0 def __init__(self, parent, text, value=0, skill=0): Window.__init__(self) self.textBox = MakeTextLine(self) self.textBox.SetText(text) self.value = int(value) self.skill = int(skill) def __del__(self): Window.__del__(self) def SetParent(self, parent): Window.SetParent(self, parent) self.parent = parent def OnMouseLeftButtonDown(self): self.parent.SelectItem(self) def SetSize(self, w, h): Window.SetSize(self, w, h) self.width = w self.height = h def OnUpdate(self): if self.IsIn(): self.isOver = True else: self.isOver = False def OnRender(self): xRender, yRender = self.GetGlobalPosition() yRender -= self.TEMPORARY_PLACE widthRender = self.width heightRender = self.height + self.TEMPORARY_PLACE * 2 grp.SetColor(BACKGROUND_COLOR) grp.RenderBar(xRender, yRender, widthRender, heightRender) grp.SetColor(DARK_COLOR) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.SetColor(BRIGHT_COLOR) grp.RenderLine(xRender, yRender + heightRender, widthRender, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) if self.isOver: grp.SetColor(HALF_WHITE_COLOR) grp.RenderBar(xRender + 2, yRender + 3, self.width - 3, heightRender - 5) def __init__(self, parent): Window.__init__(self, 'TOP_MOST') self.down = 1 self.parent = parent self.DropList = ListBoxEx() self.DropList.SetParent(self) self.DropList.itemHeight = 20 self.DropList.itemWidth = 220 self.DropList.itemStep = 18 self.DropList.SetPosition(0, 0) self.DropList.SetSize(200, 2) self.DropList.SetSelectEvent(self.SetTitle) self.DropList.SetViewItemCount(0) self.DropList.Show() self.selected = self.DropList.GetSelectedItem() self.SetSize(220, 95) def __del__(self): Window.__del__(self) def AppendItem(self, text, value=0, skill=0): self.DropList.AppendItem(self.Item(self, text, value, skill)) def OnPressEscapeKey(self): self.Hide() self.Clear() def SetTitle(self, item): self.dropped = 0 self.selected = item if self.OnChange: self.OnChange() self.Clear() def SetSize(self, w, h): Window.SetSize(self, w, h + 10) self.width = w self.height = h self.DropList.SetSize(w, h) def Clear(self): for x in self.DropList.itemList: x.Hide() self.DropList.RemoveAllItems() def ExpandMe(self): if self.dropped == 1: self.dropped = 0 else: self.dropped = 1 def OnUpdate(self): (w, h) = self.parent.GetLocalPosition() self.maxh = self.DropList.itemStep * len(self.DropList.itemList) self.SetPosition(w + 15, h + 65) if self.dropped == 0 or not self.parent.IsShow() or len( self.DropList.itemList) == 0: self.SetSize(self.GetWidth(), 0) self.DropList.SetViewItemCount(0) self.Hide() elif self.dropped == 1: self.Show() self.SetTop() height = self.maxh if int(self.maxh / self.DropList.itemStep) < 2: height = self.maxh + 5 else: self.maxh self.SetSize(self.GetWidth(), height) self.DropList.SetViewItemCount(self.maxh / self.DropList.itemStep) callFncList = [] def callFnc(delay, fnc, *args): global callFncList try: callFncList = [x for x in callFncList if not x.state] callFncList.append(CallFnc(delay, fnc, *args)) except BaseException: pass def MakeTextLine(parent): textLine = TextLine() textLine.SetParent(parent) textLine.SetWindowHorizontalAlignCenter() textLine.SetWindowVerticalAlignCenter() textLine.SetHorizontalAlignCenter() textLine.SetVerticalAlignCenter() textLine.Show() return textLine class Component: @staticmethod def Line(parent, x, y, sx, sy): button = Line() if parent is not None: button.SetParent(parent) button.SetPosition(x, y) button.SetSize(sx, sy) button.Show() return button @staticmethod def ListaBoard(parent, x, y, sx, sy, event=None): bar = Bar() bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(sx, sy) bar.SetColor(0x77000000) bar.Show() ListBox = ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetSize(sx, sy) ListBox.Setiw(sx - 2) if event is not None: ListBox.SetSelectEvent(event) ListBox.Show() scroll = ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(sx - 17, 0) scroll.SetScrollBarSize(sy) scroll.Show() ListBox.SetScrollBar(scroll) ListBox.SetViewItemCount(sy / 20) return ListBox, bar, scroll @staticmethod def Page(parent, x, y, sx, sy, kolor): Page = Box() Page.SetParent(parent) Page.SetPosition(x, y) Page.SetSize(sx, sy) Page.SetColor(kolor) Page.Show() Page.AddFlag('not_pick') return Page @staticmethod def SlotbarText(parent, editlineText, x, y, width, heigh): bar = Bar() if parent is not None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width, heigh) bar.SetColor(BACKGROUND_COLOR) bar.Show() TextLine2 = TextLine() TextLine2.SetParent(bar) TextLine2.SetText(editlineText) TextLine2.SetHorizontalAlignCenter() TextLine2.SetVerticalAlignCenter() TextLine2.SetWindowHorizontalAlignCenter() TextLine2.SetWindowVerticalAlignCenter() TextLine2.Show() Page = Box() Page.SetParent(parent) Page.SetPosition(x, y) Page.SetSize(width, heigh - 1) Page.SetColor(0x7eff0000) Page.Show() Page.AddFlag('not_pick') return bar, TextLine2, Page @staticmethod def Sloty(parent, x, y, func, func2): Slot = ImageBox() Slot.SetParent(parent) Slot.LoadImage('upload/mh/slotbar.tga') Slot.OnMouseLeftButtonUp = lambda: func() Slot.OnMouseRightButtonUp = lambda: func2() Slot.SetPosition(x, y) Slot.Show() Slot2 = ImageBox() Slot2.SetParent(Slot) Slot2.OnMouseLeftButtonUp = lambda: func() Slot2.OnMouseRightButtonUp = lambda: func2() Slot2.SetPosition(0, 0) Slot2.Show() return Slot, Slot2 @staticmethod def Sloty2(parent, x, y,sx,sy, func, func2): Slot = GridSlotWindow() Slot.SetParent(parent) Slot.SetPosition(x, y) Slot.ArrangeSlot(1, sx,sy, 32, 32, 0, 0) Slot.SetSlotBaseImage('d:/ymir work/ui/public/Slot_Base.sub', 1.0, 1.0, 1.0, 1.0) Slot.Show() Slot.SetSelectEmptySlotEvent(lambda slot=None, arg2 = Slot: func(slot,arg2)) Slot.SetSelectItemSlotEvent(lambda slot=None, arg2 = Slot: func2(slot,arg2)) return Slot @staticmethod def TextLine(parent, textlineText, x, y): textline = TextLine() if parent is not None: textline.SetParent(parent) textline.SetPosition(x, y) textline.SetText(textlineText) textline.Show() return textline @staticmethod def Button(parent, buttonName, x, y, func, UpVisual, OverVisual, DownVisual, XT=0): Large = ('d:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') Small = ('d:/ymir work/ui/public/small_button_01.sub', 'd:/ymir work/ui/public/small_button_02.sub', 'd:/ymir work/ui/public/small_button_03.sub') button = Button() if parent is not None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(str(Large[0])) button.SetOverVisual(str(Large[1])) button.SetDownVisual(str(Large[2])) button.Show() if buttonName[0] == '_': button.SetText(buttonName.replace('_', '')) else: button.SetToolTipText(buttonName, XT) button.SetEvent(func) return button @staticmethod def ToggleButton(parent, label, x, y, eventDown, eventUp, time,funcR=None, UpVisual = 'large', OverVisual = 'large', DownVisual = 'large'): if 'ui/skill/' in UpVisual: button = ToggleButton() button.SetToolTipText(label) # button.SetUpVisual(str(UpVisual)) # button.SetOverVisual(str(OverVisual)) # button.SetDownVisual(str(DownVisual)) else: button = CoolButtonToggle() if 'cb' in UpVisual: button.SetSize(20, 20) button.SetToolTipText(label) else: button.SetSize(90, 20) button.SetText(label) if time != 'xd': button.setEventDelay(time) if parent is not None: button.SetParent(parent) button.SetPosition(x, y) button.setEventDown(eventDown) button.setEventUp(eventUp) button.SetToggleDownEvent(button.startEvent) button.SetToggleUpEvent(button.stopEvent) if funcR is not None: button.OnMouseRightButtonDown = funcR button.Show() return button @staticmethod def Button2(parent, buttonName, tooltipText, x, y, sx, sy, func): button = CoolButton() if parent is not None: button.SetParent(parent) button.SetPosition(x, y) button.SetSize(sx, sy) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() #button.OnMouseLeftButtonUp = lambda: func1 # button.SetTextColor(1) button.SetEvent(func) return button @staticmethod def ExpandedImage(parent, x, y, img, ev0=None, ev1=None): image = ImageBox() if parent is not None: image.SetParent(parent) image.SetPosition(x, y) image.LoadImage(img) image.Show() image.AddFlag('not_pick') if ev0 is not None and ev1 is not None: image.OnMouseOverIn = lambda: ev0() image.OnMouseOverOut = lambda: ev1() return image @staticmethod def makeBar(color, x, y, sx, sy, parent, hideshow,text='Brak opisu'): SlotBar = Bar() SlotBar.SetColor(color) SlotBar.SetSize(sx, sy) if parent is not None: SlotBar.SetParent(parent) if x == 'center': SlotBar.SetCenterPosition() else: SlotBar.SetPosition(x, y) if hideshow == 'show': SlotBar.Show() else: SlotBar.Hide() SlotBar.AddFlag('movable') SlotBar.AddFlag('float') SlotBar.ButtonClose() SlotBar.ButtonPyt(text) return SlotBar @staticmethod def makeBar2(color, x, y, sx, sy, parent, hideshow): parent = BoardWithTitleBar() parent.SetSize(sx, sy) parent.SetCenterPosition() parent.AddFlag('movable') parent.AddFlag('float') if hideshow == 'show': parent.Show() return parent @staticmethod def makeObra(parent, sx, sy, x, y, color): Page = Box() Page.SetParent(parent) Page.SetPosition(x, y) Page.SetSize(sx + 1, sy + 1) Page.SetColor(color) Page.Show() Page.AddFlag('not_pick') return Page @staticmethod def ComboBox(parent, text, x, y, width, height, xd): combo = ComboBox() if parent is not None: combo.SetParent(parent) combo.SetPosition(x, y) combo.SetSize(width, height) combo.SetCurrentItem(text) combo.Show() for i in xd: combo.InsertItem(1, str(i)) return combo @staticmethod def ToggleButtonBar(parent, x, y, sx, sy, text, funcDown, funcUp, delay): button = BarButtonToggle('TOP_MOST') button.SetParent(parent) button.SetSize(sx, sy) button.SetText(text) button.SetPosition(x, y) button.SetTextColor(0x7effffff) button.Show() button.setEventDown(funcDown) button.setEventUp(funcUp) button.setEventDelay(delay) button.SetToggleDownEvent(button.startEvent) button.SetToggleUpEvent(button.stopEvent) return button @staticmethod def EditLine(parent, editlineText, x, y, sx, sy, max, text): SlotBarx = SlotBar() SlotBarx.SetParent(parent) SlotBarx.SetSize(sx, sy) SlotBarx.SetPosition(x, y) SlotBarx.Show() Value = EditLine() Value.SetParent(SlotBarx) Value.SetSize(sx - 18, sy) Value.SetPosition(2, 1) Value.SetMax(max) Value.SetLimitWidth(Test.FloatToSieluFloat(sx)) Value.SetMultiLine() Value.SetText(editlineText) Value.Show() Page = Box() Page.SetParent(parent) Page.SetPosition(x, y) Page.SetSize(sx, sy) # 0x7e1169F3 #0x7eD49D1D #0x7e4C4C4C #0x7eD49D1D Page.SetColor(0x7e333333) Page.Show() Page.AddFlag('not_pick') Slot = ImageBox() Slot.SetParent(SlotBarx) Slot.SetToolTipText(str(text)) Slot.LoadImage('d:/ymir work/ui/pattern/ScrollBar_Middle.tga') Slot.SetPosition(sx - 8, 8) Slot.Show() return Value, SlotBarx, Page, Slot class Item(ListBoxEx.Item): def __init__(self, text): ListBoxEx.Item.__init__(self) self.canLoad = 0 self.text = text self.textLine = self.__CreateTextLine(text[:50]) def __del__(self): ListBoxEx.Item.__del__(self) def GetText(self): return self.text def SetSize(self, width, height): ListBoxEx.Item.SetSize(self, width - 15, height) def __CreateTextLine(self, text): textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(0, 0) textLine.SetText(text) textLine.Show() return textLine class Item(ListBoxEx.Item): def __init__(self, text): ListBoxEx.Item.__init__(self) self.canLoad = 0 self.text = text self.textLine = self.__CreateTextLine(text[:50]) def __del__(self): ListBoxEx.Item.__del__(self) def GetText(self): return self.text def SetSize(self, width, height): ListBoxEx.Item.SetSize(self, width - 15, height) def __CreateTextLine(self, text): textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(0, 0) textLine.SetText(text) textLine.Show() return textLine class CoolButton(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.eventFunc = None self.eventArgs = None self.ButtonText = None self.ToolTipText = None self.isOver = False self.isSelected = False self.width = 0 self.height = 0 self.IsGood = 0 self.MyName = None def RegisterMyName(self,Name): self.MyName = Name def GetMyName(self): return self.MyName def __del__(self): Window.__del__(self) self.eventFunc = None self.eventArgs = None def SetColorNEW(self, color): xRender, yRender = self.GetGlobalPosition() widthRender = self.width heightRender = self.height def SetSize(self, width, height): Window.SetSize(self, width, height) self.width = width self.height = height def getState(self): return False def SetEvent(self, func, *args): try: self.eventFunc = func self.eventArgs = args except BaseException: pass # ,dbg def SetTextColor(self, color): if not self.ButtonText: return self.ButtonText.SetPackedFontColor((57 * 255, 255 * 255, 20 * 255)) def SetText(self, text): if not self.ButtonText: textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(self.GetWidth() / 2, self.GetHeight() / 2) textLine.SetVerticalAlignCenter() textLine.SetHorizontalAlignCenter() textLine.SetOutline() textLine.Show() self.ButtonText = textLine self.ButtonText.SetText(text) def SetToolTipText(self, text, x=0, y=-19): if not self.ToolTipText: toolTip = createToolTipWindowDict['TEXT']() toolTip.SetParent(self) toolTip.SetSize(0, 0) toolTip.SetHorizontalAlignCenter() toolTip.SetOutline() toolTip.Hide() toolTip.SetPosition(x + self.GetWidth() / 2, y) self.ToolTipText = toolTip self.ToolTipText.SetText(text) def ShowToolTip(self): if self.ToolTipText: self.ToolTipText.Show() def HideToolTip(self): if self.ToolTipText: self.ToolTipText.Hide() def OnMouseLeftButtonDown(self): self.isSelected = True def OnMouseLeftButtonUp(self): self.isSelected = False if self.eventFunc: self.eventFunc(*self.eventArgs) def pauseEvent(self, time): pass def OnUpdate(self): if self.IsIn(): self.isOver = True self.ShowToolTip() else: self.isOver = False self.HideToolTip() def SetGood(self): self.IsGood = 1 def OnRender(self): global BACKGROUND_COLOR, OBRAMOWANIE, WHITE_COLOR, HALF_WHITE_COLOR xRender = self.GetGlobalPosition()[0] yRender = self.GetGlobalPosition()[1] widthRender = self.width heightRender = self.height if self.IsGood == 1: grp.SetColor(0x00000000) else: grp.SetColor(BACKGROUND_COLOR) grp.RenderBar(xRender, yRender, widthRender, heightRender) grp.SetColor(0x7e777777) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.RenderLine(xRender, yRender + heightRender, widthRender + 1, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) if self.isOver: grp.SetColor(0x33FFFFFF) grp.RenderBar(xRender + 2, yRender + 2, self.width - 3, heightRender - 3) if self.isSelected: grp.SetColor(WHITE_COLOR) grp.RenderBar(xRender + 2, yRender + 2, self.width - 3, heightRender - 3) class CoolButtonToggle(Window): def __init__(self, layer='UI'): Window.__init__(self, layer) self.ButtonText = None self.ToolTipText = None self.isOver = False self.isSelected = False self.width = 0 self.height = 0 self.eventUp = None self.eventDown = None self.timer = WaitingDialog() self.delay = None self.event_down = None self.event_up = None self.eventDownArgs = None self.eventUpArgs = None self.eventDownReturnValue = None self.eventUpReturnValue = None self.state = False self.pause = False self.pauseTimer = None self.txts = None self.MyName = None def RegisterMyName(self,Name): self.MyName = Name def GetMyName(self): return self.MyName def __del__(self): Window.__del__(self) self.eventUp = None self.eventDown = None def Down(self): wndMgr.Down(self.hWnd) #AppendChat('Down') self.state = True self.isSelected = True def SetUp(self): wndMgr.SetUp(self.hWnd) #AppendChat('UP') self.isSelected = False self.state = False def SetUpVisual(self, filename): wndMgr.SetUpVisual(self.hWnd, filename) def SetOverVisual(self, filename): wndMgr.SetOverVisual(self.hWnd, filename) def SetDownVisual(self, filename): wndMgr.SetDownVisual(self.hWnd, filename) def SetDisableVisual(self, filename): wndMgr.SetDisableVisual(self.hWnd, filename) def GetUpVisualFileName(self): return wndMgr.GetUpVisualFileName(self.hWnd) def GetOverVisualFileName(self): return wndMgr.GetOverVisualFileName(self.hWnd) def GetDownVisualFileName(self): return wndMgr.GetDownVisualFileName(self.hWnd) def SetColorNEW(self, color): xRender, yRender = self.GetGlobalPosition() widthRender = self.width heightRender = self.height def SetSize(self, width, height): Window.SetSize(self, width, height) self.width = width self.height = height def SetTextColor(self, color): if not self.ButtonText: return self.ButtonText.SetPackedFontColor((57 * 255, 255 * 255, 20 * 255)) def SetText(self, text): self.txts = text if not self.ButtonText: textLine = TextLine() textLine.SetParent(self) textLine.SetPosition(self.width / 2, self.height / 2) #textLine.SetPosition(self.GetWidth(), self.GetHeight() / 2) textLine.SetVerticalAlignCenter() textLine.SetHorizontalAlignCenter() textLine.SetOutline() textLine.Show() self.ButtonText = textLine self.ButtonText.SetText(text) def SetToolTipText(self, text, x=0, y=-19): if not self.ToolTipText: toolTip = createToolTipWindowDict['TEXT']() toolTip.SetParent(self) toolTip.SetSize(0, 0) toolTip.SetHorizontalAlignCenter() toolTip.SetOutline() toolTip.Hide() toolTip.SetPosition(x + self.GetWidth() / 2, y) self.ToolTipText = toolTip self.ToolTipText.SetText(text) def ShowToolTip(self): self.isOver = True if self.ToolTipText: self.ToolTipText.Show() def HideToolTip(self): self.isOver = False if self.ToolTipText: self.ToolTipText.Hide() def OnMouseLeftButtonDown(self): self.isSelected = True # AppendChat('Down') def OnMouseLeftButtonUp(self): self.isSelected = False if self.eventFunc: self.eventFunc(*self.eventArgs) # AppendChat('UP') def OnUpdate(self): if self.IsIn(): self.isOver = True self.ShowToolTip() else: self.isOver = False self.HideToolTip() def OnRender(self): global BACKGROUND_COLOR, OBRAMOWANIE, WHITE_COLOR, HALF_WHITE_COLOR xRender = self.GetGlobalPosition()[0] yRender = self.GetGlobalPosition()[1] widthRender = self.width heightRender = self.height grp.SetColor(BACKGROUND_COLOR) grp.RenderBar(xRender, yRender, widthRender, heightRender) grp.SetColor(0x7e777777) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.RenderLine(xRender, yRender + heightRender, widthRender + 1, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) if self.isOver: grp.SetColor(0x33FFFFFF) grp.RenderBar(xRender + 2, yRender + 2, self.width - 3, heightRender - 3) if self.isSelected: # AppendChat(self.isSelected) # AppendChat(self.isOver) # grp.SetColor(WHITE_COLOR) # grp.RenderBar(xRender + 2, yRender + 2, # self.width - 3, heightRender - 3) grp.SetColor(0x7e00FF00) grp.RenderLine(xRender, yRender, widthRender, 0) grp.RenderLine(xRender, yRender, 0, heightRender) grp.RenderLine(xRender, yRender + heightRender,widthRender + 1, 0) grp.RenderLine(xRender + widthRender, yRender, 0, heightRender) def __del__(self): Window.__del__(self) self.eventUp = None self.eventDown = None def SetToggleUpEvent(self, event): self.eventUp = event def SetToggleDownEvent(self, event): self.eventDown = event def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterToggleButton(self, layer) def OnToggleUp(self): self.isSelected = False #AppendChat('UP') #AppendChat(self.MyName) # if self.MyName[-1] == '2': self.MyName = self.MyName[:-1] # Test.SendReq(str(self.MyName)+str(';False;but')) if self.eventUp: self.eventUp() def OnToggleDown(self): self.isSelected = True #AppendChat('Down') #AppendChat(self.MyName) # if self.MyName[-1] == '2': self.MyName = self.MyName[:-1] # Test.SendReq(str(self.MyName)+str(';True;but')) if self.eventDown: self.eventDown() def close(self): self.timer.Close() self.eventDownReturnValue = None self.eventUpReturnValue = None self.Hide() def close2(self): self.timer.Close() self.eventDownReturnValue = None self.eventUpReturnValue = None # self.Hide() def setEventDown(self, event): self.event_down = event def setEventUp(self, event): self.event_up = event def setEventDelay(self, time): self.delay = time def setEventDownArgs(self, *args): self.eventDownArgs = args def setEventUpArgs(self, *args): self.eventUpArgs = args def getState(self): return self.state def getEventDownArgs(self): return self.eventDownArgs def getEventUpArgs(self): return self.eventUpArgs def getEventDownReturnValue(self): return self.eventDownReturnValue def getEventUpReturnValue(self): return self.eventUpReturnValue def isPause(self): return self.pause def OnMouseRightButtonUp(self): pass def pauseEvent(self, time): self.pause = True self.pauseTimer = WaitingDialog() self.pauseTimer.Open(time) self.pauseTimer.SAFE_SetTimeOverEvent(self.resumeEvent) def resumeEvent(self): self.pause = False def startEvent(self): self.state = True try: if self.event_down is not None and not self.pause: if self.eventDownArgs is not None: self.eventDownReturnValue = self.event_down( *self.eventDownArgs) else: self.eventDownReturnValue = self.event_down() if self.delay is not None: self.timer.Open(self.delay) self.timer.SAFE_SetTimeOverEvent(self.startEvent) except BaseException: pass # dbg.LogBox(str(self)) def stopEvent(self): self.state = False try: if self.event_up is not None: if self.eventUpArgs is not None: self.eventUpReturnValue = self.event_up( *self.eventUpArgs) else: self.eventUpReturnValue = self.event_up() self.timer.Close() except BaseException: pass class MultiHack(Window): def __init__(self): Test.SetHandle(self) Window.__init__(self) self.comp = Component() self.editlineDICT = {} callFnc(0, self.loadGui) def CHEAT_Chat(self, typek, text): self.FishBotCheck(text) def poka(self): if self.board['Glowne'].IsShow(): self.board['Glowne'].Hide() else: self.board['Glowne'].Show() def FishBotCheckEgoria(self, text): if self.IsFishing == False: return if 'Aby wyci' in text: text = text.replace('\','').replace('/','').replace('*','').replace('-','').replace('|','') text = text.lower() czas = float(bytes(float(bytes(app.GetRandom(672665, 1182523))) / float(bytes(1000000)))) if '1' in text or 'jedn' in text: chat.AppendChat(7, 'Klikam raz') callFnc(czas, self.FishXXXX, 1) if '2' in text or 'dwi' in text: chat.AppendChat(7, 'Klikam 2 razy') callFnc(czas, self.FishXXXX, 2) if '3' in text or 'trzy' in text: chat.AppendChat(7, 'Klikam 3 razy') callFnc(czas, self.FishXXXX, 3) if '4' in text or 'cztery' in text: chat.AppendChat(7, 'Klikam 4 razy') callFnc(czas, self.FishXXXX, 4) if '5' in text or 'pi' in text: chat.AppendChat(7, 'Klikam 5 razy') callFnc(czas, self.FishXXXX, 5) def FishBotCheck2(self, text): if self.IsFishing == False: return if 'Wylosowano:' in text: czas = float(bytes(float(bytes(app.GetRandom(672665, 1182523))) / float(bytes(1000000)))) if '1' in text: chat.AppendChat(2, 'Klikam raz') callFnc(czas, self.FishXXXX, 1) if '2' in text: chat.AppendChat(2, 'Klikam 2 razy') callFnc(czas, self.FishXXXX, 2) if '3' in text: chat.AppendChat(2, 'Klikam 3 razy') callFnc(czas, self.FishXXXX, 3) if '4' in text: chat.AppendChat(2, 'Klikam 4 razy') callFnc(czas, self.FishXXXX, 4) if '5' in text: chat.AppendChat(2, 'Klikam 5 razy') callFnc(czas, self.FishXXXX, 5) def FishXXXX(self, ile): for iloscklikniec in xrange(ile): czas = float(bytes(float(bytes(app.GetRandom(191141, 371887))) / float(bytes(1000000)))) callFnc(float(bytes(czas*(iloscklikniec+1))), player.SetAttackKeyState, True) czas = float(bytes(float(bytes(app.GetRandom(977022, 1241322))) / float(bytes(100000)))) callFnc(czas, self.CastRod) def FishBotCheck(self, text): if self.IsFishing == False: return lista = { 'pierwszy.':1, 'drugi.':2, 'trzeci.':3, 'czwarty.':4, 'piaty.':5 } if 'Prawdziwy komunikat to:' in text: text = text.split(': ') self.FishBotVal = 0 self.FishBotCounter = 0 try: self.FishBotVal = lista[text[1]] except: chat.AppendChat(2, str(text)) if 'Refleks' in text or 'Uzyj spacji' in text or 'Nacisnij spacje' in text or 'Musze ' in text or 'spacje' in text or 'Masz refleks?!' in text or 'przycisk spacja' in text: self.FishBotCounter += 1 #chat.AppendChat(2, str(('self.Refleks',self.FishBotVal))) czas = float(bytes(float(bytes(app.GetRandom(672665, 1182523))) / float(bytes(1000000)))) if self.FishBotCounter == self.FishBotVal: if '1.' in text or '1 r' in text or '1x' in text: chat.AppendChat(2, 'Klikam raz') callFnc(czas, self.FishXXXX, 1) elif '2.' in text or '2 r' in text or '2x' in text: chat.AppendChat(2, 'Klikam 2 razy') callFnc(czas, self.FishXXXX, 2) elif '3.' in text or '3 r' in text or '3x' in text: chat.AppendChat(2, 'Klikam 3 razy') callFnc(czas, self.FishXXXX, 3) elif '4.' in text or '4 r' in text or '4x' in text: chat.AppendChat(2, 'Klikam 4 razy') callFnc(czas, self.FishXXXX, 4) elif '5.' in text or '5 r' in text or '5x' in text: chat.AppendChat(2, 'Klikam 5 razy') callFnc(czas, self.FishXXXX, 5) #self.CastRod def UseBait(self): for Slot in xrange(player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT): if int(bytes(player.GetItemIndex(Slot))) in [27800, 27801, 27802]: net.SendItemUsePacket(Slot) break def AddBait(self): if int(bytes(player.GetItemCountByVnum(27802))) == 0 and int(bytes(player.GetItemCountByVnum(27801))) == 0 and int(bytes(player.GetItemCountByVnum(27800))) == 0: return 0 self.UseBait() return 1 def CastRod(self): if self.IsFishing and self.AddBait(): player.SetAttackKeyState(True) else: self.FishBotStop() def FishBotStart(self): self.Buttons['Fishbot'].SetTextColor(0x7e00ff00) self.IsFishing = True self.CastRod() def FishBotStop(self): self.Buttons['Fishbot'].SetTextColor(0xffffffff) player.SetAttackKeyState(False) self.IsFishing = False def loadGui(self): self.comp = Component() self.board = {} self.Buttons = {} self.ButtonsClose = {} self.EditLines = {} self.ListaBoard = {} self.Slot_Mobber = {} self.Slot_Poty = {} self.Metin_X = 1 self.Metin_Y = 1 self.Boss_X = 1 self.Boss_Y = 1 self.FarmBotStep = 0 self.RadarCordy = [0, 0, 0] self.Kordy = [] self.Kordy_nazwy = [] self.Lista_Itemkow = [] self.Pickup_podnos = [] self.Kopacz_Rud = [] self.AutoWstawanieStatus = 1 self.skillToUse = [] self.Nick = '' self.Pickupfirsttime = 0 self.mobyfirsttime = 0 self.Teleport_Map_Size = (1 * 256, 1 * 256) self.Target_BUFFBOT = None self.curCh = 1 self.skillToUse_B = [] self.Moby = [] self.MobyDB = [] self.StopekFarmbot = 0 self.IsFishing = False self.board['Glowne'] = self.comp.makeBar(BOARD_BG, 'center', 100, 325, 290, None, 'show') self.Buttons['HIDESHOW'] = self.comp.Button2(None, 'Pokaz MH', '', 3, 290, 80, 20, self.poka) self.Buttons['Fishbot'] = self.comp.ToggleButton(self.board['Glowne'],'Fishbot',110,260,self.FishBotStart,self.FishBotStop,'xd') self.board['Auto Atak Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 195, 40, None, 'hide','Ciagly atak efekt dziala jak trzymanie spacji ') self.Buttons['Auto Atak'] = self.comp.ToggleButton(self.board['Glowne'],'Auto atak',10,10,self.AutoAtakFunc,self.AutoAtakFuncOFF,1,lambda x=self.board['Auto Atak Settings']: self.HideShow(x)) self.Buttons['Auto Atak2'] = self.comp.ToggleButton(self.board['Auto Atak Settings'],'Auto atak',10,10,self.AutoAtakFunc,self.AutoAtakFuncOFF,1) self.Buttons['Rotacja_S'] = False self.Buttons['Rotacja_S_B'] = self.comp.ToggleButton(self.board['Auto Atak Settings'], 'Atak rotacyjny', 105, 10, (lambda x=('Rotacja_S', True): self.TruFols(x)), (lambda x=('Rotacja_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.EditLines['Czas Auto Atak'] = self.comp.EditLine(self.board['Auto Atak Settings'], '1', 130, 10, 40, 20, 22, 'Predkosc rotacji') self.board['Mobber Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 335, 40, None, 'hide','Mobber umozliwia automatyczne sciaganie potworow za pomoca peleryny mestwa. Aby mobber dziala poprawnie nalezy umiescic peleryne w slocie do tego przeznaczonym.') self.Buttons['Mobber'] = self.comp.ToggleButton(self.board['Glowne'], 'Mobber', 110, 10, self.MobberFunc,self.MobberFuncOFF, 1, lambda x=self.board['Mobber Settings']: self.HideShow(x)) self.Buttons['Mobber2'] = self.comp.ToggleButton(self.board['Mobber Settings'], 'Mobber', 10, 10, self.MobberFunc, self.MobberFuncOFF, 1) self.Buttons['Mobber_Zwykla_S'] = True self.Buttons['Mobber_Zwykla_S_B'] = self.comp.ToggleButton(self.board['Mobber Settings'], 'Zwykle', 200, 10, (lambda x=('Mobber_Zwykla_S', True): self.TruFols(x)), (lambda x=('Mobber_Zwykla_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Mobber_Zwykla_S_B'].Down() self.Buttons['Mobber_Mega_S'] = False self.Buttons['Mobber_Mega_S_B'] = self.comp.ToggleButton(self.board['Mobber Settings'], 'Mega', 225, 10, (lambda x=('Mobber_Mega_S', True): self.TruFols(x)), (lambda x=('Mobber_Mega_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Mober_xBP_S'] = False self.Buttons['Mober_xBP_S_B'] = self.comp.ToggleButton(self.board['Mobber Settings'], 'Bez peleryn', 290, 10, (lambda x=('Mober_xBP_S', True): self.TruFols(x)), (lambda x=('Mober_xBP_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Mobber_ML_S'] = False self.Buttons['Mobber_ML_S_B'] = self.comp.ToggleButton(self.board['Mobber Settings'], 'MobLock', 250, 10, (lambda x=('Mobber_ML_S', True): self.TruFols(x)), (lambda x=('Mobber_ML_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Slot_Mobber['Mobber'] = self.comp.Sloty2(self.board['Mobber Settings'], 160, 4,1,1, self.SetSloty,self.DelSloty) self.EditLines['Czas Mobber'] = self.comp.EditLine(self.board['Mobber Settings'], '1', 110, 10, 40, 20, 22, 'Co ile sekund przywolywac') self.board['AutoPoty Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 120, 95, None, 'hide','Automatycznie uzywanie mikstur(Musisz umiescic mikstury w danym polu)') self.Buttons['AutoPoty'] = self.comp.ToggleButton(self.board['Glowne'], 'Auto Poty', 210, 10, self.PotyFunc,self.PotyFuncOFF, 0.1,lambda x=self.board['AutoPoty Settings']: self.HideShow(x)) self.Buttons['AutoPoty2'] = self.comp.ToggleButton(self.board['AutoPoty Settings'], 'Auto Poty', 10, 65, self.PotyFunc, self.PotyFuncOFF, 0.1) self.Slot_Poty['PotyRed'] = self.comp.Sloty2(self.board['AutoPoty Settings'], 14, 4,1,1, self.SetSloty,self.DelSloty) self.Slot_Poty['PotyBlue'] = self.comp.Sloty2(self.board['AutoPoty Settings'], 64, 4,1,1, self.SetSloty,self.DelSloty) self.EditLines['RedAutoPoty'] = self.comp.EditLine(self.board['AutoPoty Settings'], '99', 10, 38, 40, 20, 22, 'Ponizej ilu % zrowia uzywac potek?') self.EditLines['BlueAutoPoty'] = self.comp.EditLine(self.board['AutoPoty Settings'], '99', 60, 38, 40, 20, 22, 'Ponizej ilu % many uzywac potek?') self.board['Dopalacze Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 248, 176, None, 'hide','Uruchamia co okreslony czas wszystkie tzw. dopalacze') self.Buttons['Dopalacze'] = self.comp.ToggleButton(self.board['Glowne'], 'Auto Dopalacze', 10, 35, self.DopalaczeFunc,self.DopalaczeFuncOFF, 0.1,lambda x=self.board['Dopalacze Settings']: self.HideShow(x)) self.Buttons['Dopalacze2'] = self.comp.ToggleButton(self.board['Dopalacze Settings'], 'Auto Dopalacze', 47, 10, self.DopalaczeFunc, self.DopalaczeFuncOFF, 0.1) self.Slot_Dopalacze = self.comp.Sloty2(self.board['Dopalacze Settings'],12,38,7,4,self.SetSloty,self.DelSloty) self.EditLines['Czas Dopalacze'] = self.comp.EditLine(self.board['Dopalacze Settings'], '10', 147, 10, 40, 20, 22, 'Co ile sekund uzywac dopalaczy') self.Buttons['NOK'] = self.comp.ToggleButton(self.board['Glowne'], 'Nieodpychanie', 210, 210, (lambda: callFnc(0, Test.SetNOK, True)), (lambda: callFnc(0, Test.SetNOK, False)), 'xd') self.Buttons['SILNE'] = self.comp.ToggleButton(self.board['Glowne'], 'Silne', 10, 210, (lambda: callFnc(0, self.Silne)), (lambda: callFnc(0, self.SilneOff)), 2) self.Buttons['WALL'] = self.comp.ToggleButton(self.board['Glowne'], 'Wallhack', 110, 210, (lambda: callFnc(0, Test.SetWH, True)), (lambda: callFnc(0, Test.SetWH, False)), 'xd') self.board['WaitHack Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 510, 40, None, 'hide','Bicie potworow w danym zasiegu || Dziala rowniez przy atakowaniu(spacja) || Ze wzgledu na Limiter moze dzialac na roznych predkosciach badz wcale, najczestsza wartosc to 0.3 || Na mieczy dziala tylko zasieg 500 natomiast na luku bez limitu.') self.Buttons['WaitHack'] = self.comp.ToggleButton(self.board['Glowne'], 'WaitHack', 110, 35, self.WaitHackFunc,self.WaitHackFuncOFF, 1, lambda x=self.board['WaitHack Settings']: self.HideShow(x)) self.Buttons['WaitHack2'] = self.comp.ToggleButton(self.board['WaitHack Settings'], 'WaitHack', 10, 10, self.WaitHackFunc, self.WaitHackFuncOFF, 1) self.Buttons['WaitHack_Moby_S'] = True self.Buttons['WaitHack_Moby_S_B'] = self.comp.ToggleButton(self.board['WaitHack Settings'], 'Atakuj moby', 304, 10, (lambda x=('WaitHack_Moby_S', True): self.TruFols(x)), (lambda x=('WaitHack_Moby_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WaitHack_Moby_S_B'].Down() self.Buttons['WaitHack_Metki_S'] = False self.Buttons['WaitHack_Metki_S_B'] = self.comp.ToggleButton(self.board['WaitHack Settings'], 'Atakuj Metiny', 329, 10, (lambda x=('WaitHack_Metki_S', True): self.TruFols(x)), (lambda x=('WaitHack_Metki_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WaitHack_Bossy_S'] = False self.Buttons['WaitHack_Bossy_S_B'] = self.comp.ToggleButton(self.board['WaitHack Settings'], 'Atakuj Bossy', 354, 10, (lambda x=('WaitHack_Bossy_S', True): self.TruFols(x)), (lambda x=('WaitHack_Bossy_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WaitHack_Range_S'] = False self.Buttons['WaitHack_Range_S_B'] = self.comp.ToggleButton(self.board['WaitHack Settings'], 'Zasiegowy Waithack (na wiekszosci serwerow nie bedzie dzialac)', 105, 10, (lambda x=('WaitHack_Range_S', True): self.TruFols(x)), (lambda x=('WaitHack_Range_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.EditLines['Czas WaitHack'] = self.comp.EditLine(self.board['WaitHack Settings'], '0.3', 135, 10, 70, 20, 22, 'Predkosc atakowania (0.5 to 2 ataki na sekunde)') self.EditLines['WaitHack Range'] = self.comp.EditLine(self.board['WaitHack Settings'], '3000', 220, 10, 70, 20, 22, 'Zasieg atakowania (minimapa to zasieg okolo 4000)') self.Buttons['WaitHack_Check_Range'] = self.comp.Button2(self.board['WaitHack Settings'], 'Sprawdz Zasieg', '', 385, 10, 95, 20, self.CheckRange) self.board['AtakNaCel Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 210, 40, None, 'hide', 'Atakuje Wybrany cel') self.Buttons['AtakNaCel'] = self.comp.ToggleButton(self.board['Glowne'], 'Atak na cel', 210, 35, self.AtakNaCelFunc,self.AtanNaCelFuncOFF, 1, lambda x=self.board['AtakNaCel Settings']: self.HideShow(x)) self.Buttons['AtakNaCel2'] = self.comp.ToggleButton(self.board['AtakNaCel Settings'], 'Atak na cel', 10, 10, self.AtakNaCelFunc, self.AtanNaCelFuncOFF, 1) self.EditLines['Czas AtakNaCel'] = self.comp.EditLine(self.board['AtakNaCel Settings'], '0.3', 110, 10, 70, 20, 22, 'Predkosc atakowania (0.5 to 2 ataki na sekunde)') self.board['Pickup Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 525, 240, None, 'hide', 'Automatyczne podnoszenie przedmiotow. Na niektorych serwerach funkcja Range moze byc zablokowana i nie dzialac prawidlowo.') self.Buttons['Pickup'] = self.comp.ToggleButton(self.board['Glowne'], 'Pickup', 110, 60, self.PickupFunc,self.PickupFuncOFF, 2, lambda x=self.board['Pickup Settings']: self.HideShow(x)) self.Buttons['Pickup2'] = self.comp.ToggleButton(self.board['Pickup Settings'], 'Pickup', 275, 10, self.PickupFunc, self.PickupFuncOFF, 2) self.ListaBoard['Pickup'] = self.comp.ListaBoard(self.board['Pickup Settings'], 10, 40, 250, 161) self.ListaBoard['Pickup_git'] = self.comp.ListaBoard(self.board['Pickup Settings'], 265, 40, 250, 161) self.EditLines['Pickup_1'] = self.comp.EditLine(self.board['Pickup Settings'], '', 10, 10, 250, 20, 222, 'Podaj nazwe szukanego przedmiotu') self.EditLines['Pickup_1'][0].OnIMEUpdate = __mem_func__(self.__Pickup) self.Buttons['Pickup_dodaj'] = self.comp.Button2(self.board['Pickup Settings'], 'Dodaj', '', 10, 210, 250, 20, self.Dodaj_Pickup) self.Buttons['Pickup_usun'] = self.comp.Button2(self.board['Pickup Settings'], 'Usun', '', 265, 210, 250, 20, self.Usun_Pickup) self.Buttons['Wybrane_S'] = False self.Buttons['Wybrane_S_B'] = self.comp.ToggleButton(self.board['Pickup Settings'], 'Podnos tylko wybrane', 370, 10, (lambda x=('Wybrane_S', True): self.TruFols(x)), (lambda x=('Wybrane_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Pickup_Normal_S'] = True self.Buttons['Pickup_Normal_S_B'] = self.comp.ToggleButton(self.board['Pickup Settings'], 'Normalny', 420, 10, (lambda x=('Pickup_Normal_S', True): self.TruFols(x)), (lambda x=('Pickup_Normal_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Pickup_Normal_S_B'].Down() self.Buttons['Pickup_Range_S'] = False self.Buttons['Pickup_Range_S_B'] = self.comp.ToggleButton(self.board['Pickup Settings'], 'Zasiegowy', 445, 10, (lambda x=('Pickup_Range_S', True): self.TruFols(x)), (lambda x=('Pickup_Range_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Pickup_Instant_S'] = False self.Buttons['Pickup_Instant_S_B'] = self.comp.ToggleButton(self.board['Pickup Settings'], 'Instant', 470, 10, (lambda x=('Pickup_Instant_S', True): self.TruFols(x)), (lambda x=('Pickup_Instant_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.board['BOOST Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 275, 40, None, 'hide','Umozliwia szybkie przemieszczanie sie po przez uzycie skrotu klawiszowego Shift + W (Uwaga! Boost moze cofac postac na serwerach z zabezpieczeniem nalezy wtedy zmniejszyc czas i jednostki przemieszczania sie w opcjach boosta) ') self.Buttons['BOOST'] = self.comp.ToggleButton(self.board['Glowne'], 'BOOST', 210, 60, self.boost, self.boostoff,1, lambda x=self.board['BOOST Settings']: self.HideShow(x)) self.Buttons['BOOST2'] = self.comp.ToggleButton(self.board['BOOST Settings'], 'BOOST', 10, 10, self.boost, self.boostoff, 1) self.EditLines['BOOST Val'] = self.comp.EditLine(self.board['BOOST Settings'], '500', 120, 10, 60, 20, 5, 'O ile jednostek sie teleportowac') self.EditLines['Czas BOOST'] = self.comp.EditLine(self.board['BOOST Settings'], '0.01', 190, 10, 60, 20, 5, 'Co ile sekund sie teleportowac') self.board['Wstawanie Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 200, 40, None, 'hide','Automatycznie odradza postac po jej zgonie i wznawia auto atak oraz mobbera od danego % Pz') self.Buttons['Wstawanie'] = self.comp.ToggleButton(self.board['Glowne'], 'Wstawanie', 10, 85, self.AutoWstawanieFunc,self.AutoWstawanieFuncOFF, 1, lambda x=self.board['Wstawanie Settings']: self.HideShow(x)) self.Buttons['Wstawanie2'] = self.comp.ToggleButton(self.board['Wstawanie Settings'], 'Wstawanie', 10, 10, self.AutoWstawanieFunc, self.AutoWstawanieFuncOFF, 1) self.EditLines['Wstawanie Proc'] = self.comp.EditLine(self.board['Wstawanie Settings'], '70', 110, 10, 60, 20, 3, '% HP Po ktorym ma zaczac bic dalej') self.board['Skile Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 370, 40, None, 'hide','Dzieki tej opcji mozesz w pelni zautomatyzowac odpalanie umiejetnosci postaci') self.Buttons['Skile'] = self.comp.ToggleButton(self.board['Glowne'], 'Skile', 110, 85, self.UseSkilsFunc,self.UseSkilsFuncOFF, 1, lambda x=self.board['Skile Settings']: self.HideShow(x)) self.Buttons['Skile2'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 260, 10, self.UseSkilsFunc, self.UseSkilsFuncOFF, 1) self.Buttons['Skille_0_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 10, 4, (lambda arg=1: self.SetSkill(arg)), (lambda arg=1: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Skille_1_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 50, 4, (lambda arg=2: self.SetSkill(arg)), (lambda arg=2: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Skille_2_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 90, 4, (lambda arg=3: self.SetSkill(arg)), (lambda arg=3: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Skille_3_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 130, 4, (lambda arg=4: self.SetSkill(arg)), (lambda arg=4: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Skille_4_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 170, 4, (lambda arg=5: self.SetSkill(arg)), (lambda arg=5: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Skille_5_'] = self.comp.ToggleButton(self.board['Skile Settings'], 'Skile', 210, 4, (lambda arg=6: self.SetSkill(arg)), (lambda arg=6: self.SetSkillOFF(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['expoddawaj'] = self.comp.ToggleButton(self.board['Glowne'], 'Oddawaj expa', 210, 185, (lambda: callFnc(0, net.SendGuildOfferPacket, player.GetStatus(player.EXP))), None, 0.1) self.board['WykGM Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 300, 40, None, 'hide', 'Funkcja wykrywa gm w zasiegu minimapy (Uwaga! Funkcja nie moze nie dzialac na niektorych serwerach gdzie jest system gm-obserwator)') self.Buttons['WykGM'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. GM', 210, 85, self.WykrywaczGM,self.WykrywaczGMOFF, 1, lambda x=self.board['WykGM Settings']: self.HideShow(x)) self.Buttons['WykGM2'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Wykr. GM', 10, 10, self.WykrywaczGM, self.WykrywaczGMOFF, 1) self.Buttons['WykGM_Dzwiek_S'] = True self.Buttons['WykGM_Dzwiek_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Dzwiek', 120, 10, (lambda x=('WykGM_Dzwiek_S', True): self.TruFols(x)), (lambda x=('WykGM_Dzwiek_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGM_Dzwiek_S_B'].Down() self.Buttons['WykGM_Czat_S'] = False self.Buttons['WykGM_Czat_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Czat', 145, 10, (lambda x=('WykGM_Czat_S', True): self.TruFols(x)), (lambda x=('WykGM_Czat_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGM_LogBox_S'] = False self.Buttons['WykGM_LogBox_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'LogBox', 170, 10, (lambda x=('WykGM_LogBox_S', True): self.TruFols(x)), (lambda x=('WykGM_LogBox_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGM_Wyloguj_S'] = False self.Buttons['WykGM_Wyloguj_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Wyloguj', 195, 10, (lambda x=('WykGM_Wyloguj_S', True): self.TruFols(x)), (lambda x=('WykGM_Wyloguj_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGM_WyjdzZGry_S'] = False self.Buttons['WykGM_WyjdzZGry_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Wyjdz z gry', 220, 10, (lambda x=('WykGM_WyjdzZGry_S', True): self.TruFols(x)), (lambda x=('WykGM_WyjdzZGry_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGM_OffFunc_S'] = False self.Buttons['WykGM_OffFunc_S_B'] = self.comp.ToggleButton(self.board['WykGM Settings'], 'Zapauzuj Funkcje', 245, 10, (lambda x=('WykGM_OffFunc_S', True): self.TruFols(x)), (lambda x=('WykGM_OffFunc_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.board['WykGraczy Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 300, 40, None, 'hide','Funkca wykrywa graczy w zasiegu') self.Buttons['WykGraczy'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. Graczy', 10, 110, self.WykrywaczGraczy,self.WykrywaczGraczyOFF, 1, lambda x=self.board['WykGraczy Settings']: self.HideShow(x)) self.Buttons['WykGraczy2'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Wykr. Graczy', 10, 10, self.WykrywaczGraczy, self.WykrywaczGraczyOFF, 1) self.Buttons['WykGraczy_Dzwiek_S'] = True self.Buttons['WykGraczy_Dzwiek_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Dzwiek', 120, 10, (lambda x=('WykGraczy_Dzwiek_S', True): self.TruFols(x)), (lambda x=('WykGraczy_Dzwiek_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGraczy_Dzwiek_S_B'].Down() self.Buttons['WykGraczy_Czat_S'] = False self.Buttons['WykGraczy_Czat_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Czat', 145, 10, (lambda x=('WykGraczy_Czat_S', True): self.TruFols(x)), (lambda x=('WykGraczy_Czat_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGraczy_LogBox_S'] = False self.Buttons['WykGraczy_LogBox_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'LogBox', 170, 10, (lambda x=('WykGraczy_LogBox_S', True): self.TruFols(x)), (lambda x=('WykGraczy_LogBox_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGraczy_Wyloguj_S'] = False self.Buttons['WykGraczy_Wyloguj_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Wyloguj', 195, 10, (lambda x=('WykGraczy_Wyloguj_S', True): self.TruFols(x)), (lambda x=('WykGraczy_Wyloguj_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGraczy_WyjdzZGry_S'] = False self.Buttons['WykGraczy_WyjdzZGry_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Wyjdz z gry', 220, 10, (lambda x=('WykGraczy_WyjdzZGry_S', True): self.TruFols(x)), (lambda x=('WykGraczy_WyjdzZGry_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykGraczy_OffFunc_S'] = False self.Buttons['WykGraczy_OffFunc_S_B'] = self.comp.ToggleButton(self.board['WykGraczy Settings'], 'Zapauzuj Funkcje', 245, 10, (lambda x=('WykGraczy_OffFunc_S', True): self.TruFols(x)), (lambda x=('WykGraczy_OffFunc_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['WykrywaczMetinkow'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. Metinow', 110, 110, self.WykrywaczMetinow, self.WykrywaczMetinowOFF, 1, None) self.Buttons['WykrywaczMetinkow2'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. Metinow', 110, 110, self.WykrywaczMetinow, self.WykrywaczMetinowOFF, 1, None) self.Buttons['WykrywaczMetino_TP'] = self.comp.Button(None, '_TP METIN', 3, 320, (lambda: callFnc(0, TeleportToDest, self.Metin_X, self.Metin_Y)), 'mh/metin_tp', 'mh/metin_tp', 'mh/metin_tp', 1) self.Buttons['WykrywaczMetino_TP'].Hide() self.Buttons['WykrywaczMetino_IDZ'] = self.comp.Button(None, '_IDZ METIN', 86, 320, (lambda: callFnc(0, chr.MoveToDestPosition, player.GetMainCharacterIndex(), self.Metin_X, self.Metin_Y)), 'mh/metin_idz', 'mh/metin_idz', 'mh/metin_idz', 1) self.Buttons['WykrywaczMetino_IDZ'].Hide() self.Buttons['WykrywaczBossow'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. Bossow', 210, 110, self.WykrywaczBossow, self.WykrywaczBossowOFF, 1, None) self.Buttons['WykrywaczBossow2'] = self.comp.ToggleButton(self.board['Glowne'], 'Wykr. Bossow', 210, 110, self.WykrywaczBossow, self.WykrywaczBossowOFF, 1, None) self.Buttons['WykrywaczBossow_TP'] = self.comp.Button(None, '_TP BOSS', 3, 390, (lambda: callFnc(0, TeleportToDest, self.Boss_X, self.Boss_Y)), 'mh/boss_tp', 'mh/boss_tp', 'mh/boss_tp', 1) self.Buttons['WykrywaczBossow_TP'].Hide() self.Buttons['WykrywaczBossow_IDZ'] = self.comp.Button(None, '_IDZ BOSS', 86, 390, (lambda: callFnc(0, chr.MoveToDestPosition, player.GetMainCharacterIndex(), self.Boss_X, self.Boss_Y)), 'mh/boss_idz', 'mh/boss_idz', 'mh/boss_idz', 1) self.Buttons['WykrywaczBossow_IDZ'].Hide() self.board['FarmBot Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 175, 265, None, 'hide','Funkcja umozliwia zautomatyzowanie naszej postaci by expila badz dropila. || Atakuj moby/metiny/bossy || Uzywaj waitachka tak/nie || Dodaj pozycje po ktorych ma biegac lub w radarze ') self.Buttons['FarmBot'] = self.comp.ToggleButton(self.board['Glowne'], 'FarmBot', 10, 135, self.FarmBot,self.FarmBotOFF, 4, lambda x=self.board['FarmBot Settings']: self.HideShow(x)) self.Buttons['FarmBot2'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'FarmBot', 10, 10, self.FarmBot, self.FarmBotOFF, 4) self.EditLines['Czas FarmBot'] = self.comp.EditLine(self.board['FarmBot Settings'], '0.15', 105, 10, 50, 20, 5, 'Podaj predkosc farmbota') self.EditLines['FarmBot Dystans'] = self.comp.EditLine(self.board['FarmBot Settings'], '2000', 10, 35, 90, 20, 8, 'Podaj dystans') self.Buttons['FarmBt_WaitHack_S'] = False self.Buttons['FarmBt_WaitHack_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Uzywaj waithacka', 135, 35, (lambda x=('FarmBt_WaitHack_S', True): self.TruFols(x)), (lambda x=('FarmBt_WaitHack_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['FarmBo_Chodz_S'] = True self.Buttons['FarmBo_Chodz_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Chodz', 10, 60, (lambda x=('FarmBo_Chodz_S', True): self.TruFols(x)), (lambda x=('FarmBo_Chodz_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['FarmBo_Chodz_S_B'].Down() self.Buttons['FarmBo_Teleportuj_S'] = False self.Buttons['FarmBo_Teleportuj_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Teleportuj', 35, 60, (lambda x=('FarmBo_Teleportuj_S', True): self.TruFols(x)), (lambda x=('FarmBo_Teleportuj_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['FarmBo_Radar_S'] = False self.Buttons['FarmBo_Radar_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Pozostan w dystansie', 105, 35, (lambda x=('FarmBo_Radar_S', True): self.TruFols(x)), (lambda x=('FarmBo_Radar_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.ListaBoard['FarmBot2'] = self.comp.ListaBoard(self.board['FarmBot Settings'], 10, 95, 145, 140) self.Buttons['FarmBot_Dodaj'] = self.comp.Button2(self.board['FarmBot Settings'], 'Dodaj', '', 10, 237, 65, 20, self.DodajKordy) self.Buttons['FarmBot_Usun'] = self.comp.Button2(self.board['FarmBot Settings'], 'Usun', '',90, 237, 64, 20, self.RemoveList2) self.Buttons['FarmBot_Moby_S'] = True self.Buttons['FarmBot_Moby_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Atakuj moby', 85, 60, (lambda x=('FarmBot_Moby_S', True): self.TruFols(x)), (lambda x=('FarmBot_Moby_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['FarmBot_Moby_S_B'].Down() self.Buttons['FarmBot_Metki_S'] = False self.Buttons['FarmBot_Metki_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Atakuj Metiny', 110, 60, (lambda x=('FarmBot_Metki_S', True): self.TruFols(x)), (lambda x=('FarmBot_Metki_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['FarmBot_Bossy_S'] = False self.Buttons['FarmBot_Bossy_S_B'] = self.comp.ToggleButton(self.board['FarmBot Settings'], 'Atakuj Bossy', 135, 60, (lambda x=('FarmBot_Bossy_S', True): self.TruFols(x)), (lambda x=('FarmBot_Bossy_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.board['Otwieracz Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 248, 80, None, 'hide','Umozliwa szybkie i sprawne otwieranie szkatulek,malzy itd') self.Buttons['Otwieracz'] = self.comp.ToggleButton(self.board['Glowne'], 'Auto Otwieracz', 110, 135, self.OtwieraczFunc,self.OtwieraczFuncOFF, 0.1,lambda x=self.board['Otwieracz Settings']: self.HideShow(x)) self.Buttons['Otwieracz2'] = self.comp.ToggleButton(self.board['Otwieracz Settings'], 'Auto Otwieracz', 47, 10, self.OtwieraczFunc, self.OtwieraczFuncOFF, 0.1) self.Slot_Otwieracz = self.comp.Sloty2(self.board['Otwieracz Settings'],12,38,7,1,self.SetSloty,self.DelSloty) self.EditLines['Czas Otwieracz'] = self.comp.EditLine(self.board['Otwieracz Settings'], '0.05', 147, 10, 50, 20, 22, 'Co ile sekund otwierac?') self.board['Buff Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 360, 40, None, 'hide', 'Buff bot umozliwia automatyczne nadawanie skilli szamanem na dany cel/postac.') self.Buttons['Buff'] = self.comp.ToggleButton(self.board['Glowne'], 'Buff', 210, 135, self.UseSkills_BFunc,self.UseSkills_BFuncOFF, 1, lambda x=self.board['Buff Settings']: self.HideShow(x)) self.Buttons['Buff2'] = self.comp.ToggleButton(self.board['Buff Settings'], 'Buff', 250, 10, self.UseSkills_BFunc, self.UseSkills_BFuncOFF, 1) self.Buttons['Buff_1_'] = self.comp.ToggleButton(self.board['Buff Settings'], 'Buff', 10, 4, (lambda arg=4: self.SetSkill_B(arg)), (lambda arg=4: self.SetSkillOFF_B(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Buff_2_'] = self.comp.ToggleButton(self.board['Buff Settings'], 'Buff', 50, 4, (lambda arg=5: self.SetSkill_B(arg)), (lambda arg=5: self.SetSkillOFF_B(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Buff_3_'] = self.comp.ToggleButton(self.board['Buff Settings'], 'Buff', 90, 4, (lambda arg=6: self.SetSkill_B(arg)), (lambda arg=6: self.SetSkillOFF_B(arg)), 1, 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub', 'd:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Buff_1_'].SetUpVisual('d:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Buff_1_'].SetOverVisual('d:/ymir work/ui/skill/shaman/hosin_01.sub') self.Buttons['Buff_1_'].SetDownVisual('d:/ymir work/ui/skill/shaman/hosin_03.sub') self.Buttons['Buff_2_'].SetUpVisual('d:/ymir work/ui/skill/shaman/gicheon_01.sub') self.Buttons['Buff_2_'].SetOverVisual('d:/ymir work/ui/skill/shaman/gicheon_01.sub') self.Buttons['Buff_2_'].SetDownVisual('d:/ymir work/ui/skill/shaman/gicheon_03.sub') self.Buttons['Buff_3_'].SetUpVisual('d:/ymir work/ui/skill/shaman/boho_01.sub') self.Buttons['Buff_3_'].SetOverVisual('d:/ymir work/ui/skill/shaman/boho_01.sub') self.Buttons['Buff_3_'].SetDownVisual('d:/ymir work/ui/skill/shaman/boho_03.sub') self.Buttons['Buff_Target'] = self.comp.Button2(self.board['Buff Settings'], 'Wybierz cel', '', 150, 10, 90, 20, self.WybierzCel) self.board['InvMene Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 200, 170, None, 'hide') self.Buttons['InvMene_Show'] = self.comp.Button2(self.board['Glowne'], 'Inv. Menager', '', 10, 160, 90, 20, lambda x=self.board['InvMene Settings']: self.HideShow(x)) self.Slot_InvMene = self.comp.Sloty2(self.board['InvMene Settings'],4,14,1,1,self.SetSloty,self.DelSloty) self.Buttons['InvMene_Stackuj'] = self.comp.Button2(self.board['InvMene Settings'], 'Stackuj', '', 40, 10, 60, 20, self.OnButton12Event) self.EditLines['InvMene_MaxStack'] = self.comp.EditLine(self.board['InvMene Settings'], '200', 100, 10, 80, 20, 5, 'Maksymalny Stack') self.Buttons['InvMene_Rozdziel'] = self.comp.Button2(self.board['InvMene Settings'], 'Rozdziel', '', 40, 30, 60, 20, self.Rozdziel_func) self.EditLines['InvMene_Ile'] = self.comp.EditLine(self.board['InvMene Settings'], '10', 100, 30, 40, 20, 4, 'Po ile podzielic') self.EditLines['InvMene_Paczki'] = self.comp.EditLine(self.board['InvMene Settings'], '5', 140, 30, 40, 20, 4, 'Ilosc paczek') self.EditLines['InvMene_CountUlep'] = self.comp.EditLine(self.board['InvMene Settings'], '1', 95, 85, 80, 20, 1, 'Ilosc razy sprobowac ulepszyc') self.Buttons['InvMene_Ulepsz'] = self.comp.Button2(self.board['InvMene Settings'], 'Ulepsz', '', 95, 110, 80, 20, self.Ulepsz_func) self.Buttons['Ulepszanie_Kowal_S_B'] = self.comp.ToggleButton(self.board['InvMene Settings'], 'Kowal', 45, 85, (lambda x=('Ulepszanie_Kowal_S', True): self.TruFols(x)), (lambda x=('Ulepszanie_Kowal_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Ulepszanie_Kowal_S_B'].Down() self.Buttons['Ulepszanie_Kowal_S'] = True self.Buttons['Ulepszanie_GILDIA_S'] = False self.Buttons['Ulepszanie_GILDIA_S_B'] = self.comp.ToggleButton(self.board['InvMene Settings'], 'Kowal Gildyjny', 70, 85, (lambda x=('Ulepszanie_GILDIA_S', True): self.TruFols(x)), (lambda x=('Ulepszanie_GILDIA_S'): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Slot_Ulepszanie = self.comp.Sloty2(self.board['InvMene Settings'], 52.5, 135,1,1, self.SetSloty,self.DelSloty) self.Slot_Ulepszanie2 = self.comp.Sloty2(self.board['InvMene Settings'], 4, 63,1,3, self.SetSloty,self.DelSloty) self.Buttons['Ulepszanie_DT_S'] = False self.Buttons['Ulepszanie_DT_S_B'] = self.comp.ToggleButton(self.board['InvMene Settings'], 'Kowal DT', 45, 110, (lambda x=('Ulepszanie_DT_S', True): self.TruFols(x)), (lambda x=('Ulepszanie_DT_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['Ulepszanie_INNE_S'] = False self.Buttons['Ulepszanie_INNE_S_B'] = self.comp.ToggleButton(self.board['InvMene Settings'], 'Inne', 70, 110, (lambda x=('Ulepszanie_INNE_S', True): self.TruFols(x)), (lambda x=('Ulepszanie_INNE_S'): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Slot_Ulepszanie.Hide() self.board['SpamBot Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 300, 170, None, 'hide','Dzieki spam botowi mozemy wysylac wiadomosci w trybie automatycznym z ustawiona wczesniej odlegloscia czasu czy tez kolorem tekstu. (Uwaga! Kolorowanie tekstu w wiadomosciach moze byc zablokowane na niektorych serwerach)') self.Buttons['SpamBot'] = self.comp.ToggleButton(self.board['Glowne'], 'Spambot', 110, 160, self.SpamBotFunc,self.SpamBotFuncOFF, 1, lambda x=self.board['SpamBot Settings']: self.HideShow(x)) self.Buttons['SpamBot2'] = self.comp.ToggleButton(self.board['SpamBot Settings'], 'SpamBot', 20, 10, self.SpamBotFunc, self.SpamBotFuncOFF, 1) self.Buttons['SpamBot_Normal_S'] = True self.Buttons['SpamBot_Normal_S_B'] = self.comp.ToggleButton(self.board['SpamBot Settings'], 'Pisz na ogolnym', 203, 10, (lambda x=('SpamBot_Normal_S', True): self.TruFols(x)), (lambda x=('SpamBot_Normal_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['SpamBot_Normal_S_B'].Down() self.Buttons['SpamBot_Wolaj_S'] = False self.Buttons['SpamBot_Wolaj_S_B'] = self.comp.ToggleButton(self.board['SpamBot Settings'], 'Pisz na wolaj', 228, 10, (lambda x=('SpamBot_Wolaj_S', True): self.TruFols(x)), (lambda x=('SpamBot_Wolaj_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.Buttons['SpamBot_PW_S'] = False self.Buttons['SpamBot_PW_S_B'] = self.comp.ToggleButton(self.board['SpamBot Settings'], 'Pisz PW', 253, 10, (lambda x=('SpamBot_PW_S', True): self.TruFols(x)), (lambda x=('SpamBot_PW_S', False): self.TruFols(x)), 1, 'cb0', 'cb1', 'cb2') self.EditLines['SpamBot Text'] = self.comp.EditLine(self.board['SpamBot Settings'], '', 10, 40, 280, 121, 222, 'Tresc wiadomosci') self.EditLines['Czas SpamBot'] = self.comp.EditLine(self.board['SpamBot Settings'], '15', 125, 10, 70, 20, 22, 'Co ile sekund wysylac wiadomosc') self.board['Gildia Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 210, 40, None, 'hide','Dzieki funkcji stworz gildie mozesz utworzyc swoja gildie z dowolnego miejsca (funkcja moze nie dzialac prawidlowo na zabezpieczonych serwerach) ') self.Buttons['Gildia_Show'] = self.comp.Button2(self.board['Glowne'], 'Zaloz Gildie', '', 210, 160, 90, 20, lambda x=self.board['Gildia Settings']: self.HideShow(x)) self.EditLines['Gildia Text'] = self.comp.EditLine(self.board['Gildia Settings'], '', 80, 10, 110, 20, 32, 'Nazwa Gildii') self.Buttons['Gildia_Zaloz'] = self.comp.Button2(self.board['Gildia Settings'], 'Zaloz', '', 10, 10, 60, 20, (lambda: callFnc(0, net.SendAnswerMakeGuildPacket,str(self.EditLines['Gildia Text'][0].GetText())))) self.board['Statystyki Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 170, 115, None, 'hide','Umozliwia szybkie rozdanie statystyk postaci. (Uwaga! Zaleca sie nie spamowanie gdyz moze wyrzucac z gry)') self.Buttons['Statystyki_Show'] = self.comp.Button2(self.board['Glowne'], 'Statystyki', '', 10, 185, 90, 20, lambda x=self.board['Statystyki Settings']: self.HideShow(x)) self.Buttons['Wit_Dodaj'] = self.comp.Button2(self.board['Statystyki Settings'], 'Dodaj Witalnosc', '', 10, 10, 100, 20, (lambda: [callFnc(0.2 * x, SendChat, '/stat ht') for x in range(int(bytes(self.EditLines['Wit'][0].GetText())))])) self.Buttons['Int_Dodaj'] = self.comp.Button2(self.board['Statystyki Settings'], 'Dodaj Inteligencje', '', 10, 35, 100, 20, (lambda: [callFnc(0.2 * x, SendChat, '/stat iq') for x in range(int(bytes(self.EditLines['Int'][0].GetText())))])) self.Buttons['Sila_Dodaj'] = self.comp.Button2(self.board['Statystyki Settings'], 'Dodaj Sile', '', 10, 60, 100, 20, (lambda: [callFnc(0.2 * x, SendChat, '/stat st') for x in range(int(bytes(self.EditLines['Sila'][0].GetText())))])) self.Buttons['Zre_Dodaj'] = self.comp.Button2(self.board['Statystyki Settings'], 'Dodaj Zrecznosc', '', 10, 85, 100, 20, (lambda: [callFnc(0.2 * x, SendChat, '/stat dx') for x in range(int(bytes(self.EditLines['Zre'][0].GetText())))])) self.EditLines['Wit'] = self.comp.EditLine(self.board['Statystyki Settings'], '10', 110, 10, 40, 20, 3, 'Podaj ile witalnosci chcesz dodac') self.EditLines['Int'] = self.comp.EditLine(self.board['Statystyki Settings'], '10', 110, 35, 40, 20, 3, 'Podaj ile inteligencji chcesz dodac') self.EditLines['Sila'] = self.comp.EditLine(self.board['Statystyki Settings'], '10', 110, 60, 40, 20, 3, 'Podaj ile sily chcesz dodac') self.EditLines['Zre'] = self.comp.EditLine(self.board['Statystyki Settings'], '10', 110, 85, 40, 20, 3, 'Podaj ile zrecznosci chcesz dodac') self.board['Kopacz Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 280, 240, None, 'hide') self.Buttons['Kopacz'] = self.comp.ToggleButton(self.board['Glowne'], 'Kopacz', 110, 185, self.KopaczFunc,self.KopaczFuncOFF, 1, lambda x=self.board['Kopacz Settings']: self.HideShow(x)) self.Buttons['Kopacz2'] = self.comp.ToggleButton(self.board['Kopacz Settings'], 'Kopacz', 35, 205, self.KopaczFunc, self.KopaczFuncOFF, 1) self.ListaBoard['Kopacz_Rudy'] = self.comp.ListaBoard(self.board['Kopacz Settings'], 10, 10, 250, 161) self.Buttons['Ruda_Dodaj'] = self.comp.Button2(self.board['Kopacz Settings'], 'Dodaj rude', '', 10, 176, 125, 20, self.Dodaj_Kopacz) self.Buttons['Ruda_Usun'] = self.comp.Button2(self.board['Kopacz Settings'], 'Usun rude', '', 135, 176, 124, 20, self.Usun_Kopacz) self.EditLines['Czas Kopacz'] = self.comp.EditLine(self.board['Kopacz Settings'], '15', 145, 205, 90, 20, 3, 'Co ile sekund kopac') self.board['AutoLogin Settings'] = self.comp.makeBar(BOARD_BG, 'center', 100, 180, 40, None, 'hide', 'Automatycznie loguje sie na postac') self.Buttons['AutoLogin'] = self.comp.ToggleButton(self.board['Glowne'], 'Auto Login', 10, 60, self.AutoLoginFunc,self.AutoLoginFuncOFF, 5, lambda x=self.board['AutoLogin Settings']: self.HideShow(x)) self.Buttons['AutoLogin2'] = self.comp.ToggleButton(self.board['AutoLogin Settings'], 'Auto Login', 10, 10, self.AutoLoginFunc, self.AutoLoginFuncOFF, 5) self.EditLines['Czas AutoLogin'] = self.comp.EditLine(self.board['AutoLogin Settings'], '10', 110, 10, 40, 20, 22, 'Co ile sekund probowac sie zalogowac') self.Buttons['Mapa_Show1'] = self.comp.Button2(self.board['Glowne'], 'Zapisz Ust.', '', 10, 235, 90, 20, self.SaveSet) self.Buttons['Mapa_Show2'] = self.comp.Button2(self.board['Glowne'], 'Wczytaj Ust.', '', 110, 235, 90, 20, self.LoadSet) self.Buttons['Mapa_Show3'] = self.comp.Button2(self.board['Glowne'], 'Zamknij Gre', '', 210, 235, 90, 20, app.Exit) def RemoveList2(self): self.Kordy.remove((str(self.getfromlb('FarmBot2').split(' ')[0]), str(self.getfromlb('FarmBot2').split(' ')[1]))) a = self.ListaBoard['FarmBot2'][0] a.RemoveAllItems() if len(self.Kordy) != 0: self.ListaBoard['FarmBot2'][2].SetPos(float(bytes(float(0)))) for i in range(len(self.Kordy)): a.AppendItem(Item(str(self.Kordy[i][0]) + str(' ') + str(self.Kordy[i][1]))) def DodajKordy(self): self.ListaBoard['FarmBot2'][0].AppendItem(Item(str(int(GetMainPos()[0])) + str(' ') + str(int(GetMainPos()[1])))) self.Kordy.append((str(int(GetMainPos()[0])), str(int(GetMainPos()[1])))) def Debug(self): player.SetSingleDIKKeyState(app.DIK_UP, True) player.SetSingleDIKKeyState(app.DIK_UP, False) def GetPositiveValue(self, value): if value < 0: return int(str(int(value))) - int(str(int((2 * value)))) else: return int(str(int(value))) def GetDistance(self, x, y): (PlayerX, PlayerY, PlayerZ) = player.GetMainCharacterPosition() PlayerX = int(str(int(PlayerX))) x = int(str(int(x))) PlayerY = int(str(int(PlayerY))) y = int(str(int(y))) (TmpX, TmpY) = (int(str(int(self.GetPositiveValue(PlayerX - x)))) ** 2, int(str(int(self.GetPositiveValue(PlayerY - y)))) ** 2) f = int(str(int(math.sqrt(int(str(int(TmpX))) + int(str(int(TmpY))))))) return f def On__(self, arg): self.Buttons[arg].Down() self.Buttons[arg + '2'].Down() try: czas = float(bytes(self.EditLines['Czas ' + arg][0].GetText())) funfel = int(bytes(app.GetRandom(-500, 500))) czas2 = czas + (czas/10000*funfel) self.Buttons[arg].setEventDelay(float(bytes(czas2))) self.Buttons[arg +'2'].setEventDelay(float(bytes(czas2))) except BaseException: pass def Off__(self, arg): try: self.Buttons[arg].SetUp() self.Buttons[arg].close2() self.Buttons[arg].state = False self.Buttons[arg + '2'].SetUp() self.Buttons[arg + '2'].close2() self.Buttons[arg + '2'].state = False except BaseException: pass def HideShow(self, x): if x.IsShow(): x.Hide() else: x.Show() x.SetTop() if self.board['Pickup Settings'] == x and self.Pickupfirsttime == 0: oldTime = app.GetGlobalTimeStamp() for i in xrange(0, 200000): e = str(app.GetGlobalTimeStamp() - oldTime) if e == '15' or e == '16' or e == '17' or e == '18': finished = 'f' break if i <= 100200 or i % 100 == 0: item.SelectItem(i) if item.GetItemType() != 6: n = item.GetItemName() if str(n) != '' and str(n) != 'Galle' and str(n) != 'Gall' and str(ord(n[0])) != '175': self.Lista_Itemkow.append(i) self.ListaBoard['Pickup'][0].AppendItem(Item((str(i) + ' ' + n))) self.Pickupfirsttime = 1 if self.board['Skile Settings'] == x and GetName(GetMyVid()) != self.Nick: self.Nick = GetName(GetMyVid()) self.skillToUse = [] Classsss = GetClass() skile = {} skile['Warrior|1'] = ['samyeon', 'palbang','jeongwi', 'geomgyeong', 'tanhwan'] skile['Warrior|0'] = ['gigongcham', 'gyeoksan','daejin', 'cheongeun', 'geompung'] skile['Assassin|1'] = ['amseup', 'gungsin','charyun', 'eunhyeong', 'sangong'] skile['Assassin|0'] = ['yeonsa', 'gwangyeok','hwajo', 'gyeonggong', 'dokgigung'] skile['Sura|1'] = ['swaeryeong', 'yonggwon','gwigeom', 'gongpo', 'jumagap', 'pabeop'] skile['Sura|0'] = ['maryeong', 'hwayeom','muyeong', 'heuksin', 'tusok', 'mahwan'] skile['Shaman|1'] = ['bipabu', 'yongpa','paeryong', 'hosin', 'boho', 'gicheon'] skile['Shaman|0'] = ['noejeon', 'byeorak', 'pokroe','jeongeop_target', 'kwaesok', 'jeungryeok'] for i in range(6): self.Buttons['Skille_{}_'.format(i)].Hide() self.Buttons['Skille_{}_'.format(i)].SetUp() self.Buttons['Skille_{}_'.format(i)].close2() for idx, val in enumerate(skile[Classsss]): self.Buttons['Skille_{}_'.format(idx)].SetUpVisual('d:/ymir work/ui/skill/{}/{}_01.sub'.format(Classsss.split('|')[0], val)) self.Buttons['Skille_{}_'.format(idx)].SetOverVisual('d:/ymir work/ui/skill/{}/{}_01.sub'.format(Classsss.split('|')[0], val)) self.Buttons['Skille_{}_'.format(idx)].SetDownVisual('d:/ymir work/ui/skill/{}/{}_03.sub'.format(Classsss.split('|')[0], val)) self.Buttons['Skille_{}_'.format(idx)].Show() def TruFols(self, x): self.Buttons[x[0]] = x[1] Name = x[0].split('_')[0] for i in self.Buttons: if Name in i and i != x[0] + '_B' and '_S_B' in i and 'WykGM' not in i and 'WykGraczy' not in i and 'FarmBot' not in i and 'WaitHack' not in i and 'Pogoda' not in i: self.Buttons[i].SetUp() self.Buttons[i].close2() self.Buttons[i.replace('_B', '')] = False if 'Ulepszanie' in x[0]: self.Slot_Ulepszanie.Hide() if '_INNE_' in x[0]: self.Slot_Ulepszanie.Show() if 'Pogoda' in x[0]: self.LoadTerain() def SetSloty(self, id,jakislot, coreturn=1): if mouseModule.mouseController.isAttached(): item.SelectItem(mouseModule.mouseController.GetAttachedItemIndex()) SLOT = mouseModule.mouseController.GetAttachedSlotNumber() INDEX = player.GetItemIndex(SLOT) if player.SLOT_TYPE_INVENTORY == mouseModule.mouseController.GetAttachedType(): mouseModule.mouseController.DeattachObject() jakislot.SetItemSlot(id, INDEX) if coreturn == 1: return INDEX if coreturn == 2: return SLOT def DelSloty(self,xd,jakislot): jakislot.ClearSlot(xd) jakislot.RefreshSlot() jakislot.ChangeInList(xd,None) def AutoAtakFunc(self): if self.Buttons['Rotacja_S']: chr.SelectInstance(GetMyVid()) Direction = app.GetRandom(0, 360) chr.SetRotation(Direction) SetAtak(True) self.On__('Auto Atak') def AutoAtakFuncOFF(self): self.Off__('Auto Atak') SetAtak(False) def Gora_func(self): chr.SelectInstance(player.GetMainCharacterIndex()) (x, y, z) = player.GetMainCharacterPosition() chr.SetPixelPosition(int(x), int(y) - 2000, int(z)) def Lewo_func(self): chr.SelectInstance(player.GetMainCharacterIndex()) (x, y, z) = player.GetMainCharacterPosition() chr.SetPixelPosition(int(x) - 2000, int(y), int(z)) def Prawo_func(self): chr.SelectInstance(player.GetMainCharacterIndex()) (x, y, z) = player.GetMainCharacterPosition() chr.SetPixelPosition(int(x) + 2000, int(y), int(z)) def Dol_func(self): chr.SelectInstance(player.GetMainCharacterIndex()) (x, y, z) = player.GetMainCharacterPosition() chr.SetPixelPosition(int(x), int(y) + 2000, int(z)) def przyciagaj(self): if self.Buttons['Mober_xBP_S']: for i in Test.ReturnList(0): if GetDis(i) < 8000 and GetDis(i) > 400: Test.AttackVid(i) else: for i in range(2): UseItem(self.Slot_Mobber['Mobber'].ReturnList()[0]) def MobberFunc(self): if self.Buttons['Mobber_ML_S']: for i in Test.ReturnList(0): if GetDis(i) < 8000: chr.SelectInstance(i) SetPixel(GetMainPos()) if self.Buttons['Mobber_Zwykla_S']: self.przyciagaj() elif self.Buttons['Mobber_Mega_S']: lista = [None,self.Gora_func, self.Gora_func, self.Dol_func, self.Dol_func, self.Prawo_func, self.Prawo_func, self.Lewo_func, self.Lewo_func, self.Dol_func, self.Dol_func, self.Gora_func, self.Gora_func, self.Lewo_func, self.Lewo_func, self.Prawo_func, self.Prawo_func, None] for idx, func in enumerate(lista): callFnc(0.35 * idx, func) callFnc(0.35 * idx, self.przyciagaj) self.On__('Mobber') def MobberFuncOFF(self): self.Off__('Mobber') def PotyFunc(self): if float(ProcHP()) < float(self.EditLines['RedAutoPoty'][0].GetText()): UseItem(self.Slot_Poty['PotyRed'].ReturnList()[0]) if float(ProcMP()) < float(self.EditLines['BlueAutoPoty'][0].GetText()): UseItem(self.Slot_Poty['PotyBlue'].ReturnList()[0]) self.On__('AutoPoty') def PotyFuncOFF(self): self.Off__('AutoPoty') def DopalaczeFunc(self): for i in self.Slot_Dopalacze.ReturnList(): UseItem(i) self.On__('Dopalacze') def DopalaczeFuncOFF(self): self.Off__('Dopalacze') def OtwieraczFunc(self): for i in self.Slot_Otwieracz.ReturnList(): UseItem(i) self.On__('Otwieracz') def OtwieraczFuncOFF(self): self.Off__('Otwieracz') def AtakNaCelFunc(self): # chr.SelectInstance(player.GetMainCharacterIndex()) # Xo, Yo, Zo = player.GetMainCharacterPosition() # Test.FloatToSieluFloat() #Test.Anim(Xo,Yo,chr.GetRotation(),0) #Test.Anim(Xo,Yo,chr.GetRotation(),1) #dbg.LogBox(str((Xo,Yo,chr.GetRotation()))) if int(bytes(GetVID())) > 0: Test.AttackVid(GetVID()) self.On__('AtakNaCel') def AtanNaCelFuncOFF(self): self.Off__('AtakNaCel') def WaitHackFunc(self): # chr.SelectInstance(player.GetMainCharacterIndex()) # Xo, Yo, Zo = player.GetMainCharacterPosition() # Test.Anim(Xo,Yo,chr.GetRotation(),0) # Test.Anim(Xo,Yo,chr.GetRotation(),1) ListaVid = [] if self.Buttons['WaitHack_Moby_S']: for i in Test.ReturnList(0): if not isBoss(i): ListaVid.append((GetDis(i), i)) if self.Buttons['WaitHack_Bossy_S']: for i in Test.ReturnList(0): chr.SelectInstance(i) iRace = chr.GetRace(i) if isBoss(i) or iRace in (153, 152, 154, 494, 491, 493, 492, 531, 533, 534, 532): ListaVid.append((GetDis(i), i)) if self.Buttons['WaitHack_Metki_S']: for i in Test.ReturnList(2): ListaVid.append((GetDis(i), i)) #AppendChat(str(ListaVid)) if ListaVid: #AppendChat(str(ListaVid)) ListaVid.sort() count = 0 #AppendChat(str(ListaVid)) for i in ListaVid: i = i[1] if not self.Buttons['WaitHack_Range_S']: if GetDis(i) > 0 and GetDis(i) < float(bytes(self.EditLines['WaitHack Range'][0].GetText())): #for iswww in range(200): Test.AttackVid(i) else: if GetDis(i) > 300 and GetDis(i) < float(bytes(self.EditLines['WaitHack Range'][0].GetText())): count += 1 if count > 8: break X, Y, Z = chr.GetPixelPosition(i) chr.SelectInstance(player.GetMainCharacterIndex()) Xo, Yo, Zo = player.GetMainCharacterPosition() q = int(str(int(math.ceil(int(bytes(int(GetDis(i)))) / 2200) + 1))) for x in range(1, q + 1): Test.TPS(int(str(int(Xo + ((Xo - X) / q) * -1 * x))), int(str(int(Yo + ((Yo - Y) / q) * -1 * x))), int(Zo), int(180)) Test.AttackVid(i) for x in range(1, q): u = q - x Test.TPS(int(str(int(Xo + ((Xo - X) / q) * -1 * u))), int(str(int(Yo + ((Yo - Y) / q) * -1 * u))), int(Zo), int(180)) Test.TPS(int(Xo), int(Yo),int(Zo), int(180)) elif GetDis(i) < 300 and GetDis(i) < float(bytes(self.EditLines['WaitHack Range'][0].GetText())): Test.AttackVid(i) self.On__('WaitHack') def WaitHackFuncOFF(self): self.Off__('WaitHack') def CheckRange(self): for i in range(100): callFnc(0.01 * i, self.CheckRange_2) def CheckRange_2(self): for i in Test.ReturnList(0)+Test.ReturnList(2): if GetDis(i) > 0 and GetDis(i) < float(bytes(self.EditLines['WaitHack Range'][0].GetText())): chr.SetAddRenderMode(i, Test.FloatToSieluFloat(1),Test.FloatToSieluFloat(0),Test.FloatToSieluFloat(1)) def LvlbotFunc(self): ListaVid = [] if self.Buttons['Lvlbot_Moby_S']: for i in Test.ReturnList(0): if not isBoss(i) and GetDis(i) > 0: ListaVid.append((GetDis(i), i)) ListaVid.sort() if self.Buttons['Lvlbot_Bossy_S']: for i in Test.ReturnList(0): chr.SelectInstance(i) iRace = chr.GetRace(i) if (isBoss(i) or iRace in (153, 152, 154, 494, 491, 493, 492, 531, 533, 534, 532) ) and GetDis(i) > 0: ListaVid.append((GetDis(i), i)) ListaVid.sort() if self.Buttons['Lvlbot_Metki_S']: for i in Test.ReturnList(2): if GetDis(i) > 0: ListaVid.append((GetDis(i), i)) ListaVid.sort() if len(ListaVid): Test.AttackVid_2(ListaVid[0][1]) self.On__('Lvlbot') def LvlbotFuncOFF(self): self.Off__('Lvlbot') def getfromlb(self, arg): if self.ListaBoard[arg][0].GetSelectedItem(): return self.ListaBoard[arg][0].GetSelectedItem().GetText() def __Pickup(self): EditLine.OnIMEUpdate(self.EditLines['Pickup_1'][0]) val = self.EditLines['Pickup_1'][0].GetText() self.ListaBoard['Pickup'][0].RemoveAllItems() for i in range(len(self.Lista_Itemkow)): ItemIndex = self.Lista_Itemkow[i] item.SelectItem(ItemIndex) ItemName = item.GetItemName() if len(val) > 3: if val.lower() in ItemName.lower(): self.ListaBoard['Pickup'][0].AppendItem(Item((str(ItemIndex) + ' ' + ItemName))) if len(val) == 0: self.ListaBoard['Pickup'][0].AppendItem(Item((str(ItemIndex) + ' ' + ItemName))) def Dodaj_Pickup(self): self.ListaBoard['Pickup_git'][0].AppendItem(Item(self.getfromlb('Pickup'))) self.Pickup_podnos.append(int(bytes(self.getfromlb('Pickup').split(' ')[0]))) def Usun_Pickup(self): self.Pickup_podnos.remove(int(bytes(self.getfromlb('Pickup_git').split(' ')[0]))) self.ListaBoard['Pickup_git'][0].RemoveAllItems() for i in range(len(self.Pickup_podnos)): ItemIndex = self.Pickup_podnos[i] item.SelectItem(ItemIndex) self.ListaBoard['Pickup_git'][0].AppendItem(Item((str(ItemIndex) + ' ' + item.GetItemName()))) def PickupFunc(self): for item in Test.ReturnItemsByName(str(GetName(GetMyVid()))): (vid, id, x, y) = item if self.Buttons['Wybrane_S']: if not id in self.Pickup_podnos: continue if self.Buttons['Pickup_Instant_S']: net.SendItemPickUpPacket(vid) continue elif self.Buttons['Pickup_Normal_S']: net.SendItemPickUpPacket(vid) break elif self.Buttons['Pickup_Range_S']: X, Y = background.GlobalPositionToLocalPosition(x, y) Xo, Yo, Zo = player.GetMainCharacterPosition() if self.GetDistance(X, Y) < 4300: q = int(str(int(math.ceil(self.GetDistance(X, Y) / 2200) + 1))) for x in range(1, q + 1): Test.TPS(int(str(int(Xo + ((Xo - X) / q) * -1 * x))), int(str(int(Yo + ((Yo - Y) / q) * -1 * x))), int(Zo), int(180)) net.SendItemPickUpPacket(vid) for x in range(1, q): u = q - x Test.TPS(int(str(int(Xo + ((Xo - X) / q) * -1))), int(str(int(Yo + ((Yo - Y) / q) * -1))), int(Zo), int(180)) Test.TPS(int(Xo), int(Yo),int(Zo), int(180)) self.On__('Pickup') def PickupFuncOFF(self): self.Off__('Pickup') def boost(self): try: chr.SelectInstance(player.GetMainCharacterIndex()) rotation = int(str(int(app.GetCameraRotation()))) x, y, z = player.GetMainCharacterPosition() if app.IsPressed(app.DIK_LSHIFT) and app.IsPressed(app.DIK_W) or app.IsPressed(app.DIK_LSHIFT) and app.IsPressed(app.DIK_D)or app.IsPressed(app.DIK_LSHIFT) and app.IsPressed(app.DIK_S)or app.IsPressed(app.DIK_LSHIFT) and app.IsPressed(app.DIK_A): self.Debug() chr.SetRotation(-app.GetCameraRotation()) xd = int(bytes(self.EditLines['BOOST Val'][0].GetText())) xx = int(str(int(xd * math.sin(rotation * 0.017453)))) yy = int(str(int(xd * math.cos(rotation * 0.017453)))) x = int(str(int(x))) y = int(str(int(y))) chr.SetPixelPosition(int(x + xx), int(y - yy)) except:pass self.On__('BOOST') def boostoff(self): self.Off__('BOOST') def AutoWstawanieFunc(self): if ProcHP() <= 0: SendChat('/restart_here') self.AutoWstawanieStatus = 0 else: if self.AutoWstawanieStatus == 0 and ProcHP() > int( bytes(self.EditLines['Wstawanie Proc'][0].GetText())): self.AutoWstawanieStatus = 1 if self.AutoWstawanieStatus == 0: for xd in self.Buttons: if '_S' not in xd and 'WykGraczy' not in xd and 'WykGM' not in xd and 'Wstawanie' not in xd: self.Buttons[xd].pauseEvent(1.1) SetAtak(False) self.On__('Wstawanie') def AutoWstawanieFuncOFF(self): self.Off__('Wstawanie') def SetSkill(self, arg): if arg not in self.skillToUse: self.skillToUse.append(arg) def SetSkillOFF(self, arg): if arg in self.skillToUse: self.skillToUse.remove(arg) def UseSkilsFunc(self): for i in self.skillToUse: # AppendChat(i) if int(bytes(player.IsSkillCoolTime(i))) == 0: if int(bytes(player.IsSkillActive(i))) == 0: if int(bytes(player.IsMountingHorse())) == 1: callFnc(0, SendChat, '/unmount') callFnc(2, player.ClickSkillSlot, int(i)) callFnc(4, SendChat, '/ride') else: player.ClickSkillSlot(int(i)) self.On__('Skile') def UseSkilsFuncOFF(self): self.Off__('Skile') def WykrywaczGM(self): for i in Test.ReturnList(6): if i and i is not None: if '[' == GetName(i)[0] and str(GetName(i)) != 'None': if self.Buttons['WykGM_Dzwiek_S']: Test.Beep(1000, 100) if self.Buttons['WykGM_Czat_S']: AppendChat(str('Wykryto GM - ') + str(GetName(i))) if self.Buttons['WykGM_LogBox_S']: dbg.LogBox(str('Wykryto GM - ') + str(GetName(i))) if self.Buttons['WykGM_Wyloguj_S']: for xd2 in xrange(500): net.SendWhisperPacket( 'ssssssssssssssssssssssssssss', 'sssssssssssssssssssssssss') if self.Buttons['WykGM_WyjdzZGry_S']: app.Exit() if self.Buttons['WykGM_OffFunc_S']: for xd in self.Buttons: if '_S' not in xd and 'WykGraczy' not in xd and 'WykGM' not in xd: try: self.Buttons[xd].pauseEvent(1.1) SetAtak(False) except BaseException: pass self.On__('WykGM') def WykrywaczGMOFF(self): self.Off__('WykGM') def WykrywaczGraczy(self): for i in Test.ReturnList(6): if i and i is not None: if GetName(GetMyVid()) != GetName(i) and str(GetName(i)) != 'None': if self.Buttons['WykGraczy_Dzwiek_S']: Test.Beep(1000, 100) if self.Buttons['WykGraczy_Czat_S']: AppendChat(str('Wykryto Gracza - ') + str(GetName(i))) if self.Buttons['WykGraczy_LogBox_S']: dbg.LogBox(str('Wykryto Gracza - ') + str(GetName(i))) if self.Buttons['WykGraczy_Wyloguj_S']: for xd in xrange(500): net.SendWhisperPacket('ssssssssssssssssssssssssssss', 'sssssssssssssssssssssssss') if self.Buttons['WykGraczy_WyjdzZGry_S']: app.Exit() if self.Buttons['WykGraczy_OffFunc_S']: for xd in self.Buttons: if '_S' not in xd and 'WykGraczy' not in xd and 'WykGM' not in xd: self.Buttons[xd].pauseEvent(1.1) SetAtak(False) self.On__('WykGraczy') def WykrywaczGraczyOFF(self): self.Off__('WykGraczy') def WykrywaczMetinow(self): self.Buttons['WykrywaczMetino_TP'].Hide() self.Buttons['WykrywaczMetino_IDZ'].Hide() for i in Test.ReturnList(2): name = str(chr.GetNameByVID(i)) if name != 'None': (self.Metin_X, self.Metin_Y, sss) = chr.GetPixelPosition(i) self.Buttons['WykrywaczMetino_TP'].Show() self.Buttons['WykrywaczMetino_TP'].SetToolTipText(('Teleportuj do {} na X:{} Y:{}'.format(name, self.Metin_X, self.Metin_Y)), 1) self.Buttons['WykrywaczMetino_IDZ'].Show() self.Buttons['WykrywaczMetino_IDZ'].SetToolTipText(('Idz do {} na X:{} Y:{}'.format(name, self.Metin_X, self.Metin_Y)), 1) self.On__('WykrywaczMetinkow') def WykrywaczMetinowOFF(self): self.Off__('WykrywaczMetinkow') self.Buttons['WykrywaczMetino_TP'].Hide() self.Buttons['WykrywaczMetino_IDZ'].Hide() def WykrywaczBossow(self): self.Buttons['WykrywaczBossow_TP'].Hide() self.Buttons['WykrywaczBossow_IDZ'].Hide() for i in Test.ReturnList(0): name = str(chr.GetNameByVID(i)) if name != 'None': chr.SelectInstance(i) iRace = chr.GetRace(i) if isBoss(i) or iRace in (153, 152, 154, 494, 491, 493, 492, 531, 533, 534, 532): (self.Boss_X, self.Boss_Y, sss) = chr.GetPixelPosition(i) self.Buttons['WykrywaczBossow_TP'].Show() self.Buttons['WykrywaczBossow_TP'].SetToolTipText(('Teleportuj do {} na X:{} Y:{}'.format(name, self.Boss_X, self.Boss_Y)), 1) self.Buttons['WykrywaczBossow_IDZ'].Show() self.Buttons['WykrywaczBossow_IDZ'].SetToolTipText(('Idz do {} na X:{} Y:{}'.format(name, self.Boss_X, self.Boss_Y)), 1) self.On__('WykrywaczBossow') def WykrywaczBossowOFF(self): self.Off__('WykrywaczBossow') self.Buttons['WykrywaczBossow_TP'].Hide() self.Buttons['WykrywaczBossow_IDZ'].Hide() def inside_circle(self, x, y, a, b, r): return (x - a) * (x - a) + (y - b) * (y - b) < r * r def FarmBot(self): try: Kordziaki = self.Kordy dystans_radar = int(self.EditLines['FarmBot Dystans'][0].GetText()) if len(Kordziaki) > 0: ListaMobow = [] ListaVid = [] ListaVidMetki = [] ListaVidBossy = [] if self.Buttons['FarmBot_Moby_S']: for i in Test.ReturnList(0): if i and i is not None and not isBoss(i) and GetDis(i) > 0 and i not in ListaVid: ListaVid.append(i) if self.Buttons['FarmBot_Bossy_S']: for i in Test.ReturnList(0): chr.SelectInstance(i) iRace = chr.GetRace(i) if i and i is not None and (isBoss(i) or iRace in (153, 152, 154, 494, 491, 493, 492, 531, 533, 534, 532)) and GetDis(i) > 0: if i not in ListaVid: ListaVid.append(i) if i not in ListaVidBossy: ListaVidBossy.append(i) if self.Buttons['FarmBot_Metki_S']: for i in Test.ReturnList(2): if i and i is not None and GetDis(i) > 0: if i not in ListaVid: ListaVid.append(i) if i not in ListaVidMetki: ListaVidMetki.append(i) chr.SelectInstance(GetMyVid()) if ListaVid: acc = 1 if self.Buttons['FarmBo_Radar_S']: x, y, z = GetMainPos() if self.RadarCordy[2] == 0: self.RadarCordy[0] = x self.RadarCordy[1] = y self.RadarCordy[2] = 1 if not self.inside_circle(x, y, self.RadarCordy[0],self.RadarCordy[1],dystans_radar): acc = 0 chr.MoveToDestPosition(GetMyVid(), float(bytes(self.RadarCordy[0])), float(bytes(self.RadarCordy[1]))) if acc: if ListaVidBossy: XDXDXD = ListaVidBossy elif ListaVidMetki: XDXDXD = ListaVidMetki else: XDXDXD = ListaVid for i in XDXDXD: if GetDis(i) > 0: if self.Buttons['FarmBo_Radar_S']: (xt, yt, zt) = chr.GetPixelPosition(i) if self.inside_circle(xt, yt, self.RadarCordy[0],self.RadarCordy[1],dystans_radar): ListaMobow.append((GetDis(i), i)) ListaMobow.sort() else: ListaMobow.append((GetDis(i), i)) ListaMobow.sort() if len(ListaMobow) > 0: if self.StopekFarmbot not in (ListaVidMetki+ListaVidBossy+ListaVid): self.StopekFarmbot = ListaMobow[0][1] if self.Buttons['FarmBt_WaitHack_S']: (xt22, yt22, zt) = chr.GetPixelPosition(self.StopekFarmbot) chr.MoveToDestPosition(GetMyVid(), int(xt22), int(yt22)) else: Test.AttackVid_2(self.StopekFarmbot) else: if self.inside_circle(GetMainPos()[0], GetMainPos()[1], int(bytes(Kordziaki[self.FarmBotStep][0])), int(bytes(Kordziaki[self.FarmBotStep][1])), 500): self.FarmBotStep += 1 if self.FarmBotStep == len(Kordziaki): self.FarmBotStep = 0 if len(Kordziaki) >= 2 and not self.inside_circle(GetMainPos()[0], GetMainPos()[1], int(bytes(Kordziaki[self.FarmBotStep][0])), int(bytes(Kordziaki[self.FarmBotStep][1])), 500): if self.Buttons['FarmBo_Teleportuj_S']: TeleportToDest(int(int(bytes(Kordziaki[self.FarmBotStep][0]))), int(int(bytes(Kordziaki[self.FarmBotStep][1])))) chr.MoveToDestPosition(GetMyVid(), int(Kordziaki[self.FarmBotStep][0]), int(Kordziaki[self.FarmBotStep][1])) else: self.DodajKordy() except:pass self.On__('FarmBot') def FarmBotOFF(self): self.Off__('FarmBot') self.RadarCordy[2] = 0 def Silne(self): chr.SelectInstance(player.GetMainCharacterIndex()) chrmgr.SetAffect(-1, 16, 1) def SilneOff(self): chr.SelectInstance(player.GetMainCharacterIndex()) chrmgr.SetAffect(-1, 16, 0) def SetSkill_B(self, arg): if arg not in self.skillToUse_B: self.skillToUse_B.append(arg) def SetSkillOFF_B(self, arg): if arg in self.skillToUse_B: self.skillToUse_B.remove(arg) def UseSkills_BFunc(self): for i in self.skillToUse_B: player.SetTarget(self.Target_BUFFBOT) player.ClickSkillSlot(int(i)) self.On__('Buff') def UseSkills_BFuncOFF(self): self.Off__('Buff') def WybierzCel(self): self.Target_BUFFBOT = player.GetTargetVID() self.Buttons['Buff_Target'].SetToolTipText(str(chr.GetNameByVID(self.Target_BUFFBOT))) def Rozdziel_func(self): Rozdziel_ID = None Rozdziel_ID_List = [] value = int(bytes(self.Slot_InvMene.ReturnList()[0])) if value is not None and value != 'None': for InventorySlot in xrange(SLOT_COUNT): if int(bytes(value)) == int(bytes(GetItemIndex(InventorySlot))): Rozdziel_ID_List.append((player.GetItemCount(InventorySlot),InventorySlot)) Rozdziel_ID_List.sort() if Rozdziel_ID_List: Rozdziel_ID = Rozdziel_ID_List[-1][1] if Rozdziel_ID != None: Count_Paczek = int(bytes(self.EditLines['InvMene_Paczki'][0].GetText())) Count_Paczek_ = 0 ban_slots = [] for i in xrange(player.INVENTORY_SLOT_COUNT): item_id = int(bytes(player.GetItemIndex(i))) item.SelectItem(item_id) (trash, size_y) = item.GetItemSize() size_y = int(bytes(size_y)) if item_id != 0: for x in xrange(size_y): ban_slots.append(i + 5 * x) if item_id == 0 and i not in ban_slots: net.SendItemMovePacket(Rozdziel_ID, i, int(bytes(self.EditLines['InvMene_Ile'][0].GetText()))) Count_Paczek_ += 1 if Count_Paczek_ >= Count_Paczek: break def OnButton12Event(self): inventorySize = 45 * 5 maxStack = int( bytes(self.EditLines['InvMene_MaxStack'][0].GetText())) items = {} self.counter = 0 def getSlotMaxCount(itemVnum): for i in xrange(inventorySize): vnum = int(bytes(player.GetItemIndex(i))) if not vnum: continue count = int(bytes(player.GetItemCount(i))) if (count == maxStack): continue if (itemVnum != vnum): continue return i for i in xrange(inventorySize): vnum = int(bytes(player.GetItemIndex(i))) if (not vnum): continue item.SelectItem(vnum) if ( (not item.IsFlag((1 << 2))) or (item.IsAntiFlag(item.ITEM_ANTIFLAG_STACK)) ): continue if (int(bytes(player.GetItemCount(i))) == maxStack): continue try: items[vnum].append(i) except BaseException: items[vnum] = [i] for k, v in items.iteritems(): dest = getSlotMaxCount(k) if (dest == -1): continue for src in v: if (src == dest): continue if int(bytes(player.GetItemCount(src))) + int(bytes(player.GetItemCount(dest))) > maxStack: continue while (self.counter < 15): self.counter += 1 if (self.counter == 14): net.SendItemMovePacket(int(bytes(player.INVENTORY)), src, int(bytes(player.INVENTORY)), dest, int(bytes(player.GetItemCount(src)))) break self.counter = 0 def Ulepsz_func(self): Ulepsz_ID = None value = int(bytes(self.Slot_Ulepszanie2.ReturnList()[0])) if value is not None and value != 'None': for InventorySlot in xrange(SLOT_COUNT): if int(bytes(value)) == int(bytes(GetItemIndex(InventorySlot))): Ulepsz_ID = InventorySlot if Ulepsz_ID != None: Ulepszacz_ID1 = self.Slot_Ulepszanie.ReturnList()[0] for i in xrange(int(bytes(self.EditLines['InvMene_CountUlep'][0].GetText()))): if self.Buttons['Ulepszanie_Kowal_S']: net.SendRefinePacket(Ulepsz_ID, 0) if self.Buttons['Ulepszanie_GILDIA_S']: net.SendRefinePacket(Ulepsz_ID, 1) if self.Buttons['Ulepszanie_DT_S']: net.SendRefinePacket(Ulepsz_ID, 4) if self.Buttons['Ulepszanie_INNE_S'] and Ulepszacz_ID1 != None: for InventorySlot in xrange(player.INVENTORY_PAGE_SIZE * 5): ItemValue = player.GetItemIndex(InventorySlot) if int(bytes(ItemValue)) == int(bytes(Ulepszacz_ID1)): net.SendItemUseToItemPacket(InventorySlot, Ulepsz_ID) net.SendRefinePacket(Ulepsz_ID, 2) break def SpamBotFunc(self): a = 0 tekst = self.EditLines['SpamBot Text'][0].GetText() if len(tekst) > 3: if self.Buttons['SpamBot_Normal_S']: SendChat(tekst) if self.Buttons['SpamBot_Wolaj_S']: net.SendChatPacket(tekst, chat.CHAT_TYPE_SHOUT) if self.Buttons['SpamBot_PW_S']: for i in Test.ReturnList(6): if i: if '[' != GetName(i)[0]: a += 1 callFnc(2 * a, net.SendWhisperPacket,str(GetName(i)), str(tekst)) callFnc(2 * a, AppendChat,(str(GetName(i)), str(tekst))) self.On__('SpamBot') def SpamBotFuncOFF(self): self.Off__('SpamBot') def KopaczFunc(self): asa = [] for i in Test.ReturnList(1): chr.SelectInstance(i) if str(bytes(GetName(i))) == str(bytes(self.getfromlb('Kopacz_Rudy'))): dystans = GetDis(i) if dystans > 0: b = (dystans, i) asa.append(b) if asa: asa.sort() (X,Y, sss) = chr.GetPixelPosition(asa[0][1]) if asa[0][0] > 150: chr.MoveToDestPosition(GetMyVid(), float(bytes(X+100)), float(bytes(Y))) else: ClickVID(int(bytes(asa[0][1]))) self.On__('Kopacz') def KopaczFuncOFF(self): self.Off__('Kopacz') def Dodaj_Kopacz(self): try: chr.SelectInstance(int(bytes(GetVID()))) self.ListaBoard['Kopacz_Rudy'][0].AppendItem(Item(str(GetName(int(bytes(GetVID())))))) self.Kopacz_Rud.append(str(GetName(int(bytes(GetVID()))))) self.ListaBoard['Kopacz_Rudy'][0].SelectIndex(0) except BaseException: pass def Usun_Kopacz(self): try: self.Kopacz_Rud.remove(self.getfromlb('Kopacz_Rudy')) self.ListaBoard['Kopacz_Rudy'][0].RemoveAllItems() for i in range(len(self.Kopacz_Rud)): ItemIndex = self.Kopacz_Rud[i] self.ListaBoard['Kopacz_Rudy'][0].AppendItem(Item(ItemIndex)) except BaseException: pass # ,dbg def SaveSet(self): global Dopalacze_ID btn_Settings_List = '' editline_Settings_List = '' dopalacze_Settings_List = '' pickup_Settings_List = '' Kordy_Name_List = '' #test_dict = [] Kordy_Settings_List = '' for i in self.Kordy: Kordy_Settings_List += str(str(i[0]) + str(',') + str(i[1])) + str('|||') for i in self.Pickup_podnos: pickup_Settings_List += str(i) + str('|||') for i in self.Slot_Dopalacze.ReturnList(): dopalacze_Settings_List += str(i) + str('|||') for i in self.EditLines: editline_Settings_List += str(self.EditLines[i][0].GetText()) + str('|||') for i in self.Buttons: if '_S' not in i or '_S_B' in i: s = str(self.Buttons[i].getState()) btn_Settings_List += str(s) + str('|||') #Save_settings(str(i), self.Buttons[i].getState()) Save_settings(str('btn_status'), btn_Settings_List[0:-3]) Save_settings(str('editline_value'), editline_Settings_List[0:-3]) Save_settings(str('dopy_value'), dopalacze_Settings_List[0:-3]) Save_settings(str('pickup_value'), pickup_Settings_List[0:-3]) Save_settings(str('Mobber_ID'), self.Slot_Mobber['Mobber'].ReturnList()[0]) Save_settings(str('RedPota_ID'), self.Slot_Poty['PotyRed'].ReturnList()[0]) Save_settings(str('BluePota_ID'), self.Slot_Poty['PotyBlue'].ReturnList()[0]) #Save_settings(str('Kordy_Name'), Kordy_Name_List) Save_settings(str('FarmBotKordy'),Kordy_Settings_List[0:-3]) def LoadSet(self): global Dopalacze_ID #AppendChat(chr.testGetPKData()) #app.RenderGame = self.oldS btn_Settings_List = list(Read_settings('btn_status').split('|||')) editline_Settings_List = list(Read_settings('editline_value').split('|||')) dopalacze_Settings_List = list(Read_settings('dopy_value').split('|||')) pickup_Settings_List = list(Read_settings('pickup_value').split('|||')) Kordy_Settings_List = list(Read_settings('FarmBotKordy').split('|||')) #Kordy_Name_List = list(Read_settings('Kordy_Name').split('|,|')) for counter, value in enumerate(dopalacze_Settings_List): if value != 'None': self.Slot_Dopalacze.SetItemSlot(counter,value) #for i in Kordy_Name_List: for ItemIndex in Kordy_Settings_List: if ItemIndex: ItemIndex = list(ItemIndex.split(',')) if (str(int(ItemIndex[0])), str(int(ItemIndex[1]))) not in self.Kordy: self.ListaBoard['FarmBot2'][0].AppendItem(Item((str(ItemIndex[0]) + ' ' + ItemIndex[1]))) self.Kordy.append((str(int(ItemIndex[0])), str(int(ItemIndex[1])))) l = -1 for i in self.EditLines: l += 1 self.EditLines[i][0].SetText(str(editline_Settings_List[l])) l = -1 for i in self.Buttons: if '_S' not in i or '_S_B' in i: l += 1 # AppendChat(i) if str(btn_Settings_List[l]) == str('True') and self.Buttons[i].getState() == False: self.Buttons[i].startEvent() # AppendChat('Start Event') if '_S_B' in i or 'expoddawaj' in i or 'NOK' in i or 'WALL' in i or 'SILNE' in i or 'Skille_' in i: self.Buttons[i].Down() # AppendChat('Down') if str(btn_Settings_List[l]) == str('False') and self.Buttons[i].getState() == True: self.Buttons[i].stopEvent() # AppendChat('Stop Event') if '_S_B' in i or 'expoddawaj' in i or 'NOK' in i or 'WALL' in i or 'SILNE' in i or 'Skille_' in i: self.Buttons[i].SetUp() # AppendChat('SetUp') # for i in range(len(dopalacze_Setting # s_List) - 1): # if dopalacze_Settings_List[i] != 'None': # item.SelectItem(int(str(int(dopalacze_Settings_List[i])))) # self.Slot_Dopalacze[i][1].LoadImage( # str(item.GetIconImageFileName())) # Dopalacze_ID[i] = dopalacze_Settings_List[i] Mobber_ID = Read_settings('Mobber_ID') if Mobber_ID != 'None': self.Slot_Mobber['Mobber'].SetItemSlot(0,Mobber_ID) RedPota_ID = Read_settings('RedPota_ID') if RedPota_ID != 'None': self.Slot_Poty['PotyRed'].SetItemSlot(0,RedPota_ID) BluePota_ID = Read_settings('BluePota_ID') if BluePota_ID != 'None': self.Slot_Poty['PotyBlue'].SetItemSlot(0,BluePota_ID) for ItemIndex in pickup_Settings_List: if ItemIndex: ItemIndex = int(bytes(int(ItemIndex))) if ItemIndex not in self.Pickup_podnos: item.SelectItem(ItemIndex) ItemName = item.GetItemName() self.ListaBoard['Pickup_git'][0].AppendItem(Item((str(ItemIndex) + ' ' + ItemName))) self.Pickup_podnos.append(int(bytes(ItemIndex))) def AutoLoginFunc(self): if not net.IsConnect(): account = player.GetMainCharacterName() for accID in xrange(4): charname = net.GetAccountCharacterSlotDataString(accID, 1) if charname in account and charname != '': net.DirectEnter(accID) break self.On__('AutoLogin') def AutoLoginFuncOFF(self): self.Off__('AutoLogin') def plzbro(): MultiHack() callFnc(0, plzbro)
  14. @Lajk w ostatnim temacie mnie podpuścił, więc stwierdziłem że czemu nie zrobić zapisywania prywatnych wiadomości, bo czasami zdarzy się zamknąć szept z osobą, którą nie chciało się tego zrobić, a wtedy cała rozmowa z tą osobą się usuwa. Krótki opis działania. Wszystkie wysłane i odebrane wiadomości zapisują się w kliencie (do momentu zmiany postaci) i jeśli zamkniemy z kimś okno szeptu, a potem je otworzymy to wczytają się wszystkie wcześniej wysłane i odebrane wiadomości w odpowiedniej kolejności. To chyba tyle (mam nadzieję, że każdy ogarnia o co chodzi). Wszystkie czynności wykonujemy w root'ach constInfo.py Dodajemy: WHISPER_MESSAGES = {} game.py Zamieniamy poniższe funkcje: def OnRecvWhisper(self, mode, name, line): if mode == chat.WHISPER_TYPE_GM: self.interface.RegisterGameMasterName(name) line.replace(" : ", ": ") if not constInfo.WHISPER_MESSAGES.has_key(name): constInfo.WHISPER_MESSAGES.update({name : [(mode, line)]}) else: constInfo.WHISPER_MESSAGES[name].append((mode, line)) self.interface.RecvWhisper(mode, name, line) def OnRecvWhisperSystemMessage(self, mode, name, line): chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line) self.interface.RecvWhisper(mode, name, line) def OnRecvWhisperError(self, mode, name, line): if localeInfo.WHISPER_ERROR.has_key(mode): chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name)) else: chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name)) self.interface.RecvWhisper(mode, name, line) interfaceModule.py Zamieniamy poniższą funkcję: def RecvWhisper(self, mode, name, line): if not self.whisperDialogDict.has_key(name): btn = self.__FindWhisperButton(name) if 0 == btn: btn = self.__MakeWhisperButton(name) btn.Flash() for text in constInfo.WHISPER_MESSAGES[name]: chat.AppendWhisper(text[0], name, text[1]) chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name)) else: chat.AppendWhisper(mode, name, line) btn.Flash() elif self.IsGameMasterName(name): dlg = self.whisperDialogDict[name] dlg.SetGameMasterLook() introSelect.py W funkcji def Open(self): dodajemy: WHISPER_MESSAGES = {} uiWhisper.py Dodajemy na górze: import constInfo W funkcji def OpenWithTarget(self, targetName): dodajemy na dole: if constInfo.WHISPER_MESSAGES.has_key(targetName): for text in constInfo.WHISPER_MESSAGES[targetName]: chat.AppendWhisper(text[0], targetName, text[1]) W funkcji def AcceptTarget(self): dodajemy na dole: if constInfo.WHISPER_MESSAGES.has_key(name): for text in constInfo.WHISPER_MESSAGES[name]: chat.AppendWhisper(text[0], name, text[1]) Zamieniamy poniższą funkcję: def SendWhisper(self): text = self.chatLine.GetText() textLength = len(text) if textLength > 0: if net.IsInsultIn(text): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING) return net.SendWhisperPacket(self.targetName, text) self.chatLine.SetText("") if not constInfo.WHISPER_MESSAGES.has_key(self.targetName): constInfo.WHISPER_MESSAGES.update({self.targetName : [(1, ("{}: {}".format(player.GetName(), text)))]}) else: constInfo.WHISPER_MESSAGES[self.targetName].append([1, "{}: {}".format(player.GetName(), text)]) chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + ": " + text) Tyle. Gdyby ktoś znalazł jakieś błędy to pisać w temacie.
  15. Siema macie tutaj, dodawanie yangów do uiMoneyDialog jak na Nerwi. Nie ma co więcej opisywać wpisując k -> zamieniane jest na 000. Udostępniam, bo jakiś bambik wziął i udostępnił na devie. GIF: Client -> root -> uipickmoney.py //1.0 Szukasz def OnAccept(self): //1.1 Podmień całą funkcje/dostosuj do tej: def OnAccept(self): text = self.pickValueEditLine.GetText().replace("k", "000") if len(text) > 0 and text.isdigit(): money = int(text) money = min(money, self.maxValue) if money > 0: if self.eventAccept: self.eventAccept(money) self.Close() Client -> uiscript -> pickmoneydialog.py //1.0 Szukasz i komentujesz #: "only_number" : 1,
  16. Hellom2zone, the firts sorry because i can't speak polish but i understand. I need help with a problem, i try to fix about 2 month but i can't. I try to compare other clients but i have the same lines, and i have the same problem, i try, to add new .py but i have the same problem, i try to change .dds or rutes but i have the same problem.. when you pass the mouse to name character board you can see your rank, if you have 1000 and you are good, or -1000 and you are evil, etc but my problem is when you pass the mouse i can't see that. that's is my problem: and this i want to mean: i don't add systems, or somethings, and my sysser is clean :S someone have any idea? really thanks!
  17. Gif systemu System informacji działa raz na sesje logowania wykorzystując "pamięć podręczną klienta" system dodawałem/testowałem na kliencie by Lajk Client 40k (+ Update v1.1.1) Wszystkie zmiany dokonujemy w pliku root. uiMessenger.py w funkcji def OnLogin(self, groupIndex, key, name=None): poniżej member.Online() self.OnRefreshList() dodajemy if not name in constInfo.ALREADY_NOTIFY_LIST: self.onlinePopup = uiCommon.OnlinePopup() self.onlinePopup.SetUserName(name) self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name) self.onlinePopup.SlideIn() constInfo.ALREADY_NOTIFY_LIST.append(name) def OpenWhisper(self, eventType, userName): self.whisperButtonEvent(userName) constInfo.py dodajemy ALREADY_NOTIFY_LIST = [] ui.py zamienimy cała funkcje class Board(Window): oraz dodajemy nową class BorderB(Board): class Board(Window): CORNER_WIDTH = 32 CORNER_HEIGHT = 32 LINE_WIDTH = 128 LINE_HEIGHT = 128 LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 BASE_PATH = "d:/ymir work/ui/pattern" IMAGES = { 'CORNER' : { 0 : "Board_Corner_LeftTop", 1 : "Board_Corner_LeftBottom", 2 : "Board_Corner_RightTop", 3 : "Board_Corner_RightBottom" }, 'BAR' : { 0 : "Board_Line_Left", 1 : "Board_Line_Right", 2 : "Board_Line_Top", 3 : "Board_Line_Bottom" }, 'FILL' : "Board_Base" } def __init__(self, layer = "UI"): Window.__init__(self, layer) self.skipMaxCheck = False self.MakeBoard() def MakeBoard(self): CornerFileNames = [ ] LineFileNames = [ ] for imageDictKey in (['CORNER', 'BAR']): for x in xrange(len(self.IMAGES[imageDictKey])): if imageDictKey == "CORNER": CornerFileNames.append("%s/%s.tga" % (self.BASE_PATH, self.IMAGES[imageDictKey][x])) elif imageDictKey == "BAR": LineFileNames.append("%s/%s.tga" % (self.BASE_PATH, self.IMAGES[imageDictKey][x])) self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag("not_pick") Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag("not_pick") Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage("%s/%s.tga" % (self.BASE_PATH, self.IMAGES['FILL'])) self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() def __del__(self): Window.__del__(self) def SetSize(self, width, height): if not self.skipMaxCheck: width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) class BorderB(Board): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 BASE_PATH = "d:/ymir work/ui/pattern" IMAGES = { 'CORNER' : { 0 : "border_b_left_top", 1 : "border_b_left_bottom", 2 : "border_b_right_top", 3 : "border_b_right_bottom" }, 'BAR' : { 0 : "border_b_left", 1 : "border_b_right", 2 : "border_b_top", 3 : "border_b_bottom" }, 'FILL' : "border_b_center" } def __init__(self): Board.__init__(self) self.eventFunc = { "MOUSE_LEFT_BUTTON_UP" : None, } self.eventArgs = { "MOUSE_LEFT_BUTTON_UP" : None, } def __del__(self): Board.__del__(self) self.eventFunc = None self.eventArgs = None def SetSize(self, width, height): Board.SetSize(self, width, height) def SetEvent(self, func, *args) : result = self.eventFunc.has_key(args[0]) if result : self.eventFunc[args[0]] = func self.eventArgs[args[0]] = args else : print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0] def OnMouseLeftButtonUp(self): if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] : apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"]) uiCommon.py na samym początku sprawdzamy czy mamy import wndMgr import app na końcu dodajemy: class OnlinePopup(ui.BorderB): def __init__(self): ui.BorderB.__init__(self) self.isActiveSlide = False self.isActiveSlideOut = False self.endTime = 0 self.wndWidth = 0 self.textLine = ui.TextLine() self.textLine.SetParent(self) self.textLine.SetWindowHorizontalAlignCenter() self.textLine.SetWindowVerticalAlignCenter() self.textLine.SetHorizontalAlignCenter() self.textLine.SetVerticalAlignCenter() self.textLine.SetPosition(13, 0) self.textLine.Show() self.onlineImage = ui.ImageBox() self.onlineImage.SetParent(self) self.onlineImage.SetPosition(8, 8) self.onlineImage.LoadImage("d:/ymir work/ui/game/windows/messenger_list_online.sub") self.onlineImage.Show() def __del__(self): ui.BorderB.__del__(self) def SlideIn(self): self.SetTop() self.Show() self.isActiveSlide = True self.endTime = app.GetGlobalTimeStamp() + 5 def Close(self): self.Hide() def Destroy(self): self.Close() def SetUserName(self, name): self.textLine.SetText("Gracz %s jest Online" % str(name)) self.wndWidth = self.textLine.GetTextSize()[0] + 40 self.SetSize(self.wndWidth, 25) self.SetPosition(-self.wndWidth, wndMgr.GetScreenHeight() - 200) def OnUpdate(self): if self.isActiveSlide and self.isActiveSlide == True: x, y = self.GetLocalPosition() if x < 0: self.SetPosition(x + 4, y) if self.endTime - app.GetGlobalTimeStamp() <= 0 and self.isActiveSlideOut == False and self.isActiveSlide == True: self.isActiveSlide = False self.isActiveSlideOut = True if self.isActiveSlideOut and self.isActiveSlideOut == True: x, y = self.GetLocalPosition() if x > -(self.wndWidth): self.SetPosition(x - 4, y) if x <= -(self.wndWidth): self.isActiveSlideOut = False self.Close() może wystąpić następujący błąd jeśli klikniemy w liście znajomych na aktywnego gracza (gdy bedzie onilne) wywali nam klienta aby to naprawić należy poprawić ścieżkę w pliku uiwhisper.py (linijka 73) def LoadDialog(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/whisperdialog.py") SKAN ETC.rar
  18. Czyli \n jako enter - zamiast dopisywania nowej linii. Wzór: veriable = MultiTextLine(parent, text , x, y, range[optional]) Przykład użycia: self.TestText = MultiTextLine(self, 'Test1\nTest2\nTest3\nTest4\nTest5', 60, 35, 15) Klasa ui.py: class MultiTextLine(ui.TextLine): def __init__(self, parent, text, x, y, range = 15): ui.TextLine.__init__(self) self.TextList = [] self.CreateUI(parent, text, x, y, range) def __del__(self): del self.TextList ui.TextLine.__del__(self) def CreateUI(self, parent, text, x, y, range): if "\n" in str(text): self.first_text = ui.TextLine() self.first_text.SetParent(parent) self.first_text.SetPosition(x, y) self.first_text.SetText(text.split("\n")[0]) self.first_text.Show() self.TextList.append(self.first_text) for i in xrange(text.count("\n")): self.i = ui.TextLine() self.i.SetParent(parent) self.i.SetPosition(x, (i + 1) * range + y) self.i.SetText(text.split("\n")[i+1]) self.i.Show() self.TextList.append(self.i) def SetText(self, text): tmpMiktar = 0 if "\n" in str(text): for i in self.TextList: if i == self.TextList[0]: i.SetText(text.split("\n")[0]) else: i.SetText(text.split("\n")[tmpMiktar]) tmpMiktar += 1 def Close(self): for i in self.TextList: i.Hide() self.__del__()
  19. Fajny bajer na serwery z odblokowanymi yangami uiinventory.py Znajdz self.wndMoney.SetText(localeInfo.NumberToMoneyString(money)) Zamien na: self.wndMoney.SetText(localeInfo.NumberToMoneyStringKitmir(money)) localeInfo.py znajdz: def NumberToMoneyString(n) : Dodaj pod: def NumberToMoneyStringKitmir(number): if number <= 0: return "0 Yang" # if len(int(number)) > 3: number = str(number) result = CutMoneyString(number, 0, 3, "", "") result = CutMoneyString(number, 3, 6, "|cFFc7b81fK|r", result) result = CutMoneyString(number, 6, 9, "|cFFc7b81fM|r", result) result = CutMoneyString(number, 9, 12, "|cFFc7b81fT|r", result) result = result+ "|cFFc7b81fYang|r" return result Pamiętaj żeby dodać taby
  20. Kolorowanie textu w pythonie za pomocą funkcji pozdro a nie jakieś |cffFFFF00M2ZONE|h|r XDDD Wrzucamy to do folderu root cff.py Sposób użycia: from cff import CFF text = CFF.format('M2ZONE', 'green') text = CFF.format(8000, 'banana') text = CFF.format(412.55, 'red') text = CFF.format('LOL', '#113355') text = CFF.format('Nazwa:', 'springgreen', CFF.FLAG_NEW_TAB) + CFF.format(item.GetItemName(), 'chocolate') text = CFF.multi_format(('a', 'b', 'c'), 'red') # text[0], text[1], text[2]
  21. Wchodzimy do: pack/root/uitooltip.py Szukamy: ATTRIBUTE_NEED_WIDTH = { Nad dodajemy: MAX_AFFECT_VALUE = { 0 : -1, item.APPLY_MAX_HP : 2000, item.APPLY_MAX_SP : 80, item.APPLY_CON : 12, item.APPLY_INT : 12, item.APPLY_STR : 12, item.APPLY_DEX : 12, item.APPLY_ATT_SPEED : 8, item.APPLY_MOV_SPEED : 20, item.APPLY_CAST_SPEED : 20, item.APPLY_HP_REGEN : 30, item.APPLY_SP_REGEN : 30, item.APPLY_POISON_PCT : 8, item.APPLY_STUN_PCT : 8, item.APPLY_SLOW_PCT : 8, item.APPLY_CRITICAL_PCT : 10, item.APPLY_PENETRATE_PCT : 10, item.APPLY_ATTBONUS_WARRIOR : 15, item.APPLY_ATTBONUS_ASSASSIN : 15, item.APPLY_ATTBONUS_SURA : 20, item.APPLY_ATTBONUS_SHAMAN : 15, item.APPLY_ATTBONUS_MONSTER : 0, item.APPLY_ATTBONUS_HUMAN : 10, item.APPLY_ATTBONUS_ANIMAL : 20, item.APPLY_ATTBONUS_ORC : 20, item.APPLY_ATTBONUS_MILGYO : 20, item.APPLY_ATTBONUS_UNDEAD : 20, item.APPLY_ATTBONUS_DEVIL : 20, item.APPLY_STEAL_HP : 10, item.APPLY_STEAL_SP : 10, item.APPLY_MANA_BURN_PCT : 10, item.APPLY_DAMAGE_SP_RECOVER : 0, item.APPLY_BLOCK : 15, item.APPLY_DODGE : 15, item.APPLY_RESIST_SWORD : 15, item.APPLY_RESIST_TWOHAND : 15, item.APPLY_RESIST_DAGGER : 15, item.APPLY_RESIST_BELL : 15, item.APPLY_RESIST_FAN : 15, item.APPLY_RESIST_BOW : 15, item.APPLY_RESIST_FIRE : 15, item.APPLY_RESIST_ELEC : 15, item.APPLY_RESIST_MAGIC : 15, item.APPLY_RESIST_WIND : 15, item.APPLY_REFLECT_MELEE : 10, item.APPLY_REFLECT_CURSE : 0, item.APPLY_POISON_REDUCE : 5, item.APPLY_KILL_SP_RECOVER : 0, item.APPLY_EXP_DOUBLE_BONUS : 20, item.APPLY_GOLD_DOUBLE_BONUS : 20, item.APPLY_ITEM_DROP_BONUS : 20, item.APPLY_POTION_BONUS : 0, item.APPLY_KILL_HP_RECOVER :0, item.APPLY_IMMUNE_STUN : 1, item.APPLY_IMMUNE_SLOW : 1, item.APPLY_IMMUNE_FALL : 0, item.APPLY_BOW_DISTANCE : 0, item.APPLY_DEF_GRADE_BONUS : 0, item.APPLY_ATT_GRADE_BONUS : 0, item.APPLY_MAGIC_ATT_GRADE : 0, item.APPLY_MAGIC_DEF_GRADE : 0, item.APPLY_MAX_STAMINA : 0, item.APPLY_MALL_ATTBONUS : 0, item.APPLY_MALL_DEFBONUS : 0, item.APPLY_MALL_EXPBONUS : 0, item.APPLY_MALL_ITEMBONUS : 0, item.APPLY_MALL_GOLDBONUS : 0, item.APPLY_SKILL_DAMAGE_BONUS : 0, item.APPLY_NORMAL_HIT_DAMAGE_BONUS : 0, item.APPLY_SKILL_DEFEND_BONUS : 0, item.APPLY_NORMAL_HIT_DEFEND_BONUS : 0, item.APPLY_PC_BANG_EXP_BONUS : 0, item.APPLY_PC_BANG_DROP_BONUS : 0, item.APPLY_RESIST_WARRIOR : 15, item.APPLY_RESIST_ASSASSIN : 15, item.APPLY_RESIST_SURA : 15, item.APPLY_RESIST_SHAMAN : 15, item.APPLY_MAX_HP_PCT : 0, item.APPLY_MAX_SP_PCT : 0, item.APPLY_ENERGY : 0, item.APPLY_COSTUME_ATTR_BONUS : 0, item.APPLY_MAGIC_ATTBONUS_PER : 0, item.APPLY_MELEE_MAGIC_ATTBONUS_PER : 0, item.APPLY_RESIST_ICE : 0, item.APPLY_RESIST_EARTH : 0, item.APPLY_RESIST_DARK : 0, item.APPLY_ANTI_CRITICAL_PCT : 0, item.APPLY_ANTI_PENETRATE_PCT : 0, } Szukamy: def __GetAttributeColor(self, index, value): if value > 0: if index >= 5: return self.SPECIAL_POSITIVE_COLOR2 else: return self.SPECIAL_POSITIVE_COLOR elif value == 0: return self.NORMAL_COLOR else: return self.NEGATIVE_COLOR Zamieniamy na: def __GetAttributeColor(self, index, value, type=0): if value == self.MAX_AFFECT_VALUE[type]: return self.SPECIAL_TITLE_COLOR if value > 0: if index >= 5: return self.SPECIAL_POSITIVE_COLOR2 else: return self.SPECIAL_POSITIVE_COLOR elif value == 0: return self.NORMAL_COLOR else: return self.NEGATIVE_COLOR Szukamy: if affectString: affectColor = self.__GetAttributeColor(i, value) self.AppendTextLine(affectString, affectColor) Zamieniamy na: if affectString: affectColor = self.__GetAttributeColor(i, value, type) self.AppendTextLine(affectString, affectColor) Jeśli dodawałeś nowe bony z mojego poradnika: Szukamy: item.APPLY_ANTI_PENETRATE_PCT : 0, Pod dodajemy: item.APPLY_ATTBONUS_STONE : 20, item.APPLY_ATTBONUS_BOSS : 20,
  22. Otwieramy plik uitooltip.py 1.Szukamy: 2.Dodajemy pod: 3.Efekt:
  23. gui biologa Biyolog Sistemi.rar [Hidden Content]
  24. Siema, ktoś tam udostępnił jakiś inny Switcher no generalnie jest on do mixu, a i tak kiedyś chciałem sobie napisać swój taki to macie: - Switcher otwiera się najeżdżając zmianką na przedmiot typu broń/zbroja. - Zablokowana możliwość poruszania, używania przedmiotów gdy jest otwarty Switcher. W pliku uibonuschanger.py dowiecie się jak wykorzystać słownik z innego pliku, zamiast kopiować go jeszcze raz do jednego pliku. Niby mógłbym to sprzedawać, bla bla ale i tak by mi sie nie chciało. Jak coś nie tak, albo czegoś brakuje to dajcie znać może mi sie zechce poprawić. GIF: #Edit: update dl'a, brakująca część kodu w uiInventory.py DL:
  25. Witam podaję wam plik do lepszego wyglądu ładowania gry Przed: Po: Zmiana ładowania.7z
×
×
  • Create New...