def set_runescape_coord(): global WINDOWS_COORD global GAME_MIDDLE_COORD WINDOWS_COORD = getRunescapeWindow() game_pos = RS.getGamePosition(WINDOWS_COORD) # GAME_MIDDLE_COORD = [game_pos[0]+513/2,game_pos[0]+337/2] GAME_MIDDLE_COORD = [game_pos[0]+513/2+20,game_pos[1]+337/2-50]
def setMainWindow(): img = pyautogui.screenshot('ababa.png') img_rgb = cv2.imread(r'C:\Users\PPC\git\RS_BOT_2.0\ababa.png') coord = RS.getFullPosition(img_rgb) if coord == None: print "Can't Find Runescape Window" exit() return coord
def mouse_move(): pass temp_list = RS.getItemPosition([0, 0]) num = 5 Mouse.moveMouseTo(inventory_coord[0] + temp_list[num][0] + Mouse.randCoord(25), inventory_coord[1] + temp_list[num][1] + Mouse.randCoord(25), 0.5) Mouse.click() num = 1 Mouse.moveMouseTo(inventory_coord[0] + temp_list[num][0] + Mouse.randCoord(25), inventory_coord[1] + temp_list[num][1] + Mouse.randCoord(25), 0.5) Mouse.click() num = 2 Mouse.moveMouseTo(inventory_coord[0] + temp_list[num][0] + Mouse.randCoord(25), inventory_coord[1] + temp_list[num][1] + Mouse.randCoord(25), 0.5) Mouse.click()
def changeMenu(inventory_ss, inventory_coord, item_type): prayer_path = os.path.join(CURRENT_WORKING_DIRECTORY, r"library\pvp_macro") prayer_path = os.path.join(prayer_path, item_type) prayer_list = getGearList(prayer_path) for item in prayer_list: img_file = cv2.imread(item, 0) p1 = Match.this(inventory_ss, img_file, 5, 5) if p1: item_click(inventory_coord, p1, 17) if __name__ == '__main__': window_coord = setMainWindow() inventory_coord = RS.getInventoryStartPosition(window_coord) inventory_ss = Screenshot.shoot(inventory_coord[0], inventory_coord[1], inventory_coord[2], inventory_coord[3], "rgb") prayer_coord = RS.getPrayerStartPosition(window_coord) prayer_ss = Screenshot.shoot(prayer_coord[0], prayer_coord[1], prayer_coord[2], prayer_coord[3], "rgb") top_menu_coord = RS.getTopMenuStartPosition(window_coord) top_menu_ss = Screenshot.shoot(top_menu_coord[0], top_menu_coord[1], top_menu_coord[2], top_menu_coord[3], "rgb") # inventory_ss = cv2.imread(r'C:\Users\PPC\git\RS_BOT_2.0\inventory_03.png') equipItems(inventory_ss, inventory_coord, "range")
def equipAncientSpell(): ancient_coord = RS.getAncientMagicStartPosition(WINDOWS_COORD) inventory_ss = Screenshot.shoot(ancient_coord[0], ancient_coord[1], ancient_coord[2], ancient_coord[3], "rgb") activeAncientMagic(inventory_ss,ancient_coord)
def equipSpecMenu(): Keyboard.press("spec") spec_coord = RS.getSpecPositon(WINDOWS_COORD) Mouse.win32Click(spec_coord[0] + Mouse.randCoord(140), spec_coord[1] + Mouse.randCoord(20))
def equipItemMenu(item_type): Keyboard.press("inventory") inventory_coord = RS.getInventoryStartPosition(WINDOWS_COORD) inventory_ss = Screenshot.shoot(inventory_coord[0], inventory_coord[1], inventory_coord[2], inventory_coord[3], "rgb") equipItems(inventory_ss,inventory_coord,item_type)
def equipPrayerMenu(prayer_type): # print "Range Prayer" Keyboard.press("prayer") prayer_coord = RS.getPrayerStartPosition(WINDOWS_COORD) prayer_ss = Screenshot.shoot(prayer_coord[0], prayer_coord[1], prayer_coord[2], prayer_coord[3], "rgb") activePrayer(prayer_ss, prayer_coord, prayer_type)
def setMainWindow(): # img = pyautogui.screenshot('ababa.png') img_rgb = cv2.imread(r'C:\Users\PPC\git\RS_BOT_2.0\asdfff.jpg') return RS.getFullPosition(img_rgb)
from core import Screenshot from core import Mouse from core import Match def setMainWindow(): # img = pyautogui.screenshot('ababa.png') img_rgb = cv2.imread(r'C:\Users\PPC\git\RS_BOT_2.0\asdfff.jpg') return RS.getFullPosition(img_rgb) if __name__ == '__main__': window_coord = setMainWindow() inventory_coord = RS.getPrayerStartPosition(window_coord) inventory_coord = RS.getInventoryStartPosition(window_coord) inventory_coord = RS.getTopMenuStartPosition(window_coord) inventory_coord = RS.getNormalMagicStartPosition(window_coord) inventory_coord = RS.getAncientMagicStartPosition(window_coord) inventory_coord = RS.getLunarMagicStartPosition(window_coord) inventory_coord = RS.getSpecPositon(window_coord) # print inventory_coord inventory_ss = Screenshot.shoot(inventory_coord[0], inventory_coord[1], inventory_coord[2], inventory_coord[3], "rgb") cv2.imwrite("asdfsdfsdffsd.png", inventory_ss) inventory_ss = cv2.imread(r'C:\Users\PPC\git\RS_BOT_2.0\asdfsdfsdffsd.png') # temp_list = RS.getAllPrayerPosition([0, 0, 0, 0]) # temp_list = RS.getInventoryStartPosition([0, 0, 0, 0]) # temp_list = RS.getAncientMagicMenuPosition([0, 0, 0, 0])