Jun-26-2019, 02:26 PM
I write this code but ı cant enject ı got ".py has failed to load" error
Can anyone tell me where I do mistake
Can anyone tell me where I do mistake
from phBot import * import phBotChat import re import time from selenium import webdriver def handle_chat(t, player, msg): if len(player) == 0: m = re.findall(r'(\d+)', msg) if m and len(m) >= 2: if msg.find('+') != -1 or msg.find(' x ') != -1: result = int(m[0]) + int(m[1]) else: result = int(m[0]) * int(m[1]) sleep(1.0) log('Sending result %s' % str(result)) if msg.find('/answer') != -1: phBotChat.All('/answer ' + str(result)) else: phBotChat.All(str(result)) elif (player.find('JobSecure') != -1 or player.find('BotCheck') != -1) and msg.lower().find('Kervankey') != -1: reply_key = kervan_key() phBotChat.Private(player, str(reply_key))) elif player == 'RemoLogger' or player == 'Bot' or player == 'BotCheck' or player == 'PurpleHaze': msg = re.findall(r'(\d+)', msg) if msg: if len(msg) == 1: time.sleep(1) log('Sending result %s' % str(msg[0])) phBotChat.Private(player, str(msg[0])) elif len(msg) >= 2: if msg.find('+') != -1 or msg.find(' x ') != -1: result = int(msg[0]) + int(msg[1]) else: result = int(msg[0]) * int(msg[1]) time.sleep(1) log('Sending result %s' % str(result)) phBotChat.Private(player, str(result)) elif msg.lower().find('Kervankey') != -1: phBotChat.Private(player, kervan_key()) def kervan_key() browser = webdriver.Firefox() browser.get('http://www.rsilkroad.com/default.aspx') time.sleep(1) k_adi = browser.find_element_by_id('kadi') k_adi.send_keys('id') time.sleep(1) pswrd = browser.find_element_by_id('ksifre') pswrd.send_keys('pss') time.sleep(1) submit_button = browser.find_elements_by_xpath('//*[@id="girisYap"]')[0] submit_button.click() lb3 = browser.find_element_by_xpath("/html/body/form/div[5]/div/div[1]/div[2]/div/div/div[3]/b") reply = lb3.text.split()[0] return reply log('[%s] Loaded' % __name__)