├── README.md ├── mine.py ├── bank.py └── nmz.py /README.md: -------------------------------------------------------------------------------- 1 | # NMZ-Script 2 | NMZ Bot for AFK Training Combat Skills in OSRS 3 | 4 | This trusty glorified auto clicker has maxed out 4 separate accounts to 99 attack/def/strength/hp/magic/ranged in NMZ! 0 bans 5 | -------------------------------------------------------------------------------- /mine.py: -------------------------------------------------------------------------------- 1 | import pyautogui 2 | import random 3 | import time 4 | import sys 5 | 6 | ''' 7 | Mines the three iron ore rocks at the tzarr mine. 8 | To set up, run to the mining spot, click north, rotate camera all the way vertical 9 | then zoom in all the way. Use runelite and center using spectacle on left side 10 | of macbook. 11 | ''' 12 | 13 | # FOR FINDING COORDS ON SCREEN 14 | # try: 15 | # while True: 16 | # x, y = pyautogui.position() 17 | # positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4) 18 | # print(positionStr) 19 | # print('\b' * (len(positionStr) + 2)) 20 | # sys.stdout.flush() 21 | # except KeyboardInterrupt: 22 | # print('\n') 23 | 24 | # top, middle, bot (x, y) 25 | # point north, all the way in and camera vert. 26 | 27 | 28 | MINE_COORDS = [ 29 | [[245, 305], [270, 320]], 30 | [[350, 400], [390, 430]], 31 | [[245, 305], [490, 540]] 32 | ] 33 | 34 | # x, y 35 | INV_SLOTS = [ 36 | [580, 452], 37 | [625, 452], 38 | [668, 452], 39 | [710, 452], 40 | [710, 489], 41 | [668, 489], 42 | [625, 489], 43 | [580, 489], 44 | [580, 524], 45 | [625, 524], 46 | [668, 524], 47 | [710, 524], 48 | [710, 561], 49 | [668, 561], 50 | [625, 561], 51 | [580, 561], 52 | [580, 597], 53 | [625, 597], 54 | [668, 597], 55 | [710, 597], 56 | [710, 633], 57 | [668, 633], 58 | [625, 633], 59 | [580, 633], 60 | [580, 669], 61 | [625, 669], 62 | [668, 669], 63 | [710, 669], 64 | ] 65 | 66 | count = 0 67 | try: 68 | while True: 69 | if count == 28: 70 | count = 0 71 | pyautogui.keyDown('shift') 72 | time.sleep(random.uniform(0.15, 0.25)) 73 | for coords in INV_SLOTS: 74 | x, y = coords[0], coords[1] 75 | x_coord = random.randint(x-5, x+5) 76 | y_coord = random.randint(y-5, y+5) 77 | 78 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.15, 0.3)) 79 | pyautogui.click() 80 | time.sleep(random.uniform(0.15, 0.25)) 81 | 82 | pyautogui.keyUp('shift') 83 | 84 | 85 | for coords in MINE_COORDS: 86 | if count == 28: 87 | break 88 | 89 | x, y = coords[0], coords[1] 90 | x_coord = random.randint(x[0], x[1]) 91 | y_coord = random.randint(y[0], y[1]) 92 | 93 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.2, 0.4)) 94 | pyautogui.click() 95 | time.sleep(random.uniform(2.7, 3.2)) 96 | 97 | count += 1 98 | 99 | except (KeyboardInterrupt, SystemExit): 100 | sys.exit(0) 101 | -------------------------------------------------------------------------------- /bank.py: -------------------------------------------------------------------------------- 1 | import pyautogui 2 | import random 3 | import time 4 | import sys 5 | 6 | ''' 7 | Bankstand skills at lumby chest. Use OpenRS, cam north, 8 | vertical camera all the way and zoom in all the way. 9 | ''' 10 | 11 | # FOR FINDING COORDS ON SCREEN 12 | # try: 13 | # while True: 14 | # x, y = pyautogui.position() 15 | # positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4) 16 | # print(positionStr) 17 | # print('\b' * (len(positionStr) + 2)) 18 | # sys.stdout.flush() 19 | # except KeyboardInterrupt: 20 | # print('\n') 21 | 22 | # top, middle, bot (x, y) 23 | # point north, all the way in and camera vert. 24 | 25 | try: 26 | while True: 27 | # REPLACE ME: click wine coords 28 | x, y = 625, 564 29 | x_coord = random.randint(x-4, x+4) 30 | y_coord = random.randint(y-4, y+4) 31 | 32 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 33 | pyautogui.click() 34 | time.sleep(random.uniform(0.15, 0.25)) 35 | 36 | # REPLACE ME: click jug coords (uses on wine) 37 | x, y = 667, 564 38 | x_coord = random.randint(x-4, x+4) 39 | y_coord = random.randint(y-4, y+4) 40 | 41 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 42 | pyautogui.click() 43 | time.sleep(random.uniform(0.5, 0.8)) 44 | 45 | pyautogui.press('space') 46 | time.sleep(random.uniform(18, 20.5)) 47 | 48 | # REPLACE ME: click bank chest coords (not in bank interface) 49 | x, y = 667, 564 50 | x_coord = random.randint(x-4, x+4) 51 | y_coord = random.randint(y-4, y+4) 52 | 53 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 54 | pyautogui.click() 55 | time.sleep(random.uniform(1.5, 2)) 56 | 57 | # REPLACE ME: click deposit all button (in bank interface) 58 | x, y = 450, 536 59 | x_coord = random.randint(x-4, x+4) 60 | y_coord = random.randint(y-4, y+4) 61 | 62 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 63 | pyautogui.click() 64 | time.sleep(random.uniform(0.5, 0.8)) 65 | 66 | # REPLACE ME: withdraw wines (in bank interface) 67 | x, y = 380, 431 68 | x_coord = random.randint(x-4, x+4) 69 | y_coord = random.randint(y-4, y+4) 70 | 71 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 72 | pyautogui.click() 73 | time.sleep(random.uniform(0.15, 0.25)) 74 | 75 | # REPLACE ME: withdraw jugs (in bank interface) 76 | x, y = 428, 431 77 | x_coord = random.randint(x-4, x+4) 78 | y_coord = random.randint(y-4, y+4) 79 | 80 | pyautogui.moveTo(x_coord, y_coord, random.uniform(0.3, 0.5)) 81 | pyautogui.click() 82 | time.sleep(random.uniform(0.5, 0.8)) 83 | 84 | pyautogui.press('esc') 85 | 86 | except (KeyboardInterrupt, SystemExit): 87 | sys.exit(0) 88 | -------------------------------------------------------------------------------- /nmz.py: -------------------------------------------------------------------------------- 1 | """Old School Runescape NMZ Training Bot 2 | 3 | Written by Cole Boothman, April 2018 (Updated April 2020) 4 | 5 | UPDATE APRIL 2020: This is a bot for AFK training in NMZ for OSRS. 6 | The bot will flick your hp prayer, drink pots and absorbs pots. 7 | 8 | To run: 9 | - needs to be configured for each computer. Uncomment the coordinate section 10 | and fill in the coordinates by using the center of each icon in OSRS that 11 | is needed. (quick pray icon and inv slots) 12 | 13 | - make sure you set the threshold for combat pots repot time, and absorbs. 14 | for absorbs, time the amount of time it takes for the monsters to drain 1 15 | dose of absorb pot and use that as a reference (add like 5-10 secs extra). 16 | 17 | - boot up Runelite, and make sure you snap the window and always run it in 18 | this place on the screen, since the coordinates will rely on this. 19 | 20 | - go in nmz, rock cake to 1hp, then run the script. 21 | 22 | The absorb pots randomly wait between 1-4 'thresholds' that you've set and 23 | will drink the proper amount of doses associated with the threshold multipler. 24 | 25 | Enjoy! 26 | """ 27 | import pyautogui as auto 28 | import sys 29 | import random 30 | import time 31 | 32 | # We assume that we are taking in 5 super combat pots, 33 | # in the first row/left first spot of second 34 | POTS = [ 35 | {'coords': [582, 451], 'doses': 4}, 36 | {'coords': [624, 451], 'doses': 4}, 37 | {'coords': [666, 451], 'doses': 4}, 38 | {'coords': [708, 451], 'doses': 4}, 39 | {'coords': [582, 491], 'doses': 4} 40 | ] 41 | 42 | ABSORBS = [ 43 | {'coords': [582, 451], 'doses': 4}, 44 | {'coords': [624, 451], 'doses': 4}, 45 | {'coords': [666, 451], 'doses': 4}, 46 | {'coords': [708, 451], 'doses': 4}, 47 | {'coords': [582, 451], 'doses': 4}, 48 | {'coords': [624, 451], 'doses': 4}, 49 | {'coords': [666, 451], 'doses': 4}, 50 | {'coords': [708, 451], 'doses': 4}, 51 | {'coords': [582, 451], 'doses': 4}, 52 | {'coords': [624, 451], 'doses': 4}, 53 | {'coords': [666, 451], 'doses': 4}, 54 | {'coords': [708, 451], 'doses': 4}, 55 | {'coords': [582, 451], 'doses': 4}, 56 | {'coords': [624, 451], 'doses': 4}, 57 | {'coords': [666, 451], 'doses': 4}, 58 | {'coords': [708, 451], 'doses': 4}, 59 | {'coords': [582, 451], 'doses': 4}, 60 | {'coords': [624, 451], 'doses': 4}, 61 | {'coords': [666, 451], 'doses': 4}, 62 | {'coords': [708, 451], 'doses': 4}, 63 | ] 64 | 65 | # Use the prayer orb 66 | HP_X = [550, 567] 67 | HP_Y = [305, 315] 68 | 69 | # FOR FINDING COORDS ON SCREEN 70 | # try: 71 | # while True: 72 | # x, y = auto.position() 73 | # positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4) 74 | # print(positionStr), 75 | # print('\b' * (len(positionStr) + 2)), 76 | # sys.stdout.flush() 77 | # except KeyboardInterrupt: 78 | # print('\n') 79 | 80 | def flash_prayorb(): 81 | # Weird behaviour with using the auto.click=(clicks=2) but below works. 82 | auto.moveTo(random.randint(HP_X[0], HP_X[1]), random.randint(HP_Y[0], HP_Y[1]), 0.5) 83 | auto.click() 84 | time.sleep(random.uniform(0.3, 0.6)) 85 | auto.click() 86 | 87 | def drink_pots(): 88 | for pot in POTS: 89 | # If still doses in this pot, drink. If not check next 90 | if pot['doses'] > 0: 91 | x, y = pot['coords'][0], pot['coords'][1] 92 | auto.moveTo(random.randint(x-4, x+4), random.randint(y-4, y+5), 0.5) 93 | auto.click() 94 | pot['doses'] -= 1 95 | break 96 | 97 | def drink_absorbs(doses): 98 | for _ in range(doses): 99 | for pot in ABSORBS: 100 | # If still doses in this pot, drink. If not check next 101 | if pot['doses'] > 0: 102 | x, y = pot['coords'][0], pot['coords'][1] 103 | auto.moveTo(random.randint(x-4, x+4), random.randint(y-4, y+5), 0.5) 104 | auto.click() 105 | pot['doses'] -= 1 106 | time.sleep(random.uniform(1.5, 2.2)) 107 | break 108 | 109 | def main(): 110 | print('Press Ctrl-C to quit.') 111 | 112 | # Initial reset of HP to start program 113 | flash_prayorb() 114 | drink_pots() 115 | 116 | # threshold time for repotting (seconds) & one dose of absorb used 117 | repot_threshold, absorb_threshold = 600, 200 118 | # random 'multiplier' for how long to wait before drinking absorbs 119 | # (multiplier * threshold) and obviously the num doses (1 * multiplier) 120 | absorb_threshold_multiplier = random.randint(1, 4) 121 | 122 | repot_start_time = time.time() 123 | absorb_start_time = time.time() 124 | drank_pots = False 125 | 126 | try: 127 | while True: 128 | # hp resets every min, so we reset every 45-50 seconds. 129 | # If we drank pots (mainly absorbs) that'll take some time... so reset faster 130 | time.sleep(random.randint(35, 40)) if drank_pots else time.sleep(random.randint(45, 50)) 131 | flash_prayorb() 132 | drank_pots = False 133 | 134 | # check to see if we need to repot. 135 | if (time.time() - repot_start_time) > repot_threshold: 136 | drink_pots() 137 | repot_start_time, drank_pots = time.time(), True 138 | 139 | # check to see if we need to drink absorbs. 140 | if (time.time() - absorb_start_time) > (absorb_threshold * absorb_threshold_multiplier): 141 | drink_absorbs(absorb_threshold_multiplier) 142 | absorb_start_time, absorb_threshold_multiplier = time.time(), random.randint(1, 4) 143 | drank_pots = True 144 | 145 | # if we drank a pot, move back to prayer orb 146 | if drank_pots: 147 | auto.moveTo(random.randint(HP_X[0], HP_X[1]), random.randint(HP_Y[0], HP_Y[1]), 0.5) 148 | 149 | except (KeyboardInterrupt, SystemExit): 150 | sys.exit(0) 151 | 152 | 153 | if __name__ == "__main__": 154 | main() 155 | --------------------------------------------------------------------------------