from sys import exit from yaspin import yaspin from yaspin.spinners import Spinners from prompt_toolkit import HTML, print_formatted_text from prompt_toolkit.styles import Style """ Register windows """ time.sleep(1) #wait for previoius process to finish str_buffer = "Detritus 3p Bot Running" sp = yaspin(text=str_buffer, spinner=Spinners.circleHalves) print = print_formatted_text # build a basic prompt_toolkit style for styling the HTML wrapped text style = Style.from_dict({'msg': '#71f076 bold', 'sub-msg': '#616161 italic'}) try: blader = wizAPI().register_window(nth=2) # Middle hitter = wizAPI().register_window(nth=1) # Furthest Left feinter = wizAPI().register_window(nth=0) # Furthest Right except IndexError: print( 'You need 3 wizard101 accounts to run this particular bot. 2 or less accounts detected' ) exit() """ compare x positions of windows to make sure 'hitter' is the farthest left, and 'feinter' is the farthest right, and 'blader' is middle """ if (hitter.get_window_rect()[0] > feinter.get_window_rect()[0]): # Switch them, if not hitter, feinter = feinter, hitter if (hitter.get_window_rect()[0] > blader.get_window_rect()[0]): hitter, blader = blader, hitter
from wizAPI import * import time import math """ Register windows """ try: hitter = wizAPI().register_window(nth=1) feinter = wizAPI().register_window(nth=0) except IndexError: print( 'You need 2 wizard101 accounts to run this particular bot. 1 or less accounts detected' ) exit() """ compare x positions of windows to make sure 'hitter' is the farthest left, and 'feinter' is the farthest right """ if (hitter.get_window_rect()[0] > feinter.get_window_rect()[0]): # Switch them, if not hitter, feinter = feinter, hitter def await_finished_loading(windows): for w in windows: while not w.is_DS_loading(): time.sleep(.2) for w in windows: while not w.is_idle(): time.sleep(.5) def print_separator(*args): sides = '+' * 16 _str = " ".join([sides, " ".join(args), sides])
from wizAPI import * import time from threading import Thread import sys print('Running: ' + str(sys.argv[0])) tester = wizAPI().register_window(nth=0) wx, wy = tester.get_window_rect()[:2] tester.grab_spell_pngs(str(sys.argv[1]))
from wizAPI import * import math player = wizAPI().register_window() def print_separator(*args): sides = '+'*16 _str = " ".join([sides, " ".join(args), sides]) l = len(_str) print('='*l) print(_str) print('='*l) def print_time(timer): minutes = math.floor(timer/60) seconds = math.floor(timer % 60) if minutes == 0: print('Round completed in {} seconds.'.format(seconds)) else: print('Round completed in {} minutes and {} seconds.'.format(minutes, seconds)) ROUND_COUNT = 0 while True: ROUND_COUNT += 1 START_TIME = time.time() print_separator('ROUND', str(ROUND_COUNT)) """ Check if we need to use a potion """