示例#1
0
def run():    
    RSX,RSY = RS.position()
    # Main stringer loop
    tries = 0 
    while True:
        if RS.isBankOpen():
            if tries == 2:
                print('Tries exausted, exiting!')
                #RS.logout()
                return 0
            #deposits all if inventory is not empty
            RS.depositAll()
            withdrawFromBank('/imgs/bowString.png')
            withdrawFromBank('/imgs/yewLongbowU.png')
            RS.closeBank()
            # starts stringing here 
            if checkInv(cwd+"/imgs/bowString.png") and checkInv(cwd+"/imgs/yewLongbowU.png"):
                makeBow()
                if RS.antiban('fletching'):
                    RandTime.randTime(11,0,0,11,9,9)
                else:
                    RandTime.randTime(15,0,0,15,9,9)
                #resets tries if items successfully found
                tries = 0
            else:
                RS.press_button('inventory')
                tries += 1
        else: 
         RS.open_cw_bank()
         RandTime.randTime(0,5,0,0,9,9)
示例#2
0
def run():
    RSX, RSY = RS.position()
    # Main stringer loop
    tries = 0
    while True:
        if RS.isBankOpen():
            if tries == 2:
                print('Tries exausted, exiting!')
                #RS.logout()
                return 0
            #deposits all if inventory is not empty
            RS.depositAll()
            withdrawFromBank('/imgs/bowString.png')
            withdrawFromBank('/imgs/yewLongbowU.png')
            RS.closeBank()
            # starts stringing here
            if checkInv(cwd + "/imgs/bowString.png") and checkInv(
                    cwd + "/imgs/yewLongbowU.png"):
                makeBow()
                if RS.antiban('fletching'):
                    RandTime.randTime(11, 0, 0, 11, 9, 9)
                else:
                    RandTime.randTime(15, 0, 0, 15, 9, 9)
                #resets tries if items successfully found
                tries = 0
            else:
                RS.press_button('inventory')
                tries += 1
        else:
            RS.open_cw_bank()
            RandTime.randTime(0, 5, 0, 0, 9, 9)
示例#3
0
def main(herb_object):
    # var to break out of loop after 3 bank tries
    bankchecking = 0
    n_secs = 1
    while True:
        if bankchecking == 5:
            break
        #open bank
        RS.open_cw_bank()

        #give time for window to open up
        time.sleep(1.2)

        #check if bank is open, if not end
        if not RS.isBankOpen():
            bankchecking +=1 
            n_secs = n_secs * bankchecking

            time.sleep(n_secs)
            continue

        # resets bankchecking
        bankchecking = 0
        #deposit all
        #if herb_object in inventory
        if not RS.isInvEmpty():
            RS.depositAll()
        
        #loop makes sure herbs are withdrawn!
        while True:
            try:
                herbx,herby = findherb(herb_object)
            except Exception as e:
                print('No more herbs')
                print(e)
                return
            Mouse.moveClick(herbx,herby,3)

            # removes RS coords since added back in in findOptionClick
            herbx -= RSX
            herby -= RSY
            RS.findOptionClick(herbx,herby,'withdrawAll')

            time.sleep(.9)
            randTime(0,0,0,0,0,9)
            # breaks when items are taken out into inventory
            if not RS.isInvEmpty():
                break
            else:
                # deposits all items from inventory
                x,y = Mouse.genCoords(RSX+13,RSY+60,RSX+500,RSY+352)
                Mouse.moveTo(x,y)

        #close bank
        RS.closeBank()
        find_grimmy_herbs_in_inventory(herb_object)
示例#4
0
def blow_glass(item, tool):
    rsx, rsy = RS.position()
    cwd = os.getcwd()

    # Main Loop starts here
    tries = 0
    while True:

        # Loop to withdraw knife and logs, and deposit and open bank
        RS.open_cw_bank()
        RandTime.randTime(0, 5, 0, 0, 9, 9)
        while True:
            if tries == 2:
                print(
                    'Maybe ran out of an item, or items not found!\nMoving on to stringing'
                )
                return 0
            #runs only if bank is open
            if RS.isBankOpen():
                RS.depositAll()
                withdraw_from_bank(tool, 'click')
                withdraw_from_bank(item, 'withdrawAll')
                RS.closeBank()

                if RS.countItemInInv(tool, 1):
                    n_logs = RS.countItemInInv(item)
                    if n_logs:
                        tries = 0
                        break
                    else:
                        print(tries)
                        #after the second try it breaks
                        tries += 1
            #Opens bank if it's not already opened
            else:
                RS.open_cw_bank()
                #gives time for bank detection to start
                RandTime.randTime(1, 0, 0, 1, 0, 9)
    #   #   #
    ########### Starts cutting logs ############
    # goes into a loop to make sure
    # logs are being cut
        while True:
            #Finds knife, cliks it
            find_template(tool, 'click')
            #   #   #
            #Finds First maple log, clicks it
            find_template(item, 'click')
            #   #   #
            #right cliks, make X, type 99
            RandTime.randTime(1, 0, 0, 1, 9, 9)
            moveToFletchingOptions(item)
            RandTime.randTime(3, 5, 0, 3, 9, 9)
            #   #   #
            #if RS.countItemInInv('yewLongbowU.png',1):
            #    break
            break
    #   #   #
    #waits 2 secs/log
        if n_logs > 6:
            n_logs = (n_logs * 2) - 7
        else:
            n_logs = (n_logs * 2)

        if RS.antiban('crafting'):
            n_logs -= 6
        RandTime.randTime(n_logs, 0, 0, n_logs, 9, 9)
示例#5
0
def blow_glass(item, tool):
    rsx,rsy = RS.position()
    cwd= os.getcwd()
    
    # Main Loop starts here
    tries = 0
    while True:

        # Loop to withdraw knife and logs, and deposit and open bank
        RS.open_cw_bank()
        RandTime.randTime(0,5,0,0,9,9)
        while True:
            if tries == 2:
                print('Maybe ran out of an item, or items not found!\nMoving on to stringing')
                return 0
            #runs only if bank is open
            if RS.isBankOpen():
                RS.depositAll()
                withdraw_from_bank(tool,'click') 
                withdraw_from_bank(item,'withdrawAll') 
                RS.closeBank()

                if RS.countItemInInv(tool,1):
                    n_logs = RS.countItemInInv(item)
                    if n_logs:
                        tries = 0
                        break
                    else:
                        print(tries)
                        #after the second try it breaks
                        tries += 1
            #Opens bank if it's not already opened
            else:
                RS.open_cw_bank()
                #gives time for bank detection to start
                RandTime.randTime(1,0,0,1,0,9)
    #   #   #  
        ########### Starts cutting logs ############
        # goes into a loop to make sure 
        # logs are being cut
        while True:
            #Finds knife, cliks it
            find_template(tool,'click')
    #   #   #
            #Finds First maple log, clicks it
            find_template(item,'click')
    #   #   #
            #right cliks, make X, type 99
            RandTime.randTime(1,0,0,1,9,9)
            moveToFletchingOptions(item)
            RandTime.randTime(3,5,0,3,9,9)
    #   #   #
            #if RS.countItemInInv('yewLongbowU.png',1):
            #    break
            break
    #   #   # 
        #waits 2 secs/log 
        if n_logs > 6:
            n_logs = (n_logs*2) - 7
        else:
            n_logs = (n_logs*2)

        if RS.antiban('crafting'):
            n_logs -= 6
        RandTime.randTime(n_logs,0,0,n_logs,9,9)
示例#6
0
from modules import RS
from modules import Minimap
from modules import RandTime
import cv2
import numpy as np

furnance_hsv_values = ([11,135,91],[12,139,99])
# loop make sure bank is opened
while 1:
    # finds and clicks on bank booth window
    if RS.find_bank_booth():
        # loop waits till bank is open
        while 1:
            if RS.isBankOpen():
                break
            RandTime.randTime(0,0,0,0,9,9)
        # Close bank and loop
        RS.depositAll()
        RS.closeBank()
        break
    else:
        # Try to find Bank on Minimap
        Minimap.findBankIcon()


示例#7
0
from modules import RS
from modules import Minimap
from modules import RandTime
import cv2
import numpy as np

furnance_hsv_values = ([11, 135, 91], [12, 139, 99])
# loop make sure bank is opened
while 1:
    # finds and clicks on bank booth window
    if RS.find_bank_booth():
        # loop waits till bank is open
        while 1:
            if RS.isBankOpen():
                break
            RandTime.randTime(0, 0, 0, 0, 9, 9)
        # Close bank and loop
        RS.depositAll()
        RS.closeBank()
        break
    else:
        # Try to find Bank on Minimap
        Minimap.findBankIcon()