Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- from random import uniform, randint
- from keyboard import wait, send, add_hotkey
- from pyautogui import pixelMatchesColor, keyDown, keyUp, moveRel, position, click, alert, typewrite
- import threading
- fail_safe = 0
- shut_down = 0
- on_off = 0
- click_one = 1
- click_two = 1
- move_one = 1
- time_to_wait = uniform(0.12, 0.16)
- chat_sell = 0
- look_chance = 60#%
- move_chance = 50#%
- def toggle():
- global on_off
- global fail_safe
- first_cord, second_cord = position()
- if pixelMatchesColor(first_cord, second_cord, (0, 0, 0), tolerance=20) is True:
- fail_safe = 1
- print('STAY SAFE!')
- if pixelMatchesColor(first_cord, second_cord, (37, 0, 18), tolerance=10) is True:
- if on_off == 0:
- on_off = 1
- print('Script toggled OFF!')
- sleep(2)
- elif on_off == 1:
- on_off = 0
- print('Script toggled back ON!')
- sleep(2)
- else:
- return
- def chat():
- global chat_sell
- if on_off == 0:
- if chat_sell >= 500:
- send('.')
- typewrite(' /market Buying Lapis/blocks $3k, hay $600, BeetRoots $128, Normal Clay $225, Xp, selling Vote Crates all @ /as tp 52 !', interval=0.07)
- send('enter')
- chat_sell = 0
- chat_sell += 1
- print('AD: '+str(500-chat_sell))
- else:
- return
- def look():
- if on_off == 0:
- first_cord, second_cord = position()
- if pixelMatchesColor(first_cord, second_cord, (95, 95, 0), tolerance=20) is True or pixelMatchesColor(first_cord, second_cord, (148, 148, 0), tolerance=30) is True:
- moveRel(-50,0, duration=0.17)
- elif pixelMatchesColor(first_cord, second_cord, (0, 89, 0), tolerance=30) is True or pixelMatchesColor(first_cord, second_cord, (0, 45, 0), tolerance=30) is True:
- moveRel(40,0, duration=0.17)
- elif pixelMatchesColor(first_cord, second_cord, (46, 0, 93), tolerance=20) is True or pixelMatchesColor(first_cord, second_cord, (36, 0, 72), tolerance=20) is True:
- moveRel(-110,0, duration=0.17)
- elif pixelMatchesColor(first_cord, second_cord, (178, 89, 0), tolerance=20) is True or pixelMatchesColor(first_cord, second_cord, (197, 98, 0), tolerance=20) is True:
- moveRel(110,0, duration=0.17)
- else:
- return
- else:
- return
- def attack():
- global click_two
- global click_one
- if on_off == 0:
- first_cord, second_cord = position()
- if pixelMatchesColor(first_cord, second_cord, (186, 112, 186), tolerance=20) is True or pixelMatchesColor(first_cord, second_cord, (135, 81, 135), tolerance=30) is True:
- chance = randint(1, 100)
- if chance >= look_chance:
- #print('Hit Chance ='+ str(chance))
- if click_two == 1:
- click()
- moveRel(3,2, duration=0.1)
- click_two = 2
- else:
- if click_two == 2:
- click()
- moveRel(-3,-2, duration=0.1)
- click_two = 1
- elif click_one == 1:
- click()
- moveRel(-40,3, duration=0.17)
- click_one = 2
- else:
- if click_one == 2:
- click()
- moveRel(40,-3, duration=0.17)
- click_one = 1
- else:
- return
- else:
- return
- def move():
- global move_one
- if on_off == 0:
- first_cord, second_cord = position()
- if pixelMatchesColor(first_cord, second_cord, (169, 56, 93), tolerance=20) is True or pixelMatchesColor(first_cord, second_cord, (90, 18, 90), tolerance=30) is True or pixelMatchesColor(first_cord, second_cord, (203, 76, 127), tolerance=20) is True:
- chance = randint(1, 100)
- if chance >= move_chance:
- #print('Move Chance ='+ str(chance))
- if move_one == 1:
- keyDown('a')
- send('backspace')
- sleep(time_to_wait)
- keyUp('a')
- move_one = 2
- elif move_one == 2:
- keyDown('d')
- send('backspace')
- sleep(time_to_wait)
- keyUp('d')
- move_one = 1
- else:
- return
- else:
- return
- while fail_safe == 0:
- shut_down += 1
- toggle()
- #chat()
- look()
- attack()
- move()
- if shut_down > 669:
- fail_safe = 1
Add Comment
Please, Sign In to add comment