示例#1
0
def main():
    while 1:
        # check health
        if Health.percentage() <= 0.20:
            print(Health.percentage())
            print("Low on Health!\nStopping!!")
            return
        # initial count of inventory
        n_items_in_inventory = RS.inventory_counter()
        # stops if inv full
        if n_items_in_inventory >= 28:
            print("Inventory Full\nScript stopped!")
            # drop items here, then continue script
            RS.inventory_counter(showImg)

            return
        # pickpockets guard
        find_ham_guard()
        # loop to wait while confuse
        #RandTime.randTime(0,4,0,0,8,9)
        RandTime.randTime(0, 0, 1, 0, 0, 9)
        if RS.inventory_counter() > n_items_in_inventory:
            continue
        else:
            while 1:
                if find_yellow_birds():
                    # waits for confuse to stop to loop
                    while find_yellow_birds():
                        pass
                else:
                    break
示例#2
0
def main():
    item_n = RS.inventory_counter()
    print("Current itme number is:{}".format(item_n))
    while 1:
        if item_n == 28:
            break
        try:
            #mines the ore
            find_mine()
        except:
            RandTime.randTime(1, 0, 0, 1, 0, 9)
            continue

        # waits for obtained ore to move on
        safe_counter = 0  #if reaches a X amount safe switches
        while 1:
            current_n_items = RS.inventory_counter()
            # counts to make sure +1 has been added to inv
            if item_n + 1 == current_n_items:
                item_n = current_n_items
                break
            else:
                if safe_counter >= 45:
                    break
                RandTime.randTime(0, 1, 0, 0, 9, 9)
                safe_counter += 1
                continue

    print("Full Inv")
示例#3
0
文件: miner.py 项目: jjvilm/osrmacro
def main():
    item_n = RS.inventory_counter()
    print("Current itme number is:{}".format(item_n))
    while 1:
        if item_n == 28:
            break
        try:
            #mines the ore
            find_mine()
        except:
            RandTime.randTime(1,0,0,1,0,9)
            continue

        # waits for obtained ore to move on
        safe_counter = 0 #if reaches a X amount safe switches
        while 1:
            current_n_items = RS.inventory_counter()
            # counts to make sure +1 has been added to inv
            if item_n + 1 == current_n_items:
                item_n = current_n_items
                break
            else:
                if safe_counter >=45:
                    break
                RandTime.randTime(0,1,0,0,9,9)
                safe_counter += 1
                continue

    print("Full Inv")
示例#4
0
def main():
    while 1:
        # check health
        if Health.percentage() <= 0.20:
            print(Health.percentage())
            print("Low on Health!\nStopping!!")
            return
        # initial count of inventory
        n_items_in_inventory = RS.inventory_counter()
        # stops if inv full
        if n_items_in_inventory >= 28:
            print("Inventory Full\nScript stopped!")
            # drop items here, then continue script
            RS.inventory_counter(showImg)

            return
        # pickpockets guard
        find_ham_guard()
        # loop to wait while confuse
        #RandTime.randTime(0,4,0,0,8,9)
        RandTime.randTime(0,0,1,0,0,9)
        if RS.inventory_counter() > n_items_in_inventory:
            continue
        else:
            while 1:
                if find_yellow_birds():
                    # waits for confuse to stop to loop
                    while find_yellow_birds():
                        pass
                else:
                    break
示例#5
0
def main():
    # runs main loop
    # gets initial count of inventory items
    item_n = RS.inventory_counter()
    while 1:
        # stops when inventory is full
        if item_n == 28:
            RS.play_sound()
            break
        try:
            # keeps mining
            cx, cy, = find_motherload_mine()
            #check_mine_availability(cx,cy)

        except:
            # slows down the loop by ~second
            RandTime.randTime(1, 0, 0, 1, 9, 9)
            continue
        # waits for obtained ore to restart loop
        item_n = RS.inventory_counter()

        times_till_break = 0
        while 1:
            # safety measure to make sure it does not get stuck counting inventory
            if times_till_break == 3:
                print('Escaping inventory loop')
                times_till_break = 0
                break
            current_n_items = RS.inventory_counter()
            # counts to make sure +1 has been added to inv
            if current_n_items >= item_n + 1:
                item_n = current_n_items
                RandTime.randTime(4, 0, 0, 7, 9, 9)
                break
            else:
                times_till_break += 1
                RandTime.randTime(7, 0, 0, 15, 9, 9)
                continue
示例#6
0
def main():
    while RS.inventory_counter() <28:
        findWine()
        RandTime.randTime(1,0,0,2,9,9)
示例#7
0
        #RS.findOptionClick(x,y,'drop')

    RandTime.randTime(2, 0, 0, 2, 9, 9)


def gen_coords(pt, btmX, btmY):
    """Generates random coords of where to click once a template is found inside the bag screenshot"""
    x1 = pt[0] + (bag_coord[0][0] + 1
                  )  #gets top-left location of able to be right clicked
    y1 = pt[1] + (bag_coord[0][1] + 1)

    x2 = btmX + (bag_coord[0][0] - 1
                 )  #bttm-right location able to be right clicked
    y2 = btmY + (bag_coord[0][1] - 1)

    within_x = random.randint(x1,
                              x2)  #generates a range of clickable locations
    within_y = random.randint(y1, y2)
    return within_x, within_y


if __name__ == '__main__':
    #item_to_drop = raw_input("Item name to drop:\n")
    item_to_drop = 'salmon'
    while 1:
        if RS.inventory_counter() >= 28:
            find_template(item_to_drop)
        else:
            time.sleep(3)