Advertisement
Guest User

głównem2

a guest
Sep 11th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 101.12 KB | None | 0 0
  1. import ui, app
  2. , chr
  3. , time
  4. , grp
  5. , math
  6. , imp
  7. , skill
  8. , localeInfo
  9. , item
  10. , background
  11. , constInfo
  12. , uiScriptLocale
  13. , chrmgrm2g
  14. , playerm2g2 as player
  15. , wndMgr
  16. , chatm2g as chat
  17. try:
  18.     import m2netm2g as m2net
  19. except:
  20.     import net
  21.     m2net = net
  22. else:
  23.     import os
  24.     from textTail import Pick
  25.     import k_locale, k_timer
  26. , k_command_manager
  27.     DISABLE_DLL_MODULE_FUNCTIONS = 1
  28.     KAMER_MODULE_NOT_LOADED = 0
  29.     try:
  30.         import player5
  31.     except:
  32.         KAMER_MODULE_NOT_LOADED = 1
  33.         dbg.LogBox('Failed to load kamer Module. Some functions are now disabled.')
  34.  
  35. FARM_CONFIG_FILE = 'temp/h4ckb4r/farm_cords.cfg'
  36. MOD_CONFIG_FILE = 'temp/h4ckb4r/mod_config2.cfg'
  37.  
  38. def ReadConfig(Setting):
  39.     handle = app.OpenTextFile(MOD_CONFIG_FILE)
  40.     count = app.GetTextFileLineCount(handle)
  41.     for i in xrange(count):
  42.         line = app.GetTextFileLine(handle, i)
  43.         if line.startswith(Setting):
  44.             return line.split('=')[1]
  45.  
  46.  
  47. def SaveConfig(Setting, Value):
  48.     sReader = open(MOD_CONFIG_FILE, 'r')
  49.     sLines = file.readlines(sReader)
  50.     sWriter = open(MOD_CONFIG_FILE, 'w')
  51.     for Line in sLines:
  52.         if Line.startswith(Setting + '='):
  53.             Line = Setting + '=' + Value + '\n'
  54.         sWriter.write(Line)
  55.  
  56.     sWriter.close()
  57.     sReader.close()
  58.  
  59.  
  60. MyX = 0
  61. MyY = 0
  62. if ReadConfig('ExtraPickUp') == '1':
  63.     EXTRA_PICKUP = 1
  64. elif ReadConfig('ExtraPickUp') == '2':
  65.     EXTRA_PICKUP = 2
  66. else:
  67.     EXTRA_PICKUP = 1
  68. oldIsPrivateShopItemPriceList = 0
  69.  
  70. def IsPrivateShopItemPriceList():
  71.     return TRUE
  72.  
  73.  
  74. def SaveLoginInfo(name, channel, id, pwd, slot, auto_login):
  75.     file = open('logininfo.xml', 'w')
  76.     file.write('<logininfo name="%s" channel_idx="%s">\n' % (name, channel))
  77.     if id == '':
  78.         file.write(' <id> </id>\n')
  79.     else:
  80.         file.write(' <id>%s</id>\n' % id)
  81.     if id == '':
  82.         file.write(' <pwd> </pwd>\n')
  83.     else:
  84.         file.write(' <pwd>%s</pwd>\n' % pwd)
  85.     file.write(' <slot>%s</slot>\n' % slot)
  86.     file.write(' <auto_login>%s</auto_login>\n' % auto_login)
  87.     file.write('</logininfo>')
  88.     file.close()
  89.  
  90.  
  91. def LoadLoginInfo(x):
  92.  
  93.     def getValue(element, name, default):
  94.         if [] != element.getElementsByTagName(name):
  95.             return element.getElementsByTagName(name).item(0).firstChild.nodeValue
  96.         else:
  97.             return default
  98.  
  99.     from xml.dom.minidom import parse
  100.     try:
  101.         f = open('logininfo.xml', 'r')
  102.         dom = parse(f)
  103.     except:
  104.         return ''
  105.  
  106.     if [] != dom.getElementsByTagName('logininfo'):
  107.         logininfo = dom.getElementsByTagName('logininfo')[0]
  108.     else:
  109.         return ''
  110.     if x == 'name':
  111.         server_name = logininfo.getAttribute('name')
  112.         return server_name
  113.     else:
  114.         if x == 'channel_idx':
  115.             channel_idx = logininfo.getAttribute('channel_idx')
  116.             return channel_idx
  117.         if x == 'id':
  118.             id = getValue(logininfo, 'id', '')
  119.             return id
  120.         if x == 'pwd':
  121.             pwd = getValue(logininfo, 'pwd', '')
  122.             return pwd
  123.         if x == 'slot':
  124.             slot = getValue(logininfo, 'slot', '0')
  125.             return slot
  126.         if x == 'is_auto_login':
  127.             is_auto_login = getValue(logininfo, 'auto_login', '0')
  128.             return is_auto_login
  129.         return ''
  130.  
  131.  
  132. RED_POTION_ID = ''
  133. BLUE_POTION_ID = ''
  134.  
  135. class Dialog1(ui.Window):
  136.     Auto_Pickup = 0
  137.     Auto_Attack = 0
  138.     Auto_RedPotion = 0
  139.     Auto_BluePotion = 0
  140.     Fast_Attack = 0
  141.     MoveSpeed = 0
  142.     AttackSpeed = 0
  143.     GuildExpDonate = 0
  144.     Attract_Mobs = 0
  145.     StopBotAndStandUp = 0
  146.     WaitForHP = 0
  147.     GM_Detector = 0
  148.     WallHack = 0
  149.     AttackInRange_Enable_Set = 0
  150.     WalkAndSearch_Enable_Set = 0
  151.     WalkAndSearch = 0
  152.     FishingState = 'stop'
  153.     killFish = 0
  154.     dropHairDye = 0
  155.     dropDeadFish = 0
  156.     openClams = 0
  157.     stopFishing = 0
  158.     quitFishing = 0
  159.     skillbot_1 = 0
  160.     skillbot_2 = 0
  161.     skillbot_3 = 0
  162.     skillbot_4 = 0
  163.     skillbot_5 = 0
  164.     skillbot_6 = 0
  165.     chat_SpamBot = 0
  166.     whisper_SpamBot = 0
  167.     BlackList = []
  168.     SpaceBar_Attack = 0
  169.     AutoRevive = 0
  170.     WaitHack = 0
  171.     LEVELBOT_STATE_STOP = 0
  172.     LEVELBOT_STATE_START = 1
  173.     LEVELBOT_STATE_DEAD = 2
  174.     LEVELBOT_STATE_WAIT = 3
  175.  
  176.     def __init__(self):
  177.         global BLUE_POTION_ID
  178.         global RED_POTION_ID
  179.         ui.Window.__init__(self)
  180.         RED_POTION_ID = ReadConfig('RedPotionID')
  181.         BLUE_POTION_ID = ReadConfig('BluePotionID')
  182.         self.BuildWindow()
  183.         k_command_manager.InitCommandManager()
  184.         import k_hook_manager
  185.         k_hook_manager.InitWhisperManager()
  186.         k_hook_manager.InitRestartManager()
  187.         k_hook_manager.InitMiniMapManager()
  188.         k_hook_manager.InitPartyManager()
  189.         k_hook_manager.InitSetLoginInfo()
  190.         if ReadConfig('FastAttack_Enabled') == '1':
  191.             self.FastAttack_Btn.Down()
  192.             self.FastAttack_Btn_func('on')
  193.         if ReadConfig('Wallhack_Enabled') == '1':
  194.             self.Wallhack_Btn.Down()
  195.             self.WallHack_Btn_func('on')
  196.         if ReadConfig('GameMasterDetector_Enabled') == '1':
  197.             self.GameMasterDetector_Btn.Down()
  198.             self.GmDetector_Btn_func('on')
  199.         if ReadConfig('AutoPickup_Enabled') == '1':
  200.             self.AutoPickup_Btn.Down()
  201.             self.Pickup_Btn_func('on')
  202.             self.ItemFilter_Window.Hide()
  203.         if ReadConfig('AttractMobs_Enabled') == '1':
  204.             self.AttractMobs_Btn.Down()
  205.             self.AttractMobs_Btn_func('on')
  206.         if ReadConfig('AttackSpeed_Enabled') == '1':
  207.             self.AttackSpeed_Btn.Down()
  208.             self.AttackSpeed_Btn_func('on')
  209.         if ReadConfig('WalkSpeed_Enabled') == '1':
  210.             self.WalkSpeed_Btn.Down()
  211.             self.WalkSpeed_Btn_func('on')
  212.         if ReadConfig('BluePotion_Enabled') == '1':
  213.             self.BluePotion_Btn.Down()
  214.             self.BluePotion_Btn_func('on')
  215.         if ReadConfig('RedPotion_Enabled') == '1':
  216.             self.RedPotion_Btn.Down()
  217.             self.RedPotion_Btn_func('on')
  218.         if m2net.GetMainActorSkillGroup() != 0:
  219.             slotIndex1 = player.GetSkillIndex(1)
  220.             slotIndex2 = player.GetSkillIndex(2)
  221.             slotIndex3 = player.GetSkillIndex(3)
  222.             slotIndex4 = player.GetSkillIndex(4)
  223.             slotIndex5 = player.GetSkillIndex(5)
  224.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex1)
  225.             skill_Duration1 = skill.GetDuration(slotIndex1, skillNextPercentage)
  226.             if self.skill1_timer_edit.GetText() == '0':
  227.                 self.skill1_timer_edit.SetText(str(skill_Duration1))
  228.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex2)
  229.             skill_Duration2 = skill.GetDuration(slotIndex2, skillNextPercentage)
  230.             if self.skill2_timer_edit.GetText() == '0':
  231.                 self.skill2_timer_edit.SetText(str(skill_Duration2))
  232.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex3)
  233.             skill_Duration3 = skill.GetDuration(slotIndex3, skillNextPercentage)
  234.             if self.skill3_timer_edit.GetText() == '0':
  235.                 self.skill3_timer_edit.SetText(str(skill_Duration3))
  236.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex4)
  237.             skill_Duration4 = skill.GetDuration(slotIndex4, skillNextPercentage)
  238.             if self.skill4_timer_edit.GetText() == '0':
  239.                 self.skill4_timer_edit.SetText(str(skill_Duration4))
  240.             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex5)
  241.             skill_Duration5 = skill.GetDuration(slotIndex5, skillNextPercentage)
  242.             if self.skill5_timer_edit.GetText() == '0':
  243.                 self.skill5_timer_edit.SetText(str(skill_Duration5))
  244.  
  245.     def __del__(self):
  246.         ui.Window.__del__(self)
  247.  
  248.     def BuildWindow(self):
  249.         self.Board = ui.ThinBoard()
  250.         try:
  251.             self.Board.SetSize(554, 50)
  252.         except:
  253.             dbg.MsgBox('lol')
  254.  
  255.         self.Board.SetPosition(wndMgr.GetScreenWidth() - 554, wndMgr.GetScreenHeight() - 50 - 38)
  256.         self.Board.Show()
  257.         self.comp = k_ui.Component()
  258.         self.func = Functions()
  259.         self.time = k_timer.Timer()
  260.         self.chatTimer = k_timer.Timer()
  261.         self.whisperTimer = k_timer.Timer()
  262.         self.stopFishingTimer = k_timer.Timer()
  263.         self.AutoRevive_Timer = k_timer.Timer()
  264.         self.WaitHack_Timer = k_timer.Timer()
  265.         self.LevelBot_Timer = k_timer.Timer()
  266.         self.getskillicon = ''
  267.         self.Fishing_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_FISHING, 90, 9, lambda arg='off': self.StartFishing_Btn_func(arg), lambda arg='on': self.StartFishing_Btn_func(arg), 'temp/h4ckb4r/fishbot_off.tga', 'temp/h4ckb4r/fishbot_on.tga', 'temp/h4ckb4r/fishbot_on.tga')
  268.         self.Farm_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_FARM, 60, 9, lambda arg='off': self.Farm_Btn_func(arg), lambda arg='on': self.Farm_Btn_func(arg), 'temp/h4ckb4r/farm_off.tga', 'temp/h4ckb4r/farm_on.tga', 'temp/h4ckb4r/farm_on.tga')
  269.         self.FastAttack_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_FASTATTACK, 40, 9, lambda arg='off': self.FastAttack_Btn_func(arg), lambda arg='on': self.FastAttack_Btn_func(arg), 'd:/ymir work/ui/game/TaskBar/Chat_Button_01.sub', 'd:/ymir work/ui/game/TaskBar/Chat_Button_02.sub', 'd:/ymir work/ui/game/TaskBar/Chat_Button_03.sub')
  270.         self.AutoAttack_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_AUTOATTACK, 10, 10, lambda arg='off': self.StartBot_Btn_func(arg), lambda arg='on': self.StartBot_Btn_func(arg), 'd:/ymir work/ui/game/taskbar/mouse_button_auto_attack_01.sub', 'd:/ymir work/ui/game/taskbar/mouse_button_auto_attack_02.sub', 'd:/ymir work/ui/game/taskbar/mouse_button_auto_attack_03.sub')
  271.         self.Wallhack_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_WALLHACK, 165, 9, lambda arg='off': self.WallHack_Btn_func(arg), lambda arg='on': self.WallHack_Btn_func(arg), 'temp/h4ckb4r/wallhack_off.tga', 'temp/h4ckb4r/wallhack_on.tga', 'temp/h4ckb4r/wallhack_on.tga')
  272.         self.GameMasterDetector_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_GM_DETECTOR, 195, 10, lambda arg='off': self.GmDetector_Btn_func(arg), lambda arg='on': self.GmDetector_Btn_func(arg), 'temp/h4ckb4r/gm_off.tga', 'temp/h4ckb4r/gm_on.tga', 'temp/h4ckb4r/gm_on.tga')
  273.         self.AutoPickup_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_AUTO_PICKUP, 225, 10, lambda arg='off': self.Pickup_Btn_func(arg), lambda arg='on': self.Pickup_Btn_func(arg), 'temp/h4ckb4r/pickup_off.tga', 'temp/h4ckb4r/pickup_on.tga', 'temp/h4ckb4r/pickup_on.tga')
  274.         self.AttractMobs_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_MOBBER, 255, 10, lambda arg='off': self.AttractMobs_Btn_func(arg), lambda arg='on': self.AttractMobs_Btn_func(arg), 'temp/h4ckb4r/attract_off.tga', 'temp/h4ckb4r/attract_on.tga', 'temp/h4ckb4r/attract_on.tga')
  275.         self.AttackSpeed_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_ATTACKSPEED, 285, 10, lambda arg='off': self.AttackSpeed_Btn_func(arg), lambda arg='on': self.AttackSpeed_Btn_func(arg), 'temp/h4ckb4r/attackspeed_off.tga', 'temp/h4ckb4r/attackspeed_on.tga', 'temp/h4ckb4r/attackspeed_on.tga')
  276.         self.WalkSpeed_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_MOVESPEED, 315, 10, lambda arg='off': self.WalkSpeed_Btn_func(arg), lambda arg='on': self.WalkSpeed_Btn_func(arg), 'temp/h4ckb4r/walkspeed_off.tga', 'temp/h4ckb4r/walkspeed_on.tga', 'temp/h4ckb4r/walkspeed_on.tga')
  277.         self.Donate_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_EXPDONATOR, 345, 10, lambda arg='off': self.Donate_Btn_func(arg), lambda arg='on': self.Donate_Btn_func(arg), 'temp/h4ckb4r/donate_off.tga', 'temp/h4ckb4r/donate_on.tga', 'temp/h4ckb4r/donate_on.tga')
  278.         self.BluePotion_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_AUTO_POTION_BLUE, 375, 10, lambda arg='off': self.BluePotion_Btn_func(arg), lambda arg='on': self.BluePotion_Btn_func(arg), 'temp/h4ckb4r/blue_off.tga', 'temp/h4ckb4r/blue_on.tga', 'temp/h4ckb4r/blue_on.tga')
  279.         self.RedPotion_Btn = self.comp.ToggleButton(self.Board, '', k_locale.TOOLTIP_AUTO_POTION_RED, 405, 10, lambda arg='off': self.RedPotion_Btn_func(arg), lambda arg='on': self.RedPotion_Btn_func(arg), 'temp/h4ckb4r/red_off.tga', 'temp/h4ckb4r/red_on.tga', 'temp/h4ckb4r/red_on.tga')
  280.         self.skill_btn = self.comp.Button(self.Board, '', 'Skill Bot', 435, 10, self.skill_btn_func, 'temp/h4ckb4r/skillbot_settings_norm.tga', 'temp/h4ckb4r/skillbot_settings_over.tga', 'temp/h4ckb4r/skillbot_settings_norm.tga')
  281.         self.settings_fish_btn = self.comp.Button(self.Board, '', 'Fish Bot Settings', 470, 10, self.settings_fish_btn_func, 'temp/h4ckb4r/fishing_settings_norm.tga', 'temp/h4ckb4r/fishing_settings_over.tga', 'temp/h4ckb4r/fishing_settings_norm.tga')
  282.         self.settings_btn = self.comp.Button(self.Board, '', '', 505, 10, self.settings_btn_func, 'd:/ymir work/ui/game/taskbar/system_button_01.sub', 'd:/ymir work/ui/game/taskbar/system_button_02.sub', 'd:/ymir work/ui/game/taskbar/system_button_03.sub')
  283.         self.hackbar_min = self.comp.Button(self.Board, '', 'Hide', self.Board.GetWidth() - 15, 0, self.Hide_Btn_func, 'd:/ymir work/ui/public/minimize_button_01.sub', 'd:/ymir work/ui/public/minimize_button_02.sub', 'd:/ymir work/ui/public/minimize_button_03.sub')
  284.         if KAMER_MODULE_NOT_LOADED == 1 or DISABLE_DLL_MODULE_FUNCTIONS == 1:
  285.             self.Farm_Btn.Disable()
  286.             self.Farm_Btn.SetUpVisual('temp/h4ckb4r/farm_dis.tga')
  287.             self.Fishing_Btn.Disable()
  288.         self.Board.HideInternal()
  289.         xPos, yPos = self.Board.GetGlobalPosition()
  290.         self.HardBar_Vertical = self.comp.ThinBoard(None, FALSE, xPos + self.Board.GetWidth() - 50, yPos - 80, 50, 80, FALSE)
  291.         self.WhisperSpammer_Btn = self.comp.Button(self.HardBar_Vertical, '', 'Whisper Spam', 10, 5, self.OpenWhisperSpamBot, 'd:/ymir work/ui/game/windows/btn_mail_up.sub', 'd:/ymir work/ui/game/windows/btn_mail_up.sub', 'd:/ymir work/ui/game/windows/btn_mail_up.sub')
  292.         self.ChatSpammer_Btn = self.comp.Button(self.HardBar_Vertical, '', 'Chat Spam', 10, 40, self.OpenChatSpamBot, 'temp/h4ckb4r/chatspam_icon.tga', 'temp/h4ckb4r/chatspam_icon.tga', 'temp/h4ckb4r/chatspam_icon.tga')
  293.         self.HardBar_Vertical.HideInternal()
  294.         RedPotion = float(ReadConfig('RedPotion'))
  295.         BluePotion = float(ReadConfig('BluePotion'))
  296.         ExpDonatePercent = float(ReadConfig('ExpDonatePercent'))
  297.         AttackSpeed = ReadConfig('AttackSpeed')
  298.         WalkSpeed = ReadConfig('WalkSpeed')
  299.         MobberDelay = ReadConfig('MobberDelay')
  300.         MobberDistance = ReadConfig('MobberDistance')
  301.         GM_ComboBox = ReadConfig('GameMasterDetector_ComboBox')
  302.         FarmBot_ComboBox = ReadConfig('FarmBot_ComboBox')
  303.         AttackInRange_Enable = int(ReadConfig('AttackInRange_Enable'))
  304.         self.AttackInRange_Enable_Set = AttackInRange_Enable
  305.         WalkAndSearch_Enable = int(ReadConfig('WalkAndSearch_Enable'))
  306.         self.WalkAndSearch_Enable_Set = WalkAndSearch_Enable
  307.         Fishbot_React_Delay = ReadConfig('Fishbot_React_Delay')
  308.         Fishbot_Fishing_Delay = ReadConfig('Fishbot_Fishing_Delay')
  309.         WaitHack_Set = int(ReadConfig('WaitHack'))
  310.         self.FastAttack_Distance = ReadConfig('FastAttack_Distance')
  311.         self.DETECT_PLAYER = int(ReadConfig('Detect_Player'))
  312.         self.player_whitelist = open('temp/h4ckb4r/player_detector_whitelist.txt', 'r').read().split(',')
  313.         xPos, yPos = self.Board.GetGlobalPosition()
  314.         self.WIDTH = 360
  315.         self.HEIGH = 250
  316.         self.HackSetting_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - self.WIDTH - 30, self.Board.GetHeight() + yPos - self.HEIGH - 50, self.WIDTH, self.HEIGH, FALSE)
  317.         self.HackSetting_Window.Hide()
  318.         self.HackSetting_Window_Close = self.comp.Button(self.HackSetting_Window, '', '', self.WIDTH - 15, 0, self.HackSet_Close_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  319.         self.tab1 = self.comp.TabControl(self.HackSetting_Window, self.WIDTH, self.HEIGH, ['bot_tab', 'Exp Bot'], ['farm_tab', 'Farm Bot'], ['auto_tab', 'Auto'], ['misc_tab', k_locale.TAB_MISC_TEXT])
  320.         import binascii
  321.         self.cred1 = self.comp.TextLine(self.HackSetting_Window, binascii.a2b_base64('Q3JlYXRlZCBieSBLYU1lUjEzMzcsIGh0dHA6Ly9tZXRpbjJtb2QudGs='), 15, 5, self.comp.RGB(255, 0, 0))
  322.         self.slotbar_AttackSpeed_Edit, self.AttackSpeed_Edit = self.comp.EditLine(self.tab1['misc_tab'], AttackSpeed, 110, 10, 25, 15, 3)
  323.         self.slotbar_MoveSpeed_Edit, self.MoveSpeed_Edit = self.comp.EditLine(self.tab1['misc_tab'], WalkSpeed, 110, 30, 25, 15, 3)
  324.         self.slotbar_MobberDelay_Edit, self.MobberDelay_Edit = self.comp.EditLine(self.tab1['misc_tab'], MobberDelay, 110, 60, 20, 15, 2)
  325.         self.slotbar_MobberDistance_Edit, self.MobberDistance_Edit = self.comp.EditLine(self.tab1['misc_tab'], MobberDistance, 110, 80, 30, 15, 4)
  326.         self.RedPotion_Text = self.comp.TextLine(self.tab1['auto_tab'], k_locale.RED_POTION_TEXT, 10, 10, self.comp.RGB(255, 0, 0))
  327.         self.BluePotion_Text = self.comp.TextLine(self.tab1['auto_tab'], k_locale.BLUE_POTION_TEXT, 10, 58, self.comp.RGB(0, 0, 255))
  328.         self.ExpDonator_Text = self.comp.TextLine(self.tab1['auto_tab'], k_locale.EXP_DONATOR_TEXT, 10, 102, self.comp.RGB(255, 255, 255))
  329.         self.AttackSpeed_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.ATTACK_SPEED_TEXT, 10, 10, self.comp.RGB(255, 255, 255))
  330.         self.MoveSpeed_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.MOVE_SPEED_TEXT, 10, 30, self.comp.RGB(255, 255, 255))
  331.         self.Mobber_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.MOBBER_DELAY_TEXT, 10, 60, self.comp.RGB(255, 255, 255))
  332.         self.MobberDistance_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.MOBBER_DISTANCE_TEXT, 10, 80, self.comp.RGB(255, 255, 255))
  333.         self.Mobber_Seconds_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.MOBBER_SECONDS_TEXT, 134, 60, self.comp.RGB(255, 255, 255))
  334.         self.RedPotion_Bar = self.comp.SliderBar(self.tab1['auto_tab'], RedPotion, self.RedPotion_Bar_func, 10, 35)
  335.         self.BluePotion_Bar = self.comp.SliderBar(self.tab1['auto_tab'], BluePotion, self.BluePotion_Bar_func, 10, 81)
  336.         self.ExpDonator_Bar = self.comp.SliderBar(self.tab1['auto_tab'], ExpDonatePercent, self.ExpDonator_Bar_func, 10, 128)
  337.         self.GM_Detector_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.GM_DETECTOR_TEXT, 10, 110, self.comp.RGB(255, 255, 255))
  338.         self.Farm_Settings_Text = self.comp.TextLine(self.tab1['farm_tab'], k_locale.FARM_SETTINS_TEXT, 10, 10, self.comp.RGB(0, 255, 255))
  339.         self.Farm_Search_Text = self.comp.TextLine(self.tab1['farm_tab'], k_locale.FARM_SEARCH_TEXT, 10, 50, self.comp.RGB(255, 255, 255))
  340.         self.AttackInRange_Btn = self.comp.ToggleButton(self.tab1['bot_tab'], '', '', 10, 30, lambda arg='off': self.AttackInRange_Btn_func(arg), lambda arg='on': self.AttackInRange_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  341.         self.ExpBot_Setting_Text = self.comp.TextLine(self.tab1['bot_tab'], k_locale.EXPBOT_SETTINGS_TEXT, 10, 10, self.comp.RGB(0, 255, 255))
  342.         self.ExpBot_AttackInRange_Text = self.comp.TextLine(self.tab1['bot_tab'], k_locale.ATTACK_IN_RANGE_TEXT, 31, 30, self.comp.RGB(255, 255, 255))
  343.         self.Farm_ComboBox = self.comp.ComboBox(self.tab1['farm_tab'], FarmBot_ComboBox, 60, 50, 90)
  344.         self.AutoRevive_Btn = self.comp.ToggleButton(self.tab1['bot_tab'], '', '', 10, 80, lambda arg=0: self.autorevive_Btn_func(arg), lambda arg=1: self.autorevive_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  345.         self.AutoRevive_Text = self.comp.TextLine(self.tab1['bot_tab'], k_locale.AUTO_REVIVE_TEXT, 31, 80, self.comp.RGB(255, 255, 255))
  346.         self.WaitHack_Btn = self.comp.ToggleButton(self.tab1['bot_tab'], '', '', 10, 105, lambda arg=0: self.waithack_Btn_func(arg), lambda arg=1: self.waithack_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  347.         self.WaitHack_Text = self.comp.TextLine(self.tab1['bot_tab'], k_locale.WAITHACK_TEXT, 31, 105, self.comp.RGB(255, 255, 255))
  348.         self.Antifly_Btn = self.comp.ToggleButton(self.tab1['misc_tab'], '', '', 10, 140, lambda arg='off': self.Antifly_Btn_func(arg), lambda arg='on': self.Antifly_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  349.         self.Antifly_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.ANTIFLY_TEXT, 30, 140, self.comp.RGB(255, 255, 255))
  350.         self.day_btn = self.comp.Button(self.tab1['misc_tab'], 'Day', '', 300, 10, self.day_Btn_func, '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')
  351.         self.night_btn = self.comp.Button(self.tab1['misc_tab'], 'Night', '', 300, 30, self.night_Btn_func, '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')
  352.         self.slotbar_FastAttack_Distance_Edit, self.FastAttack_Distance_Edit = self.comp.EditLine(self.tab1['misc_tab'], self.FastAttack_Distance, 110, 162, 30, 15, 4)
  353.         self.FastAttack_Distance_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.FASTATTACK_DISTANCE_SETUP_TEXT, 145, 162, self.comp.RGB(255, 255, 255))
  354.         self.PlayerDetector_Btn = self.comp.ToggleButton(self.tab1['misc_tab'], '', 'temp/h4ckb4r/player_detector_whitelist.txt', 140, 140, lambda arg='off': self.PlayerDetector_Btn_func(arg), lambda arg='on': self.PlayerDetector_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  355.         self.PlayerDetector_Text = self.comp.TextLine(self.tab1['misc_tab'], k_locale.STOP_BOT_PLAYER_APPEAR_TEXT, 160, 140, self.comp.RGB(255, 255, 255))
  356.         self.GM_ComboBox = self.comp.ComboBox(self.tab1['misc_tab'], 'LogOut', 110, 110, 90)
  357.         if ReadConfig('Antifly') == 'On':
  358.             self.Antifly_Btn_func('on')
  359.             self.Antifly_Btn.Down()
  360.         else:
  361.             self.Antifly_Btn.SetUp()
  362.         if self.DETECT_PLAYER == 1:
  363.             self.PlayerDetector_Btn_func('on')
  364.             self.PlayerDetector_Btn.Down()
  365.         else:
  366.             self.PlayerDetector_Btn.SetUp()
  367.         if WaitHack_Set == 1:
  368.             self.waithack_Btn_func(1)
  369.             self.WaitHack_Btn.Down()
  370.         else:
  371.             self.WaitHack_Btn.SetUp()
  372.         self.FastAttack_Distance_Edit.SetNumberMode()
  373.         self.AttackSpeed_Edit.SetNumberMode()
  374.         self.MoveSpeed_Edit.SetNumberMode()
  375.         self.MobberDelay_Edit.SetNumberMode()
  376.         self.MobberDistance_Edit.SetNumberMode()
  377.         self.RedPotion_Text.SetText(k_locale.RED_POTION_TEXT % float(self.RedPotion_Bar.GetSliderPos() * 100) + '%')
  378.         self.BluePotion_Text.SetText(k_locale.BLUE_POTION_TEXT % float(self.BluePotion_Bar.GetSliderPos() * 100) + '%')
  379.         self.ExpDonator_Text.SetText(k_locale.EXP_DONATOR_TEXT % float(self.ExpDonator_Bar.GetSliderPos() * 100) + '%')
  380.         self.GM_ComboBox.SetCurrentItem(GM_ComboBox)
  381.         ComboBox_List = ('LogOut', 'Quit', 'Stop Botting', 'Visible', 'Show Name')
  382.         lCount = 0
  383.         for cList in ComboBox_List:
  384.             self.GM_ComboBox.InsertItem(lCount, cList)
  385.             lCount += 1
  386.  
  387.         self.Farm_ComboBox.InsertItem(0, 'Metin')
  388.         self.Farm_ComboBox.InsertItem(1, 'BOSS')
  389.         self.Farm_ComboBox.InsertItem(2, 'Metin&BOSS')
  390.         self.Farm_ComboBox.InsertItem(3, k_locale.FARM_COMBOBOX_ORE_TEXT)
  391.         self.Farm_ComboBox.SetEvent(ui.__mem_func__(self.Farm_ComboBox_OnSelectItem))
  392.         if AttackInRange_Enable == 1:
  393.             self.AttackInRange_Btn.Down()
  394.             self.func.AttackInRange = 1
  395.         if WalkAndSearch_Enable == 1:
  396.             self.Farm_Walk_Btn.Down()
  397.             self.FarmCord_Window_Btn.Show()
  398.             self.WalkAndSearch = 1
  399.         self.GameMasterInfo_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 424, self.Board.GetHeight() + yPos - 10 - 68, 424, 15, FALSE)
  400.         self.GameMasterInfo_Window.Hide()
  401.         self.GameMasterInfo_Window_Close = self.comp.Button(self.GameMasterInfo_Window, '', '', 404, 10, self.GameMasterInfo_Close, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  402.         self.GameMaster_Names_Text = self.comp.TextLine(self.GameMasterInfo_Window, '', 10, 10, self.comp.RGB(255, 0, 0))
  403.         self.MetinInfo_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 424, self.Board.GetHeight() + yPos - 10 - 68 - 30, 424, 15, FALSE)
  404.         self.MetinInfo_Window.Hide()
  405.         self.MetinInfo_Window_Go = self.comp.Button(self.MetinInfo_Window, 'Go', '', 354, 7, self.MetinInfo_Go, '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')
  406.         self.MetinInfo_Window_Close = self.comp.Button(self.MetinInfo_Window, '', '', 404, 10, self.MetinInfo_Close, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  407.         self.MetinInfo_Window_Text = self.comp.TextLine(self.MetinInfo_Window, '', 10, 10, self.comp.RGB(255, 0, 0))
  408.         self.FarmCords_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 164 - 20, self.Board.GetHeight() + yPos - 283 - 50, 164, 283, FALSE)
  409.         self.FarmCords_Window.Hide()
  410.         self.AddCords_Btn = self.comp.Button(self.FarmCords_Window, 'Add', '', 10, 252, self.AddCords_Btn_func, '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')
  411.         self.RemoveCords_Btn = self.comp.Button(self.FarmCords_Window, 'Del', '', 57, 252, self.RemoveCords_Btn_func, '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')
  412.         self.FarmCords_Close = self.comp.Button(self.FarmCords_Window, '', '', 135, 255, self.FarmCords_Close_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  413.         self.Cords_Text = self.comp.TextLine(self.FarmCords_Window, k_locale.FARM_COORDINATES_TEXT, 10, 10, self.comp.RGB(255, 0, 0))
  414.         self.bar_FarmCord_ListBox, self.list_FarmCord_ListBox, self.scroll_FarmCord_ListBox = self.comp.ListBoxEx(self.FarmCords_Window, 10, 26, 142, 217)
  415.         self.Farm_ComboBox_OnSelectItem()
  416.         self.Fishbot_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 307 - 50, self.Board.GetHeight() + yPos - 245 - 60, 307, 245, FALSE)
  417.         self.Fishbot_Window.Hide()
  418.         self.CloseFish_Window = self.comp.Button(self.Fishbot_Window, ' ', '', 292, 230, self.CloseFish_Window_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  419.         self.KillFish_Btn = self.comp.ToggleButton(self.Fishbot_Window, ' ', '', 10, 93, lambda arg='off': self.KillFish_Btn_func(arg), lambda arg='on': self.KillFish_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  420.         self.DropHairDye_Btn = self.comp.ToggleButton(self.Fishbot_Window, ' ', '', 10, 118, lambda arg='off': self.DropHairDye_Btn_func(arg), lambda arg='on': self.DropHairDye_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  421.         self.DropDeadFishes_Btn = self.comp.ToggleButton(self.Fishbot_Window, ' ', '', 10, 142, lambda arg='off': self.DropDeadFishes_Btn_func(arg), lambda arg='on': self.DropDeadFishes_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  422.         self.OpenClams_Btn = self.comp.ToggleButton(self.Fishbot_Window, ' ', '', 10, 167, lambda arg='off': self.OpenClams_Btn_func(arg), lambda arg='on': self.OpenClams_Btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  423.         self.stopfishing_btn = self.comp.ToggleButton(self.Fishbot_Window, '', 'Stop Fishing', 10, 215, lambda arg='off': self.stopfishing_btn_func(arg), lambda arg='on': self.stopfishing_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  424.         self.quitfishing_btn = self.comp.ToggleButton(self.Fishbot_Window, '', 'Quit Game', 30, 215, lambda arg='off': self.quitfishing_btn_func(arg), lambda arg='on': self.quitfishing_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  425.         self.slotbar_delay, self.delay = self.comp.EditLine(self.Fishbot_Window, Fishbot_React_Delay, 10, 35, 30, 15, 4)
  426.         self.slotbar_fishing_delay, self.fishing_delay = self.comp.EditLine(self.Fishbot_Window, Fishbot_Fishing_Delay, 10, 62, 30, 15, 4)
  427.         self.slotbar_stopfishing_timer, self.stopfishing_timer = self.comp.EditLine(self.Fishbot_Window, '60.0', 168, 216, 35, 15, 5)
  428.         self.fishbot_settings_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_SETTINGS_TEXT, 10, 10, self.comp.RGB(255, 0, 0))
  429.         self.fishbot_delay_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_REACT_DELAY_TEXT, 47, 36, self.comp.RGB(255, 255, 255))
  430.         self.fishbot_fishingdelay_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_FISHING_DELAY_TEXT, 47, 63, self.comp.RGB(255, 255, 255))
  431.         self.fishbot_killfish_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_KILLFISH_TEXT, 35, 94, self.comp.RGB(255, 255, 255))
  432.         self.fishbot_dropdye_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_DROP_HAIRDYE_TEXT, 35, 119, self.comp.RGB(255, 255, 255))
  433.         self.fishbot_dropdead_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_DROP_DEADFISH_TEXT, 35, 143, self.comp.RGB(255, 255, 255))
  434.         self.fishbot_openclams_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_OPEN_CLAMS_TEXT, 35, 168, self.comp.RGB(255, 255, 255))
  435.         self.stopfishing_text = self.comp.TextLine(self.Fishbot_Window, k_locale.FISHBOT_STOPQUIT_AFTER, 57, 216, self.comp.RGB(255, 255, 255))
  436.         self.stopfishing_text2 = self.comp.TextLine(self.Fishbot_Window, localeInfo.MINUTE, 215, 217, self.comp.RGB(255, 255, 255))
  437.         self.SkillBot_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 290 - 20, self.Board.GetHeight() + yPos - 160, 290, 120, FALSE)
  438.         self.SkillBot_Window.Hide()
  439.         self.skill_timer_active = {1: 0,
  440.            2: 0,
  441.            3: 0,
  442.            4: 0,
  443.            5: 0,
  444.            6: 0}
  445.         self.skill_Timer1 = k_timer.Timer()
  446.         self.skill_Timer2 = k_timer.Timer()
  447.         self.skill_Timer3 = k_timer.Timer()
  448.         self.skill_Timer4 = k_timer.Timer()
  449.         self.skill_Timer5 = k_timer.Timer()
  450.         self.skill_Timer6 = k_timer.Timer()
  451.  
  452.         def skillbot_timer_on_btn_func(arg):
  453.             self.skill_timer_active[arg] = 1
  454.  
  455.         def skillbot_timer_off_btn_func(arg):
  456.             self.skill_timer_active[arg] = 0
  457.  
  458.         self.slot_skill1_timer_edit, self.skill1_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 10, 50, 30, 15, 4)
  459.         self.skill1_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 30, 50, lambda arg=1: skillbot_timer_off_btn_func(arg), lambda arg=1: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  460.         self.slot_skill2_timer_edit, self.skill2_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 60, 50, 30, 15, 4)
  461.         self.skill2_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 80, 50, lambda arg=2: skillbot_timer_off_btn_func(arg), lambda arg=2: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  462.         self.slot_skill3_timer_edit, self.skill3_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 110, 50, 30, 15, 4)
  463.         self.skill3_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 130, 50, lambda arg=3: skillbot_timer_off_btn_func(arg), lambda arg=3: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  464.         self.slot_skill4_timer_edit, self.skill4_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 150, 50, 30, 15, 4)
  465.         self.skill4_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 170, 50, lambda arg=4: skillbot_timer_off_btn_func(arg), lambda arg=4: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  466.         self.slot_skill5_timer_edit, self.skill5_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 190, 50, 30, 15, 4)
  467.         self.skill5_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 210, 50, lambda arg=5: skillbot_timer_off_btn_func(arg), lambda arg=5: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  468.         self.slot_skill6_timer_edit, self.skill6_timer_edit = self.comp.EditLine(self.SkillBot_Window, '0', 240, 50, 30, 15, 4)
  469.         self.skill6_timer_btn = self.comp.ToggleButton(self.SkillBot_Window, '', 'Activate Timer', 260, 50, lambda arg=6: skillbot_timer_off_btn_func(arg), lambda arg=6: skillbot_timer_on_btn_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  470.         self.skill1_timer_edit.SetText(ReadConfig('Skill_Time1'))
  471.         self.skill2_timer_edit.SetText(ReadConfig('Skill_Time2'))
  472.         self.skill3_timer_edit.SetText(ReadConfig('Skill_Time3'))
  473.         self.skill4_timer_edit.SetText(ReadConfig('Skill_Time4'))
  474.         self.skill5_timer_edit.SetText(ReadConfig('Skill_Time5'))
  475.         self.skill6_timer_edit.SetText(ReadConfig('Skill_Time6'))
  476.         self.RestartHere_Activate = 0
  477.         self.RestartHere_Timer1 = k_timer.Timer()
  478.         self.FollowTarget_Activate = 0
  479.         self.FollowTarget_Timer1 = k_timer.Timer()
  480.         self.TARGET_FOLLOW_VID = 0
  481.  
  482.         def RestartHere_func(arg):
  483.             if arg == 1:
  484.                 self.RestartHere_Activate = 1
  485.                 self.RestartHere_Timer1.SetTimer(12.0)
  486.             else:
  487.                 self.RestartHere_Activate = 0
  488.  
  489.         self.FollowTarget_Btn = None
  490.         self.FollowTarget_Text = None
  491.  
  492.         def FollowTarget_func(arg):
  493.             if arg == 1:
  494.                 vid = player.GetTargetVID()
  495.                 if vid:
  496.                     self.TARGET_FOLLOW_VID = vid
  497.                     name = chr.GetNameByVID(vid)
  498.                     self.FollowTarget_Text.SetText('Follow Target: ' + name)
  499.                     self.FollowTarget_Activate = 1
  500.                     self.FollowTarget_Timer1.SetTimer(2.0)
  501.                 else:
  502.                     self.FollowTarget_Btn.SetUp()
  503.                     chat.AppendChat(1, 'Select Target')
  504.             else:
  505.                 self.FollowTarget_Activate = 0
  506.                 self.FollowTarget_Text.SetText('Follow Target')
  507.                 chr.SelectInstance(player.GetMainCharacterIndex())
  508.  
  509.         self.RestartHere_Btn = self.comp.ToggleButton(self.SkillBot_Window, '', '', 10, 75, lambda arg=0: RestartHere_func(arg), lambda arg=1: RestartHere_func(arg), 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/check_image.sub')
  510.         self.RestartHere_Text = self.comp.TextLine(self.SkillBot_Window, uiScriptLocale.RESTART_HERE, 30, 75, self.comp.RGB(255, 255, 255))
  511.         self.WhisperSpamBot_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 330 - 20, self.Board.GetHeight() + yPos - 172 - 50, 330, 172, FALSE)
  512.         self.WhisperSpamBot_Window.Hide()
  513.         self.spam_send_btn = self.comp.Button(self.WhisperSpamBot_Window, 'Send', '', 185, 140, self.spam_send_btn_func, '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')
  514.         self.wspam_close = self.comp.Button(self.WhisperSpamBot_Window, ' ', '', 315, 0, self.wspam_close_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  515.         self.spam_start_btn = self.comp.ToggleButton(self.WhisperSpamBot_Window, 'Start', '', 232, 140, lambda arg='off': self.spam_start_btn_func(arg), lambda arg='on': self.spam_start_btn_func(arg), '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')
  516.         self.slotbar_PlayersLimit_Edit, self.PlayersLimit_Edit = self.comp.EditLine(self.WhisperSpamBot_Window, '20', 10, 67, 20, 15, 2)
  517.         self.slotbar_spam_timer_edit, self.spam_timer_edit = self.comp.EditLine(self.WhisperSpamBot_Window, '10.0', 235, 119, 30, 15, 4)
  518.         self.slotbar_Whisperpam_Edit, self.Whisperpam_Edit = self.comp.EditLine(self.WhisperSpamBot_Window, '', 10, 26, 310, 30, 120)
  519.         self.whisper_text = self.comp.TextLine(self.WhisperSpamBot_Window, 'WHISPER', 10, 10, self.comp.RGB(255, 0, 0))
  520.         self.playerslimit_text = self.comp.TextLine(self.WhisperSpamBot_Window, 'Players Limit', 38, 68, self.comp.RGB(255, 255, 255))
  521.         self.spam_timer_Text = self.comp.TextLine(self.WhisperSpamBot_Window, 'Timer', 270, 119, self.comp.RGB(255, 255, 255))
  522.         self.ChatSpamBot_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 411 - 20, self.Board.GetHeight() + yPos - 96 - 50, 411, 96, FALSE)
  523.         self.ChatSpamBot_Window.Hide()
  524.         self.chat_SpamClose = self.comp.Button(self.ChatSpamBot_Window, '', '', 396, 0, self.chat_SpamClose_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  525.         self.chat_SpamButton = self.comp.ToggleButton(self.ChatSpamBot_Window, 'Start', '', 341, 65, lambda arg='off': self.chat_SpamButton_func(arg), lambda arg='on': self.chat_SpamButton_func(arg), 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  526.         self.slotbar_chat_SpamEdit, self.chat_SpamEdit = self.comp.EditLine(self.ChatSpamBot_Window, '', 9, 27, 390, 30, 152)
  527.         self.slotbar_chat_TimerEdit, self.chat_TimerEdit = self.comp.EditLine(self.ChatSpamBot_Window, '5.0', 10, 65, 25, 15, 4)
  528.         self.chat_spamText = self.comp.TextLine(self.ChatSpamBot_Window, 'Chat Spamer', 10, 10, self.comp.RGB(255, 0, 0))
  529.         self.chat_spamTimer = self.comp.TextLine(self.ChatSpamBot_Window, 'Timer', 40, 67, self.comp.RGB(255, 255, 255))
  530.         self.pickupTimer = k_timer.Timer()
  531.         self.ItemFilter_Window = self.comp.ThinBoard(None, FALSE, self.Board.GetWidth() + xPos - 385 - 20, self.Board.GetHeight() + yPos - 342 - 50, 385, 342, FALSE)
  532.         self.ItemFilter_Window.Hide()
  533.         self.if_close_pfilter_btn = self.comp.Button(self.ItemFilter_Window, ' ', '', 370, 0, self.if_close_pfilter_btn_func, 'd:/ymir work/ui/public/close_button_01.sub', 'd:/ymir work/ui/public/close_button_02.sub', 'd:/ymir work/ui/public/close_button_03.sub')
  534.         self.if_remove_item_btn = self.comp.Button(self.ItemFilter_Window, 'Remove', '', 316, 300, self.if_remove_item_btn_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  535.         self.if_search_btn = self.comp.Button(self.ItemFilter_Window, 'Search', '', 132, 22, self.if_search_btn_func, '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')
  536.         self.if_add_item_btn = self.comp.Button(self.ItemFilter_Window, 'Add', '', 118, 300, self.if_add_item_btn_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub')
  537.         self.if_filter_on = self.comp.ToggleButton(self.ItemFilter_Window, 'ON', '', 13, 320, lambda arg='off': self.if_filter_on_func(arg), lambda arg='on': self.if_filter_on_func(arg), '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')
  538.         self.if_slotbar_search_edit, self.if_search_edit = self.comp.EditLine(self.ItemFilter_Window, '', 11, 25, 110, 15, 20)
  539.         self.if_pickup_list_text = self.comp.TextLine(self.ItemFilter_Window, 'PickUp List', 205, 28, self.comp.RGB(255, 255, 255))
  540.         self.if_filter_on_txt = self.comp.TextLine(self.ItemFilter_Window, 'Item Filter', 62, 323, self.comp.RGB(0, 0, 255))
  541.         self.if_bar_list_items, self.if_list_list_items, if_list_items_scroll = self.comp.ListBoxEx(self.ItemFilter_Window, 10, 49, 168, 244)
  542.         self.if_bar_list_white, self.if_list_list_white, if_white_scroll = self.comp.ListBoxEx(self.ItemFilter_Window, 204, 48, 171, 245)
  543.         if ReadConfig('ExtraPickUp') == '2':
  544.             self.if_filter_on.Down()
  545.             self.if_filter_on.SetText('ON')
  546.         else:
  547.             self.if_filter_on.SetUp()
  548.             self.if_filter_on.SetText('OFF')
  549.         self.ITEM_FILTER_LIST = []
  550.         self.ITEM_FILTER_WHITELIST = []
  551.         return
  552.  
  553.     def Antifly_Btn_func(self, arg):
  554.         if arg == 'on':
  555.             chat.AppendChat(1, 'Antifly On, Restart game')
  556.             SaveConfig('Antifly', 'On')
  557.         elif arg == 'off':
  558.             chat.AppendChat(1, 'Antifly Off, Restart game')
  559.             SaveConfig('Antifly', 'Off')
  560.  
  561.     def PlayerDetector_Btn_func(self, arg):
  562.         if arg == 'on':
  563.             self.player_whitelist = open('temp/h4ckb4r/player_detector_whitelist.txt', 'r').read()
  564.             self.DETECT_PLAYER = 1
  565.             SaveConfig('Detect_Player', '1')
  566.         elif arg == 'off':
  567.             self.DETECT_PLAYER = 0
  568.             SaveConfig('Detect_Player', '0')
  569.  
  570.     def day_Btn_func(self):
  571.         background.SetEnvironmentData(0)
  572.  
  573.     def night_Btn_func(self):
  574.         background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  575.         background.SetEnvironmentData(1)
  576.  
  577.     def cleverbot_Btn_func(self, arg):
  578.         import WHISPER_MODULE
  579.         if arg == 'on':
  580.             WHISPER_MODULE.CLEVERBOT_ENABLED = 1
  581.             SaveConfig('Cleverbot', 'On')
  582.         elif arg == 'off':
  583.             WHISPER_MODULE.CLEVERBOT_ENABLED = 0
  584.             SaveConfig('Cleverbot', 'Off')
  585.  
  586.     def autorevive_Btn_func(self, arg):
  587.         self.AutoRevive = arg
  588.  
  589.     def waithack_Btn_func(self, arg):
  590.         self.WaitHack_Timer.SetTimer(0.3)
  591.         self.WaitHack = arg
  592.         SaveConfig('WaitHack', str(arg))
  593.  
  594.     def SpaceBar_Attack_Btn_func(self, arg):
  595.         if arg == 'on':
  596.             self.SpaceBar_Attack = 1
  597.             SaveConfig('SpaceBar_Attack_Enabled', '1')
  598.         elif arg == 'off':
  599.             self.SpaceBar_Attack = 0
  600.             SaveConfig('SpaceBar_Attack_Enabled', '0')
  601.  
  602.     def al_close_btn_func(self):
  603.         self.AutoLogin_Window.Hide()
  604.  
  605.     def al_save_btn_func(self):
  606.         slot = int(self.al_slot_edit.GetText()) - 1
  607.         SaveLoginInfo(self.al_combo_server.GetCurrentText(), self.al_channel_edit.GetText(), self.al_id_edit.GetText(), self.al_pwd_edit.GetText(), str(slot), self.AutoLogin)
  608.  
  609.     def al_autologin_btn_func(self, arg):
  610.         if arg == 'on':
  611.             self.AutoLogin = 1
  612.         elif arg == 'off':
  613.             self.AutoLogin = 0
  614.  
  615.     def FillWhiteList(self):
  616.         handle = app.OpenTextFile('temp/h4ckb4r/pickup_whitelist.txt')
  617.         count = app.GetTextFileLineCount(handle)
  618.         self.ITEM_FILTER_WHITELIST = []
  619.         self.if_list_list_white.RemoveAllItems()
  620.         for i in xrange(count):
  621.             line = app.GetTextFileLine(handle, i)
  622.             item1 = line.split(' : ')
  623.             if item1[0].isdigit():
  624.                 fill_list = {'vnum': item1[0], 'name': item1[1]}
  625.                 self.ITEM_FILTER_WHITELIST.append(fill_list)
  626.                 self.if_list_list_white.AppendItem(k_ui.Item('%s : %s' % (item1[0], item1[1])))
  627.  
  628.     def if_filter_on_func(self, arg):
  629.         global EXTRA_PICKUP
  630.         if arg == 'on':
  631.             self.if_filter_on.SetText('ON')
  632.             SaveConfig('ExtraPickUp', '2')
  633.             EXTRA_PICKUP = 2
  634.         elif arg == 'off':
  635.             self.if_filter_on.SetText('OFF')
  636.             SaveConfig('ExtraPickUp', '1')
  637.             EXTRA_PICKUP = 1
  638.  
  639.     def if_close_pfilter_btn_func(self):
  640.         self.ItemFilter_Window.Hide()
  641.  
  642.     def if_search_btn_func(self):
  643.         if self.if_search_edit.GetText() == '':
  644.             self.if_list_list_items.RemoveAllItems()
  645.             for it in self.ITEM_FILTER_LIST:
  646.                 self.if_list_list_items.AppendItem(k_ui.Item('%s : %s' % (it['vnum'], it['name'])))
  647.  
  648.         else:
  649.             self.if_list_list_items.RemoveAllItems()
  650.             for it in self.ITEM_FILTER_LIST:
  651.                 if it['vnum'].count(self.if_search_edit.GetText()) or it['name'].count(self.if_search_edit.GetText()):
  652.                     self.if_list_list_items.AppendItem(k_ui.Item('%s : %s' % (it['vnum'], it['name'])))
  653.  
  654.     def if_remove_item_btn_func(self):
  655.         count = 0
  656.         selItem = self.if_list_list_white.GetSelectedItem()
  657.         if selItem:
  658.             selected = selItem.GetText().split(' : ')
  659.             for i in self.ITEM_FILTER_WHITELIST:
  660.                 if selected[0] == i['vnum']:
  661.                     self.ITEM_FILTER_WHITELIST.pop(count)
  662.                     self.if_list_list_white.RemoveItem(selItem)
  663.                     break
  664.                 count += 1
  665.  
  666.             self.if_list_list_white.RemoveAllItems()
  667.             save = open('temp/h4ckb4r/pickup_whitelist.txt', 'w')
  668.             for newList in self.ITEM_FILTER_WHITELIST:
  669.                 self.if_list_list_white.AppendItem(k_ui.Item('%s : %s' % (newList['vnum'], newList['name'])))
  670.                 save.write('%s : %s\n' % (newList['vnum'], newList['name']))
  671.  
  672.             save.close()
  673.  
  674.     def if_add_item_btn_func(self):
  675.         selItem = self.if_list_list_items.GetSelectedItem()
  676.         if selItem:
  677.             selected = selItem.GetText()
  678.             self.if_list_list_white.AppendItem(k_ui.Item(selected))
  679.             sp = selected.split(' : ')
  680.             fill_list = {'vnum': sp[0],
  681.                'name': sp[1]}
  682.             self.ITEM_FILTER_WHITELIST.append(fill_list)
  683.             save = open('temp/h4ckb4r/pickup_whitelist.txt', 'w')
  684.             for newList in self.ITEM_FILTER_WHITELIST:
  685.                 save.write('%s : %s\n' % (newList['vnum'], newList['name']))
  686.  
  687.             save.close()
  688.  
  689.     def LoadItemList(self):
  690.         self.ITEM_FILTER_LIST = []
  691.         handle = app.OpenTextFile('%s/item_list.txt' % app.GetLocalePath())
  692.         count = app.GetTextFileLineCount(handle)
  693.         for i in xrange(count):
  694.             line = app.GetTextFileLine(handle, i)
  695.             itemVnum = line.split('\t')[0]
  696.             if itemVnum.isdigit():
  697.                 item.SelectItem(int(itemVnum))
  698.                 itemName = item.GetItemName()
  699.                 fill_list = {'vnum': itemVnum,
  700.                    'name': itemName}
  701.                 self.ITEM_FILTER_LIST.append(fill_list)
  702.  
  703.         return self.ITEM_FILTER_LIST
  704.  
  705.     oldSetPhaseWindow = 0
  706.  
  707.     def SetPhaseWindow(self, phase, self2):
  708.         if phase == m2net.PHASE_WINDOW_LOGIN:
  709.             pass
  710.         if phase == m2net.PHASE_WINDOW_GAME:
  711.             pass
  712.         if phase == m2net.PHASE_WINDOW_SELECT:
  713.             pass
  714.         if phase == m2net.PHASE_WINDOW_LOAD:
  715.             pass
  716.         self.oldSetPhaseWindow(phase, self2)
  717.  
  718.     oldClearPhaseWindow = 0
  719.  
  720.     def ClearPhaseWindow(self, phase, self2):
  721.         if phase == m2net.PHASE_WINDOW_LOGIN:
  722.             pass
  723.         if phase == m2net.PHASE_WINDOW_GAME:
  724.             if self.AttackSpeed == 1:
  725.                 self.AttackSpeed = 0
  726.                 self.AttackSpeed_Btn.SetUp()
  727.             if self.MoveSpeed == 1:
  728.                 self.MoveSpeed = 0
  729.                 self.WalkSpeed_Btn.SetUp()
  730.         if phase == m2net.PHASE_WINDOW_SELECT:
  731.             pass
  732.         if phase == m2net.PHASE_WINDOW_LOAD:
  733.             pass
  734.         self.oldClearPhaseWindow(phase, self2)
  735.  
  736.     def InitPhaseManager(self):
  737.         self.oldSetPhaseWindow = m2net.SetPhaseWindow
  738.         m2net.SetPhaseWindow = self.SetPhaseWindow
  739.         self.oldClearPhaseWindow = m2net.ClearPhaseWindow
  740.         m2net.ClearPhaseWindow = self.ClearPhaseWindow
  741.  
  742.     def OpenWhisperSpamBot(self):
  743.         if self.WhisperSpamBot_Window.IsShow():
  744.             self.WhisperSpamBot_Window.Hide()
  745.         else:
  746.             self.WhisperSpamBot_Window.Show()
  747.  
  748.     def spam_send_btn_func(self, auto=0):
  749.         pLimit = 0
  750.         for vid in player5.GetVirtualID():
  751.             pLimit += 1
  752.             if pLimit == int(self.PlayersLimit_Edit.GetText()):
  753.                 return
  754.             if chr.INSTANCE_TYPE_PLAYER == chr.GetInstanceType(vid):
  755.                 name = chr.GetNameByVID(vid)
  756.                 if name != 'None':
  757.                     if not name.startswith('['):
  758.                         for bl in self.BlackList:
  759.                             if bl != name:
  760.                                 m2net.SendWhisperPacket(name, self.Whisperpam_Edit.GetText())
  761.  
  762.                         if auto == 1:
  763.                             self.BlackList.append(name)
  764.  
  765.     def wspam_close_func(self):
  766.         self.WhisperSpamBot_Window.Hide()
  767.  
  768.     def spam_start_btn_func(self, arg):
  769.         if arg == 'on':
  770.             self.whisper_SpamBot = 1
  771.             self.whisperTimer.SetTimer(float(self.spam_timer_edit.GetText()))
  772.             self.BlackList = []
  773.         elif arg == 'off':
  774.             self.whisper_SpamBot = 0
  775.             self.BlackList = []
  776.  
  777.     def OpenChatSpamBot(self):
  778.         if self.ChatSpamBot_Window.IsShow():
  779.             self.ChatSpamBot_Window.Hide()
  780.         else:
  781.             self.ChatSpamBot_Window.Show()
  782.  
  783.     def chat_SpamClose_func(self):
  784.         self.ChatSpamBot_Window.Hide()
  785.  
  786.     def chat_SpamButton_func(self, arg):
  787.         if arg == 'on':
  788.             self.chat_SpamBot = 1
  789.             self.chatTimer.SetTimer(float(self.chat_TimerEdit.GetText()))
  790.         elif arg == 'off':
  791.             self.chat_SpamBot = 0
  792.  
  793.     def SendChatText(self, text):
  794.         if text[0] == '!':
  795.             m2net.SendChatPacket(text[1:], chat.CHAT_TYPE_SHOUT)
  796.         else:
  797.             m2net.SendChatPacket(text, chat.CHAT_TYPE_TALKING)
  798.  
  799.     def CloseFish_Window_func(self):
  800.         self.SaveConfigFile()
  801.         self.Fishbot_Window.Hide()
  802.  
  803.     def KillFish_Btn_func(self, arg):
  804.         if arg == 'on':
  805.             self.killFish = 1
  806.         elif arg == 'off':
  807.             self.killFish = 0
  808.  
  809.     def DropHairDye_Btn_func(self, arg):
  810.         if arg == 'on':
  811.             self.dropHairDye = 1
  812.         elif arg == 'off':
  813.             self.dropHairDye = 0
  814.  
  815.     def DropDeadFishes_Btn_func(self, arg):
  816.         if arg == 'on':
  817.             self.dropDeadFish = 1
  818.         elif arg == 'off':
  819.             self.dropDeadFish = 0
  820.  
  821.     def OpenClams_Btn_func(self, arg):
  822.         if arg == 'on':
  823.             self.openClams = 1
  824.         elif arg == 'off':
  825.             self.openClams = 0
  826.  
  827.     def pos_change_btn_func(self, arg):
  828.         if arg == 'on':
  829.             pass
  830.         elif arg == 'off':
  831.             pass
  832.  
  833.     def stopfishing_btn_func(self, arg):
  834.         if arg == 'on':
  835.             self.stopFishing = 1
  836.             self.quitfishing_btn.SetUp()
  837.             self.quitFishing = 0
  838.         elif arg == 'off':
  839.             self.stopFishing = 0
  840.  
  841.     def quitfishing_btn_func(self, arg):
  842.         if arg == 'on':
  843.             self.quitFishing = 1
  844.             self.stopfishing_btn.SetUp()
  845.             self.stopFishing = 0
  846.         elif arg == 'off':
  847.             self.quitFishing = 0
  848.  
  849.     def StartFishing_Btn_func(self, arg):
  850.         if arg == 'on':
  851.             self.FishingState = 'start'
  852.             self.time.SetTimerFishing(float(self.fishing_delay.GetText()) + player5.GetRandomFloat(0.0, 0.7))
  853.             if self.stopFishing == 1:
  854.                 t = float(self.stopfishing_timer.GetText())
  855.                 from datetime import timedelta
  856.                 d = timedelta(8=t)
  857.                 self.stopFishingTimer.SetTimer(float(d.seconds))
  858.         elif arg == 'off':
  859.             self.FishingState = 'stop'
  860.             player5.StartFishing()
  861.  
  862.     def Farm_ComboBox_OnSelectItem(self):
  863.         if self.Farm_ComboBox.GetCurrentText() == 'Metin':
  864.             self.Farm_Btn.SetUpVisual('temp/h4ckb4r/farm_off.tga')
  865.             self.Farm_Btn.SetOverVisual('temp/h4ckb4r/farm_on.tga')
  866.             self.Farm_Btn.SetDownVisual('temp/h4ckb4r/farm_on.tga')
  867.             self.Farm_Btn_func('off')
  868.         elif self.Farm_ComboBox.GetCurrentText() == 'BOSS':
  869.             self.Farm_Btn.SetUpVisual('temp/h4ckb4r/farm_boss_off.tga')
  870.             self.Farm_Btn.SetOverVisual('temp/h4ckb4r/farm_boss_on.tga')
  871.             self.Farm_Btn.SetDownVisual('temp/h4ckb4r/farm_boss_on.tga')
  872.             self.Farm_Btn_func('off')
  873.         elif self.Farm_ComboBox.GetCurrentText() == k_locale.FARM_COMBOBOX_ORE_TEXT:
  874.             self.Farm_Btn.SetUpVisual('temp/h4ckb4r/farm_ore_off.tga')
  875.             self.Farm_Btn.SetOverVisual('temp/h4ckb4r/farm_ore_on.tga')
  876.             self.Farm_Btn.SetDownVisual('temp/h4ckb4r/farm_ore_on.tga')
  877.             self.Farm_Btn_func('off')
  878.         else:
  879.             self.Farm_Btn.SetUpVisual('temp/h4ckb4r/farm_off.tga')
  880.             self.Farm_Btn.SetOverVisual('temp/h4ckb4r/farm_on.tga')
  881.             self.Farm_Btn.SetDownVisual('temp/h4ckb4r/farm_on.tga')
  882.             self.Farm_Btn_func('off')
  883.  
  884.     def MetinInfo_Go(self):
  885.         if self.Farm_ComboBox.GetCurrentText() != k_locale.FARM_COMBOBOX_ORE_TEXT:
  886.             player5.SendAttackPacket(self.func.metin_vid)
  887.         elif player5.GetMotion() != 'Mining':
  888.             m2net.SendOnClickPacket(self.func.metin_vid)
  889.  
  890.     def MetinInfo_Close(self):
  891.         self.MetinInfo_Window.Hide()
  892.  
  893.     def GameMasterInfo_Close(self):
  894.         self.GameMasterInfo_Window.Hide()
  895.  
  896.     def SaveFarmCords(self):
  897.         save = open(FARM_CONFIG_FILE, 'w+')
  898.         for i in xrange(self.list_FarmCord_ListBox.GetItemCount()):
  899.             self.list_FarmCord_ListBox.SelectIndex(i)
  900.             selItem = self.list_FarmCord_ListBox.GetSelectedItem()
  901.             if selItem:
  902.                 save.write(selItem.GetText() + '\n')
  903.  
  904.         save.close()
  905.  
  906.     def ReadFarmCords(self):
  907.         handle = app.OpenTextFile(FARM_CONFIG_FILE)
  908.         count = app.GetTextFileLineCount(handle)
  909.         for i in xrange(count):
  910.             try:
  911.                 line = app.GetTextFileLine(handle, i).split(',')
  912.                 x = line[0]
  913.                 y = line[1]
  914.                 if x.isdigit() and y.isdigit():
  915.                     self.list_FarmCord_ListBox.AppendItem(k_ui.Item(x + ',' + y))
  916.             except IndexError:
  917.                 pass
  918.  
  919.     def AddCords_Btn_func(self):
  920.         x, y, z = player.GetMainCharacterPosition()
  921.         x = int(x) / 100
  922.         y = int(y) / 100
  923.         self.list_FarmCord_ListBox.AppendItem(k_ui.Item(str(x) + ',' + str(y)))
  924.         self.SaveFarmCords()
  925.         if self.list_FarmCord_ListBox.GetItemCount() < 10:
  926.             self.scroll_FarmCord_ListBox.Hide()
  927.         else:
  928.             self.scroll_FarmCord_ListBox.Show()
  929.  
  930.     def RemoveCords_Btn_func(self):
  931.         selItem = self.list_FarmCord_ListBox.GetSelectedItem()
  932.         sel = 0
  933.         if selItem:
  934.             sel = self.list_FarmCord_ListBox.GetItemIndex(selItem) - 1
  935.             self.list_FarmCord_ListBox.RemoveItem(selItem)
  936.         else:
  937.             return
  938.         self.SaveFarmCords()
  939.         self.list_FarmCord_ListBox.RemoveAllItems()
  940.         self.ReadFarmCords()
  941.         self.list_FarmCord_ListBox.SelectIndex(sel)
  942.         if self.list_FarmCord_ListBox.GetItemCount() < 10:
  943.             self.scroll_FarmCord_ListBox.Hide()
  944.         else:
  945.             self.scroll_FarmCord_ListBox.Show()
  946.  
  947.     def FarmCords_Close_func(self):
  948.         self.FarmCords_Window.Hide()
  949.         self.settings_btn_func()
  950.  
  951.     def SaveConfigFile(self):
  952.         SaveConfig('RedPotion', str(self.RedPotion_Bar.GetSliderPos() * 100))
  953.         SaveConfig('BluePotion', str(self.BluePotion_Bar.GetSliderPos() * 100))
  954.         SaveConfig('ExpDonatePercent', str(self.ExpDonator_Bar.GetSliderPos() * 100))
  955.         SaveConfig('AttackSpeed', self.AttackSpeed_Edit.GetText())
  956.         SaveConfig('WalkSpeed', self.MoveSpeed_Edit.GetText())
  957.         SaveConfig('MobberDelay', self.MobberDelay_Edit.GetText())
  958.         SaveConfig('MobberDistance', self.MobberDistance_Edit.GetText())
  959.         SaveConfig('GameMasterDetector_ComboBox', self.GM_ComboBox.GetCurrentText())
  960.         SaveConfig('FarmBot_ComboBox', self.Farm_ComboBox.GetCurrentText())
  961.         SaveConfig('AttackInRange_Enable', str(self.AttackInRange_Enable_Set))
  962.         SaveConfig('WalkAndSearch_Enable', str(self.WalkAndSearch_Enable_Set))
  963.         SaveConfig('Fishbot_React_Delay', self.delay.GetText())
  964.         SaveConfig('Fishbot_Fishing_Delay', self.fishing_delay.GetText())
  965.         SaveConfig('FastAttack_Distance', self.FastAttack_Distance_Edit.GetText())
  966.  
  967.     def settings_btn_func(self):
  968.         if self.HackSetting_Window.IsShow():
  969.             self.SaveConfigFile()
  970.             self.HackSetting_Window.Hide()
  971.         else:
  972.             xPos, yPos = self.Board.GetGlobalPosition()
  973.             self.HackSetting_Window.SetPosition(self.Board.GetWidth() + xPos - self.WIDTH - 30, self.Board.GetHeight() + yPos - self.HEIGH - 50)
  974.             self.HackSetting_Window.Show()
  975.  
  976.     def skill_btn_func(self):
  977.         if self.SkillBot_Window.IsShow():
  978.             self.SkillBot_Window.Hide()
  979.             SaveConfig('Skill_Time1', self.skill1_timer_edit.GetText())
  980.             SaveConfig('Skill_Time2', self.skill2_timer_edit.GetText())
  981.             SaveConfig('Skill_Time3', self.skill3_timer_edit.GetText())
  982.             SaveConfig('Skill_Time4', self.skill4_timer_edit.GetText())
  983.             SaveConfig('Skill_Time5', self.skill5_timer_edit.GetText())
  984.             SaveConfig('Skill_Time6', self.skill6_timer_edit.GetText())
  985.         else:
  986.             xPos, yPos = self.Board.GetGlobalPosition()
  987.             self.SkillBot_Window.SetPosition(self.Board.GetWidth() + xPos - 290 - 20, self.Board.GetHeight() + yPos - 160)
  988.             self.getskillicon = k_ui.SkillAditionDialog()
  989.             x = -30
  990.             self.skilliconsDict = {}
  991.             self.skilliconsActiveDict = {}
  992.             for i in range(1, 7):
  993.                 x = x + 45
  994.                 skillSlot = player.GetSkillIndex(i)
  995.                 skillGrade = player.GetSkillGrade(i)
  996.                 skillLevel = player.GetSkillLevel(i)
  997.                 if 0 == skillGrade:
  998.                     skillLevel += 0
  999.                 elif 1 == skillGrade:
  1000.                     skillLevel += 20
  1001.                 elif 2 == skillGrade:
  1002.                     skillLevel += 30
  1003.                 elif 3 == skillGrade:
  1004.                     skillLevel = 40
  1005.                 if m2net.GetMainActorSkillGroup() == 0:
  1006.                     SkillIcon = ui.ToggleButton()
  1007.                     SkillIcon.SetParent(self.SkillBot_Window)
  1008.                     SkillIcon.SetPosition(x, 10)
  1009.                     SkillIcon.SetUpVisual('d:/ymir work/ui/public/slot_base.sub')
  1010.                     SkillIcon.SetOverVisual('d:/ymir work/ui/public/slot_base.sub')
  1011.                     SkillIcon.SetDownVisual('d:/ymir work/ui/public/slot_base.sub')
  1012.                     SkillIcon.SetToolTipText('')
  1013.                     SkillIcon.SetText('')
  1014.                     SkillIcon.Show()
  1015.                     SkillIcon.Disable()
  1016.                     self.skilliconsDict[i] = SkillIcon
  1017.                 else:
  1018.                     SkillIcon = ui.ToggleButton()
  1019.                     SkillIcon.SetParent(self.SkillBot_Window)
  1020.                     SkillIcon.SetPosition(x, 10)
  1021.                     if skillGrade != 3:
  1022.                         SkillIcon.SetUpVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade + 1))
  1023.                         SkillIcon.SetOverVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade + 1))
  1024.                         SkillIcon.SetDownVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade + 1))
  1025.                     else:
  1026.                         SkillIcon.SetUpVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade))
  1027.                         SkillIcon.SetOverVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade))
  1028.                         SkillIcon.SetDownVisual(self.getskillicon.GetSkillIcon(i, 'Count', skillGrade))
  1029.                     SkillIcon.SetToolTipText(skill.GetSkillName(player.GetSkillIndex(i)))
  1030.                     if skillLevel == 0:
  1031.                         SkillIcon.SetText(str(skillLevel))
  1032.                     else:
  1033.                         SkillIcon.SetText('')
  1034.                     SkillIcon.Show()
  1035.                     SkillIcon.Enable()
  1036.                     self.skilliconsDict[i] = SkillIcon
  1037.                 SkillActivated = ui.ToggleButton()
  1038.                 SkillActivated.SetParent(self.SkillBot_Window)
  1039.                 SkillActivated.SetPosition(x, 10)
  1040.                 SkillActivated.SetUpVisual('id:/ymir work/ui/public/slot_cover_button_03.sub')
  1041.                 SkillActivated.SetOverVisual('d:/ymir work/ui/public/slot_cover_button_03.sub')
  1042.                 SkillActivated.SetDownVisual('d:/ymir work/ui/public/slot_cover_button_03.sub')
  1043.                 SkillActivated.SetToolTipText(skill.GetSkillName(player.GetSkillIndex(i)))
  1044.                 SkillActivated.Hide()
  1045.                 self.skilliconsActiveDict[i] = SkillActivated
  1046.                 self.skilliconsDict[i].SetToggleDownEvent(lambda arg=i: self.skillbot_on_func(arg))
  1047.                 self.skilliconsDict[i].SetToggleUpEvent(lambda arg=i: self.skillbot_off_func(arg))
  1048.                 self.skilliconsActiveDict[i].SetToggleDownEvent(lambda arg=i: self.skillbot_on_func(arg))
  1049.                 self.skilliconsActiveDict[i].SetToggleUpEvent(lambda arg=i: self.skillbot_off_func(arg))
  1050.                 self.SkillBot_Window.Show()
  1051.  
  1052.             if self.skillbot_1 == 1:
  1053.                 self.skilliconsActiveDict[1].Show()
  1054.                 self.skilliconsActiveDict[1].Down()
  1055.             else:
  1056.                 self.skilliconsActiveDict[1].Hide()
  1057.                 self.skilliconsActiveDict[1].SetUp()
  1058.             if self.skillbot_2 == 1:
  1059.                 self.skilliconsActiveDict[2].Show()
  1060.                 self.skilliconsActiveDict[2].Down()
  1061.             else:
  1062.                 self.skilliconsActiveDict[2].Hide()
  1063.                 self.skilliconsActiveDict[2].SetUp()
  1064.             if self.skillbot_3 == 1:
  1065.                 self.skilliconsActiveDict[3].Show()
  1066.                 self.skilliconsActiveDict[3].Down()
  1067.             else:
  1068.                 self.skilliconsActiveDict[3].Hide()
  1069.                 self.skilliconsActiveDict[3].SetUp()
  1070.             if self.skillbot_4 == 1:
  1071.                 self.skilliconsActiveDict[4].Show()
  1072.                 self.skilliconsActiveDict[4].Down()
  1073.             else:
  1074.                 self.skilliconsActiveDict[4].Hide()
  1075.                 self.skilliconsActiveDict[4].SetUp()
  1076.             if self.skillbot_5 == 1:
  1077.                 self.skilliconsActiveDict[5].Show()
  1078.                 self.skilliconsActiveDict[5].Down()
  1079.             else:
  1080.                 self.skilliconsActiveDict[5].Hide()
  1081.                 self.skilliconsActiveDict[5].SetUp()
  1082.             if self.skillbot_6 == 1:
  1083.                 self.skilliconsActiveDict[6].Show()
  1084.                 self.skilliconsActiveDict[6].Down()
  1085.             else:
  1086.                 self.skilliconsActiveDict[6].Hide()
  1087.                 self.skilliconsActiveDict[6].SetUp()
  1088.  
  1089.     def skillbot_on_func(self, arg):
  1090.         self.skilliconsActiveDict[arg].Show()
  1091.         self.skilliconsActiveDict[arg].Down()
  1092.         self.func.UseSkillBot(arg)
  1093.         if arg == 1:
  1094.             if self.skill_timer_active[1] == 1:
  1095.                 self.skill_Timer1.SetTimer(float(self.skill1_timer_edit.GetText()))
  1096.             self.skillbot_1 = 1
  1097.         elif arg == 2:
  1098.             if self.skill_timer_active[2] == 1:
  1099.                 self.skill_Timer2.SetTimer(float(self.skill2_timer_edit.GetText()))
  1100.             self.skillbot_2 = 1
  1101.         elif arg == 3:
  1102.             if self.skill_timer_active[3] == 1:
  1103.                 self.skill_Timer3.SetTimer(float(self.skill3_timer_edit.GetText()))
  1104.             self.skillbot_3 = 1
  1105.         elif arg == 4:
  1106.             if self.skill_timer_active[4] == 1:
  1107.                 self.skill_Timer4.SetTimer(float(self.skill4_timer_edit.GetText()))
  1108.             self.skillbot_4 = 1
  1109.         elif arg == 5:
  1110.             if self.skill_timer_active[5] == 1:
  1111.                 self.skill_Timer5.SetTimer(float(self.skill5_timer_edit.GetText()))
  1112.             self.skillbot_5 = 1
  1113.         elif arg == 6:
  1114.             if self.skill_timer_active[6] == 1:
  1115.                 self.skill_Timer6.SetTimer(float(self.skill6_timer_edit.GetText()))
  1116.             self.skillbot_6 = 1
  1117.  
  1118.     def skillbot_off_func(self, arg):
  1119.         self.skilliconsActiveDict[arg].Hide()
  1120.         self.skilliconsActiveDict[arg].SetUp()
  1121.         if arg == 1:
  1122.             self.skillbot_1 = 0
  1123.         elif arg == 2:
  1124.             self.skillbot_2 = 0
  1125.         elif arg == 3:
  1126.             self.skillbot_3 = 0
  1127.         elif arg == 4:
  1128.             self.skillbot_4 = 0
  1129.         elif arg == 5:
  1130.             self.skillbot_5 = 0
  1131.         elif arg == 6:
  1132.             self.skillbot_6 = 0
  1133.  
  1134.     def settings_fish_btn_func(self):
  1135.         if self.Fishbot_Window.IsShow():
  1136.             self.SaveConfigFile()
  1137.             self.Fishbot_Window.Hide()
  1138.         else:
  1139.             xPos, yPos = self.Board.GetGlobalPosition()
  1140.             self.Fishbot_Window.SetPosition(self.Board.GetWidth() + xPos - 307 - 50, self.Board.GetHeight() + yPos - 245 - 60)
  1141.             self.Fishbot_Window.Show()
  1142.  
  1143.     def HackSet_Close_func(self):
  1144.         self.SaveConfigFile()
  1145.         self.HackSetting_Window.Hide()
  1146.  
  1147.     def Hide_Btn_func(self):
  1148.         self.Board.Hide()
  1149.         self.HardBar_Vertical.Hide()
  1150.         self.hackbar_s = self.comp.Button(None, '', 'Show', wndMgr.GetScreenWidth() - 15, wndMgr.GetScreenHeight() - 50 - 39, self.Show_Btn_func, 'd:/ymir work/ui/public/minimize_button_01.sub', 'd:/ymir work/ui/public/minimize_button_02.sub', 'd:/ymir work/ui/public/minimize_button_03.sub')
  1151.         return
  1152.  
  1153.     def Show_Btn_func(self):
  1154.         self.Board.Show()
  1155.         self.HardBar_Vertical.Show()
  1156.         self.hackbar_s.Hide()
  1157.  
  1158.     def FarmCord_Window_Btn_func(self):
  1159.         self.FarmCords_Window.Show()
  1160.         self.HackSetting_Window.Hide()
  1161.         self.list_FarmCord_ListBox.RemoveAllItems()
  1162.         self.ReadFarmCords()
  1163.  
  1164.     def WallHack_Btn_func(self, arg):
  1165.         if arg == 'on':
  1166.             player5.SkipCollision(1)
  1167.             self.WallHack = 1
  1168.             self.time.SetTimerWallHack(5.0)
  1169.             SaveConfig('Wallhack_Enabled', '1')
  1170.         elif arg == 'off':
  1171.             self.WallHack = 0
  1172.             player5.SkipCollision(0)
  1173.             SaveConfig('Wallhack_Enabled', '0')
  1174.  
  1175.     def AttackInRange_Btn_func(self, arg):
  1176.         if arg == 'on':
  1177.             self.func.AttackInRange = 1
  1178.             self.AttackInRange_Enable_Set = 1
  1179.         elif arg == 'off':
  1180.             self.func.AttackInRange = 0
  1181.             self.AttackInRange_Enable_Set = 0
  1182.  
  1183.     def Farm_Btn_func(self, arg):
  1184.         if arg == 'on':
  1185.             self.Auto_Attack = 0
  1186.             self.StopBotAndStandUp = 0
  1187.             self.WaitForHP = 0
  1188.             self.time.SetTimerFarm(1.5)
  1189.             self.func.farmbot_active = 'goto'
  1190.         elif arg == 'off':
  1191.             self.func.farmbot_active = 'stop'
  1192.             self.pos = 0
  1193.  
  1194.     def Farm_Walk_Btn_func(self, arg):
  1195.         if arg == 'on':
  1196.             self.FarmCord_Window_Btn.Show()
  1197.             self.WalkAndSearch_Enable_Set = 1
  1198.             self.WalkAndSearch = 1
  1199.         elif arg == 'off':
  1200.             self.FarmCord_Window_Btn.Hide()
  1201.             self.WalkAndSearch_Enable_Set = 0
  1202.             self.WalkAndSearch = 0
  1203.  
  1204.     def GmDetector_Btn_func(self, arg):
  1205.         if arg == 'on':
  1206.             self.GM_Detector = 1
  1207.             SaveConfig('GameMasterDetector_Enabled', '1')
  1208.         elif arg == 'off':
  1209.             self.GM_Detector = 0
  1210.             SaveConfig('GameMasterDetector_Enabled', '0')
  1211.  
  1212.     def FastAttack_Btn_func(self, arg):
  1213.         if arg == 'on':
  1214.             self.Fast_Attack = 1
  1215.             self.time.SetTimerFastAttack(0.6)
  1216.             SaveConfig('FastAttack_Enabled', '1')
  1217.         elif arg == 'off':
  1218.             self.Fast_Attack = 0
  1219.             SaveConfig('FastAttack_Enabled', '0')
  1220.  
  1221.     def StartBot_Btn_func(self, arg):
  1222.         global MyX
  1223.         global MyY
  1224.         if arg == 'on':
  1225.             if self.func.AttackInRange == 1:
  1226.                 MyX, MyY, z = player.GetMainCharacterPosition()
  1227.             self.Auto_Attack = self.LEVELBOT_STATE_START
  1228.             if self.SpaceBar_Attack == 1:
  1229.                 player.SetAttackKeyState(TRUE)
  1230.             self.AutoRevive = 0
  1231.             self.AutoRevive_Btn.SetUp()
  1232.             SaveConfig('AutoAttack_Enabled', '1')
  1233.         elif arg == 'off':
  1234.             self.Auto_Attack = self.LEVELBOT_STATE_STOP
  1235.             chrmgrm2g.AutoAttackOnOff(0)
  1236.             chrmgrm2g.AutoStartOnOff(0, 1)
  1237.             if self.SpaceBar_Attack == 1:
  1238.                 player.SetAttackKeyState(FALSE)
  1239.             SaveConfig('AutoAttack_Enabled', '0')
  1240.  
  1241.     def Pickup_Btn_func(self, arg):
  1242.         if arg == 'on':
  1243.             self.if_list_list_items.RemoveAllItems()
  1244.             for it in self.LoadItemList():
  1245.                 self.if_list_list_items.AppendItem(k_ui.Item('%s : %s' % (it['vnum'], it['name'])))
  1246.  
  1247.             self.FillWhiteList()
  1248.             self.ItemFilter_Window.Show()
  1249.             self.Auto_Pickup = 1
  1250.             SaveConfig('AutoPickup_Enabled', '1')
  1251.         elif arg == 'off':
  1252.             self.ItemFilter_Window.Hide()
  1253.             self.Auto_Pickup = 0
  1254.             SaveConfig('AutoPickup_Enabled', '0')
  1255.  
  1256.     def AttractMobs_Btn_func(self, arg):
  1257.         if arg == 'on':
  1258.             self.func.MobberFunction(int(self.MobberDistance_Edit.GetText()))
  1259.             self.Attract_Mobs = 1
  1260.             self.time.SetTimerMobber(float(self.MobberDelay_Edit.GetText()))
  1261.             SaveConfig('AttractMobs_Enabled', '1')
  1262.         elif arg == 'off':
  1263.             self.Attract_Mobs = 0
  1264.             SaveConfig('AttractMobs_Enabled', '0')
  1265.  
  1266.     def AttackSpeed_Btn_func(self, arg):
  1267.         if arg == 'on':
  1268.             self.AttackSpeed = 1
  1269.             SaveConfig('AttackSpeed_Enabled', '1')
  1270.         elif arg == 'off':
  1271.             self.AttackSpeed = 0
  1272.             player5.SetAtt4ckSpeed(player.GetMainCharacterIndex(), player.GetStatus(player.ATT_SPEED))
  1273.             SaveConfig('AttackSpeed_Enabled', '0')
  1274.  
  1275.     def WalkSpeed_Btn_func(self, arg):
  1276.         if arg == 'on':
  1277.             self.MoveSpeed = 1
  1278.             self.time.SetTimerMoveSpeed(1.5)
  1279.             SaveConfig('WalkSpeed_Enabled', '1')
  1280.         elif arg == 'off':
  1281.             self.MoveSpeed = 0
  1282.             player5.SetMoveSpeed(player.GetMainCharacterIndex(), player.GetStatus(player.MOVING_SPEED))
  1283.             SaveConfig('WalkSpeed_Enabled', '0')
  1284.  
  1285.     def Donate_Btn_func(self, arg):
  1286.         if arg == 'on':
  1287.             import uiCommon
  1288.             QuestionDialog = uiCommon.QuestionDialog()
  1289.             QuestionDialog.SetText('Turn On Guild exp donator ?')
  1290.             QuestionDialog.SetAcceptEvent(self.DonatorOk)
  1291.             QuestionDialog.SetCancelEvent(self.DonatorCancel)
  1292.             QuestionDialog.Open()
  1293.             self.DonatorQuestionDialog = QuestionDialog
  1294.         elif arg == 'off':
  1295.             self.GuildExpDonate = 0
  1296.  
  1297.     def DonatorOk(self):
  1298.         self.GuildExpDonate = 1
  1299.         self.DonatorQuestionDialog.Close()
  1300.         self.DonatorQuestionDialog = None
  1301.         return
  1302.  
  1303.     def DonatorCancel(self):
  1304.         self.Donate_Btn.SetUp()
  1305.         self.DonatorQuestionDialog.Close()
  1306.         self.DonatorQuestionDialog = None
  1307.         return
  1308.  
  1309.     def RedPotion_Btn_func(self, arg):
  1310.         if arg == 'on':
  1311.             self.Auto_RedPotion = 1
  1312.             SaveConfig('RedPotion_Enabled', '1')
  1313.         elif arg == 'off':
  1314.             self.Auto_RedPotion = 0
  1315.             SaveConfig('RedPotion_Enabled', '0')
  1316.  
  1317.     def BluePotion_Btn_func(self, arg):
  1318.         if arg == 'on':
  1319.             self.Auto_BluePotion = 1
  1320.             SaveConfig('BluePotion_Enabled', '1')
  1321.         elif arg == 'off':
  1322.             self.Auto_BluePotion = 0
  1323.             SaveConfig('BluePotion_Enabled', '0')
  1324.  
  1325.     def RedPotion_Bar_func(self):
  1326.         self.RedPotion_Text.SetText(k_locale.RED_POTION_TEXT % float(self.RedPotion_Bar.GetSliderPos() * 100) + '%')
  1327.  
  1328.     def BluePotion_Bar_func(self):
  1329.         self.BluePotion_Text.SetText(k_locale.BLUE_POTION_TEXT % float(self.BluePotion_Bar.GetSliderPos() * 100) + '%')
  1330.  
  1331.     def ExpDonator_Bar_func(self):
  1332.         self.ExpDonator_Text.SetText(k_locale.EXP_DONATOR_TEXT % float(self.ExpDonator_Bar.GetSliderPos() * 100) + '%')
  1333.  
  1334.     def OnUpdate(self):
  1335.         if self.RestartHere_Activate == 1:
  1336.             HP = int(player.GetStatus(player.HP))
  1337.             if HP <= 0:
  1338.                 if self.RestartHere_Timer1.Timer():
  1339.                     m2net.SendChatPacket('/restart_here')
  1340.                     self.RestartHere_Timer1.SetTimer(12.0)
  1341.         if self.FollowTarget_Activate == 1:
  1342.             chr.SelectInstance(self.TARGET_FOLLOW_VID)
  1343.             x, y, z = chr.GetPixelPosition(self.TARGET_FOLLOW_VID)
  1344.             mx, my, mz = player.GetMainCharacterPosition()
  1345.             if player.GetCharacterDistance(self.TARGET_FOLLOW_VID) > 600:
  1346.                 chr.MoveToDestPosition(player.GetMainCharacterIndex(), int(x) + 200, int(y))
  1347.         if self.Fast_Attack == 1:
  1348.             if self.time.TimerFastAttack():
  1349.                 self.func.FastAttack(int(self.FastAttack_Distance_Edit.GetText()))
  1350.                 self.time.SetTimerFastAttack(0.6)
  1351.         if self.Auto_Pickup == 1:
  1352.             if EXTRA_PICKUP == 1:
  1353.                 if self.pickupTimer.Timer():
  1354.                     self.func.NewPickCloseItem()
  1355.                     self.pickupTimer.SetTimer(0.5)
  1356.             elif EXTRA_PICKUP == 2:
  1357.                 if self.pickupTimer.Timer():
  1358.                     for newList in self.ITEM_FILTER_WHITELIST:
  1359.                         self.func.PickCloseItemID(int(newList['vnum']))
  1360.  
  1361.                     self.pickupTimer.SetTimer(0.5)
  1362.             elif self.pickupTimer.Timer():
  1363.                 player5.PickCloseItem()
  1364.                 self.pickupTimer.SetTimer(0.5)
  1365.         if self.AttackSpeed == 1:
  1366.             try:
  1367.                 player5.SetAtt4ckSpeed(player.GetMainCharacterIndex(), int(self.AttackSpeed_Edit.GetText()))
  1368.             except:
  1369.                 pass
  1370.  
  1371.         if self.MoveSpeed == 1:
  1372.             try:
  1373.                 player5.SetMoveSpeed(player.GetMainCharacterIndex(), int(self.MoveSpeed_Edit.GetText()))
  1374.                 if self.time.TimerMoveSpeed():
  1375.                     player5.SetMoveSpeed(player.GetMainCharacterIndex(), player.GetStatus(player.MOVING_SPEED))
  1376.                     int(self.MoveSpeed_Edit.GetText())
  1377.                     self.time.SetTimerMoveSpeed(1.5)
  1378.             except:
  1379.                 pass
  1380.  
  1381.         if self.GuildExpDonate == 1:
  1382.             self.func.ExpDonator(self.ExpDonator_Bar.GetSliderPos() * 100)
  1383.         if self.Auto_Attack == self.LEVELBOT_STATE_START:
  1384.             if self.LevelBot_Timer.Timer():
  1385.                 if player.GetStatus(player.HP) <= 0:
  1386.                     self.LevelBot_Timer.SetTimer(12.0)
  1387.                     self.Auto_Attack = self.LEVELBOT_STATE_DEAD
  1388.                 elif self.SpaceBar_Attack == 0:
  1389.                     chrmgrm2g.AutoAttackOnOff(1)
  1390.                     chrmgrm2g.AutoStartOnOff(1, 1)
  1391.                 else:
  1392.                     self.LevelBot_Timer.SetTimer(3.0)
  1393.  
  1394.         elif self.Auto_Attack == self.LEVELBOT_STATE_DEAD:
  1395.             if self.LevelBot_Timer.Timer():
  1396.                 m2net.SendChatPacket('/restart_here')
  1397.                 self.LevelBot_Timer.SetTimer(1.0)
  1398.                 self.Auto_Attack = self.LEVELBOT_STATE_WAIT
  1399.         elif self.Auto_Attack == self.LEVELBOT_STATE_WAIT:
  1400.             maxHP = player.GetStatus(player.MAX_HP)
  1401.             hp = player.GetStatus(player.HP)
  1402.             curPoint = min(hp, maxHP)
  1403.             curPoint = max(hp, 0)
  1404.             maxPoint = max(maxHP, 0)
  1405.             if int(float(curPoint) / max(1, float(maxPoint)) * 100) > 30:
  1406.                 self.LevelBot_Timer.SetTimer(1.0)
  1407.                 self.Auto_Attack = self.LEVELBOT_STATE_START
  1408.         if self.Auto_Attack == self.LEVELBOT_STATE_STOP and self.AutoRevive == 1:
  1409.             HP = player.GetStatus(player.HP)
  1410.             if HP <= 0:
  1411.                 self.AutoRevive_Timer.SetTimer(11.0)
  1412.                 self.AutoRevive = 2
  1413.         if self.AutoRevive == 2:
  1414.             if self.AutoRevive_Timer.Timer():
  1415.                 m2net.SendChatPacket('/restart_here')
  1416.                 self.AutoRevive = 1
  1417.         if self.WaitHack == 1:
  1418.             if self.func.PlayerDetector(self.DETECT_PLAYER, self.player_whitelist) == False:
  1419.                 if self.WaitHack_Timer.Timer():
  1420.                     for vid in player5.GetVirtualID():
  1421.                         if chr.INSTANCE_TYPE_ENEMY == chr.GetInstanceType(vid) or 2 == chr.GetInstanceType(vid):
  1422.                             if player.GetCharacterDistance(vid) < 500:
  1423.                                 player5.SendBattlePacket(vid)
  1424.  
  1425.                     self.WaitHack_Timer.SetTimer(0.3)
  1426.         if self.Auto_RedPotion == 1:
  1427.             self.func.AutoPotRed(self.RedPotion_Bar.GetSliderPos() * 100)
  1428.         if self.Auto_BluePotion == 1:
  1429.             self.func.AutoPotBlue(self.BluePotion_Bar.GetSliderPos() * 100)
  1430.         if self.Attract_Mobs == 1:
  1431.             if self.func.PlayerDetector(self.DETECT_PLAYER, self.player_whitelist) == False:
  1432.                 if self.time.TimerMobber():
  1433.                     self.func.MobberFunction(int(self.MobberDistance_Edit.GetText()))
  1434.                     self.time.SetTimerMobber(float(self.MobberDelay_Edit.GetText()))
  1435.         if self.GM_Detector == 1:
  1436.             if self.GM_ComboBox.GetCurrentText() == 'LogOut':
  1437.                 if self.func.DetectGameMaster():
  1438.                     m2net.SendChatPacket('/logout')
  1439.                     self.GM_Detector = 0
  1440.             elif self.GM_ComboBox.GetCurrentText() == 'Quit':
  1441.                 if self.func.DetectGameMaster():
  1442.                     app.Abort()
  1443.             elif self.GM_ComboBox.GetCurrentText() == 'Stop Botting':
  1444.                 if self.func.DetectGameMaster():
  1445.                     self.FastAttack_Btn.SetUp()
  1446.                     self.FastAttack_Btn_func('off')
  1447.                     self.AttractMobs_Btn.SetUp()
  1448.                     self.AttractMobs_Btn_func('off')
  1449.                     self.Fishing_Btn.SetUp()
  1450.                     self.StartFishing_Btn_func('off')
  1451.                     self.AttackSpeed_Btn.SetUp()
  1452.                     self.AttackSpeed_Btn_func('off')
  1453.                     self.WalkSpeed_Btn.SetUp()
  1454.                     self.WalkSpeed_Btn_func('off')
  1455.                     self.GameMaster_Names_Text.SetText('Bot stopped ' + self.func.GetGameMasterName() + ' is around')
  1456.                     if not self.GameMasterInfo_Window.IsShow():
  1457.                         self.GameMasterInfo_Window.Show()
  1458.                     self.GM_Detector = 0
  1459.             elif self.GM_ComboBox.GetCurrentText() == 'Visible':
  1460.                 self.func.MakeGameMasterVisible()
  1461.             elif self.GM_ComboBox.GetCurrentText() == 'Show Name':
  1462.                 if self.func.DetectGameMaster():
  1463.                     x, y = self.func.GetGameMasterPosition()
  1464.                     x = int(x) / 100
  1465.                     y = int(y) / 100
  1466.                     self.GameMaster_Names_Text.SetText('GM: %s (%i, %i)' % (self.func.GetGameMasterName(), x, y))
  1467.                     if not self.GameMasterInfo_Window.IsShow():
  1468.                         self.GameMasterInfo_Window.Show()
  1469.         if self.func.farmbot_active == 'goto':
  1470.             if self.time.TimerFarm() == 1:
  1471.                 if self.WalkAndSearch == 1:
  1472.                     self.func.Farming(self.Farm_ComboBox.GetCurrentText())
  1473.                 else:
  1474.                     type = self.Farm_ComboBox.GetCurrentText()
  1475.                     if self.func.GetMetin(type) != '':
  1476.                         self.MetinInfo_Window_Text.SetText(self.func.GetMetin(type))
  1477.                         if not self.MetinInfo_Window.IsShow():
  1478.                             self.MetinInfo_Window.Show()
  1479.                 self.time.SetTimerFarm(1.5)
  1480.         elif self.func.farmbot_active == 'metin_found':
  1481.             if self.time.TimerFarm() == 1:
  1482.                 if player.GetStatus(player.HP) < 0:
  1483.                     self.time.SetTimerFarm(12.0)
  1484.                     self.func.farmbot_active = 'dead'
  1485.                 player.SetTarget(self.func.metin_vid)
  1486.                 if player.GetTargetVID() == self.func.metin_vid:
  1487.                     player5.SendAttackPacket(self.func.metin_vid)
  1488.                 else:
  1489.                     self.func.farmbot_active = 'goto'
  1490.                 self.time.SetTimerFarm(2.0)
  1491.         elif self.func.farmbot_active == 'ore_found':
  1492.             if self.time.TimerFarm() == 1:
  1493.                 if player.GetStatus(player.HP) < 0:
  1494.                     self.time.SetTimerFarm(12.0)
  1495.                     self.func.farmbot_active = 'dead'
  1496.                 player.SetTarget(self.func.metin_vid)
  1497.                 if player.GetTargetVID() == self.func.metin_vid:
  1498.                     if player5.GetMotion() != 'Mining':
  1499.                         m2net.SendOnClickPacket(self.func.metin_vid)
  1500.                 else:
  1501.                     self.func.farmbot_active = 'goto'
  1502.                 self.time.SetTimerFarm(10.0)
  1503.         elif self.func.farmbot_active == 'dead':
  1504.             if self.time.TimerFarm() == 1:
  1505.                 m2net.SendChatPacket('/restart_here')
  1506.                 self.time.SetTimerFarm(12.0)
  1507.                 self.func.farmbot_active = 'metin_found'
  1508.         if self.WallHack == 1:
  1509.             if self.time.TimerWallHack() == 1:
  1510.                 player5.SkipCollision(1)
  1511.                 self.time.SetTimerWallHack(5.0)
  1512.         if self.FishingState == 'start':
  1513.             if self.quitFishing == 1:
  1514.                 if self.stopFishingTimer.Timer() == 1:
  1515.                     app.Abort()
  1516.             if self.stopFishing == 1:
  1517.                 if self.stopFishingTimer.Timer() == 1:
  1518.                     self.Fishing_Btn.SetUp()
  1519.                     self.FishingState = 'stop'
  1520.                     player5.StartFishing()
  1521.             if player.GetStatus(player.HP) < 0:
  1522.                 self.time.SetTimerFishing(12.0)
  1523.                 self.FishingState = 'Dead'
  1524.             if player5.GetMotion() == 'Idle':
  1525.                 if self.time.TimerFishing() == 1:
  1526.                     if self.func.UseBait():
  1527.                         player5.StartFishing()
  1528.                     else:
  1529.                         self.Fishing_Btn.SetUp()
  1530.                         self.FishingState = 'stop'
  1531.                     self.time.SetTimerFishing(float(self.fishing_delay.GetText()) + player5.GetRandomFloat(0.0, 1.0))
  1532.             elif player5.GetMotion() == 'Fishing_React':
  1533.                 self.time.SetTimerFishing(float(self.delay.GetText()) + player5.GetRandomFloat(0.0, 1.0))
  1534.                 self.FishingState = 'React'
  1535.         elif self.FishingState == 'React':
  1536.             if self.time.TimerFishing() == 1:
  1537.                 player5.StartFishing()
  1538.                 self.FishingState = 'start'
  1539.                 if self.killFish == 1:
  1540.                     self.func.killFishes()
  1541.                 if self.dropHairDye == 1:
  1542.                     self.func.dropHairDye()
  1543.                 if self.dropDeadFish == 1:
  1544.                     self.func.dropDeadFishes()
  1545.                 if self.openClams == 1:
  1546.                     self.func.openClams()
  1547.                 self.time.SetTimerFishing(float(self.fishing_delay.GetText()) + player5.GetRandomFloat(0.0, 1.0))
  1548.         elif self.FishingState == 'Dead':
  1549.             if self.time.TimerFishing() == 1:
  1550.                 m2net.SendChatPacket('/restart_here')
  1551.                 self.FishingState = 'start'
  1552.                 self.time.SetTimerFishing(float(self.fishing_delay.GetText()))
  1553.         if self.skillbot_1 == 1:
  1554.             if self.skill_timer_active[1] == 1:
  1555.                 if self.skill_Timer1.Timer() == 1:
  1556.                     self.func.UseSkillBot(1)
  1557.                     self.skill_Timer1.SetTimer(float(self.skill1_timer_edit.GetText()))
  1558.             else:
  1559.                 self.func.UseSkillBot(1)
  1560.         if self.skillbot_2 == 1:
  1561.             if self.skill_timer_active[2] == 1:
  1562.                 if self.skill_Timer2.Timer() == 1:
  1563.                     self.func.UseSkillBot(2)
  1564.                     self.skill_Timer2.SetTimer(float(self.skill2_timer_edit.GetText()))
  1565.             else:
  1566.                 self.func.UseSkillBot(2)
  1567.         if self.skillbot_3 == 1:
  1568.             if self.skill_timer_active[3] == 1:
  1569.                 if self.skill_Timer3.Timer() == 1:
  1570.                     self.func.UseSkillBot(3)
  1571.                     self.skill_Timer3.SetTimer(float(self.skill3_timer_edit.GetText()))
  1572.             else:
  1573.                 self.func.UseSkillBot(3)
  1574.         if self.skillbot_4 == 1:
  1575.             if self.skill_timer_active[4] == 1:
  1576.                 if self.skill_Timer4.Timer() == 1:
  1577.                     self.func.UseSkillBot(4)
  1578.                     self.skill_Timer4.SetTimer(float(self.skill4_timer_edit.GetText()))
  1579.             else:
  1580.                 self.func.UseSkillBot(4)
  1581.         if self.skillbot_5 == 1:
  1582.             if self.skill_timer_active[5] == 1:
  1583.                 if self.skill_Timer5.Timer() == 1:
  1584.                     self.func.UseSkillBot(5)
  1585.                     self.skill_Timer5.SetTimer(float(self.skill5_timer_edit.GetText()))
  1586.             else:
  1587.                 self.func.UseSkillBot(5)
  1588.         if self.skillbot_6 == 1:
  1589.             if self.skill_timer_active[6] == 1:
  1590.                 if self.skill_Timer6.Timer() == 1:
  1591.                     self.func.UseSkillBot(6)
  1592.                     self.skill_Timer6.SetTimer(float(self.skill6_timer_edit.GetText()))
  1593.             else:
  1594.                 self.func.UseSkillBot(6)
  1595.         if self.chat_SpamBot == 1:
  1596.             if self.chatTimer.Timer() == 1:
  1597.                 self.SendChatText(self.chat_SpamEdit.GetText())
  1598.                 self.chatTimer.SetTimer(float(self.chat_TimerEdit.GetText()))
  1599.         if self.whisper_SpamBot == 1:
  1600.             if self.whisperTimer.Timer() == 1:
  1601.                 self.spam_send_btn_func(1)
  1602.                 self.whisperTimer.SetTimer(float(self.spam_timer_edit.GetText()))
  1603.  
  1604.     def OpenWindow(self):
  1605.         if self.Board.IsShow():
  1606.             self.Board.Hide()
  1607.         else:
  1608.             self.Board.Show()
  1609.  
  1610.     def Close(self):
  1611.         self.Board.Hide()
  1612.  
  1613.  
  1614. class Functions():
  1615.  
  1616.     def GetHP_Percent(self):
  1617.         maxHP = int(player.GetStatus(player.MAX_HP))
  1618.         HP = int(player.GetStatus(player.HP))
  1619.         curPoint = min(HP, maxHP)
  1620.         curPoint = max(HP, 0)
  1621.         maxPoint = max(maxHP, 0)
  1622.         return float(curPoint) / max(1, float(maxPoint)) * 100
  1623.  
  1624.     def AutoPotRed(self, percent):
  1625.         maxHP = int(player.GetStatus(player.MAX_HP))
  1626.         HP = int(player.GetStatus(player.HP))
  1627.         HP_RECOVERY = int(player.GetStatus(player.HP_RECOVERY))
  1628.         curPoint = min(HP, maxHP)
  1629.         curPoint = max(HP, 0)
  1630.         maxPoint = max(maxHP, 0)
  1631.         if float(curPoint) / max(1, float(maxPoint)) * 100 < percent and HP_RECOVERY == 0:
  1632.             for eachSlot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1633.                 if player.GetItemIndex(eachSlot) in [ int(i) for i in RED_POTION_ID.split(',') ]:
  1634.                     m2net.SendItemUsePacket(eachSlot)
  1635.                     break
  1636.  
  1637.     def AutoPotBlue(self, percent):
  1638.         maxSP = int(player.GetStatus(player.MAX_SP))
  1639.         SP = int(player.GetStatus(player.SP))
  1640.         SP_RECOVERY = int(player.GetStatus(player.SP_RECOVERY))
  1641.         curPoint2 = min(SP, maxSP)
  1642.         curPoint2 = max(SP, 0)
  1643.         maxPoint2 = max(maxSP, 0)
  1644.         if float(curPoint2) / max(1, float(maxPoint2)) * 100 < percent and SP_RECOVERY == 0:
  1645.             for eachSlot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1646.                 if player.GetItemIndex(eachSlot) in [ int(i) for i in BLUE_POTION_ID.split(',') ]:
  1647.                     m2net.SendItemUsePacket(eachSlot)
  1648.                     break
  1649.  
  1650.     def ExpDonator(self, percent):
  1651.         nextEXP = int(player.GetStatus(player.NEXT_EXP))
  1652.         Exp = int(player.GetEXP())
  1653.         curPoint = min(Exp, nextEXP)
  1654.         curPoint = max(Exp, 0)
  1655.         maxPoint = max(nextEXP, 0)
  1656.         if float(curPoint) / max(1, float(maxPoint)) * 100 > percent:
  1657.             m2net.SendGuildOfferPacket(Exp)
  1658.             return
  1659.  
  1660.     def MobberFunction(self, dist):
  1661.         maxHP = int(player.GetStatus(player.MAX_HP))
  1662.         HP = int(player.GetStatus(player.HP))
  1663.         curPoint = min(HP, maxHP)
  1664.         curPoint = max(HP, 0)
  1665.         maxPoint = max(maxHP, 0)
  1666.         if float(curPoint) / max(1, float(maxPoint)) * 100 > 30:
  1667.             for vid in player5.GetVirtualID():
  1668.                 if chr.INSTANCE_TYPE_ENEMY == chr.GetInstanceType(vid):
  1669.                     if player.GetCharacterDistance(vid) < dist:
  1670.                         player5.SendBattlePacket(vid)
  1671.  
  1672.     AttackInRange = 0
  1673.  
  1674.     def IsInRange(self, vid):
  1675.         if self.AttackInRange == 1:
  1676.             mobX, mobY = player5.GetPixelPosition2(vid)
  1677.             x1 = (MyX - mobX) / 100
  1678.             y1 = (MyY - mobY) / 100
  1679.             return math.sqrt(math.pow(x1, 2) + math.pow(y1, 2))
  1680.  
  1681.     def AttackNearestMob(self):
  1682.         MobList = []
  1683.         Count = 0
  1684.         for vid in player5.GetVirtualID():
  1685.             if chr.INSTANCE_TYPE_ENEMY == chr.GetInstanceType(vid):
  1686.                 if self.IsInRange(vid) < 40:
  1687.                     if player5.IsDead(i) == 0:
  1688.                         distance = player.GetCharacterDistance(vid)
  1689.                         MobData = {'VID': vid,
  1690.                            'COUNT': Count,
  1691.                            'DISTANCE': distance}
  1692.                         Count += 1
  1693.                         MobList.append(MobData)
  1694.  
  1695.         NearestMob = 0
  1696.         try:
  1697.             for data in MobList:
  1698.                 Distance = float(data['DISTANCE'])
  1699.                 if Distance < float(MobList[NearestMob]['DISTANCE']):
  1700.                     NearestMob = data['COUNT']
  1701.  
  1702.             VID = int(MobList[NearestMob]['VID'])
  1703.             player5.SendAttackPacket(VID)
  1704.         except IndexError:
  1705.             VID = 0
  1706.  
  1707.     def FastAttack(self, dst):
  1708.         vid = player.GetTargetVID()
  1709.         distance = player.GetCharacterDistance(vid)
  1710.         if distance < dst:
  1711.             if vid != 0:
  1712.                 if vid != -1:
  1713.                     if chr.INSTANCE_TYPE_NPC != chr.GetInstanceType(vid):
  1714.                         if vid != player.GetMainCharacterIndex():
  1715.                             player5.SendBattlePacket(vid)
  1716.  
  1717.     def DetectGameMaster(self):
  1718.         for vid in player5.GetVirtualID():
  1719.             name = chr.GetNameByVID(vid)
  1720.             if name.startswith('['):
  1721.                 return 1
  1722.  
  1723.         return 0
  1724.  
  1725.     def MakeGameMasterVisible(self):
  1726.         for vid in player5.GetVirtualID():
  1727.             name = chr.GetNameByVID(vid)
  1728.             if name.startswith('['):
  1729.                 chr.SelectInstance(vid)
  1730.                 chr.SetNameString(name)
  1731.                 chr.Show()
  1732.                 chr.SelectInstance(player.GetMainCharacterIndex())
  1733.  
  1734.     def GetGameMasterName(self):
  1735.         for vid in player5.GetVirtualID():
  1736.             name = chr.GetNameByVID(vid)
  1737.             if name.startswith('['):
  1738.                 return name
  1739.  
  1740.         return ''
  1741.  
  1742.     def GetGameMasterPosition(self):
  1743.         for vid in player5.GetVirtualID():
  1744.             name = chr.GetNameByVID(vid)
  1745.             if name.startswith('['):
  1746.                 mobX, mobY = player5.GetPixelPosition2(vid)
  1747.                 return (
  1748.                  mobX, abs(mobY))
  1749.  
  1750.         return (0, 0)
  1751.  
  1752.     def ReadFarmConfig(Setting):
  1753.         lines = open('temp/h4ckb4r/mod_farm_list.cfg').readlines()
  1754.         for line in lines:
  1755.             if line.startswith(Setting):
  1756.                 return line.split('=')[1].replace('\n', '')
  1757.  
  1758.     pos = 0
  1759.     metin_vid = 0
  1760.     metin_life = 0
  1761.     farmbot_active = 'stop'
  1762.     MetinList = [ int(n) for n in ReadFarmConfig('MetinList').split(',') ]
  1763.     BossList = [ int(n) for n in ReadFarmConfig('BossList').split(',') ]
  1764.     OreList = [ int(n) for n in ReadFarmConfig('OreList').split(',') ]
  1765.  
  1766.     def Farming(self, type):
  1767.         x, y, z = player.GetMainCharacterPosition()
  1768.         x = int(x) / 100
  1769.         y = int(y) / 100
  1770.         handle = app.OpenTextFile(FARM_CONFIG_FILE)
  1771.         count = app.GetTextFileLineCount(handle) - 1
  1772.         line = app.GetTextFileLine(handle, self.pos)
  1773.         xx = int(line.split(',')[0])
  1774.         yy = int(line.split(',')[1])
  1775.         chr.MoveToDestPosition(player.GetMainCharacterIndex(), xx * 100, yy * 100)
  1776.         if x >= xx - 2 and x <= xx + 2 and y >= yy - 2 and y <= yy + 2:
  1777.             if self.pos != count:
  1778.                 self.pos += 1
  1779.             if self.pos == count:
  1780.                 self.pos = 0
  1781.         for vid in player5.GetVirtualID():
  1782.             vnum = player5.GetVirtualNumber(vid)
  1783.             if type == 'Metin':
  1784.                 if vnum in self.MetinList:
  1785.                     self.metin_vid = vid
  1786.                     self.metin_life = i
  1787.                     self.farmbot_active = 'metin_found'
  1788.                     break
  1789.             elif type == 'BOSS':
  1790.                 if vnum in self.BossList:
  1791.                     self.metin_vid = vid
  1792.                     self.metin_life = i
  1793.                     self.farmbot_active = 'metin_found'
  1794.                     break
  1795.             elif type == k_locale.FARM_COMBOBOX_ORE_TEXT:
  1796.                 if vnum in self.OreList:
  1797.                     self.metin_vid = vid
  1798.                     self.farmbot_active = 'ore_found'
  1799.                     break
  1800.             elif vnum in MetinList or vnum in BossList:
  1801.                 self.metin_vid = vid
  1802.                 self.metin_life = i
  1803.                 self.farmbot_active = 'metin_found'
  1804.                 break
  1805.  
  1806.     FOUND_COORDS = (0, 0)
  1807.  
  1808.     def GetMetin(self, type):
  1809.         for vid in player5.GetVirtualID():
  1810.             if type == 'Metin':
  1811.                 if vnum in self.MetinList:
  1812.                     x, y = player5.GetPixelPosition2(vid)
  1813.                     self.FOUND_COORDS = (int(x), int(y))
  1814.                     self.metin_vid = vid
  1815.                     return chr.GetNameByVID(vid) + ', VID: ' + str(vid) + ', VNUM: ' + str(vnum) + ', POS: (' + str(int(x) / 100) + ', ' + str(int(y) / 100) + ')'
  1816.             elif type == 'BOSS':
  1817.                 if vnum in self.BossList:
  1818.                     x, y = player5.GetPixelPosition2(vid)
  1819.                     self.FOUND_COORDS = (int(x), int(y))
  1820.                     self.metin_vid = vid
  1821.                     return chr.GetNameByVID(vid) + ', VID: ' + str(vid) + ', VNUM: ' + str(vnum) + ', POS: (' + str(int(x) / 100) + ', ' + str(int(y) / 100) + ')'
  1822.             elif type == k_locale.FARM_COMBOBOX_ORE_TEXT:
  1823.                 if vnum in self.OreList:
  1824.                     x, y = player5.GetPixelPosition2(vid)
  1825.                     self.FOUND_COORDS = (int(x), int(y))
  1826.                     self.metin_vid = vid
  1827.                     return chr.GetNameByVID(vid) + ', VID: ' + str(vid) + ', VNUM: ' + str(vnum) + ', POS: (' + str(int(x) / 100) + ', ' + str(int(y) / 100) + ')'
  1828.             elif vnum in self.MetinList or vnum in self.BossList:
  1829.                 x, y = player5.GetPixelPosition2(vid)
  1830.                 self.FOUND_COORDS = (int(x), int(y))
  1831.                 self.metin_vid = vid
  1832.                 return chr.GetNameByVID(vid) + ', VID: ' + str(vid) + ', VNUM: ' + str(vnum) + ', POS: (' + str(int(x) / 100) + ', ' + str(int(y) / 100) + ')'
  1833.  
  1834.         return ''
  1835.  
  1836.     def UseBait(self):
  1837.         for Slot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1838.             if player.GetItemIndex(Slot) in (27800, 27801, 27802):
  1839.                 m2net.SendItemUsePacket(Slot)
  1840.                 return 1
  1841.  
  1842.         return 0
  1843.  
  1844.     def killFishes(self):
  1845.         for Slot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1846.             if player.GetItemIndex(Slot) in (27803, 27804, 27805, 27806, 27807, 27808,
  1847.                                              27809, 27811, 27812, 27813, 27814, 27815,
  1848.                                              27816, 27817, 27818, 27819, 27820, 27821,
  1849.                                              27822, 27823, 30112):
  1850.                 m2net.SendItemUsePacket(Slot)
  1851.  
  1852.     def openClams(self):
  1853.         for Slot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1854.             if player.GetItemIndex(Slot) == 27987:
  1855.                 m2net.SendItemUsePacket(Slot)
  1856.  
  1857.     def dropDeadFishes(self):
  1858.         for Slot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1859.             if player.GetItemIndex(Slot) in (27833, 27834, 27835, 27836, 27837, 27838,
  1860.                                              27839, 27840, 27841, 27842, 27843, 27844,
  1861.                                              27845, 27846, 27847, 27848, 27849, 27850,
  1862.                                              27851, 27852, 27853, 27802):
  1863.                 m2net.SendItemDropPacketNew(player.INVENTORY, Slot, 1)
  1864.  
  1865.     def dropHairDye(self):
  1866.         for Slot in xrange(player.INVENTORY_PAGE_SIZE * 2):
  1867.             if player.GetItemIndex(Slot) >= 70201 and player.GetItemIndex(Slot) <= 70208:
  1868.                 m2net.SendItemDropPacketNew(player.INVENTORY, Slot, 1)
  1869.  
  1870.     def UseSkillBot(self, slot):
  1871.         if not player.IsSkillCoolTime(slot):
  1872.             player.ClickSkillSlot(slot)
  1873.  
  1874.     def MoveToDestPosition(self, xx, yy):
  1875.         x, y, z = player.GetMainCharacterPosition()
  1876.         x = int(x) / 100
  1877.         y = int(y) / 100
  1878.         if x >= xx - 2 and x <= xx + 2 and y >= y - 2 and y <= yy + 2:
  1879.             return 'running'
  1880.         else:
  1881.             chr.MoveToDestPosition(player.GetMainCharacterIndex(), xx * 100, yy * 100)
  1882.             return 'dest'
  1883.  
  1884.     def GetRandom(self):
  1885.         rdata = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
  1886.         for n in xrange(len(rdata)):
  1887.             if n == app.GetRandom(0, len(rdata)):
  1888.                 return rdata[n]
  1889.  
  1890.         return rdata[0]
  1891.  
  1892.     def PickCloseItemID(self, vnum):
  1893.         for VID in self.GetItemsOnGround():
  1894.             if player5.GetVirtualNumberOfGroundItem(VID) == vnum:
  1895.                 player5.SendItemPickUpPacket(VID)
  1896.  
  1897.     def NewPickCloseItem(self):
  1898.         for VID in self.GetItemsOnGround():
  1899.             player5.SendItemPickUpPacket(VID)
  1900.  
  1901.     def PickCloseYang(self):
  1902.         for VID in self.GetYangOnGround():
  1903.             player5.SendItemPickUpPacket(VID)
  1904.  
  1905.     def GetItemsOnGround(self):
  1906.         List = []
  1907.         Picker = Pick
  1908.         for y in xrange(125, 600, 18):
  1909.             for x in xrange(300, 825, 31):
  1910.                 iVID = Picker(x, y)
  1911.                 if iVID != -1 and iVID not in List:
  1912.                     List.append(iVID)
  1913.  
  1914.         return List
  1915.  
  1916.     def GetYangOnGround(self):
  1917.         List = []
  1918.         Picker = Pick
  1919.         for y in xrange(125, 600, 18):
  1920.             for x in xrange(300, 825, 31):
  1921.                 FirstCoord = None
  1922.                 LastCoord = None
  1923.                 iVID = Picker(x, y)
  1924.                 if iVID != -1:
  1925.                     if iVID not in List:
  1926.                         _range = xrange(1, 29)
  1927.                         for i in _range:
  1928.                             if Picker(x - i, y) != iVID:
  1929.                                 FirstCoord = x - i + 1
  1930.                                 break
  1931.  
  1932.                         if FirstCoord == None:
  1933.                             continue
  1934.                         for i in _range:
  1935.                             if Picker(FirstCoord + i, y) != iVID:
  1936.                                 LastCoord = FirstCoord + i - 1
  1937.                                 break
  1938.  
  1939.                         if LastCoord == None:
  1940.                             continue
  1941.                         List.append(iVID)
  1942.  
  1943.         return List
  1944.  
  1945.     def PlayerDetector(self, detect, whitelist):
  1946.         if detect == True:
  1947.             for vid in player5.GetVirtualID():
  1948.                 if chr.INSTANCE_TYPE_PLAYER == chr.GetInstanceType(vid):
  1949.                     if vid == player.GetMainCharacterIndex():
  1950.                         continue
  1951.                     name = chr.GetNameByVID(vid)
  1952.                     if name == 'None':
  1953.                         continue
  1954.                     if name in whitelist:
  1955.                         continue
  1956.                     if int(player.GetCharacterDistance(vid)) < 7000:
  1957.                         return True
  1958.  
  1959.             return False
  1960.         return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement