├── Air_Craft.py
├── Earth_Craft.py
├── Fire_craft.py
├── README.md
├── Sketch_Arduino_leon_Mouse.ino
├── app_icon_sly.ico
├── archive
├── api_dax_walker.py
├── osrs_path_walker_dax.py
├── test_functions.py
└── test_postition.py
├── arduinoMouse.py
├── clay_beginner_money_maker.py
├── combat.py
├── config_generator.py
├── cooking.py
├── core.py
├── crafting.py
├── feather_trade.py
├── fishing.py
├── fletching.py
├── functions.py
├── herblore.py
├── images
├── Congrats_flag.png
├── Earth_alter_mark1.png
├── activity_adviser.png
├── air_craft_bank.png
├── air_craft_mark_1.png
├── air_craft_mark_2.png
├── air_craft_mark_3.png
├── air_craft_mark_4.png
├── air_craft_mark_5.png
├── air_craft_mark_6.png
├── air_craft_mark_7.png
├── air_craft_mark_8.png
├── air_craft_mark_9.png
├── alkarid_fishspot_step_1.png
├── alkarid_fishspot_step_2.png
├── alkarid_fishspot_step_3.png
├── anch_cooked.png
├── anch_fish.png
├── angler_fish.png
├── apple_fruit.png
├── bait_pack.png
├── banana_fruit.png
├── bank_deposit.png
├── bank_deposit_box.png
├── bank_mark2.png
├── bank_mark3.png
├── bank_mark4.png
├── bear_pie.png
├── bones_icon.png
├── bronze_axe.png
├── bronze_bar.png
├── bronze_nails.png
├── bronze_scimitar.png
├── bronze_wire.png
├── bucket.png
├── check_inv_result.png
├── chisel.png
├── chompy_pie.png
├── clay_deposit_spot1.png
├── clay_deposit_spot2.png
├── clay_deposit_spot3 .png
├── clay_deposit_spot3.png
├── clay_deposit_spot4.png
├── clay_deposit_spot5.png
├── clay_ore.png
├── clue_nest.png
├── coal_ore.PNG
├── cooking_xp.png
├── cooking_xp2.png
├── cooking_xp3.png
├── copper_ore.png
├── diamond_icon.png
├── director_tutorial.png
├── draynor_bank_spot.png
├── earth_mark2.png
├── earthalter_mark1.png
├── edgeville_spot.png
├── exp_fruit.png
├── feather_pack.png
├── fire_craft_bank.png
├── fire_craft_mark_1.png
├── fire_craft_mark_2.png
├── fire_craft_mark_3.png
├── fire_craft_mark_4.png
├── fire_craft_mark_5.png
├── fire_craft_mark_6.png
├── fire_craft_runealter.png
├── firemaking_xp.png
├── firemaking_xp2.png
├── firespot_draynor_oak.png
├── firespot_draynor_willow.png
├── firespot_draynor_wood.png
├── firespot_farador_oak.png
├── firespot_lumbridge_wood.png
├── firespot_varrock_wood.png
├── gem_icon.png
├── gem_icon2.png
├── geo_icon.png
├── gerrant_shop.PNG
├── gold_bar.png
├── grape.png
├── greenberry_fruit.png
├── guam_grime.png
├── guam_icon.png
├── harra_grime.png
├── harra_icon.png
├── img_grid.png
├── inventory_enabled.png
├── inventshot.png
├── iron_axe.png
├── iron_bar.png
├── iron_dart_tips.png
├── iron_ore.png
├── iron_scimitar.png
├── item-images.zip
├── knife.png
├── lemon_fruit.png
├── lime_fruit.png
├── lobster_fish.png
├── magic_longbow.PNG
├── make_craft.png
├── make_herb.png
├── make_how.png
├── make_string.png
├── maple_icon.png
├── maple_longbow.png
├── marre_grime.png
├── marre_icon.png
├── miner_img.png
├── mini_map.png
├── money_bag_2.png
├── oak_icon.png
├── oak_longbow.png
├── osrs_title_2.png
├── papyaya_fruit.png
├── pie_shell.png
├── pineapple_fruit.png
├── port_sarim_jewl.png
├── port_sarim_spot_water.png
├── prawn_burnt.png
├── prawn_cooked.png
├── prawn_fish.png
├── purple_fruit.png
├── ranarr_grime.png
├── ranarr_icon.png
├── raw_bear.png
├── raw_chompy.png
├── raw_rabbit.png
├── rim_mine_spot1.png
├── rim_mine_spot2.png
├── ruby_icon.png
├── rune_icon.png
├── runeshot.png
├── salmon_cooked.png
├── salmon_fish.png
├── sapphire_icon.png
├── sapphire_ring.png
├── screen_resize.png
├── screenshot2.png
├── sea_puzzle.png
├── shark.png
├── snap_grime.png
├── snap_icon.png
├── steel_axe.png
├── steel_bar.png
├── steel_chainbody.png
├── steel_scimitar.png
├── strawberry_fruit.png
├── stringbow_icon.png
├── superheat_cast.png
├── switch-off.png
├── switch-on.png
├── tar_grime.png
├── tar_icon.png
├── tea_icon.png
├── test_mm.png
├── textshot.png
├── thieving.png
├── tin_ore.png
├── tinderbox.png
├── toad_grime.png
├── toad_icon.png
├── trout_cooked.png
├── trout_fish.png
├── tynan_shop.png
├── vial_water.png
├── waterjug.png
├── willow_icon.png
├── wood_icon.png
├── woodcutting_xp.png
└── xp_gain.png
├── jar files
├── httpplug-1.0.3.jar
├── shortestagility-5.0.2.jar
└── slyminimap-1.0.0.jar
├── location.json
├── magic.py
├── miner.py
├── osrs_item_prices.py
├── osrs_return_data_status.py
├── osrs_walker.py
├── prayer.py
├── pybot-config.yaml
├── read_path.py
├── requirements.txt
├── server.py
├── slyautomation_title.py
├── smithing.py
├── thieving.py
└── woodcutting.py
/README.md:
--------------------------------------------------------------------------------
1 | # Old School Botting Functions
2 |
3 | Full tutorial on creating Functions for automation using Python for osrs botting.
4 | The example used will be woodcutting, where the script will use colour detection using opencv and use pyautogui to move the mouse, click and use the keyboard to drop items using an image recognition module that will detect the wood icons in the inventory.
5 |
6 | Consider donating if you found the project fun and learnt more about python: https://www.buymeacoffee.com/slyautomatG
7 |
8 | Other python files will also use tesseract-OCR to detect text within images using tesseract-OCR image to text recognition functions.
9 |
10 | Need help with installing python, pycharm and cloning a repo? read this article for help: https://www.slyautomation.com/blog/install-pycharm-and-python-clone-a-github-project/
11 |
12 | ## Setup
13 |
14 | ```diff
15 | Note: PC Monitor settings - change resolution to 1920x1080 panel and text of apps was set to 100%.
16 | ```
17 | Right click and select Display Settings
18 |
19 | 
20 |
21 | In the Scale And Layout section - Change size of text to 100% and Set Display Resolution to 1920 x 1080 for best results.
22 |
23 | 
24 |
25 |
26 | ### Installing Pycharm
27 | pycharm
28 |
29 | pycharm windows
30 |
31 | How to Install Pycharm
32 |
33 | How to add Project with Pycharm
34 |
35 | Editing how to ensure venv (virtual environment) is active
36 |
37 | ## core.py and function.py
38 | For the full video tutorial click link: https://www.youtube.com/watch?v=C7ZY4KYpFII
39 |
40 | This video is more about how it was created at the start core.py is how to make the python script focus on the old school runescape application and adjust the window size so all the scripts run as intended. Then functions.py is where all the different kinds of shortcut functions are placed to reference the mini map, or a piece of code to do color detection or open the inventory.
41 |
42 | ## Quick module install Steps
43 |
44 | in terminal type:
45 |
46 | pip install -r requirements.txt
47 |
48 | tesseract-ocr = https://digi.bib.uni-mannheim.de/tesseract/?C=M;O=D
49 |
50 | if that website is down use 5.3: https://drive.google.com/file/d/1acZJSm3BEmCORSB4NDmpaaT5WC1FNu2s/view?usp=sharing
51 |
52 | or use original version 3.0.2: https://drive.google.com/file/d/1mCgYueVKRVbPg-ICz8BjrAWH5oOLjp55/view?usp=sharing
53 |
54 | Tutorial on installing tesseract-OCR: https://youtube.com/watch?v=X3snnwzJfEw&t=25m15s
55 |
56 | ## Runelite Setup
57 | Tutorial on runelite setup click link: https://youtube.com/watch?v=JO2FvkJwppA
58 |
59 | Also make sure that the transparent side panels and chatbox is unchecked:
60 |
61 | 
62 |
63 | Make sure the tool bar is enabled and showing on the right had side of the client window (press the arrow to enable the toolbar as visable):
64 |
65 | 
66 |
67 |
68 | ### pybot-config.yaml (configuration file)
69 |
70 | 
71 |
72 | client_title: Is the title of the application window usually Runelite if you have completed the steps for the Runelite Setup, if not then enter RuneLite - username or OpenOSRS
73 |
74 | 
75 |
76 | 
77 |
78 | To disable the username in the client window using the toolbar search for runelite plugin and in the settings make sure 'Show display name title' is unchecked.
79 |
80 | 
81 |
82 | enable_on_start: if you don't want the config window to pop up each time, enter as false
83 |
84 | file_path_to_client: the head folder where the OSRS client is stored usually .runelite or .openosrs
85 |
86 | pc_profile: is the user profile of the pc so it can find runelite or openosrs
87 |
88 | 
89 |
90 | tesseract_path: Is the folder address to tesseract-ocr program
91 |
92 | 
93 |
94 | ```diff
95 | - Note: copy the format below make sure to include the slashes (\).
96 | ```
97 | 
98 |
99 | In Runescape setting, set the following:
100 |
101 | - Ideally under display, enable hide roofs, camera zoom, screen brightness matching below.
102 |
103 | 
104 |
105 | - Under controls, enable shift click to drop items, and set inventory shortcut to ESC keystroke.
106 |
107 | 
108 |
109 | - Under Interfaces ensure Game Client layout is Resizable - Modern Layout
110 | - Show data orbs enabled
111 |
112 | 
113 |
114 | Make sure the info boxes are filled and the standard brown color, use the toolbar and search Runelite. In the settings under overlay section select the 'Overlay color'.
115 |
116 | Change Interface font to 'Bold'.
117 | Change Infobox font to 'Bold'.
118 | Change opacity to 255 and the hex color to #FF463D32:
119 |
120 | 
121 |
122 |
123 | ## Woodcutting
124 |
125 | ### features
126 |
127 | Cuts woods and makes fire
128 | - Use object marker plugin to highlight trees red, green or yellow.
129 | - Make sure to have an axe equipped and a tinderbox if firemaking.
130 |
131 | - Turn on woodcutting plugin
132 | - Turn off Show weight in item stats
133 | Tutorial on firemaking code click link: https://youtu.be/bHZCQUChG_k
134 |
135 | 
136 |
137 | - Pick a object marker color, a wood type and how long in hours to run for
138 |
139 | 
140 |
141 | ## fishing.py
142 | - Turn on fishing plugin.
143 | - Make sure to have net for prawn fishing or a rod and bait/feathers for fish.
144 | Tutorial on fishing code click link: https://youtube.com/watch?v=5K-nMy9Pdvg
145 |
146 |
147 | ## mining.py
148 | - Turn on mining plugin.
149 | - Mark ore spots using the object marker to green.
150 |
151 | 
152 |
153 | - Make sure to equip a pick axe.
154 |
155 | - enter the ore type, the marker color and how long to run in hours (Change Run_Duration_hours)
156 | 
157 |
158 | 
159 |
160 | Tutorial on mining code click link: https://youtube.com/watch?v=dkD5gXcgQYI
161 |
162 |
163 | ## combat.py
164 | - Turn on NPC Indicators plugin and Opponent Information plugin
165 | - Change Highlight colour to #ff00ffff
166 |
167 | 
168 |
169 | - Hold Shift and Right Click on NPC/Mob and select Tag-All
170 |
171 | 
172 |
173 | - In the Combat script change the first value to the NPC/Mob name
174 | - Change Run_duraction_hours to the number of hours to run script for
175 |
176 | 
177 |
178 | - To add or use a NPC/Mob not on the list add it to the monster_array as ['each iteration captured by the combat_text'] and add to monster_list the name
179 |
180 | 
181 |
182 | Tutorial on combat code click link: https://youtube.com/watch?v=llGbhVfU1Bc
183 |
184 | ## thieving.py
185 |
186 | ### steal_man() Works with Knights, Goblins and Thieves etc.
187 |
188 | - Turn on NPC Indicators plugin
189 | - Change Highlight colour to #ff00ffff
190 | - Hold Shift and Right Click on NPC/Mob and select Tag etc.
191 |
192 | 
193 |
194 | - Make sure pickpocket will be actioned on left click (some npcs even on always right click have 'talk to' as left click option)
195 |
196 | 
197 |
198 | - To stop script hold down the capslock key
199 |
200 | ### Improvements to add
201 | - Stop or eat when health is low (warning this does not stop when health is low)
202 |
203 | ### steal_tea()
204 |
205 | - Hold shift and mark object Tea Stall (Make sure the color is red)
206 |
207 | 
208 |
209 | 
210 |
211 | ## Clay Money Maker
212 | This only works at the Rimmington mine and banks at Port Sarim deposit box.
213 | - Turn on mining plugin.
214 | - Make sure to equip a pick axe.
215 | - The Start location when running the clay_beginner_money_maker.py is at the Rimmington Mine start next to the clay deposits
216 |
217 | 
218 | ```diff
219 | - IMPORTANT! Set compass directly north, click the on the compass to reset straight.
220 | Otherwise the walker from deposit box to rimmington mine won't work.
221 | ```
222 | 
223 |
224 | - Mark clay spots next to the east fence line using the object marker to green (optional are red or amber).
225 |
226 | 
227 |
228 | 
229 |
230 | - Mark the deposit box at Port Sarim using the object marker to red.
231 |
232 | 
233 |
234 | This is the path that is takes:
235 |
236 | 
237 |
238 | Make sure to select the color that you highlighted the clay ores and set the Run Duration to the number of hours:
239 |
240 | 
241 |
242 |
243 | ## smithing.py
244 |
245 | Tutorial on smithing code click link: https://youtube.com/watch?v=YezEeVjoP6o
246 |
247 | ## magic.py
248 |
249 | ### features
250 |
251 | High alching
252 |
253 | Superheat item
254 |
255 | Tutorial on magic code click link: https://youtube.com/watch?v=Vyhy2CpfK7I
256 |
257 | ## osrs_walker.py
258 |
259 | Tutorial: TBA
260 |
261 | - Located in jar_files: Add httpplug-1.0.3.jar to C:\Users\ \.openosrs \plugins
262 | - Located in jar_files: Add shortestagility-5.0.2.jar to C:\Users\ \.openosrs \plugins
263 |
264 | 
265 |
266 | ### Setup
267 | - Create txt file on desktop paths.txt, the modified plugin shortestagility-5.0.2.jar saves the coordinates when a path target is made in osrs.
268 | - 
269 | - 
270 | - 
271 |
272 | - Use main map and right click then select 'set target', run server.py and then run osrs_walker.py.
273 | - 
274 |
275 | ## Troubleshooting
276 |
277 | python venv/Scripts/pywin32_postinstall.py -install
278 |
279 | ## Wiki
280 | [Wiki page on function descriptions and purpose](https://github.com/slyautomation/osrs_basic_botting_functions/wiki/Purpose-and-Definition-of-Functions-including-argument-s-usage)
281 |
282 |
283 | Using the top banner in pycharm under file goto setttings.
284 | 
285 |
286 | Then in settings under the tools section click on terminal. and you'll need to change the shell path to cmd.exe. at the moment your default terminal is powershell
287 | Image
288 | 
289 |
290 | You'll now be able to type in the pip command no issues
291 |
292 |
293 |
294 |
295 |
--------------------------------------------------------------------------------
/Sketch_Arduino_leon_Mouse.ino:
--------------------------------------------------------------------------------
1 | /* HID KeyBoard Example
2 | by: Jim Lindblom
3 | date: 1/12/2012
4 | license: MIT License - Feel free to use this code for any purpose.
5 | No restrictions. Just keep this license if you go on to use this
6 | code in your future endeavors! Reuse and share.
7 |
8 | This is very simplistic code that allows you to send a 'z' with
9 | a momentary pushbutton.
10 | */
11 |
12 | #include
13 |
14 | int buttonPin = 9; // Set a button to any pin
15 | int y;
16 | int i;
17 | int l;
18 | int x;
19 | String list;
20 | void setup()
21 | {
22 | Serial.begin(115200);
23 | Serial.setTimeout(1);
24 | // pinMode(buttonPin, INPUT); // Set the button as an input
25 | digitalWrite(buttonPin, HIGH); // Pull the button high
26 | delay(1000); // short delay to let outputs settle
27 | Mouse.begin(); //Init mouse emulation
28 | }
29 | void loop()
30 | {
31 | if ( Serial.available()) {
32 | list = Serial.readStringUntil('\n'); // Use readStringUntil to avoid the 1 second delay.
33 | if (list == "l") {
34 | Mouse.click(MOUSE_LEFT);
35 | }
36 | if (list == "r") {
37 | Mouse.click(MOUSE_RIGHT);
38 | }
39 | else {
40 | i = list.indexOf(";");
41 | l = list.length();
42 | x = list.substring(0,i).toInt();
43 | y = list.substring(i+1,l).toInt();
44 | Serial.println(x + " | " + y);
45 | }
46 | }
47 | //delay(1000); // delay so there aren't a kajillion z's
48 | Mouse.move(x, y, 0); // move mouse on y axis
49 | //delay(1000); // delay so there aren't a kajillion z's
50 | //Mouse.move(x, 0, 0); // move mouse on x axis
51 | x = 0;
52 | y = 0;
53 | }
54 |
--------------------------------------------------------------------------------
/app_icon_sly.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/app_icon_sly.ico
--------------------------------------------------------------------------------
/archive/api_dax_walker.py:
--------------------------------------------------------------------------------
1 | import json
2 | import time
3 |
4 | import requests
5 |
6 | API_URL = "https://api.dax.cloud/walker/generatePath"
7 |
8 | errorMessageMapping = {
9 | "UNMAPPED_REGION": "Unmapped region",
10 | "BLOCKED": "Tile is blocked",
11 | "EXCEEDED_SEARCH_LIMIT": "Exceeded search limit",
12 | "UNREACHABLE": "Unreachable tile",
13 | "NO_WEB_PATH": "No web path",
14 | "INVALID_CREDENTIALS": "Invalid credentials",
15 | "RATE_LIMIT_EXCEEDED": "Rate limit exceeded",
16 | "NO_RESPONSE_FROM_SERVER": "No response from server",
17 | "UNKNOWN": "Unknown"
18 | }
19 |
20 |
21 | def post_http_path(start, end, api_key, api_secret):
22 | headers = {
23 | "key": api_key,
24 | "secret": api_secret
25 | }
26 | pathArray = {"start": {
27 | "x": start[0],
28 | "y": start[1],
29 | "z": start[2]
30 | },
31 | "end": {
32 | "x": end[0],
33 | "y": end[1],
34 | "z": end[2]
35 | }
36 | }
37 | data = pathArray
38 | # data = json.dumps(pathArray, separators=(',', ':'))
39 | print(data)
40 | response = requests.post(API_URL, json=data, headers=headers)
41 | print(response.text)
42 | result = response.text
43 | #stats = json.loads(response.text)
44 | #print(stats)
45 | return result
46 |
47 | API_KEY = "sub_DPjXXzL5DeSiPf"
48 | #API_KEY = "sub_DPjcfqN4YkIxm8"
49 | API_SECRET = "PUBLIC-KEY"
50 | start = (3223,3218,0)
51 | #print(start[0])
52 | end = (3164,3480,0)
53 |
54 | #post_http_path(start, end, API_KEY, API_SECRET)
55 |
--------------------------------------------------------------------------------
/archive/osrs_path_walker_dax.py:
--------------------------------------------------------------------------------
1 |
2 | # use ctrl-f and the find ',0'and replace with ','
3 | # remove last ',' in last row
4 | import json
5 | #import server
6 | from api_dax_walker import post_http_path, API_SECRET, API_KEY
7 | import simplejson
8 |
9 | from api_dax_walker import post_http_path, API_KEY, API_SECRET
10 |
11 |
12 | def get_live_info(category):
13 | try:
14 | f = open('live_data.json', )
15 | data = json.load(f)
16 | return data[category]
17 | except:
18 | pass
19 |
20 | def get_location_points(location):
21 | f = open('location.json', )
22 | data = json.load(f)
23 | print(len(data['locations']))
24 | coords = []
25 | x = 0
26 | while x < len(data['locations']):
27 | if data['locations'][x]['name'] == location:
28 | print(data['locations'][x]['coords'])
29 | coords = data['locations'][x]['coords']
30 | x += 1
31 | return coords
32 |
33 | def save_json_data(data):
34 | data = simplejson.loads(data)
35 | with open(f"paths.json", "w") as outfile:
36 | simplejson.dump(data, outfile)
37 |
38 | def get_current_location():
39 | position_data = get_live_info('worldPoint')
40 | print(position_data)
41 | default_z = 0
42 | live_x, live_y = position_data['x'], position_data['y']
43 | return (live_x, live_y, default_z)
44 |
45 | def list_of_paths():
46 | pathArray = []
47 | f = open('paths.json', )
48 | data = json.load(f)
49 | print(data['path'])
50 | for d in data['path']:
51 | print((d['x'], d['y'], d['z']))
52 | pathArray.append([d['x'], d['y']])
53 | return pathArray
54 |
55 | start = get_current_location()
56 | end = get_location_points('Lumbridge')
57 |
58 | path = post_http_path(start, end, API_KEY, API_SECRET)
59 |
60 | save_json_data(path)
61 |
62 |
63 | path = list_of_paths()
64 | print(path)
65 |
66 | TARGET_PATH = path
--------------------------------------------------------------------------------
/archive/test_functions.py:
--------------------------------------------------------------------------------
1 | from functions import pick_item_right
2 | import functions
3 |
4 | pick_item_right(1464-1280, 118, 2)
5 |
--------------------------------------------------------------------------------
/archive/test_postition.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import cv2
3 | import pyautogui
4 | import random
5 | import time
6 | import os
7 | from PIL import Image
8 | import pytesseract
9 | import functions
10 | from functions import screen_Image
11 | from functions import image_Rec_clicker
12 | from functions import random_combat
13 | from functions import random_quests
14 | from functions import random_skills
15 | from functions import random_inventory
16 | # from core import findWindow_runelite
17 | from functions import Image_Rec_single
18 |
19 | global hwnd
20 | global iflag
21 | global icoord
22 | iflag = False
23 | global newTime_break
24 | newTime_break = False
25 | global timer
26 | global timer_break
27 | global ibreak
28 |
29 |
30 | def random_break(start, c):
31 | global newTime_break
32 | startTime = time.time()
33 | # 1200 = 20 minutes
34 | a = random.randrange(0, 4)
35 | if startTime - start > c:
36 | options[a]()
37 | newTime_break = True
38 |
39 |
40 | def randomizer(timer_breaks, ibreaks):
41 | global newTime_break
42 | global timer_break
43 | global ibreak
44 | random_break(timer_breaks, ibreaks)
45 | if newTime_break == True:
46 | timer_break = timer()
47 | ibreak = random.randrange(600, 2000)
48 | newTime_break = False
49 |
50 | # b = random.uniform(4, 5)
51 |
52 |
53 | def timer():
54 | startTime = time.time()
55 | return startTime
56 |
57 |
58 | def random_pause():
59 | b = random.uniform(20, 250)
60 | print('pausing for ' + str(b) + ' seconds')
61 | time.sleep(b)
62 | newTime_break = True
63 |
64 |
65 | pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract'
66 | iflag = False
67 |
68 | options = {0: random_inventory,
69 | 1: random_combat,
70 | 2: random_skills,
71 | 3: random_quests,
72 | 4: random_pause}
73 |
74 |
75 | def mini_map_image():
76 | screen_Image(1963 - 1280, 57, 2068 - 1280, 155, 'mini_map.png')
77 |
78 |
79 | def Find_on_Map(image, event, threshold):
80 | global icoord
81 | global iflag
82 | img_rgb = cv2.imread(r'world.png')
83 | # print('screenshot taken')
84 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
85 | template = cv2.imread(image, 0)
86 | w, h = template.shape[::-1]
87 | pt = None
88 | # print('getting match requirements')
89 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
90 | threshold = threshold
91 | loc = np.where(res >= threshold)
92 | # print('determine loc and threshold')
93 | # if len(loc[0]) == 0:
94 | # exit()
95 | iflag = False
96 | event = event
97 | for pt in zip(*loc[::-1]):
98 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
99 | if pt is None:
100 | iflag = False
101 | else:
102 | iflag = True
103 | cv2.imwrite(r'res.png', img_rgb)
104 |
105 | return iflag
106 |
107 |
108 | def Find_on_Region(image, event, threshold):
109 | global icoord
110 | global iflag
111 | img_rgb = cv2.imread(r'west_varrock_mines.png')
112 | # print('screenshot taken')
113 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
114 | template = cv2.imread(image, 0)
115 | w, h = template.shape[::-1]
116 | pt = None
117 | # print('getting match requirements')
118 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
119 | threshold = threshold
120 | loc = np.where(res >= threshold)
121 | # print('determine loc and threshold')
122 | # if len(loc[0]) == 0:
123 | # exit()
124 | iflag = False
125 | event = event
126 | for pt in zip(*loc[::-1]):
127 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
128 | if pt is None:
129 | iflag = False
130 | else:
131 | iflag = True
132 | cv2.imwrite(r'res_region.png', img_rgb)
133 | im = Image.open(r'res_region.png')
134 | im.show(title="result")
135 | print('left:', pt[0], 'right:', pt[0] + w, 'top:', pt[1], 'bottom:', pt[1] + h)
136 | print('center x:', ((pt[0] + w) + pt[0])/2, 'center y:', ((pt[1] + h) + pt[1])/2)
137 | return iflag
138 |
139 |
140 | mini_map_image()
141 | # print(Find_on_Map('mini_map.png', 'find on map', 0.6))
142 | print(Find_on_Region('mini_map.png', 'find on map', 0.6))
143 |
--------------------------------------------------------------------------------
/arduinoMouse.py:
--------------------------------------------------------------------------------
1 | # In seconds. Any duration less than this is rounded to 0.0 to instantly move
2 | # the mouse.
3 | import collections
4 | import ctypes
5 | import platform
6 | import random
7 | import sys
8 | import time
9 | import ctypes.wintypes
10 |
11 | import serial
12 |
13 | Point = collections.namedtuple("Point", "x y")
14 | Size = collections.namedtuple("Size", "width height")
15 | # FIXES SLOW TIME.SLEEP IN WINDOWS OS
16 | timeBeginPeriod = ctypes.windll.winmm.timeBeginPeriod #new
17 | timeBeginPeriod(1) #new
18 |
19 | MINIMUM_DURATION = 0.1
20 | # If sleep_amount is less than MINIMUM_DURATION, time.sleep() will be a no-op and the mouse cursor moves there instantly.
21 | MINIMUM_SLEEP = 0.05
22 |
23 | # The number of seconds to pause after EVERY public function call. Useful for debugging:
24 | PAUSE = 0.1 # Tenth-second pause by default.
25 |
26 |
27 | def write_read(x):
28 | arduino.write(bytes(x, 'utf-8'))
29 |
30 | def linear(n):
31 | """
32 | Returns ``n``, where ``n`` is the float argument between ``0.0`` and ``1.0``. This function is for the default
33 | linear tween for mouse moving functions.
34 |
35 | This function was copied from PyTweening module, so that it can be called even if PyTweening is not installed.
36 | """
37 |
38 | if not 0.0 <= n <= 1.0:
39 | raise print("Argument must be between 0.0 and 1.0.")
40 | return n
41 |
42 | def _position():
43 | """Returns the current xy coordinates of the mouse cursor as a two-integer
44 | tuple by calling the GetCursorPos() win32 function.
45 |
46 | Returns:
47 | (x, y) tuple of the current xy coordinates of the mouse cursor.
48 | """
49 |
50 | cursor = ctypes.wintypes.POINT()
51 | ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
52 | return (cursor.x, cursor.y)
53 |
54 | def _size():
55 | """Returns the width and height of the screen as a two-integer tuple.
56 |
57 | Returns:
58 | (width, height) tuple of the screen size, in pixels.
59 | """
60 | return (ctypes.windll.user32.GetSystemMetrics(0), ctypes.windll.user32.GetSystemMetrics(1))
61 |
62 | def position(x=None, y=None):
63 | """
64 | Returns the current xy coordinates of the mouse cursor as a two-integer tuple.
65 |
66 | Args:
67 | x (int, None, optional) - If not None, this argument overrides the x in
68 | the return value.
69 | y (int, None, optional) - If not None, this argument overrides the y in
70 | the return value.
71 |
72 | Returns:
73 | (x, y) tuple of the current xy coordinates of the mouse cursor.
74 |
75 | NOTE: The position() function doesn't check for failsafe.
76 | """
77 | posx, posy = _position()
78 | posx = int(posx)
79 | posy = int(posy)
80 | if x is not None: # If set, the x parameter overrides the return value.
81 | posx = int(x)
82 | if y is not None: # If set, the y parameter overrides the return value.
83 | posy = int(y)
84 | return Point(posx, posy)
85 |
86 | def size():
87 | """Returns the width and height of the screen as a two-integer tuple.
88 |
89 | Returns:
90 | (width, height) tuple of the screen size, in pixels.
91 | """
92 | return Size(*_size())
93 |
94 | def getPointOnLine(x1, y1, x2, y2, n):
95 | """
96 | Returns an (x, y) tuple of the point that has progressed a proportion ``n`` along the line defined by the two
97 | ``x1``, ``y1`` and ``x2``, ``y2`` coordinates.
98 |
99 | This function was copied from pytweening module, so that it can be called even if PyTweening is not installed.
100 | """
101 | x = ((x2 - x1) * n) + x1
102 | y = ((y2 - y1) * n) + y1
103 | return (x, y)
104 |
105 |
106 | def last_adjust(x, y, Debug=False):
107 | posx, posy = _position()
108 | if Debug:
109 | print(x,y)
110 | if posx > x:
111 | mov_x = x - posx
112 | else:
113 | mov_x = posx - x
114 |
115 | if posy > y:
116 | mov_y = y - posy
117 | else:
118 | mov_y = posy - y
119 | if Debug:
120 | print(posx - x, posy - y)
121 | write_read(str(int(mov_x)) + ";" + str(int(mov_y)))
122 | def _moveTo(x, y, Debug=False):
123 | """Send the mouse move event to Windows by calling SetCursorPos() win32
124 | function.
125 |
126 | Args:
127 | button (str): The mouse button, either 'left', 'middle', or 'right'
128 | x (int): The x position of the mouse event.
129 | y (int): The y position of the mouse event.
130 |
131 | Returns:
132 | None
133 | """
134 | mov_x = 0
135 | mov_y = 0
136 | posx, posy = _position()
137 | if Debug:
138 | print(posx, posy)
139 | if posx > x:
140 | mov_x = x - posx
141 | else:
142 | mov_x = posx - x
143 |
144 | if posy > y:
145 | mov_y = y - posy
146 | else:
147 | mov_y = posy - y
148 |
149 | if Debug:
150 | print(posx - x, posy - y)
151 | write_read(str(int(mov_x)) + ";" + str(int(mov_y)))
152 |
153 | def _mouseMoveDrag(moveOrDrag, x, y, xOffset, yOffset, duration, tween=linear, Debug=False):
154 |
155 |
156 | xOffset = int(xOffset) if xOffset is not None else 0
157 | yOffset = int(yOffset) if yOffset is not None else 0
158 |
159 | if x is None and y is None and xOffset == 0 and yOffset == 0:
160 | return # Special case for no mouse movement at all.
161 |
162 | startx, starty = position()
163 |
164 | x = int(x) if x is not None else startx
165 | y = int(y) if y is not None else starty
166 |
167 | # x, y, xOffset, yOffset are now int.
168 | x += xOffset
169 | y += yOffset
170 |
171 | width, height = size()
172 |
173 |
174 | # If the duration is small enough, just move the cursor there instantly.
175 | steps = [(x, y)]
176 |
177 | if duration > MINIMUM_DURATION:
178 | # Non-instant moving/dragging involves tweening:
179 | num_steps = max(width, height)
180 | if Debug:
181 | print('num_steps:', num_steps)
182 | sleep_amount = duration / num_steps
183 | if sleep_amount < MINIMUM_SLEEP:
184 | num_steps = int(duration / MINIMUM_SLEEP)
185 | num_steps = num_steps * 4
186 | sleep_amount = duration / num_steps
187 | if Debug:
188 | print('num_steps:', num_steps)
189 | steps = [getPointOnLine(startx, starty, x, y, tween(n / num_steps)) for n in range(num_steps)]
190 | # Making sure the last position is the actual destination.
191 | steps.append((x, y))
192 |
193 | for tweenX, tweenY in steps:
194 | if len(steps) > 1:
195 | # A single step does not require tweening.
196 | time.sleep(sleep_amount)
197 |
198 | tweenX = int(round(tweenX))
199 | tweenY = int(round(tweenY))
200 |
201 | if moveOrDrag == "move":
202 | _moveTo(tweenX, tweenY)
203 | else:
204 | raise NotImplementedError("Unknown value of moveOrDrag: {0}".format(moveOrDrag))
205 | if Debug:
206 | print("last:", tweenX, tweenY)
207 |
208 |
209 | def arduino_mouse(x=100, y=100, duration=0.3,button=None, port='COM5', baudrate=115200, Debug=False):
210 | global arduino
211 | #arduino = serial.Serial(port=port, baudrate=baudrate, timeout=.1)
212 | _mouseMoveDrag('move', x, y, xOffset=0, yOffset=0, duration=duration, tween=linear)
213 | time.sleep(0.01)
214 | if Debug:
215 | print(position())
216 | if position() != (x, y):
217 | last_adjust(x, y)
218 | time.sleep(0.01)
219 | if Debug:
220 | print(position())
221 | if position() != (x, y):
222 | last_adjust(x, y)
223 | time.sleep(0.01)
224 | if Debug:
225 | print(position())
226 | c = random.uniform(0.001, 0.01)
227 | time.sleep(c)
228 |
229 | # l is read by arduino to mean click left and r is to right click
230 | if button != None:
231 | if button == 'left':
232 | write_read(str('l'))
233 | if button == 'right':
234 | write_read(str('r'))
235 |
236 | port='COM5'
237 | baudrate=115200
238 | arduino = serial.Serial(port=port, baudrate=baudrate, timeout=.1)
239 | if __name__ == "__main__":
240 | time.sleep(3.5)
241 | arduino_mouse(x=100, y=150, duration=0.3, button='right', Debug=False, port='COM5', baudrate=115200)
242 |
--------------------------------------------------------------------------------
/clay_beginner_money_maker.py:
--------------------------------------------------------------------------------
1 | from threading import Thread
2 | import win32gui
3 | import keyboard
4 | from PIL import ImageGrab
5 |
6 | import core
7 | import cv2
8 | import numpy as np
9 |
10 | global hwnd
11 | global iflag
12 | global icoord
13 | import functions
14 | from functions import Image_count
15 | from functions import screen_Image
16 | from functions import Image_to_Text
17 | from functions import resizeImage
18 | from functions import find_Object_precise
19 |
20 | from functions import random_combat
21 | from functions import random_quests
22 | from functions import random_skills
23 | from functions import random_inventory
24 | from functions import random_breaks
25 |
26 | import time
27 | import random
28 | import pyautogui
29 |
30 | global hwnd
31 | global iflag
32 | global icoord
33 | iflag = False
34 | global newTime_break
35 | newTime_break = False
36 | global timer
37 | global timer_break
38 | global ibreak
39 |
40 |
41 | class bcolors:
42 | OK = '\033[92m' #GREEN
43 | WARNING = '\033[93m' #YELLOW
44 | FAIL = '\033[91m' #RED
45 | RESET = '\033[0m' #RESET COLOR
46 |
47 | def random_break(start, c):
48 | global newTime_break
49 | startTime = time.time()
50 | # 1200 = 20 minutes
51 | a = random.randrange(0, 4)
52 | if startTime - start > c:
53 | options[a]()
54 | newTime_break = True
55 |
56 | def randomizer(timer_breaks, ibreaks):
57 | global newTime_break
58 | global timer_break
59 | global ibreak
60 | random_break(timer_breaks, ibreaks)
61 | if newTime_break == True:
62 | timer_break = timer()
63 | ibreak = random.randrange(600, 2000)
64 | newTime_break = False
65 |
66 | # b = random.uniform(4, 5)
67 |
68 | def timer():
69 | startTime = time.time()
70 | return startTime
71 |
72 | def random_pause():
73 | global actions
74 | b = random.uniform(20, 250)
75 | actions = 'pausing for ' + str(b) + ' seconds'
76 | time.sleep(b)
77 | newTime_break = True
78 |
79 |
80 | options = {0: random_inventory,
81 | 1: random_combat,
82 | 2: random_skills,
83 | 3: random_quests,
84 | 4: random_pause}
85 |
86 |
87 | def determine_position_to_bank():
88 | global ore_count, gem_count, clue_count, actions
89 | if ore_count + gem_count + clue_count < 27:
90 | return 4
91 | if functions.mini_map_bool('port_sarim_spot_water.png', 0.85):
92 | actions = 'player located @ step 2'
93 | return 2
94 | if functions.mini_map_bool('port_sarim_jewl.png', 0.85):
95 | actions = 'player located @ step 1'
96 | return 1
97 | if functions.mini_map_bool('rim_mine_spot1.png', 0.85):
98 | actions = 'player located @ step 0'
99 | return 0
100 | else:
101 | return 0
102 |
103 | def determine_position_to_clay():
104 | global ore_count, gem_count, clue_count, actions
105 | gem_count = int(count_gems() + count_gems2())
106 | ore_count = int(inv_count('clay'))
107 | clue_count = int(count_geo())
108 | if ore_count + gem_count + clue_count > 27:
109 | return 6
110 | if functions.mini_map_bool('clay_deposit_spot1.png', 0.85):
111 | actions = 'player located @ step 1 Spot 5 _1'
112 | return 0
113 | if functions.mini_map_bool('clay_deposit_spot4.png', 0.85):
114 | actions = 'player located @ step 1 Spot 5 _4'
115 | return 0
116 | if functions.mini_map_bool('clay_deposit_spot5.png', 0.85):
117 | actions = 'player located @ step 1 Spot 5 _5'
118 | return 1
119 | if functions.mini_map_bool('clay_deposit_spot3.png', 0.85):
120 | actions = 'player located @ step 1 Spot 5 _3'
121 | return 1
122 | if functions.mini_map_bool('clay_deposit_spot2.png', 0.85):
123 | actions = 'player located @ step 1 Spot 5 _2'
124 | return 1
125 | if functions.mini_map_bool('port_sarim_spot_water.png', 0.85):
126 | actions = 'player located @ step 2'
127 | return 2
128 | if functions.mini_map_bool('port_sarim_jewl.png', 0.85):
129 | actions = 'player located @ step 3'
130 | return 3
131 | if functions.mini_map_bool('rim_mine_spot1.png', 0.85):
132 | actions = 'player located @ step 4'
133 | return 5
134 | if functions.mini_map_bool('bank_deposit.png', 0.85):
135 | actions = 'player located @ step 0'
136 | return 0
137 | else:
138 | return 0
139 |
140 | def rim_minetobank():
141 | global actions
142 | step = 0
143 | step = determine_position_to_bank()
144 | c = random.uniform(14, 15)
145 | x = 60
146 | y = 25
147 | if step == 0:
148 | while functions.mini_map_image('rim_mine_spot1.png', x, y, 0.8, 'left') != True:
149 | actions = 'finding 1st step to bank'
150 | time.sleep(c)
151 | actions = '1st step to bank'
152 | step = 1
153 |
154 | c = random.uniform(9, 10)
155 | x = 10
156 | y = 1
157 | if step == 1:
158 | while functions.mini_map_image('port_sarim_jewl.png', x, y, 0.8, 'left') != True:
159 | actions = 'finding 2nd step to bank'
160 | time.sleep(c)
161 | actions = '2nd step to bank'
162 |
163 |
164 | c = random.uniform(9, 10)
165 | x = 50
166 | y = -25
167 | if step == 1:
168 | while functions.mini_map_image('port_sarim_jewl.png', x, y, 0.8, 'left') != True:
169 | actions = 'finding 3rd step to bank'
170 | time.sleep(c)
171 | actions = '3rd step to bank'
172 | step = 2
173 |
174 | c = random.uniform(11, 12)
175 | x = 75
176 | y = 25
177 | if step == 2:
178 | while functions.mini_map_image('port_sarim_spot_water.png', x, y, 0.8, 'left') != True:
179 | actions = "finding 4th step to bank"
180 | time.sleep(c)
181 | actions = '4th step to bank'
182 | step = 3
183 |
184 | if step == 3:
185 | b = random.uniform(0.175, 0.677)
186 | x = random.randrange(750, 755)
187 | #print('x: ', x)
188 | y = random.randrange(175, 180)
189 | #print('y: ', y)
190 | c = random.uniform(10, 12)
191 | pyautogui.click(x, y, 1, duration=b, button='left')
192 | time.sleep(c)
193 | actions = '5th step to bank'
194 | b = random.uniform(0.175, 0.677)
195 | x = random.randrange(750, 755) # 1755,1765
196 | #print('x: ', x)
197 | y = random.randrange(140, 145) # 175,185
198 | #print('y: ', y)
199 | c = random.uniform(9, 10)
200 | pyautogui.click(x, y, 1, duration=b, button='left')
201 | actions = 'last step to bank'
202 | time.sleep(c)
203 | c = random.uniform(2.1, 3)
204 | find_banker()
205 | actions = 'finding deposit box'
206 | time.sleep(c)
207 | while not depositbox():
208 | c = random.uniform(2.1, 3)
209 | find_banker()
210 | actions = 'finding deposit box'
211 | time.sleep(c)
212 | actions = 'finished deposit end of function'
213 | c = random.uniform(1, 5)
214 | time.sleep(c)
215 | step = 4
216 |
217 | def nums(first_number, last_number, step=1):
218 | return range(first_number, last_number+1, step)
219 |
220 | def rim_minetoclay():
221 | global actions
222 | actions = 'start of function'
223 | step = 0
224 | step = determine_position_to_clay()
225 | if step == 0:
226 | b = random.uniform(0.175, 0.677)
227 | x = random.randrange(710, 725)
228 | #print('x: ', x)
229 | y = random.randrange(60, 70)
230 | #print('y: ', y)
231 | c = random.uniform(10, 12)
232 | pyautogui.click(x, y, 1, duration=b, button='left')
233 | time.sleep(c)
234 | actions = '0 step to mining clay'
235 | step = 1
236 | c = random.uniform(11, 12)
237 | x = -5
238 | y = 0
239 | if step == 1:
240 | spot = functions.mini_map_image('clay_deposit_spot5.png', x, 5, 0.85, 'left')
241 | while spot != True:
242 | actions = 'finding 1st clay mine step'
243 | for i in nums(1, 5):
244 | if i == 5 or i == 3 or i == 1:
245 | y = 5
246 | spot = functions.mini_map_image('clay_deposit_spot' + str(i) + '.png', x, y, 0.85, 'left')
247 | if spot:
248 | actions = '1st clay mine step found _' + str(i)
249 | break
250 |
251 |
252 | time.sleep(c)
253 | actions = '1st step to mine clay'
254 | step = 2
255 | c = random.uniform(11, 12)
256 | x = 0
257 | y = 40
258 | if step == 2:
259 | while functions.mini_map_image('port_sarim_spot_water.png', x, y, 0.85, 'left') != True:
260 | actions = 'finding 2nd clay mine step'
261 | time.sleep(c)
262 | actions = '2nd step to mine clay'
263 | step = 3
264 |
265 | c = random.uniform(9, 10)
266 | x = -15
267 | y = -10
268 | if step == 3:
269 | while functions.mini_map_image('port_sarim_jewl.png', x, y, 0.85, 'left') != True:
270 | actions = 'finding 3rd clay mine step'
271 | time.sleep(c)
272 | actions = '3rd step to mine clay'
273 | step = 4
274 |
275 | c = random.uniform(9, 10)
276 | x = -50
277 | y = 30
278 | if step == 4:
279 | while functions.mini_map_image('port_sarim_jewl.png', x, y, 0.85, 'left') != True:
280 | actions = 'finding 4th clay mine step'
281 | time.sleep(c)
282 | actions = '4th step to mine clay'
283 | step = 5
284 |
285 | c = random.uniform(14, 15)
286 | x = -8
287 | y = 33
288 | if step == 5:
289 | while functions.mini_map_image('rim_mine_spot1.png', x, y, 0.9, 'left') != True:
290 | actions = 'finding 5th clay mine step'
291 | time.sleep(c)
292 | actions = '5th step to mine clay'
293 | step = 6
294 |
295 | def find_banker():
296 | find_Object_precise(0, 0, 0, 700, 800) # red
297 |
298 | def depositbox():
299 | global actions
300 | if functions.Image_count('bank_deposit.png', 0.8, 0, 0, 700, 800) > 0:
301 | b = random.uniform(0.1, 0.65)
302 | x = random.randrange(370, 390) # 950,960
303 | y = random.randrange(440, 460) # 490,500
304 | pyautogui.moveTo(x, y, duration=b)
305 | b = random.uniform(0.01, 0.1)
306 | pyautogui.click(duration=b)
307 | actions = 'successful deposit...'
308 | c = random.uniform(0.1, 1)
309 | time.sleep(c)
310 | gem_count = int(count_gems() + count_gems2())
311 | ore_count = int(inv_count('clay'))
312 | clue_count = int(count_geo())
313 | total_invent = gem_count + ore_count + clue_count
314 | if total_invent > 0:
315 | return False
316 | return True
317 | actions = 'deposit box not found...'
318 | return False
319 |
320 | def count_gems():
321 | return Image_count('gem_icon.png')
322 | def count_geo():
323 | return Image_count('geo_icon.png')
324 | def count_gems2():
325 | return Image_count('gem_icon2.png')
326 | def inv_count(name):
327 | return Image_count(name + '_ore.png')
328 |
329 | def timer_countdown():
330 | global Run_Duration_hours, stop_script
331 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
332 | #print(t_end)
333 | final = round((60 * 60 * Run_Duration_hours) / 1)
334 | #print(final)
335 | for i in range(final):
336 | caps = keyboard.is_pressed('capslock')
337 | if caps or stop_script:
338 | stop_script = True
339 | print('\n manually stopped script!!!')
340 | exit()
341 | # the exact output you're looking for:
342 | print(bcolors.OK + f'\r[%-10s] %d%%' % ('='*round((i/final)*10), round((i/final)*100)), f'time left: {(t_end - time.time())/60 :.2f} mins | coords: {spot} | status: {mined_text} | ore: {ore_count} | gems: {gem_count} | clues: {clue_count} | {actions}', end='')
343 | time.sleep(1)
344 |
345 | def moneymaker_clay(Take_Human_Break=False, Run_Duration_hours=4, color=6):
346 | global stop_script, spot, mined_text, time_left, powerlist, actions, powerlist, t_end, gem_count, ore_count, clue_count
347 | print("Will break in: %.2f" % (ibreak / 60) + " minutes |", "Mine Ore Selected: Clay")
348 | t1 = Thread(target=timer_countdown)
349 | t1.start()
350 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
351 | invent = functions.invent_enabled()
352 | if invent == 0:
353 | actions = 'opening inventory'
354 | pyautogui.press('esc')
355 | gem_count = int(count_gems() + count_gems2())
356 | ore_count = int(inv_count('clay'))
357 | clue_count = int(count_geo())
358 | if ore_count + gem_count + clue_count > 27:
359 | rim_minetobank()
360 | rim_minetoclay()
361 | step = determine_position_to_clay()
362 | if step != 5:
363 | rim_minetoclay()
364 | while time.time() < t_end:
365 | caps = keyboard.is_pressed('capslock')
366 | if caps or stop_script:
367 | stop_script = True
368 | print('\n manually stopped script!!!')
369 | exit()
370 | invent = functions.invent_enabled()
371 | if invent == 0:
372 | actions = 'opening inventory'
373 | pyautogui.press('esc')
374 | randomizer(timer_break, ibreak)
375 | r = random.uniform(0.1, 1)
376 | gem_count = int(count_gems() + count_gems2())
377 | ore_count = int(inv_count('clay'))
378 | clue_count = int(count_geo())
379 | inventory = gem_count + ore_count + clue_count
380 | if inventory > 27:
381 | random_breaks(0.1, 0.7)
382 | actions = 'Going to Bank'
383 | rim_minetobank()
384 | actions = 'Going to Mining Spot'
385 | rim_minetoclay()
386 | mined_text = Image_to_Text('thresh', 'textshot.png')
387 | if mined_text.strip().lower() != 'mining' and mined_text.strip().lower() != 'mininq':
388 | #actions = 'Not mining'
389 | spot = functions.find_Object(color, 0, 0, 700, 800)
390 | if Take_Human_Break:
391 | c = random.triangular(0.05, 30, 0.5)
392 | time.sleep(c)
393 | else:
394 | c = random.triangular(0.05, 0.1, 0.08)
395 | time.sleep(c)
396 |
397 |
398 | x = random.randrange(100, 250)
399 | y = random.randrange(400, 500)
400 | pyautogui.click(x, y, button='right')
401 | ibreak = random.randrange(300, 2000)
402 | timer_break = timer()
403 | spot = (0, 0)
404 | actions = 'None'
405 | mined_text = 'Not Mining'
406 | ore_count = 0
407 | gem_count = 0
408 | clue_count = 0
409 | stop_script = False
410 | # ----- OBJECT MARKER COLOR FOR CLAY ------
411 | red = 0
412 | green = 1
413 | amber = 2
414 |
415 | # --------- CHANGE TO RUN FOR AMOUNT OF HOURS ----------------
416 | Run_Duration_hours = 4
417 | # TO STOP SCRIPT WHILE MINING HOLD CAPSLOCK KEY
418 | moneymaker_clay(Take_Human_Break=False, Run_Duration_hours=Run_Duration_hours, color=green)
419 |
420 |
--------------------------------------------------------------------------------
/combat.py:
--------------------------------------------------------------------------------
1 | import re
2 | from threading import Thread
3 | import win32gui
4 | import numpy as np
5 | import cv2
6 | import pyautogui
7 | import random
8 | import time
9 | import argparse
10 | import os
11 | import yaml
12 | import requests
13 | import simplejson
14 |
15 | global hwnd
16 | global iflag
17 | global icoord
18 | import datetime
19 | import pytesseract
20 | from PIL import Image, ImageGrab
21 | from functions import Image_to_Text, findarea_attack_quick
22 | from functions import resizeImage
23 | from functions import random_combat
24 | from functions import random_quests
25 | from functions import random_skills
26 | from functions import random_inventory
27 | from functions import image_Rec_clicker
28 | import functions
29 | import core
30 |
31 | def gfindWindow(data): # find window name returns PID of the window
32 | global hwnd
33 | hwnd = win32gui.FindWindow(None, data)
34 | # hwnd = win32gui.GetForegroundWindow()860
35 | #print('findWindow:', hwnd)
36 | win32gui.SetActiveWindow(hwnd)
37 | # win32gui.ShowWindow(hwnd)
38 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
39 |
40 |
41 | with open("pybot-config.yaml", "r") as yamlfile:
42 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
43 |
44 | try:
45 | gfindWindow(data[0]['Config']['client_title'])
46 | except BaseException:
47 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
48 | core.printWindows()
49 | pass
50 |
51 | try:
52 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
53 | except BaseException:
54 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
55 | core.printWindows()
56 | pass
57 |
58 | iflag = False
59 |
60 | global newTime_break
61 |
62 | newTime_break = False
63 |
64 | global timer
65 | global timer_break
66 | global ibreak
67 |
68 | class bcolors:
69 | OK = '\033[92m' #GREEN
70 | WARNING = '\033[93m' #YELLOW
71 | FAIL = '\033[91m' #RED
72 | RESET = '\033[0m' #RESET COLOR
73 |
74 |
75 | def timer():
76 | startTime = time.time()
77 | return startTime
78 |
79 |
80 | def random_pause():
81 | global actions
82 | b = random.uniform(20, 250)
83 | actions = 'pausing for ' + str(b) + ' seconds'
84 | time.sleep(b)
85 | newTime_break = True
86 |
87 |
88 | options = {0: random_inventory,
89 | 1: random_combat,
90 | 2: random_skills,
91 | 3: random_quests,
92 | 4: random_pause}
93 |
94 |
95 | def random_break(start, c):
96 | global newTime_break
97 | startTime = time.time()
98 | # 1200 = 20 minutes
99 | a = random.randrange(0, 4)
100 | if startTime - start > c:
101 | options[a]()
102 | newTime_break = True
103 |
104 |
105 | def randomizer(timer_breaks, ibreaks):
106 | global newTime_break
107 | global timer_break
108 | global ibreak
109 | random_break(timer_breaks, ibreaks)
110 | if newTime_break == True:
111 | timer_break = timer()
112 | ibreak = random.randrange(600, 2000)
113 | newTime_break = False
114 |
115 | # b = random.uniform(4, 5)
116 |
117 | def timer_countdown():
118 | global Run_Duration_hours
119 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
120 | #print(t_end)
121 | final = round((60 * 60 * Run_Duration_hours) / 1)
122 | #print(final)
123 | for i in range(final):
124 | # the exact output you're looking for:
125 | print(bcolors.OK + f'\r[%-10s] %d%%' % ('='*round((i/final)*10), round((i/final)*100)), f'time left: {(t_end - time.time())/60 :.2f} mins | coords: {coords} | combat text: {combat_text} | {actions}', end='')
126 | time.sleep(1)
127 |
128 |
129 | def powerattack_text(monster='chicken', burybones=True, Pickup_loot=False, Take_Human_Break=False, Run_Duration_hours=6):
130 | global ibreak, coords, combat_text, time_left, powerlist, actions, powerlist, t_end
131 | print('Will break in: %.2f' % (ibreak / 60) + ' minutes |', "Mob Selected:", monster)
132 | t1 = Thread(target=timer_countdown)
133 | t1.start()
134 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
135 | # using the datetime.fromtimestamp() function
136 | #date_time = datetime.datetime.fromtimestamp(t_end)
137 | #print(date_time)
138 | group = monster_list.index(monster)
139 | while time.time() < t_end:
140 | randomizer(timer_break, ibreak)
141 | r = random.uniform(0.1, 5)
142 | resizeImage()
143 | combat_text = Image_to_Text('thresh', 'textshot.png')
144 | combat_text = re.sub('[^A-Za-z0-9]+', ' ', combat_text)
145 | #print(combat_text)
146 | attack = 0
147 | for monsters in monster_array[group]:
148 | #print(monsters)
149 | if combat_text.strip().lower().find(monsters) == -1:
150 | attack += 1
151 | if Plugin_Enabled:
152 | if attack == monster:
153 | attack = 1
154 | if attack == len(monster_array[group]):
155 | d = random.uniform(0.05, 0.1)
156 | time.sleep(d)
157 | if burybones and image_Rec_clicker('bones_icon.png', 'bury bones', 5, 5, 0.7, 'left', 5, False):
158 | c = random.uniform(0.6, 1)
159 | time.sleep(c)
160 | if Pickup_loot:
161 | coords = findarea_attack_quick(2, 5)
162 | if coords[0] != 0: # pick up highlighted loot
163 | c = random.uniform(3, 5)
164 | time.sleep(c)
165 | coords = findarea_attack_quick(3)
166 | if coords[0] != 0: # attack npc/monster
167 | c = random.uniform(3, 5)
168 | time.sleep(c)
169 | if Take_Human_Break:
170 | c = random.triangular(0.1, 50, 3)
171 | time.sleep(c)
172 |
173 | coords = (0, 0)
174 | actions = 'None'
175 | combat_text = 'Not in Combsat'
176 | time_left = 0
177 |
178 |
179 | def plugin(category='npc name'):
180 | c = s.get("http://localhost:8081/events", stream=True)
181 | data = simplejson.loads(c.text)
182 | data[category]
183 | #print(data[category])
184 | return data[category]
185 |
186 |
187 | # ------ SET TO TRUE IF USING HTTPSERVER PLUGIN --------
188 |
189 | Plugin_Enabled = True
190 | if Plugin_Enabled:
191 | s = requests.session()
192 |
193 | if __name__ == "__main__":
194 | # ----- UPDATE WITH ALL VARIATIONS OF MONSTER'S IMAGE TO TEXT RESULT IN LINE WITH MONSTER_LIST -----
195 | monster_array = [
196 | ['chicken'], ['guard', 'gua rd'], ['cow', 'cou'], ['monk'], ['imp'], ['skeleton'], ['dwarf'], ['giant frog', 'giant', 'frog']
197 | ]
198 | x = random.randrange(100, 250)
199 | y = random.randrange(400, 500)
200 | pyautogui.click(x, y, button='right')
201 | ibreak = random.randrange(300, 2000)
202 | timer_break = timer()
203 |
204 | # --------- CHANGE TO RUN FOR AMOUNT OF HOURS ----------------
205 | Run_Duration_hours = 4.3
206 | # --------------------------------------------------------------------------------------------------
207 | monster_list = ['chicken', 'guard', 'cow', 'monk', 'imp', 'skeleton', 'dwarf', 'giant frog']
208 |
209 | powerattack_text('chicken', Take_Human_Break=True, Run_Duration_hours=Run_Duration_hours)
210 | #os.system('shutdown -s -f')
211 |
--------------------------------------------------------------------------------
/config_generator.py:
--------------------------------------------------------------------------------
1 | import yaml
2 |
3 | def resourcePath(relativePath):
4 | """ Get absolute path to resource, works for dev and for PyInstaller """
5 | try:
6 | # PyInstaller creates a temp folder and stores path in _MEIPASS
7 | basePath = sys._MEIPASS
8 | except Exception:
9 | basePath = os.path.abspath(".")
10 |
11 | return os.path.join(basePath, relativePath)
12 |
13 | import os
14 |
15 | def ensure_dir():
16 | directory = os.path.dirname('config')
17 | print(directory)
18 | if not os.path.exists('config'):
19 | os.makedirs('config')
20 |
21 | bool_config = os.path.isfile(resourcePath('pybot-config.yaml'))
22 |
23 | if not bool_config:
24 | f = open(resourcePath("pybot-config.yaml"), "w")
25 | config_list = [['client title','OpenOSRS'], ['pc_profile','C:\\Users\\i7 8700'],
26 | ['file_path_to_client', '\\.openosrs\\'], ['tesseract_path','C:\\Program Files (x86)\\Tesseract-OCR\\tesseract'],
27 | ['enable_on_start', True]]
28 |
29 | article_info= [{
30 | 'Config': {
31 | 'client_title': config_list[0][1],
32 | 'pc_profile': config_list[1][1],
33 | 'file_path_to_client': config_list[2][1],
34 | 'tesseract_path': config_list[3][1],
35 | 'enable_on_start': config_list[4][1]
36 | }
37 | }]
38 |
39 | data = yaml.dump(article_info, f)
40 | f.close()
41 |
42 | bool_config = os.path.isfile(resourcePath('pybot-config.yaml'))
43 | if bool_config:
44 | print('config already exists!')
45 | with open(resourcePath("pybot-config.yaml"), "r") as yamlfile:
46 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
47 | print("Read successful")
48 | yamlfile.close()
49 | print(data)
50 |
51 | config_list = [['client title', data[0]['Config']['client_title']], ['pc_profile', data[0]['Config']['pc_profile']],
52 | ['file_path_to_client', data[0]['Config']['file_path_to_client']],
53 | ['tesseract_path', data[0]['Config']['tesseract_path']],
54 | ['enable_on_start', data[0]['Config']['enable_on_start']]
55 | ]
56 | ensure_dir()
57 | if data[0]['Config']['enable_on_start'] == True:
58 | import tkinter
59 | from tkinter import *
60 | from PIL import Image, ImageTk
61 | test = []
62 | root = Tk()
63 |
64 | root.title('Sly OSRS PyBot_Config')
65 | root.geometry('715x465')
66 | root.configure(background='#40362C')
67 | Font_tuple = ('Unispace', 15)
68 | Font_tuple_entry = ('Unispace', 10)
69 | filename = resourcePath('images/osrs_title_2.png')
70 | image1 = Image.open(filename)
71 | image1 = image1.convert('RGBA')
72 | h = (400, 400)
73 | image1.thumbnail(h)
74 | test1 = ImageTk.PhotoImage(image1)
75 | label1 = tkinter.Label(image=test1, background='#40362C', anchor=CENTER, justify=CENTER)
76 | label1.image = test1
77 | label1.grid(column=0, columnspan=2)
78 | x = 1
79 | while x < len(config_list) + 1:
80 | lbl = Label(root, text=(config_list[(x - 1)][0]), background='#40362C', fg='yellow', padx=20)
81 | lbl.configure(font=Font_tuple)
82 | lbl.grid(column=0, row=x)
83 | x += 1
84 |
85 | x = 1
86 | while x < len(config_list) + 1:
87 | print(config_list[(x - 1)][0])
88 | if config_list[(x - 1)][0] != 'enable_on_start':
89 | txt = Entry(root,width=50, background='#40362C', fg='yellow')
90 | txt.insert(-1, (config_list[(x - 1)][1]) )
91 | txt.configure(font=Font_tuple_entry)
92 | test.append(txt)
93 | txt.grid(column=1, row=x)
94 | x += 1
95 |
96 | is_on = True
97 | # Define Our Images
98 | image1 = Image.open(resourcePath('images/switch-on.png'))
99 | image1 = image1.convert('RGBA')
100 | h = (50, 50)
101 | image1.thumbnail(h)
102 | on = ImageTk.PhotoImage(image1)
103 | image2 = Image.open(resourcePath('images/switch-off.png'))
104 | image2 = image2.convert('RGBA')
105 | h = (50, 50)
106 | image2.thumbnail(h)
107 | off = ImageTk.PhotoImage(image2)
108 |
109 |
110 | def toggle():
111 | global is_on
112 |
113 | if is_on:
114 | toggle_btn.config(image=off)
115 | is_on = False
116 | else:
117 | toggle_btn.config(image=on)
118 | is_on = True
119 |
120 | #lbl = Label(root, text=('Tesseract'), background='#40362C', fg='yellow', padx=20)
121 | #lbl.configure(font=Font_tuple)
122 | #lbl.grid(column=0, row=len(config_list) + 1)
123 |
124 | toggle_btn = Button(image=on, width=50, background='#40362C', activebackground='#40362C', bd=0, relief=None, fg='yellow', command=toggle)
125 | toggle_btn.grid(column=0, row=5, columnspan=2, pady=2)
126 |
127 |
128 | def clicked():
129 | c_title = test[0].get()
130 | if is_on:
131 | t_enable = True
132 | else:
133 | t_enable = False
134 | p_profile = test[1].get()
135 | f_path = test[2].get()
136 | t_path = test[3].get()
137 | article_info = [
138 | {
139 | 'Config': {
140 | 'client_title': c_title,
141 | 'pc_profile': p_profile,
142 | 'file_path_to_client': f_path,
143 | 'tesseract_path': t_path,
144 | 'enable_on_start': t_enable
145 | }
146 | }
147 | ]
148 |
149 | with open("pybot-config.yaml", 'w') as yamlfile:
150 | data = yaml.dump(article_info, yamlfile)
151 | print("Write successful")
152 | yamlfile.close()
153 | print('config file generated!!!')
154 | with open("pybot-config.yaml", "r") as yamlfile:
155 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
156 | print("Read successful")
157 | yamlfile.close()
158 | print(data)
159 | root.quit()
160 | root.destroy()
161 |
162 |
163 | btn = Button(root, text='Generate Config File', fg='yellow',
164 | command=clicked,
165 | background='#40362C',
166 | pady=0)
167 | btn.grid(column=0, row=6, columnspan=2, pady=2)
168 | btn.configure(font=Font_tuple)
169 | root.mainloop()
170 |
--------------------------------------------------------------------------------
/core.py:
--------------------------------------------------------------------------------
1 | import win32gui
2 | import yaml
3 | import platform
4 | global hwnd
5 | hwnd = 0
6 |
7 | with open("pybot-config.yaml", "r") as yamlfile:
8 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
9 |
10 | def findWindow_Linux(data):
11 | import subprocess
12 | subprocess.call(["xdotool", "search", "--name", data, "windowfocus", "%2"])
13 | subprocess.call(["xdotool", "getwindowfocus", "windowmove", "0", "0"])
14 | subprocess.call(["xdotool", "getwindowfocus", "windowsize", "865", "830"])
15 |
16 |
17 | def getWindow_Linux(data):
18 | import subprocess
19 | subprocess.call(["xdotool", "search", "--name", data, "windowfocus", "%2"])
20 | rect = subprocess.call(["xdotool", "getwindowfocus", "getwindowgeometry"])
21 | # Take care of borders for finding character
22 | x = rect[0]
23 | # 30 is the amount of pixels in the client top border
24 | y = rect[1] + 30
25 | # 50 is the amount of pixels in the client side border
26 | w = rect[2] - x - 50
27 | h = rect[3] - y - 30
28 | # Find center
29 | #print('window width:', w, 'window height:', h)
30 | return x, y, w, h
31 |
32 | def findWindow_runelite(): # find window name returns PID of the window
33 | global hwnd
34 | hwnd = win32gui.FindWindow(None, "RuneLite")
35 | # hwnd = win32gui.GetForegroundWindow()860
36 | #print('findWindow:', hwnd)
37 | win32gui.SetActiveWindow(hwnd)
38 | # win32gui.ShowWindow(hwnd)
39 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
40 |
41 | def findWindow_openosrs(): # find window name returns PID of the window
42 | global hwnd
43 | hwnd = win32gui.FindWindow(None, "OpenOSRS")
44 | # hwnd = win32gui.GetForegroundWindow()860
45 | #print('findWindow:', hwnd)
46 | win32gui.SetActiveWindow(hwnd)
47 | # win32gui.ShowWindow(hwnd)
48 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
49 |
50 | def findWindow(data): # find window name returns PID of the window
51 | global hwnd
52 | hwnd = win32gui.FindWindow(None, data)
53 | # hwnd = win32gui.GetForegroundWindow()860
54 | #print('findWindow:', hwnd)
55 | win32gui.SetActiveWindow(hwnd)
56 | # win32gui.ShowWindow(hwnd)
57 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
58 |
59 | def getWindow(data): # find window name returns PID of the window
60 | global hwnd
61 | hwnd = win32gui.FindWindow(None, data)
62 | # hwnd = win32gui.GetForegroundWindow()860
63 | #print('findWindow:', hwnd)
64 | win32gui.SetActiveWindow(hwnd)
65 | win32gui.SetForegroundWindow(hwnd)
66 | rect = win32gui.GetWindowRect(hwnd)
67 | # Take care of borders for finding character
68 | x = rect[0]
69 | # 30 is the amount of pixels in the client top border
70 | y = rect[1] + 30
71 | # 50 is the amount of pixels in the client side border
72 | w = rect[2] - x - 50
73 | h = rect[3] - y - 30
74 | # Find center
75 | #print('window width:', w, 'window height:', h)
76 | return x, y, w, h
77 |
78 | def printWindows():
79 | def winEnumHandler(hwnd, ctx):
80 | if win32gui.IsWindowVisible(hwnd):
81 | if win32gui.GetWindowText(hwnd) is not None and win32gui.GetWindowText(hwnd) != '':
82 | print(win32gui.GetWindowText(hwnd))
83 |
84 | win32gui.EnumWindows(winEnumHandler, None)
85 |
86 | print('Operating system:', platform.system())
87 | if platform.system() == 'Linux' or platform.system() == 'Mac':
88 | try:
89 | findWindow_Linux(data[0]['Config']['client_title'])
90 | except BaseException:
91 | print("unable to find window:", data[0]['Config']['client_title'], "please see list of window names below:")
92 | printWindows()
93 | pass
94 | else:
95 | try:
96 | findWindow(data[0]['Config']['client_title'])
97 | except BaseException:
98 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
99 | printWindows()
100 | pass
101 |
--------------------------------------------------------------------------------
/crafting.py:
--------------------------------------------------------------------------------
1 | import pyautogui
2 | import random
3 | import time
4 | import functions
5 | import pytesseract
6 | from functions import Image_count
7 | from functions import skill_lvl_up
8 | from functions import spaces
9 | from functions import pick_item
10 | from functions import random_combat
11 | from functions import random_quests
12 | from functions import random_skills
13 | from functions import random_inventory
14 | from functions import random_breaks
15 | from functions import find_Object_precise
16 | from functions import exit_bank
17 | from functions import Image_Rec_single
18 | from functions import deposit_secondItem
19 | import win32gui
20 | import core
21 | import yaml
22 | global hwnd
23 | global iflag
24 | global icoord
25 | iflag = False
26 | global newTime_break
27 | newTime_break = False
28 | global timer
29 | global timer_break
30 | global ibreak
31 |
32 | class bcolors:
33 | OK = '\033[92m' #GREEN
34 | WARNING = '\033[93m' #YELLOW
35 | FAIL = '\033[91m' #RED
36 | RESET = '\033[0m' #RESET COLOR
37 |
38 | def gfindWindow(data): # find window name returns PID of the window
39 | global hwnd
40 | hwnd = win32gui.FindWindow(None, data)
41 | # hwnd = win32gui.GetForegroundWindow()860
42 | #print('findWindow:', hwnd)
43 | win32gui.SetActiveWindow(hwnd)
44 | # win32gui.ShowWindow(hwnd)
45 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
46 |
47 |
48 | with open("pybot-config.yaml", "r") as yamlfile:
49 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
50 |
51 | try:
52 | gfindWindow(data[0]['Config']['client_title'])
53 | except BaseException:
54 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
55 | core.printWindows()
56 | pass
57 |
58 | try:
59 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
60 | except BaseException:
61 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
62 | core.printWindows()
63 | pass
64 |
65 | def random_break(start, c):
66 | global newTime_break
67 | startTime = time.time()
68 | # 1200 = 20 minutes
69 | a = random.randrange(0, 4)
70 | if startTime - start > c:
71 | options[a]()
72 | newTime_break = True
73 |
74 |
75 | def randomizer(timer_breaks, ibreaks):
76 | global newTime_break
77 | global timer_break
78 | global ibreak
79 | random_break(timer_breaks, ibreaks)
80 | if newTime_break == True:
81 | timer_break = timer()
82 | ibreak = random.randrange(600, 2000)
83 | newTime_break = False
84 |
85 | # b = random.uniform(4, 5)
86 |
87 |
88 | def timer():
89 | startTime = time.time()
90 | return startTime
91 |
92 |
93 | def random_pause():
94 | b = random.uniform(20, 250)
95 | print('pausing for ' + str(b) + ' seconds')
96 | time.sleep(b)
97 | newTime_break = True
98 |
99 |
100 | pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract'
101 | iflag = False
102 |
103 | options = {0: random_inventory,
104 | 1: random_combat,
105 | 2: random_skills,
106 | 3: random_quests,
107 | 4: random_pause}
108 |
109 |
110 | def pick_gold_bars():
111 | pick_item(1751 - 1280, 123) # pick in bank
112 | random_breaks(0.1, 1.5)
113 |
114 |
115 | def pick_sapphires():
116 | pick_item(1751 - 1280, 123) # pick in bank
117 | random_breaks(0.1, 1.5)
118 | pick_item(1703 - 1280, 159) # pick in bank
119 | random_breaks(0.1, 1.5)
120 |
121 |
122 | def pick_silver_bars():
123 | pick_item(1751 - 1280, 198) # 375 # pick in bank
124 | random_breaks(0.1, 1.5)
125 |
126 |
127 | def bank_spot_edgville():
128 | find_Object_precise(1, 0, 0, 860, 775) # green
129 |
130 |
131 | def craft_spot_edgville():
132 | find_Object_precise(0, 0, 0, 860, 775) # red
133 |
134 |
135 | def craft_gold_ring():
136 | pick_item(1389 - 1280, 277) # 375
137 | random_breaks(0.1, 1.5)
138 |
139 |
140 | def craft_sapphire_ring():
141 | pick_item(1439 - 1280, 277) # 375
142 | random_breaks(0.1, 1.5)
143 |
144 |
145 | def timer_countdown():
146 | global invent_count, smithing_text, actions, coords, inv
147 |
148 | for i in range(invent_count):
149 | # the exact output you're looking for:
150 | print(bcolors.OK + f'\r[%-10s] %d%%' % ('='*round((i/invent_count)*10), round((i/invent_count)*100)), f'bars left: {inv} | coords: {coords} | status: {actions}', end='')
151 | time.sleep(1)
152 |
153 | def craft_bar_items(num, type, craft_item, run_time_minutes=360):
154 | global invent_count, actions, inv
155 | invent_count = num
156 | # run_time_minutes 6hrs by default
157 | t_end = time.time() + 60 * run_time_minutes
158 | while time.time() < t_end or num <= 0:
159 | if type == 2:
160 | j = round((num) / 13) + 1
161 | else:
162 | j = round((num) / 27) + 1
163 |
164 | pick_options = {0: pick_gold_bars,
165 | 1: pick_silver_bars,
166 | 2: pick_sapphires
167 | }
168 | craft_options = {'gold_ring': craft_gold_ring,
169 | 'sapphire_ring': craft_sapphire_ring,
170 | }
171 | barlist = ['gold_bar.png', 'silver_bar.png', 'gold_bar.png']
172 | while j > 0:
173 | invent = invent_enabled()
174 | #print(invent)
175 | if invent == 0:
176 | pyautogui.press('esc')
177 | bank_spot_edgville()
178 | actions = 'Going to Bank'
179 | bank = get_bank_craft_items(type)
180 | random_breaks(9.5, 11)
181 | while bank == 0:
182 | bank = get_bank_craft_items(type)
183 | random_breaks(0.05, 0.2)
184 | inv = Image_count(barlist[type]) # 0 or 1
185 | actions = 'To Crafting spot'
186 | craft_spot_edgville()
187 | random_breaks(9.5, 11)
188 | craft_options[craft_item]()
189 | while inv > 0:
190 | actions = 'Crafting...'
191 | if skill_lvl_up() != 0:
192 | actions = 'level up'
193 | random_breaks(0.1, 3)
194 | pyautogui.press('space')
195 | random_breaks(0.1, 3)
196 | pyautogui.press('space')
197 | a = random.randrange(0, 2)
198 | # print(a)
199 | spaces(a)
200 | actions = 'To Crafting spot'
201 | craft_spot_edgville()
202 | random_breaks(1, 2)
203 | craft_options[craft_item]()
204 | inv = Image_count(barlist[type])
205 | #print(inv)
206 | j -= 1
207 | num = j
208 | invent_count = num
209 | random_breaks(0.1, 1.5)
210 |
211 | def invent_enabled():
212 | return Image_count('inventory_enabled.png', threshold=0.9)
213 |
214 | def get_bank_craft_items(type):
215 | global actions
216 | bank = Image_count('bank_deposit.png', 0.75)
217 | actions = "bank deposit open:", bank
218 | pick_options = {0: pick_gold_bars,
219 | 1: pick_silver_bars,
220 | 2: pick_sapphires
221 | }
222 | if bank > 0:
223 | deposit_secondItem()
224 | random_breaks(0.1, 0.5)
225 | pick_options[type]()
226 | exit_bank()
227 | return bank
228 | else:
229 | actions = "bank inventory not found"
230 | bank_spot_edgville()
231 | return bank
232 |
233 | inv = 0
234 | coords = (0, 0)
235 | actions = 'None'
236 | time_left = 0
237 | invent_count = 0
238 | #-------------------------------
239 |
240 | number_of_bars = 28
241 |
242 | pick_gold_bars = 0,
243 | pick_silver_bars = 1,
244 | pick_sapphires = 2
245 |
246 | # what to craft---- {bar_type}_{item_type} 'gold_ring'
247 |
248 | #-------------------------------
249 | if __name__ == "__main__":
250 | craft_bar_items(number_of_bars, pick_gold_bars, 'gold_ring', run_time_minutes=360)
251 |
--------------------------------------------------------------------------------
/feather_trade.py:
--------------------------------------------------------------------------------
1 | import random
2 | import time
3 | import win32gui
4 | import pyautogui
5 | import yaml
6 | import core
7 | import functions
8 | from functions import find_Object_right, pick_item_right, image_Rec_inventory, pick_item
9 |
10 | def gfindWindow(data): # find window name returns PID of the window
11 | global hwnd
12 | hwnd = win32gui.FindWindow(None, data)
13 | # hwnd = win32gui.GetForegroundWindow()860
14 | #print('findWindow:', hwnd)
15 | win32gui.SetActiveWindow(hwnd)
16 | # win32gui.ShowWindow(hwnd)
17 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
18 |
19 |
20 | with open("pybot-config.yaml", "r") as yamlfile:
21 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
22 |
23 | try:
24 | gfindWindow(data[0]['Config']['client_title'])
25 | except BaseException:
26 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
27 | core.printWindows()
28 | pass
29 |
30 | try:
31 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
32 | except BaseException:
33 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
34 | core.printWindows()
35 | pass
36 |
37 | def gerrants_shop_active():
38 | shop = functions.Image_count('gerrant_shop.png', 0.75)
39 | if shop > 0:
40 | return True
41 | else:
42 | return False
43 | return False
44 |
45 | def tynan_shop_active():
46 | shop = functions.Image_count('tynan_shop.png', 0.75)
47 | if shop > 0:
48 | return True
49 | else:
50 | return False
51 | return False
52 | def trade_gerrant():
53 | shop = False
54 | while shop == False:
55 | while functions.find_Object_right_quick(4) == False:
56 | d = random.uniform(0.1, 0.3)
57 | time.sleep(d)
58 | d = random.uniform(3, 5)
59 | time.sleep(d)
60 | shop = gerrants_shop_active()
61 |
62 | def trade_tynan():
63 | shop = False
64 | while shop == False:
65 | while functions.find_Object_right_quick(4) == False:
66 | d = random.uniform(0.1, 0.3)
67 | time.sleep(d)
68 | d = random.uniform(3, 5)
69 | time.sleep(d)
70 | shop = tynan_shop_active()
71 | def get_feathers():
72 | pick_item_right(1420-1280, 300, 4)
73 | d = random.uniform(0.1,0.5)
74 | time.sleep(d)
75 | pick_item(1815 - 1280, 215)
76 | invent = functions.invent_enabled()
77 | print(invent)
78 | if invent == 0:
79 | pyautogui.press('esc')
80 | image_Rec_inventory('feather_pack.png', 0.8, 'left')
81 | d = random.uniform(1, 4)
82 | time.sleep(d)
83 |
84 |
85 | def get_bait():
86 | pick_item_right(1700 - 1280, 255, 4)
87 | d = random.uniform(0.1, 0.5)
88 | time.sleep(d)
89 | pick_item(1815 - 1280, 215)
90 | invent = functions.invent_enabled()
91 | print(invent)
92 | if invent == 0:
93 | pyautogui.press('esc')
94 | image_Rec_inventory('bait_pack.png', 0.8, 'left')
95 |
96 |
97 | def get_sandworms():
98 | print('worms, ', functions.Image_count('tynan_shop.png'))
99 | if functions.Image_count('tynan_shop.png') > 0:
100 | pick_item_right(1466 - 1280, 300, 2)
101 | d = random.uniform(0.1, 0.5)
102 | time.sleep(d)
103 | pick_item(1815 - 1280, 215)
104 | invent = functions.invent_enabled()
105 | print(invent)
106 | if invent == 0:
107 | pyautogui.press('esc')
108 | image_Rec_inventory('bait_pack.png', 0.8, 'left')
109 | d = random.uniform(8, 10)
110 | time.sleep(d)
111 |
112 |
113 | Run_Duration_hours = 0.5
114 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
115 | while time.time() < t_end:
116 | trade_tynan()
117 | get_sandworms()
118 |
--------------------------------------------------------------------------------
/fishing.py:
--------------------------------------------------------------------------------
1 | from threading import Thread
2 | import win32gui
3 | import numpy as np
4 | import cv2
5 | import pyautogui
6 | import random
7 | import time
8 | import os
9 | import functions
10 | import pytesseract
11 | import core
12 | import yaml
13 | from PIL import Image
14 | from functions import Image_count
15 | from functions import image_Rec_clicker
16 | from functions import screen_Image
17 | from functions import release_drop_item
18 | from functions import drop_item
19 | from functions import Image_to_Text
20 | from functions import random_breaks
21 | from functions import invent_crop
22 | from functions import Image_Rec_single
23 | from functions import resizeImage
24 | from functions import skill_lvl_up
25 | from functions import spaces
26 | from functions import random_combat
27 | from functions import random_quests
28 | from functions import random_skills
29 | from functions import random_inventory
30 | from functions import random_breaks
31 |
32 | # from core import findWindow_runelite
33 |
34 | global hwnd
35 | global iflag
36 | global icoord
37 | iflag = False
38 | global newTime_break
39 | newTime_break = False
40 | global timer
41 | global timer_break
42 | global ibreak
43 |
44 | class bcolors:
45 | OK = '\033[92m' #GREEN
46 | WARNING = '\033[93m' #YELLOW
47 | FAIL = '\033[91m' #RED
48 | RESET = '\033[0m' #RESET COLOR
49 |
50 | def gfindWindow(data): # find window name returns PID of the window
51 | global hwnd
52 | hwnd = win32gui.FindWindow(None, data)
53 | # hwnd = win32gui.GetForegroundWindow()860
54 | #print('findWindow:', hwnd)
55 | win32gui.SetActiveWindow(hwnd)
56 | # win32gui.ShowWindow(hwnd)
57 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
58 |
59 |
60 | with open("pybot-config.yaml", "r") as yamlfile:
61 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
62 |
63 | try:
64 | gfindWindow(data[0]['Config']['client_title'])
65 | except BaseException:
66 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
67 | core.printWindows()
68 | pass
69 |
70 | try:
71 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
72 | except BaseException:
73 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
74 | core.printWindows()
75 | pass
76 |
77 | def random_break(start, c):
78 | global newTime_break
79 | startTime = time.time()
80 | # 1200 = 20 minutes
81 | a = random.randrange(0, 4)
82 | if startTime - start > c:
83 | options[a]()
84 | newTime_break = True
85 |
86 |
87 | def randomizer(timer_breaks, ibreaks):
88 | global newTime_break
89 | global timer_break
90 | global ibreak
91 | random_break(timer_breaks, ibreaks)
92 | if newTime_break == True:
93 | timer_break = timer()
94 | ibreak = random.randrange(600, 2000)
95 | newTime_break = False
96 |
97 | # b = random.uniform(4, 5)
98 |
99 |
100 | def timer():
101 | startTime = time.time()
102 | return startTime
103 |
104 |
105 | def random_pause():
106 | b = random.uniform(20, 250)
107 | print('pausing for ' + str(b) + ' seconds')
108 | time.sleep(b)
109 | newTime_break = True
110 |
111 |
112 | iflag = False
113 |
114 | options = {0: random_inventory,
115 | 1: random_combat,
116 | 2: random_skills,
117 | 3: random_quests,
118 | 4: random_pause}
119 |
120 |
121 | def drop_fish():
122 | global actions
123 | actions = "dropping fish"
124 | invent_crop()
125 | drop_item()
126 | image_Rec_clicker(r'prawn_fish.png', 'dropping item', 5, 5, 0.9, 'left', 10, False, False)
127 | image_Rec_clicker(r'trout_fish.png', 'dropping item', 5, 5, 0.9, 'left', 10, False, False)
128 | image_Rec_clicker(r'salmon_fish.png', 'dropping item', 5, 5, 0.9, 'left', 10, False, False)
129 | image_Rec_clicker(r'lobster_fish.png', 'dropping item', 5, 5, 0.9, 'left', 10, False, False)
130 | release_drop_item()
131 | actions = "all fish dropped"
132 |
133 |
134 | def find_fish(showCoords=False, left=0, top=0, right=800, bottom=800, boundaries=[([110, 100, 0], [195, 180, 60])]):
135 | functions.screen_Image(left, top, right, bottom)
136 | image = cv2.imread('images/screenshot.png')
137 | image = cv2.rectangle(image, pt1=(600, 0), pt2=(850, 200), color=(0, 0, 0), thickness=-1)
138 | image = cv2.rectangle(image, pt1=(0, 0), pt2=(150, 100), color=(0, 0, 0), thickness=-1)
139 | #cv2.imwrite('images/screenshot3.png', image)
140 | # define the list of boundaries
141 | # B, G, R
142 |
143 | # loop over the boundaries
144 | for (lower, upper) in boundaries:
145 | # create NumPy arrays from the boundaries
146 | lower = np.array(lower, dtype="uint8")
147 | upper = np.array(upper, dtype="uint8")
148 | # find the colors within the specified boundaries and apply
149 | # the mask
150 | mask = cv2.inRange(image, lower, upper)
151 | output = cv2.bitwise_and(image, image, mask=mask)
152 | ret, thresh = cv2.threshold(mask, 40, 255, 0)
153 | contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
154 | if len(contours) != 0:
155 | #print(len(contours))
156 | # find the biggest countour (c) by the area
157 | c = max(contours, key=cv2.contourArea)
158 | #print(contours)
159 | x, y, w, h = cv2.boundingRect(c)
160 | #image = cv2.rectangle(image, pt1=(x, y), pt2=(x+w, y+h), color=(0, 0, 255), thickness=2)
161 | if showCoords:
162 | print(x, y, w, h)
163 | x = random.randrange(x + 5, x + max(w - 5, 6)) + left # 950,960
164 | #print('x: ', x)
165 | y = random.randrange(y + 5, y + max(h - 5, 6)) + top # 490,500
166 | #print('y: ', y)
167 | b = random.uniform(0.2, 0.4)
168 | pyautogui.moveTo(x, y, duration=b)
169 | b = random.uniform(0.01, 0.05)
170 | pyautogui.click(duration=b)
171 | # show the images
172 | #cv2.imshow("Result", np.hstack([image, output]))
173 | #cv2.waitKey(0)
174 | return (x, y)
175 | else:
176 | return False
177 | def pick_random_fishing_spot(showCoords=False):
178 | fish = find_fish()
179 | return fish
180 |
181 | def timer_countdown():
182 | global Run_Duration_hours
183 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
184 | #print(t_end)
185 | final = round((60 * 60 * Run_Duration_hours) / 1)
186 | #print(final)
187 | for i in range(final):
188 | # the exact output you're looking for:
189 | print(bcolors.OK + f'\r[%-10s] %d%%' % ('='*round((i/final)*10), round((i/final)*100)), f'time left: {(t_end - time.time())/60 :.2f} mins | coords: {coords} | status: {fishing_text} | fish: {fish_count} | clues: {clue_count} | {actions}', end='')
190 | time.sleep(1)
191 |
192 | def powerfisher(fish_type, Run_Duration_hours=6):
193 | global ibreak, coords, fishing_text, time_left, powerlist, actions, t_end, fish_count, clue_count, invent_count
194 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
195 |
196 | print('Will break in: %.2f' % (ibreak / 60) + ' minutes |', "Fish Type Selected:", fish_type)
197 | t1 = Thread(target=timer_countdown)
198 | t1.start()
199 |
200 | while time.time() < t_end:
201 | randomizer(timer_break, ibreak)
202 | resizeImage()
203 | fishing_text = Image_to_Text('thresh', 'textshot.png')
204 | # print(fished)
205 | if fishing_text.strip().lower() != 'fishing' and fishing_text.strip().lower() != 'fishinq' and fishing_text.strip().lower() != 'ishing' and fishing_text.strip().lower() != 'pishing':
206 | random_breaks(0.2, 3)
207 | pick_random_fishing_spot(fish_type)
208 | random_breaks(5, 10)
209 | if skill_lvl_up() != 0:
210 | actions = 'level up'
211 | random_breaks(0.2, 3)
212 | pyautogui.press('space')
213 | random_breaks(0.1, 3)
214 | pyautogui.press('space')
215 | a = random.randrange(0, 2)
216 | # print(a)
217 | spaces(a)
218 | actions = 'none'
219 | invent_crop()
220 | fish_count = functions.invent_count(fish_type + '.png')
221 | if fish_type == 'prawn_fish':
222 | fish_count = functions.invent_count(fish_type + '.png', 0.95) + functions.invent_count('anch_fish.png', 0.95)
223 | clue_count = Image_count(r'sea_puzzle.png')
224 | invent = fish_count + clue_count
225 | if fish_type == 'prawn_fish' or fish_type == 'lobster_fish':
226 | z = 27
227 | else:
228 | z = 26
229 | if invent > z:
230 | invent = functions.invent_enabled()
231 | if invent == 0:
232 | actions = 'opening inventory'
233 | pyautogui.press('esc')
234 | random_breaks(0.2, 0.7)
235 | drop_fish()
236 | random_breaks(0.2, 0.7)
237 | #pick_random_fishing_spot(fish_type)
238 |
239 |
240 | coords = (0, 0)
241 | actions = 'None'
242 | fishing_text = 'Not Fishing'
243 | time_left = 0
244 |
245 | #-------------------------------
246 |
247 | invent_count = 0
248 |
249 | #use the other names to fly/cage fish
250 | fish_type = 'prawn_fish' # 'lobster_fish' 'salmon_fish#
251 | fish_count = 0
252 | clue_count = 0
253 | #-------------------------------
254 |
255 | if __name__ == "__main__":
256 | time.sleep(2)
257 | resizeImage()
258 | x = random.randrange(100, 250)
259 | y = random.randrange(400, 500)
260 | pyautogui.click(x, y, button='right')
261 | ibreak = random.randrange(300, 2000)
262 | timer_break = timer()
263 | # --------- CHANGE TO RUN FOR AMOUNT OF HOURS ----------------
264 | Run_Duration_hours = 5.1
265 | powerfisher(fish_type, Run_Duration_hours=Run_Duration_hours)
266 |
--------------------------------------------------------------------------------
/herblore.py:
--------------------------------------------------------------------------------
1 | import os
2 | import subprocess
3 | import win32gui
4 | import numpy as np
5 | import cv2
6 | import pyautogui
7 | import random
8 | import time
9 | import core
10 | global hwnd
11 | global iflag
12 | global icoord
13 | import functions
14 | import yaml
15 | from functions import find_Object, deposit_all_Bank, deposit_secondItem, \
16 | exit_bank, image_Rec_clicker, Image_Rec_single
17 | iflag = False
18 | icoord = []
19 | pyautogui.FAILSAFE = False
20 |
21 | def gfindWindow(data): # find window name returns PID of the window
22 | global hwnd
23 | hwnd = win32gui.FindWindow(None, data)
24 | # hwnd = win32gui.GetForegroundWindow()860
25 | #print('findWindow:', hwnd)
26 | win32gui.SetActiveWindow(hwnd)
27 | # win32gui.ShowWindow(hwnd)
28 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
29 |
30 |
31 | with open("pybot-config.yaml", "r") as yamlfile:
32 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
33 |
34 | try:
35 | gfindWindow(data[0]['Config']['client_title'])
36 | except BaseException:
37 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
38 | core.printWindows()
39 | pass
40 |
41 | try:
42 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
43 | except BaseException:
44 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
45 | core.printWindows()
46 | pass
47 |
48 | def Image_Rec_single_closest(image, threshold=0.7, clicker='left'):
49 | functions.screen_Image(620, 480, 820, 750, 'closest.png')
50 | img_rgb = cv2.imread('images/closest.png')
51 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
52 | template = cv2.imread(image, 0)
53 | w, h = template.shape[::-1]
54 | pt = None
55 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
56 | threshold = threshold
57 | loc = np.where(res >= threshold)
58 | close_list = []
59 | close_points = []
60 | pos = pyautogui.position()
61 | for pt in zip(*loc[::-1]):
62 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
63 | close_list.append(abs(abs(pos[0] - pt[0]) + abs(pos[1] - pt[1])))
64 | close_points.append(pt)
65 | if pt is None:
66 | print('not found')
67 | return False
68 | pick_random_item = random.randrange(0, len(close_points))
69 | coords = close_points[pick_random_item]
70 | print(coords)
71 | x = random.randrange(5, 20) + 620
72 | y = random.randrange(5, 20) + 480
73 | icoord = coords[0] + x
74 | icoord = (icoord, coords[1] + y)
75 | b = random.uniform(0.1, 0.7)
76 | pyautogui.moveTo(icoord, duration=b)
77 | b = random.uniform(0.01, 0.3)
78 | pyautogui.click(icoord, duration=b, button=clicker)
79 | return close_points
80 |
81 |
82 | def vial_inv(vial):
83 | counter = 0
84 | myScreenshot = pyautogui.screenshot()
85 | myScreenshot.save(r"screen.png")
86 | img_rgb = cv2.imread('screen.png')
87 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
88 | template = cv2.imread('images/' + str(vial) + '_icon.png', 0)
89 | w, h = template.shape[::-1]
90 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
91 | threshold = 0.8
92 | loc = np.where(res >= threshold)
93 | for pt in zip(*loc[::-1]):
94 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
95 | counter += 1
96 | #cv2.imwrite('res.png', img_rgb)
97 | return counter
98 | # cv2.waitKey(0)
99 |
100 | def skill_lvl_up():
101 | counter = 0
102 | myScreenshot = pyautogui.screenshot()
103 | myScreenshot.save(r"screen.png")
104 | img_rgb = cv2.imread('screen.png')
105 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
106 | template = cv2.imread('images/Congrats_flag.png', 0)
107 | w, h = template.shape[::-1]
108 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
109 | threshold = 0.8
110 | loc = np.where(res >= threshold)
111 | for pt in zip(*loc[::-1]):
112 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
113 | counter += 1
114 | cv2.imwrite('res.png', img_rgb)
115 | return counter
116 | def cleaning_weeds(weed):
117 | x = random.randrange(5, 40) # x = random.randrange(1795, 1800)
118 | print('x: ', x)
119 | y = random.randrange(5, 40) # y = random.randrange(50, 60)
120 | print('y: ', y)
121 | image_Rec_clicker(str(weed) + '_grime.png','cleaning weed', threshold=0.8, fast=True, playarea=False)
122 |
123 | def combine_items(item, Pause=False):
124 | Image_Rec_single_closest("images/vial_water.png") # water
125 | c = random.uniform(0.1,0.9)
126 | time.sleep(c)
127 | Image_Rec_single_closest("images/" + item + "_icon.png") # item
128 | c = random.uniform(0.1, 1)
129 | time.sleep(c)
130 | pyautogui.press('space')
131 | c = random.uniform(1, 2)
132 | time.sleep(c)
133 | while functions.make_enabled("make_herb.png") == 1:
134 | pyautogui.press('space')
135 | e = random.uniform(0.1, 0.9)
136 | time.sleep(e)
137 | if Pause:
138 | c = random.uniform(0, 10)
139 | time.sleep(c)
140 |
141 | def single_pick_potion_item(v,u):
142 | c = random.uniform(0.1, 0.7)
143 | d = random.uniform(0.01, 0.15)
144 | x = random.randrange(v-10, v+10)
145 | print('x: ', x)
146 | y = random.randrange(u-5, u+5)
147 | b = random.uniform(0.1, 0.7)
148 | pyautogui.moveTo(x, y, duration=b)
149 | time.sleep(d)
150 | pyautogui.click(button='left')
151 | time.sleep(c)
152 |
153 | def pick_potion_item(v,u):
154 | c = random.uniform(0.1, 0.7)
155 | d = random.uniform(0.01, 0.15)
156 | x = random.randrange(v-10, v+10)
157 | print('x: ', x)
158 | y = random.randrange(u-5, u+5)
159 | b = random.uniform(0.1, 0.7)
160 | pyautogui.moveTo(x, y, duration=b)
161 | time.sleep(d)
162 | pyautogui.click(button='right')
163 | time.sleep(c)
164 | w = random.randrange(0, 10) + x
165 | print('x: ', x)
166 | z = random.randrange(65, 70) + y #52, 62
167 | print('y: ', y)
168 | pyautogui.moveTo(w, z, duration=b)
169 | b = random.uniform(0.1, 0.19)
170 | pyautogui.click(duration=b)
171 | c = random.uniform(0.1, 0.5)
172 | time.sleep(c)
173 |
174 | # def grind_horns(item):
175 | # c = random.uniform(0.1, 0.8)
176 | # find_Object(1)
177 | # time.sleep(c)
178 | # c = random.uniform(0.1, 0.6)
179 | # deposit_secondItem()
180 | # time.sleep(c)
181 | # pick_potion_item(470, 485)
182 | # c = random.uniform(0.1, 0.25)
183 | # exit_bank()
184 | # time.sleep(c)
185 | # combine_items()
186 | # while vial_inv(item) > 0: # harra #guam #toad
187 | # while skill_lvl_up() == 0:
188 | # print('skills are: ', skill_lvl_up())
189 | # print('items left: ', vial_inv(item)) # guam #harra
190 | # print('keep making money!!!')
191 | # if vial_inv(item) == 0: # guam #harra
192 | # break
193 | # if vial_inv(item) == 0: # guam #harra
194 | # break
195 | # if skill_lvl_up() == 1:
196 | # break
197 | # time.sleep(c)
198 | def cast_superglass(v,u):
199 | c = random.uniform(0.1, 0.3)
200 | d = random.uniform(0.01, 0.15)
201 | x = random.randrange(v-5, v+5)
202 | #print('x: ', x)
203 | y = random.randrange(u-5, u+5)
204 | b = random.uniform(0.1, 0.4)
205 | pyautogui.moveTo(x, y, duration=b)
206 | time.sleep(d)
207 | pyautogui.click(button='left')
208 | time.sleep(c)
209 | def pick_seaweed(v,u):
210 | c = random.uniform(0.01, 0.2)
211 | d = random.uniform(0.01, 0.05)
212 | x = random.randrange(v-8, v+8)
213 | #print('x: ', x)
214 | y = random.randrange(u-5, u+5)
215 | b = random.uniform(0.1, 0.3)
216 | pyautogui.moveTo(x, y, duration=b)
217 | time.sleep(d)
218 | pyautogui.click(button='left')
219 | time.sleep(c)
220 | c = random.uniform(0.01, 0.2)
221 | d = random.uniform(0.01, 0.05)
222 | x = random.randrange(v - 9, v + 9)
223 | #print('x: ', x)
224 | y = random.randrange(u - 5, u + 5)
225 | b = random.uniform(0.02, 0.2)
226 | pyautogui.moveTo(x, y, duration=b)
227 | time.sleep(d)
228 | pyautogui.click(button='left')
229 | time.sleep(c)
230 | c = random.uniform(0.05, 0.2)
231 | d = random.uniform(0.01, 0.05)
232 | x = random.randrange(v - 9, v + 9)
233 | #print('x: ', x)
234 | y = random.randrange(u - 5, u + 5)
235 | b = random.uniform(0.05, 0.2)
236 | pyautogui.moveTo(x, y, duration=b)
237 | time.sleep(d)
238 | pyautogui.click(button='left')
239 | time.sleep(c)
240 | def pick_bucket_sand(v,u):
241 | c = random.uniform(0.1, 0.4)
242 | d = random.uniform(0.05, 0.2)
243 | x = random.randrange(v-10, v+10)
244 | #print('x: ', x)
245 | y = random.randrange(u-5, u+5)
246 | b = random.uniform(0.1, 0.4)
247 | pyautogui.moveTo(x, y, duration=b)
248 | time.sleep(d)
249 | pyautogui.click(button='right')
250 | time.sleep(c)
251 | w = random.randrange(0, 10) + x
252 | #print('x: ', x)
253 | z = random.randrange(70, 75) + y #52, 62
254 | #print('y: ', y)
255 | pyautogui.moveTo(w, z, duration=b)
256 | b = random.uniform(0.05, 0.2)
257 | pyautogui.click(duration=b)
258 | c = random.uniform(0.1, 0.2)
259 | time.sleep(c)
260 |
261 |
262 | def pick_all_item(v,u):
263 | c = random.uniform(0.1, 0.8)
264 | d = random.uniform(0.05, 0.15)
265 | x = random.randrange(v-10, v+10)
266 | print('x: ', x)
267 | y = random.randrange(u-5, u+5)
268 | b = random.uniform(0.1, 0.85)
269 | pyautogui.moveTo(x, y, duration=b)
270 | time.sleep(d)
271 | pyautogui.click(button='left')
272 | time.sleep(c)
273 |
274 | def pick_grimy_item(v,u):
275 | c = random.uniform(0.1, 0.8)
276 | d = random.uniform(0.01, 0.15)
277 | x = random.randrange(v-10, v+10)
278 | print('x: ', x)
279 | y = random.randrange(u-5, u+5)
280 | b = random.uniform(0.1, 0.85)
281 | pyautogui.moveTo(x, y, duration=b)
282 | time.sleep(d)
283 | pyautogui.click(button='right')
284 | time.sleep(c)
285 | w = random.randrange(0, 10) + x
286 | print('x: ', x)
287 | z = random.randrange(100, 105) + y #100, 105 #110,115
288 | print('y: ', y)
289 | pyautogui.moveTo(w, z, duration=b)
290 | b = random.uniform(0.1, 0.19)
291 | pyautogui.click(duration=b)
292 | c = random.uniform(1.7, 2.6)
293 | time.sleep(c)
294 |
295 | def takepotion():
296 | Image_Rec_single('prayer4_potion.png', 'taking potion', 0.95, 'left')
297 | j = 0
298 | while j < 10:
299 | print('ass potion')
300 | d = random.uniform(63, 64)
301 | time.sleep(d)
302 | potion = Image_Rec_single('prayer4_potion.png', 'taking potion', 0.95, 'left')
303 | if potion is False:
304 | potion = Image_Rec_single('prayer2_potion.png', 'taking potion', 0.95, 'left')
305 | if potion is False:
306 | potion = Image_Rec_single('prayer1_potion.png', 'taking potion', 0.95, 'left')
307 | def superglass_money():
308 | a = random.uniform(0.1, 0.35)
309 | find_Object(1)
310 | deposit_secondItem()
311 | pick_bucket_sand(472,269)
312 | pick_seaweed(423, 269)
313 | time.sleep(a)
314 | a = random.uniform(0.1, 0.3)
315 | exit_bank()
316 | time.sleep(a)
317 | cast_superglass(642,607)
318 | a = random.uniform(3, 4)
319 | time.sleep(a)
320 | print("ready")
321 |
322 | def clean_weeds(x,y,name):
323 | c = random.uniform(0.1, 0.8)
324 | error_c = 0
325 | while functions.bank_ready(False) == False:
326 | if error_c > 3:
327 | exit()
328 | find_Object(1)
329 | c = random.uniform(1, 3)
330 | time.sleep(c)
331 | error_c += 1
332 | c = random.uniform(0.1, 0.6)
333 | deposit_all_Bank()
334 | time.sleep(c)
335 | pick_all_item(x, y) #harra 227, 265 #guam 185, 265 #ranarr 185 485 #irit 425, 485 kwuarm 185, 520 avan 275, 520, cada 280,520 lant 425,520
336 | c = random.uniform(0.1, 0.25)
337 | exit_bank()
338 | time.sleep(c)
339 | c = random.uniform(0.1, 1)
340 | invent = functions.invent_enabled()
341 | print(invent)
342 | if invent == 0:
343 | pyautogui.press('esc')
344 | cleaning_weeds(name) #guam #harra #ranarr #irit #kwuarm #avan #cada #lant
345 | time.sleep(c)
346 |
347 |
348 |
349 | def make_potion(item, vialx, vialy, herbx, herby):
350 | c = random.uniform(0.1, 0.6)
351 | error_c = 0
352 | while functions.bank_ready(False) == False:
353 | if error_c > 3:
354 | exit()
355 | find_Object(1)
356 | c = random.uniform(1, 3)
357 | time.sleep(c)
358 | error_c += 1
359 | deposit_all_Bank()
360 | time.sleep(c)
361 | single_pick_potion_item(vialx, vialy) # water
362 | c = random.uniform(0.1, 0.25)
363 | single_pick_potion_item(herbx, herby) # herb item
364 | c = random.uniform(0.1, 0.25)
365 | exit_bank()
366 | time.sleep(c)
367 | combine_items(item)
368 | time_start = time.time()
369 | time_end = 0
370 | i = 9
371 | x = random.uniform(i, i+5)
372 | while vial_inv(item) > 0 and time_end < x: #harra #guam #toad
373 | while skill_lvl_up() == 0:
374 | time_end = time.time() - time_start
375 | print('skills are: ', skill_lvl_up())
376 | print('items left: ', vial_inv(item)) #guam #harra
377 | print('keep making money!!!')
378 | if vial_inv(item) == 0: #guam #harra
379 | break
380 | if vial_inv(item) == 0: #guam #harra
381 | break
382 | if skill_lvl_up() == 1:
383 | break
384 | time.sleep(c)
385 |
386 | def superglassmaking(i):
387 | j = round(i)
388 | while j > 0:
389 | superglass_money()
390 | j -= 1
391 | print('superglass left: ', j)
392 |
393 | def weedcleaning(i, x, y, name):
394 | j = round(i/28) + 1
395 | while j > 0:
396 | clean_weeds(x, y, name)
397 | #clean_weeds(280,161,'irit') #guam #harra #ranarr #irit #kwuarm #avan #cada #lant #cad #mar
398 | # harra 280, 410 #guam 280, 378 #toad 470, 450 #ranarr 230, 485 irit 330, 485 kwuarm 235, 520 avan 130, 520 cada 375,520 lant 470, 485
399 | j -= 1
400 |
401 |
402 | def potionmaking(i):
403 | j = round(i/14)
404 | while j > 0:
405 | # used to make unfinished potions, 'item' is the herb name
406 | # vailx and vialy is the bank inventory of the vials of water
407 | # herbx and herby is the bank inventory for the herb
408 | make_potion('guam', 232, 307, 183, 341) # item, vialx, vialy, herbx, herby
409 | j -= 1
410 |
411 | if __name__ == "__main__":
412 | #superglassmaking(50)
413 | # weedcleaning is used to clean herbs, the function values order is:
414 | # number of grimy herbs to clean.
415 | # the x and y of the grimy herb in the bank inventory.
416 | # name of the 'herb'. #guam #harra #ranarr #irit #kwuarm #avan #cada #lant #cad #marre #tar
417 | weedcleaning(100, 185, 305, 'guam')
418 |
419 | # potionmaking is used to make unfinished potions refer to the potionmaking function to make changes.
420 | # The variable it takes is the number of unfinished potions to make.
421 | potionmaking(100)
422 | #os.system('shutdown -s -f')
423 |
--------------------------------------------------------------------------------
/images/Congrats_flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/Congrats_flag.png
--------------------------------------------------------------------------------
/images/Earth_alter_mark1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/Earth_alter_mark1.png
--------------------------------------------------------------------------------
/images/activity_adviser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/activity_adviser.png
--------------------------------------------------------------------------------
/images/air_craft_bank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_bank.png
--------------------------------------------------------------------------------
/images/air_craft_mark_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_1.png
--------------------------------------------------------------------------------
/images/air_craft_mark_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_2.png
--------------------------------------------------------------------------------
/images/air_craft_mark_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_3.png
--------------------------------------------------------------------------------
/images/air_craft_mark_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_4.png
--------------------------------------------------------------------------------
/images/air_craft_mark_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_5.png
--------------------------------------------------------------------------------
/images/air_craft_mark_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_6.png
--------------------------------------------------------------------------------
/images/air_craft_mark_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_7.png
--------------------------------------------------------------------------------
/images/air_craft_mark_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_8.png
--------------------------------------------------------------------------------
/images/air_craft_mark_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/air_craft_mark_9.png
--------------------------------------------------------------------------------
/images/alkarid_fishspot_step_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/alkarid_fishspot_step_1.png
--------------------------------------------------------------------------------
/images/alkarid_fishspot_step_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/alkarid_fishspot_step_2.png
--------------------------------------------------------------------------------
/images/alkarid_fishspot_step_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/alkarid_fishspot_step_3.png
--------------------------------------------------------------------------------
/images/anch_cooked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/anch_cooked.png
--------------------------------------------------------------------------------
/images/anch_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/anch_fish.png
--------------------------------------------------------------------------------
/images/angler_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/angler_fish.png
--------------------------------------------------------------------------------
/images/apple_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/apple_fruit.png
--------------------------------------------------------------------------------
/images/bait_pack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bait_pack.png
--------------------------------------------------------------------------------
/images/banana_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/banana_fruit.png
--------------------------------------------------------------------------------
/images/bank_deposit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bank_deposit.png
--------------------------------------------------------------------------------
/images/bank_deposit_box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bank_deposit_box.png
--------------------------------------------------------------------------------
/images/bank_mark2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bank_mark2.png
--------------------------------------------------------------------------------
/images/bank_mark3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bank_mark3.png
--------------------------------------------------------------------------------
/images/bank_mark4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bank_mark4.png
--------------------------------------------------------------------------------
/images/bear_pie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bear_pie.png
--------------------------------------------------------------------------------
/images/bones_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bones_icon.png
--------------------------------------------------------------------------------
/images/bronze_axe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bronze_axe.png
--------------------------------------------------------------------------------
/images/bronze_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bronze_bar.png
--------------------------------------------------------------------------------
/images/bronze_nails.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bronze_nails.png
--------------------------------------------------------------------------------
/images/bronze_scimitar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bronze_scimitar.png
--------------------------------------------------------------------------------
/images/bronze_wire.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bronze_wire.png
--------------------------------------------------------------------------------
/images/bucket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/bucket.png
--------------------------------------------------------------------------------
/images/check_inv_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/check_inv_result.png
--------------------------------------------------------------------------------
/images/chisel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/chisel.png
--------------------------------------------------------------------------------
/images/chompy_pie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/chompy_pie.png
--------------------------------------------------------------------------------
/images/clay_deposit_spot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot1.png
--------------------------------------------------------------------------------
/images/clay_deposit_spot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot2.png
--------------------------------------------------------------------------------
/images/clay_deposit_spot3 .png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot3 .png
--------------------------------------------------------------------------------
/images/clay_deposit_spot3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot3.png
--------------------------------------------------------------------------------
/images/clay_deposit_spot4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot4.png
--------------------------------------------------------------------------------
/images/clay_deposit_spot5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_deposit_spot5.png
--------------------------------------------------------------------------------
/images/clay_ore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clay_ore.png
--------------------------------------------------------------------------------
/images/clue_nest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/clue_nest.png
--------------------------------------------------------------------------------
/images/coal_ore.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/coal_ore.PNG
--------------------------------------------------------------------------------
/images/cooking_xp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/cooking_xp.png
--------------------------------------------------------------------------------
/images/cooking_xp2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/cooking_xp2.png
--------------------------------------------------------------------------------
/images/cooking_xp3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/cooking_xp3.png
--------------------------------------------------------------------------------
/images/copper_ore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/copper_ore.png
--------------------------------------------------------------------------------
/images/diamond_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/diamond_icon.png
--------------------------------------------------------------------------------
/images/director_tutorial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/director_tutorial.png
--------------------------------------------------------------------------------
/images/draynor_bank_spot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/draynor_bank_spot.png
--------------------------------------------------------------------------------
/images/earth_mark2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/earth_mark2.png
--------------------------------------------------------------------------------
/images/earthalter_mark1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/earthalter_mark1.png
--------------------------------------------------------------------------------
/images/edgeville_spot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/edgeville_spot.png
--------------------------------------------------------------------------------
/images/exp_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/exp_fruit.png
--------------------------------------------------------------------------------
/images/feather_pack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/feather_pack.png
--------------------------------------------------------------------------------
/images/fire_craft_bank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_bank.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_1.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_2.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_3.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_4.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_5.png
--------------------------------------------------------------------------------
/images/fire_craft_mark_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_mark_6.png
--------------------------------------------------------------------------------
/images/fire_craft_runealter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/fire_craft_runealter.png
--------------------------------------------------------------------------------
/images/firemaking_xp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firemaking_xp.png
--------------------------------------------------------------------------------
/images/firemaking_xp2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firemaking_xp2.png
--------------------------------------------------------------------------------
/images/firespot_draynor_oak.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_draynor_oak.png
--------------------------------------------------------------------------------
/images/firespot_draynor_willow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_draynor_willow.png
--------------------------------------------------------------------------------
/images/firespot_draynor_wood.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_draynor_wood.png
--------------------------------------------------------------------------------
/images/firespot_farador_oak.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_farador_oak.png
--------------------------------------------------------------------------------
/images/firespot_lumbridge_wood.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_lumbridge_wood.png
--------------------------------------------------------------------------------
/images/firespot_varrock_wood.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/firespot_varrock_wood.png
--------------------------------------------------------------------------------
/images/gem_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/gem_icon.png
--------------------------------------------------------------------------------
/images/gem_icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/gem_icon2.png
--------------------------------------------------------------------------------
/images/geo_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/geo_icon.png
--------------------------------------------------------------------------------
/images/gerrant_shop.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/gerrant_shop.PNG
--------------------------------------------------------------------------------
/images/gold_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/gold_bar.png
--------------------------------------------------------------------------------
/images/grape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/grape.png
--------------------------------------------------------------------------------
/images/greenberry_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/greenberry_fruit.png
--------------------------------------------------------------------------------
/images/guam_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/guam_grime.png
--------------------------------------------------------------------------------
/images/guam_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/guam_icon.png
--------------------------------------------------------------------------------
/images/harra_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/harra_grime.png
--------------------------------------------------------------------------------
/images/harra_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/harra_icon.png
--------------------------------------------------------------------------------
/images/img_grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/img_grid.png
--------------------------------------------------------------------------------
/images/inventory_enabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/inventory_enabled.png
--------------------------------------------------------------------------------
/images/inventshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/inventshot.png
--------------------------------------------------------------------------------
/images/iron_axe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/iron_axe.png
--------------------------------------------------------------------------------
/images/iron_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/iron_bar.png
--------------------------------------------------------------------------------
/images/iron_dart_tips.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/iron_dart_tips.png
--------------------------------------------------------------------------------
/images/iron_ore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/iron_ore.png
--------------------------------------------------------------------------------
/images/iron_scimitar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/iron_scimitar.png
--------------------------------------------------------------------------------
/images/item-images.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/item-images.zip
--------------------------------------------------------------------------------
/images/knife.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/knife.png
--------------------------------------------------------------------------------
/images/lemon_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/lemon_fruit.png
--------------------------------------------------------------------------------
/images/lime_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/lime_fruit.png
--------------------------------------------------------------------------------
/images/lobster_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/lobster_fish.png
--------------------------------------------------------------------------------
/images/magic_longbow.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/magic_longbow.PNG
--------------------------------------------------------------------------------
/images/make_craft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/make_craft.png
--------------------------------------------------------------------------------
/images/make_herb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/make_herb.png
--------------------------------------------------------------------------------
/images/make_how.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/make_how.png
--------------------------------------------------------------------------------
/images/make_string.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/make_string.png
--------------------------------------------------------------------------------
/images/maple_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/maple_icon.png
--------------------------------------------------------------------------------
/images/maple_longbow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/maple_longbow.png
--------------------------------------------------------------------------------
/images/marre_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/marre_grime.png
--------------------------------------------------------------------------------
/images/marre_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/marre_icon.png
--------------------------------------------------------------------------------
/images/miner_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/miner_img.png
--------------------------------------------------------------------------------
/images/mini_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/mini_map.png
--------------------------------------------------------------------------------
/images/money_bag_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/money_bag_2.png
--------------------------------------------------------------------------------
/images/oak_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/oak_icon.png
--------------------------------------------------------------------------------
/images/oak_longbow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/oak_longbow.png
--------------------------------------------------------------------------------
/images/osrs_title_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/osrs_title_2.png
--------------------------------------------------------------------------------
/images/papyaya_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/papyaya_fruit.png
--------------------------------------------------------------------------------
/images/pie_shell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/pie_shell.png
--------------------------------------------------------------------------------
/images/pineapple_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/pineapple_fruit.png
--------------------------------------------------------------------------------
/images/port_sarim_jewl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/port_sarim_jewl.png
--------------------------------------------------------------------------------
/images/port_sarim_spot_water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/port_sarim_spot_water.png
--------------------------------------------------------------------------------
/images/prawn_burnt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/prawn_burnt.png
--------------------------------------------------------------------------------
/images/prawn_cooked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/prawn_cooked.png
--------------------------------------------------------------------------------
/images/prawn_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/prawn_fish.png
--------------------------------------------------------------------------------
/images/purple_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/purple_fruit.png
--------------------------------------------------------------------------------
/images/ranarr_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/ranarr_grime.png
--------------------------------------------------------------------------------
/images/ranarr_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/ranarr_icon.png
--------------------------------------------------------------------------------
/images/raw_bear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/raw_bear.png
--------------------------------------------------------------------------------
/images/raw_chompy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/raw_chompy.png
--------------------------------------------------------------------------------
/images/raw_rabbit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/raw_rabbit.png
--------------------------------------------------------------------------------
/images/rim_mine_spot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/rim_mine_spot1.png
--------------------------------------------------------------------------------
/images/rim_mine_spot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/rim_mine_spot2.png
--------------------------------------------------------------------------------
/images/ruby_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/ruby_icon.png
--------------------------------------------------------------------------------
/images/rune_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/rune_icon.png
--------------------------------------------------------------------------------
/images/runeshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/runeshot.png
--------------------------------------------------------------------------------
/images/salmon_cooked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/salmon_cooked.png
--------------------------------------------------------------------------------
/images/salmon_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/salmon_fish.png
--------------------------------------------------------------------------------
/images/sapphire_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/sapphire_icon.png
--------------------------------------------------------------------------------
/images/sapphire_ring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/sapphire_ring.png
--------------------------------------------------------------------------------
/images/screen_resize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/screen_resize.png
--------------------------------------------------------------------------------
/images/screenshot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/screenshot2.png
--------------------------------------------------------------------------------
/images/sea_puzzle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/sea_puzzle.png
--------------------------------------------------------------------------------
/images/shark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/shark.png
--------------------------------------------------------------------------------
/images/snap_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/snap_grime.png
--------------------------------------------------------------------------------
/images/snap_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/snap_icon.png
--------------------------------------------------------------------------------
/images/steel_axe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/steel_axe.png
--------------------------------------------------------------------------------
/images/steel_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/steel_bar.png
--------------------------------------------------------------------------------
/images/steel_chainbody.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/steel_chainbody.png
--------------------------------------------------------------------------------
/images/steel_scimitar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/steel_scimitar.png
--------------------------------------------------------------------------------
/images/strawberry_fruit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/strawberry_fruit.png
--------------------------------------------------------------------------------
/images/stringbow_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/stringbow_icon.png
--------------------------------------------------------------------------------
/images/superheat_cast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/superheat_cast.png
--------------------------------------------------------------------------------
/images/switch-off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/switch-off.png
--------------------------------------------------------------------------------
/images/switch-on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/switch-on.png
--------------------------------------------------------------------------------
/images/tar_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tar_grime.png
--------------------------------------------------------------------------------
/images/tar_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tar_icon.png
--------------------------------------------------------------------------------
/images/tea_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tea_icon.png
--------------------------------------------------------------------------------
/images/test_mm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/test_mm.png
--------------------------------------------------------------------------------
/images/textshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/textshot.png
--------------------------------------------------------------------------------
/images/thieving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/thieving.png
--------------------------------------------------------------------------------
/images/tin_ore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tin_ore.png
--------------------------------------------------------------------------------
/images/tinderbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tinderbox.png
--------------------------------------------------------------------------------
/images/toad_grime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/toad_grime.png
--------------------------------------------------------------------------------
/images/toad_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/toad_icon.png
--------------------------------------------------------------------------------
/images/trout_cooked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/trout_cooked.png
--------------------------------------------------------------------------------
/images/trout_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/trout_fish.png
--------------------------------------------------------------------------------
/images/tynan_shop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/tynan_shop.png
--------------------------------------------------------------------------------
/images/vial_water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/vial_water.png
--------------------------------------------------------------------------------
/images/waterjug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/waterjug.png
--------------------------------------------------------------------------------
/images/willow_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/willow_icon.png
--------------------------------------------------------------------------------
/images/wood_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/wood_icon.png
--------------------------------------------------------------------------------
/images/woodcutting_xp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/woodcutting_xp.png
--------------------------------------------------------------------------------
/images/xp_gain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/images/xp_gain.png
--------------------------------------------------------------------------------
/jar files/httpplug-1.0.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/jar files/httpplug-1.0.3.jar
--------------------------------------------------------------------------------
/jar files/shortestagility-5.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/jar files/shortestagility-5.0.2.jar
--------------------------------------------------------------------------------
/jar files/slyminimap-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slyautomation/osrs_basic_botting_functions/9bf33e7cf171b36a1a8ff7e8c8995f5d3cedb10f/jar files/slyminimap-1.0.0.jar
--------------------------------------------------------------------------------
/magic.py:
--------------------------------------------------------------------------------
1 | import random
2 | import time
3 | import pyautogui
4 | import win32gui
5 | import core
6 | import yaml
7 | from functions import pick_item
8 | from functions import random_combat
9 | from functions import random_quests
10 | from functions import random_skills
11 | from functions import random_inventory
12 | from functions import random_breaks
13 |
14 | from functions import find_Object
15 | from functions import exit_bank
16 | from functions import Image_Rec_single
17 | from functions import deposit_secondItem
18 |
19 | import functions
20 |
21 | global hwnd
22 | global iflag
23 | global icoord
24 | iflag = False
25 | global newTime_break
26 | newTime_break = False
27 | global timer
28 | global timer_break
29 | global ibreak
30 |
31 | def gfindWindow(data): # find window name returns PID of the window
32 | global hwnd
33 | hwnd = win32gui.FindWindow(None, data)
34 | # hwnd = win32gui.GetForegroundWindow()860
35 | #print('findWindow:', hwnd)
36 | win32gui.SetActiveWindow(hwnd)
37 | # win32gui.ShowWindow(hwnd)
38 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
39 |
40 |
41 | with open("pybot-config.yaml", "r") as yamlfile:
42 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
43 |
44 | try:
45 | gfindWindow(data[0]['Config']['client_title'])
46 | except BaseException:
47 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
48 | core.printWindows()
49 | pass
50 |
51 | try:
52 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
53 | except BaseException:
54 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
55 | core.printWindows()
56 | pass
57 |
58 | def random_break(start, c):
59 | global newTime_break
60 | startTime = time.time()
61 | # 1200 = 20 minutes
62 | a = random.randrange(0, 4)
63 | if startTime - start > c:
64 | options[a]()
65 | newTime_break = True
66 |
67 |
68 | def randomizer(timer_breaks, ibreaks):
69 | global newTime_break
70 | global timer_break
71 | global ibreak
72 | random_break(timer_breaks, ibreaks)
73 | if newTime_break == True:
74 | timer_break = timer()
75 | ibreak = random.randrange(600, 2000)
76 | newTime_break = False
77 |
78 | # b = random.uniform(4, 5)
79 |
80 |
81 | def timer():
82 | startTime = time.time()
83 | return startTime
84 |
85 |
86 | def random_pause():
87 | b = random.uniform(20, 250)
88 | print('pausing for ' + str(b) + ' seconds')
89 | time.sleep(b)
90 | newTime_break = True
91 |
92 |
93 | iflag = False
94 |
95 | options = {0: random_inventory,
96 | 1: random_combat,
97 | 2: random_skills,
98 | 3: random_quests,
99 | 4: random_pause}
100 |
101 |
102 | def high_alch_command():
103 | # 3rd item
104 | b = random.uniform(0.33, 0.46)
105 | x = random.randrange(791, 800) + 5
106 | print('x: ', x)
107 | y = random.randrange(585, 595) + 5
108 | print('y: ', y)
109 | d = random.uniform(0.11, 0.18)
110 | pyautogui.moveTo(x, y, duration=b)
111 | time.sleep(d)
112 | pyautogui.click()
113 | print('alch command clicked')
114 |
115 |
116 | def high_alch():
117 | # 3rd item
118 | b = random.uniform(0.33, 0.46)
119 | c = random.uniform(1, 1.5)
120 | x = random.randrange(730, 750)
121 | print('x: ', x)
122 | y = random.randrange(490, 515) + 5
123 | print('y: ', y)
124 | d = random.uniform(0.11, 0.18)
125 | pyautogui.moveTo(x, y, duration=b)
126 | time.sleep(d)
127 | pyautogui.click()
128 |
129 | print('alching item')
130 |
131 |
132 | def high_aclh_loop(vol, bool):
133 | t = vol
134 | exp = bool
135 | while t > 0:
136 | c = random.uniform(1.5, 1.8)
137 | high_alch_command()
138 | # time.sleep(c)
139 | high_alch_command() # alchs same spot as alch spell location #high_alch() alchs 3rd inventory spot
140 | c = random.uniform(1.4, 1.9)
141 | if exp:
142 | print('expensive')
143 | x = random.uniform(0.8, 1.2)
144 | time.sleep(x)
145 | x = random.uniform(0.8, 1.2)
146 | pyautogui.press('space')
147 | time.sleep(x)
148 | pyautogui.press('1')
149 | x = random.uniform(0.5, 0.6)
150 | time.sleep(x)
151 | time.sleep(c)
152 | t -= 1
153 |
154 |
155 | def pick_iron_items():
156 | pick_item(1510 - 1280, 123)
157 | random_breaks(0.5, 1.5)
158 |
159 |
160 | def pick_bronze_items():
161 | pick_item(1560 - 1280, 123)
162 | random_breaks(0.5, 1.5)
163 | pick_item(1607 - 1280, 123)
164 | random_breaks(0.1, 0.5)
165 |
166 |
167 | def bank_spot_varrock():
168 | find_Object(2) # amber
169 |
170 |
171 | def cast_superheat():
172 | pick_item(2029 - 1280, 573)
173 |
174 |
175 | def pick_ore(type):
176 | Image_Rec_single(type, 'pick ores', 5, 5, 0.8, 'left', 20, 620, 480, False)
177 |
178 |
179 | def superheat_items(num, bar):
180 | vol = [13, 27]
181 | j = round(num / vol[bar])
182 | pick_options = {0: pick_bronze_items,
183 | 1: pick_iron_items}
184 | orelist = ['copper.png', 'iron_ore.png']
185 | while j > 0:
186 | bank_spot_varrock()
187 | random_breaks(0.3, 0.5)
188 | deposit_secondItem()
189 | random_breaks(0.3, 0.5)
190 | pick_options[bar]()
191 | exit_bank()
192 | random_breaks(0.05, 0.2)
193 | inv = 27
194 | while inv != 0:
195 | cast_superheat()
196 | random_breaks(0.2, 0.4)
197 | pick_ore(orelist[bar])
198 | random_breaks(0.1, 0.2)
199 | inv -= 1
200 | print(inv)
201 | j -= 1
202 | random_breaks(0.4, 0.8)
203 |
204 |
205 | if __name__ == "__main__":
206 | high_aclh_loop(68, False)
207 | # superheat_items(100, 1) #100 items iron
208 |
--------------------------------------------------------------------------------
/miner.py:
--------------------------------------------------------------------------------
1 |
2 | import datetime
3 | import win32gui
4 | from threading import Thread
5 | import core
6 | import yaml
7 | from functions import Image_count, invent_enabled
8 | from functions import image_Rec_clicker
9 | from functions import screen_Image
10 | from functions import release_drop_item
11 | from functions import drop_item
12 | from functions import Image_to_Text
13 | from functions import invent_crop
14 | from functions import resizeImage
15 | from PIL import ImageGrab
16 |
17 | from functions import random_combat
18 | from functions import random_quests
19 | from functions import random_skills
20 | from functions import random_inventory
21 | from functions import random_breaks
22 |
23 | import numpy as np
24 | import cv2
25 | import time
26 | import random
27 | import pyautogui
28 |
29 | global hwnd
30 | global iflag
31 | global icoord
32 | iflag = False
33 | global newTime_break
34 | newTime_break = False
35 | global timer
36 | global timer_break
37 | global ibreak
38 | import slyautomation_title
39 |
40 | class bcolors:
41 | OK = '\033[92m' #GREEN
42 | WARNING = '\033[93m' #YELLOW
43 | FAIL = '\033[91m' #RED
44 | RESET = '\033[0m' #RESET COLOR
45 |
46 | def gfindWindow(data): # find window name returns PID of the window
47 | global hwnd
48 | hwnd = win32gui.FindWindow(None, data)
49 | # hwnd = win32gui.GetForegroundWindow()860
50 | #print('findWindow:', hwnd)
51 | win32gui.SetActiveWindow(hwnd)
52 | # win32gui.ShowWindow(hwnd)
53 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
54 |
55 |
56 | with open("pybot-config.yaml", "r") as yamlfile:
57 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
58 |
59 | try:
60 | gfindWindow(data[0]['Config']['client_title'])
61 | except BaseException:
62 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
63 | core.printWindows()
64 | pass
65 |
66 | try:
67 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
68 | except BaseException:
69 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
70 | core.printWindows()
71 | pass
72 |
73 | def random_break(start, c):
74 | global newTime_break
75 | startTime = time.time()
76 | # 1200 = 20 minutes
77 | a = random.randrange(0, 4)
78 | if startTime - start > c:
79 | options[a]()
80 | newTime_break = True
81 |
82 | def randomizer(timer_breaks, ibreaks):
83 | global newTime_break
84 | global timer_break
85 | global ibreak
86 | random_break(timer_breaks, ibreaks)
87 | if newTime_break == True:
88 | timer_break = timer()
89 | ibreak = random.randrange(600, 2000)
90 | newTime_break = False
91 |
92 | # b = random.uniform(4, 5)
93 |
94 | def timer():
95 | startTime = time.time()
96 | return startTime
97 |
98 | def random_pause():
99 | b = random.uniform(20, 250)
100 | print('pausing for ' + str(b) + ' seconds')
101 | time.sleep(b)
102 | newTime_break = True
103 |
104 |
105 | options = {0: random_inventory,
106 | 1: random_combat,
107 | 2: random_skills,
108 | 3: random_quests,
109 | 4: random_pause}
110 |
111 | def Miner_Image_quick():
112 | left = 150
113 | top = 150
114 | right = 600
115 | bottom = 750
116 |
117 | im = ImageGrab.grab(bbox=(left, top, right, bottom))
118 | im.save('images/miner_img.png', 'png')
119 |
120 | def Miner_Image():
121 | screen_Image(150, 150, 600, 750, 'images/miner_img.png')
122 |
123 | def drop_ore():
124 | global actions
125 | actions = "drop ore."
126 | invent_crop()
127 | drop_item()
128 | image_Rec_clicker(r'copper_ore.png', 'dropping item', threshold=0.8, playarea=False)
129 | image_Rec_clicker(r'clay_ore.png', 'dropping item', threshold=0.8, playarea=False)
130 | image_Rec_clicker(r'coal_ore.png', 'dropping item', threshold=0.8, playarea=False)
131 | image_Rec_clicker(r'iron_ore.png', 'dropping item', threshold=0.8, playarea=False)
132 | image_Rec_clicker(r'tin_ore.png', 'dropping item', threshold=0.8, playarea=False)
133 | release_drop_item()
134 | #print("dropping ore done")
135 | return "drop ore done"
136 |
137 |
138 | def findarea_single(ore, cropx, cropy):
139 | Miner_Image_quick()
140 | image = cv2.imread(r"images/miner_img.png")
141 |
142 | # B, G, R
143 | #--------------------- ADD OBJECTS -------------------
144 | tin = ([103, 86, 65], [145, 133, 128])
145 | copper = ([35, 70, 120], [65, 110, 170])
146 | coal = ([20, 30, 30], [30, 50, 50])
147 | iron = ([15, 20, 40], [25, 40, 70])
148 | iron2 = ([17, 20, 42], [25, 38, 70])
149 | clay = ([50, 105, 145], [60, 125, 165])
150 | red = ([0, 0, 180], [80, 80, 255])
151 | green = ([0, 180, 0], [80, 255, 80])
152 | amber = ([0, 160, 160], [80, 255, 255])
153 | # --------------------- ADD OBJECTS -------------------
154 | ore_list = [tin, copper, coal, iron, iron2, clay, red, green, amber]
155 | boundaries = [ore_list[ore]]
156 | # loop over the boundaries
157 | for (lower, upper) in boundaries:
158 | # create NumPy arrays from the boundaries
159 | lower = np.array(lower, dtype="uint8")
160 | upper = np.array(upper, dtype="uint8")
161 | # find the colors within the specified boundaries and apply
162 | # the mask
163 | mask = cv2.inRange(image, lower, upper)
164 | output = cv2.bitwise_and(image, image, mask=mask)
165 | ret, thresh = cv2.threshold(mask, 40, 255, 0)
166 | contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
167 | if len(contours) != 0:
168 | # find the biggest countour (c) by the area
169 | c = max(contours, key=cv2.contourArea)
170 |
171 | x, y, w, h = cv2.boundingRect(c)
172 | x = random.randrange(x + 5, x + max(w - 5, 6)) + cropx # 950,960
173 | #print('x: ', x)
174 | y = random.randrange(y + 5, y + max(h - 5, 6)) + cropy # 490,500
175 | #print('y: ', y)
176 | b = random.uniform(0.1, 0.3)
177 | pyautogui.moveTo(x, y, duration=b)
178 | b = random.uniform(0.07, 0.11)
179 | pyautogui.click(duration=b)
180 | return (x, y)
181 |
182 |
183 | def count_gems():
184 | return Image_count('gem_icon.png')
185 |
186 | def count_geo():
187 | return Image_count('geo_icon.png')
188 |
189 | def count_gems2():
190 | return Image_count('gem_icon2.png')
191 |
192 | def inv_count(name):
193 | return Image_count(name + '_ore.png')
194 |
195 | def timer_countdown():
196 | global Run_Duration_hours
197 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
198 | #print(t_end)
199 | final = round((60 * 60 * Run_Duration_hours) / 1)
200 | #print(final)
201 | for i in range(final):
202 | # the exact output you're looking for:
203 | print(bcolors.OK + f'\r[%-10s] %d%%' % ('='*round((i/final)*10), round((i/final)*100)), f'time left: {(t_end - time.time())/60 :.2f} mins | coords: {spot} | status: {mined_text} | ore: {ore_count} | gems: {gem_count} | clues: {clue_count} | {actions}', end='')
204 | time.sleep(1)
205 |
206 | def count_items():
207 | global Run_Duration_hours
208 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
209 | while time.time() < t_end:
210 | global ore, powerlist, ore_count, mined_text, gem_count, clue_count
211 | gem_count = int(count_gems() + count_gems2())
212 | ore_count = int(inv_count(powerlist[ore]))
213 | clue_count = int(count_geo())
214 | time.sleep(0.1)
215 | def print_progress(time_left, spot, mined_text, powerlist, ore, actions):
216 | print(bcolors.OK +
217 | f'\rtime left: {time_left} | coords: {spot} | status: {mined_text} | ore: {int(inv_count(powerlist[ore]))} | gems: {int(count_gems() + count_gems2())} | clues: {int(count_geo())} | {actions}',
218 | end='')
219 |
220 | def powerminer_text(ore, num, Take_Human_Break=False, Run_Duration_hours=5):
221 | global spot, mined_text, time_left, powerlist, actions, powerlist, t_end, gem_count, ore_count, clue_count
222 | powerlist = ['tin', 'copper', 'coal', 'iron', 'gold', 'clay', 'red', 'green', 'amber']
223 | print("Will break in: %.2f" % (ibreak / 60) + " minutes |", "Mine Ore Selected:", powerlist[ore])
224 | t1 = Thread(target=timer_countdown)
225 | t1.start()
226 | spot = (0,0)
227 | actions = 'None'
228 | mined_text = 'Not Mining'
229 |
230 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
231 | while time.time() < t_end:
232 | invent = invent_enabled()
233 | if invent == 0:
234 | actions = 'opening inventory'
235 | pyautogui.press('esc')
236 | time_left = str(datetime.timedelta(seconds=round(t_end - time.time(), 0)))
237 | actions = 'None'
238 | randomizer(timer_break, ibreak)
239 | r = random.uniform(0.1, 5)
240 | gem_count = int(count_gems() + count_gems2())
241 | ore_count = int(inv_count(powerlist[ore]))
242 | clue_count = int(count_geo())
243 | #inventory = int(inv_count(powerlist[ore])) + int(count_gems()) + int(count_gems2()) + int(count_geo())
244 | inventory = gem_count + ore_count + clue_count
245 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
246 | if inventory > 27:
247 | actions = 'dropping ore starting...'
248 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
249 | actions = drop_ore()
250 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
251 | random_breaks(0.2, 0.7)
252 | mined_text = Image_to_Text('thresh', 'textshot.png')
253 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
254 | if mined_text.strip().lower() != 'mining' and mined_text.strip().lower() != 'mininq':
255 | mined_text = 'Not Mining'
256 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
257 | #random_breaks(0.05, 0.1)
258 | spot = findarea_single(num, 150, 150)
259 | if Take_Human_Break:
260 | c = random.triangular(0.05, 6, 0.5)
261 | time.sleep(c)
262 | else:
263 | mined_text = 'Mining'
264 | #print_progress(time_left, spot, mined_text, powerlist, ore, actions)
265 |
266 |
267 | spot = (0, 0)
268 | actions = 'None'
269 | mined_text = 'Not Mining'
270 | time_left = 0
271 |
272 | #-------------------------------
273 |
274 | powerlist = ['tin', 'copper', 'coal', 'iron', 'gold', 'clay', 'red', 'green', 'amber']
275 |
276 | ore_count = 0
277 | gem_count = 0
278 | clue_count = 0
279 | #-------------------------------
280 |
281 | if __name__ == "__main__":
282 | x = random.randrange(100, 250)
283 | y = random.randrange(400, 500)
284 | pyautogui.click(x, y, button='right')
285 | ibreak = random.randrange(300, 2000)
286 | timer_break = timer()
287 |
288 |
289 | # ----- ORE -------
290 | tin = 0
291 | copper = 1
292 | coal = 2
293 | iron = 3
294 | gold = 4
295 | clay = 5
296 |
297 | # ----- OBJECT MARKER COLOR ------
298 | red = 6
299 | green = 7
300 | amber = 8
301 |
302 | # --------- CHANGE TO RUN FOR AMOUNT OF HOURS ----------------
303 | Run_Duration_hours = 0.1
304 |
305 | # | ore | marker color | take break | how long to run for in hours
306 | powerminer_text(copper, red, Take_Human_Break=True, Run_Duration_hours=Run_Duration_hours)
307 |
308 | #os.system('shutdown -s -f')
309 |
--------------------------------------------------------------------------------
/osrs_item_prices.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import os
3 |
4 | import requests
5 | import json
6 | import pandas as pd
7 | import webbrowser
8 | import numpy as np
9 | from datetime import datetime
10 | import ctypes # An included library with Python install.
11 | from win10toast import ToastNotifier
12 |
13 | print(os.path.dirname('csv'))
14 | def resourcePath(relativePath):
15 | """ Get absolute path to resource, works for dev and for PyInstaller """
16 | try:
17 | # PyInstaller creates a temp folder and stores path in _MEIPASS
18 | basePath = sys._MEIPASS
19 | except Exception:
20 | basePath = os.path.abspath(".")
21 |
22 | return os.path.join(basePath, relativePath)
23 |
24 | def ensure_dir():
25 | directory = os.path.dirname('csv')
26 | print(directory)
27 | if not os.path.exists('csv'):
28 | os.makedirs('csv')
29 |
30 | ensure_dir()
31 |
32 | directory = os.path.dirname('csv')
33 |
34 | toaster = ToastNotifier()
35 | toaster.show_toast("Python Script Uploading Data", "Retrieving data from prices.runescape.wiki and saving as csv", icon_path=resourcePath("app_icon_sly.ico"), duration=5)
36 |
37 |
38 | # datetime object containing current date and time
39 | from pandas.io.json import json_normalize
40 |
41 | now = datetime.now()
42 |
43 | print("now =", now)
44 |
45 | # dd/mm/YY H:M:S
46 | dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
47 | print("date and time =", dt_string)
48 |
49 | new = 2 # open in a new tab, if possible
50 |
51 | # python-requests
52 | # prices.runescape.wiki/api/v1/osrs/1h
53 |
54 |
55 | # Show all columns
56 | pd.set_option('display.max_columns', None)
57 | # Show all lines
58 | pd.set_option('display.max_rows', None)
59 | # value display length is 100, the default is 50
60 | pd.set_option('max_colwidth', 200)
61 |
62 |
63 |
64 | def call_http_prices():
65 | headers = {
66 | 'User-Agent': 'Flipping Price',
67 | 'From': 'email@gmail.com' # This is another valid field
68 | }
69 | response = requests.get("https://prices.runescape.wiki/api/v1/osrs/1h", headers=headers)
70 | stats = json.loads(response.text)
71 | print(stats)
72 | return stats
73 |
74 | # average over 12 hour window get data each hour over a week
75 |
76 | jsonData = call_http_prices()
77 |
78 | data = pd.DataFrame(jsonData)
79 | data['item_id'] = data.index
80 | data['index_id'] = np.arange(len(data))
81 | #print(data)
82 |
83 |
84 | test = data['data']
85 | test_pd = pd.DataFrame(json_normalize(test))
86 | test_pd['avgHighPrice'] = test_pd['avgHighPrice'].apply('{:.0f}'.format)
87 | test_pd['avgLowPrice'] = test_pd['avgLowPrice'].apply('{:.0f}'.format)
88 | #temp_data = pd.DataFrame(json_normalize(test))
89 | temp_data = pd.json_normalize(test)
90 | temp_data['index_id'] = np.arange(len(temp_data))
91 | data = pd.merge(data, temp_data, left_on='index_id', right_on='index_id', how='left').drop(['index_id','data'], axis=1)
92 |
93 | timeframe = data.iloc[0]['timestamp']
94 | datetime_time = datetime.fromtimestamp(timeframe).strftime('%d-%b-%Y-%H%M')
95 |
96 | #print(datetime_time)
97 | #print(data)
98 |
99 | format_data = pd.DataFrame(data)
100 |
101 | data = format_data.drop(columns='timestamp').fillna(0)
102 |
103 | #finalData = toptenvalue(dataFile)
104 |
105 | #data = pd.DataFrame(finalData)
106 |
107 | #addmargins()
108 | #addtestdate()
109 | data.to_csv(os.path.dirname('csv') + 'csv\\raw_data-' + datetime_time + '.csv', index=False)
110 | print(os.path.dirname('csv') + 'csv\\raw_data-' + datetime_time + '.csv')
111 | html = data.to_html()
112 | text_file = open("index.html", "w")
113 | text_file.write(html)
114 | text_file.close()
115 |
116 | url = "index.html"
117 | webbrowser.open(url, new=new)
118 |
119 |
--------------------------------------------------------------------------------
/osrs_return_data_status.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 |
4 | def get_live_info():
5 | '''Returns specific live information from the game client via the Status Socket plugin.'''
6 | try:
7 | f = open('live_data.json', "r+")
8 | data = json.load(f)
9 | #print(data)
10 | f.close()
11 | return data
12 | except:
13 | pass
14 |
15 | def update_inventory():
16 | """Updates the current inventory."""
17 | inventory = None
18 | data = get_live_info()
19 | if data != None:
20 | inventory = data['inventory']
21 | return inventory
22 |
23 | def update_positon():
24 | """Updates the current position of the player."""
25 | position = None
26 | data = get_live_info()
27 | if data != None:
28 | position = [data['worldPoint']['x'], data['worldPoint']['y']]
29 | return position
30 | def update_run_energy():
31 | """Updates the current run energy."""
32 | run_energy = None
33 | data = get_live_info()
34 | while data is None:
35 | data = get_live_info()
36 | run_energy = data['run energy']
37 | return run_energy
38 |
39 | def update_camera_angle():
40 | """Updates current camera angle."""
41 | camera_angle = None
42 | data = get_live_info()
43 | if data != None:
44 | camera_angle = data['camera']['yaw']
45 | return camera_angle
46 |
47 | get_live_info()
48 | t = update_run_energy()
49 | print(t)
50 |
--------------------------------------------------------------------------------
/osrs_walker.py:
--------------------------------------------------------------------------------
1 | import random
2 | import subprocess
3 | import time
4 |
5 | import win32gui
6 | import pyautogui
7 | from time import sleep
8 | import math
9 | import json
10 |
11 | from osrs_return_data_status import update_run_energy
12 | from read_path import get_current_path, get_current_path_random
13 | import yaml
14 |
15 | with open("pybot-config.yaml", "r") as yamlfile:
16 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
17 |
18 | client_title = data[0]['Config']['client_title']
19 |
20 |
21 | class Walking():
22 | degreesPerYaw: float = 360 / 2048
23 |
24 | def __init__(
25 | self,
26 | client_top_border: int,
27 | client_side_border: int,
28 | tiles_pixels: int,
29 | offset_minimap_x: float,
30 | offset_minimap_y: float,
31 | offset_minimap_x_resize: float,
32 | offset_minimap_y_resize: float,
33 | offset_run_button_x: float,
34 | offset_run_button_y: float,
35 | offset_logout_x: float,
36 | offset_logout_y: float
37 | ):
38 |
39 | self.client_top_border = client_top_border
40 | self.client_side_border = client_side_border
41 | self.tiles_pixels = tiles_pixels
42 | self.offset_minimap_x = offset_minimap_x
43 | self.offset_minimap_y = offset_minimap_y
44 | self.offset_minimap_x_resize = offset_minimap_x_resize
45 | self.offset_minimap_y_resize = offset_minimap_y_resize
46 | self.offset_run_button_x = offset_run_button_x
47 | self.offset_run_button_y = offset_run_button_y
48 | self.offset_logout_x = offset_logout_x
49 | self.offset_logout_y = offset_logout_y
50 | self.run_bool = False
51 |
52 |
53 | def get_run_button(self, window_features: list) -> list:
54 | x, y, w, h = window_features
55 | run_x = x + (w - self.offset_run_button_x)
56 | run_y = y + self.offset_run_button_y
57 | return [run_x, run_y]
58 |
59 | def get_logout_cross(self, window_features: list) -> list:
60 | x, y, w, h = window_features
61 | run_x = x + (w - self.offset_logout_x)
62 | run_y = y + self.offset_logout_y
63 | return [run_x, run_y]
64 |
65 | def get_window(self, windowname: str) -> list:
66 | '''Returns the position of the window and the size of the window excluding the borders.'''
67 | # Get window handle.
68 | hwnd = win32gui.FindWindow(None, windowname)
69 | # Set window to foreground.
70 | win32gui.SetForegroundWindow(hwnd)
71 | # Get the window size.
72 | rect = win32gui.GetWindowRect(hwnd)
73 | # Adjust size for borders
74 | x = rect[0]
75 | y = rect[1] + self.client_top_border
76 | w = rect[2] - x - self.client_side_border
77 | h = rect[3] - y - self.client_top_border
78 | return [x, y, w, h]
79 |
80 | def find_center_minimap_resizable(self, window_features: list) -> list:
81 | '''Returns the center of the window, excluding the borders.'''
82 | x, y, w, h = window_features
83 | map_center_x = x + (w - self.offset_minimap_x_resize)
84 | map_center_y = y + self.offset_minimap_y_resize
85 | return [map_center_x, map_center_y]
86 |
87 | def get_live_info(self, category: str) -> dict:
88 | '''Returns specific live information from the game client via the Status Socket plugin.'''
89 | try:
90 | f = open('live_data.json', )
91 | data = json.load(f)
92 | return data[category]
93 | except:
94 | pass
95 |
96 | def compute_tiles(self, live_x: int, live_y: int, new_x: int, n_y: int) -> list:
97 | '''Returns the range to click from the minimap center in amount of tiles.'''
98 | # Get live camera data.
99 | camera_data = self.get_live_info('camera')
100 | print("camera data:", camera_data)
101 | while camera_data is None:
102 | camera_data = self.get_live_info('camera')
103 | if camera_data != None:
104 | # Get camera angle.
105 | yaw = camera_data['yaw']
106 | # Account for anticlockwise OSRS minimap.
107 | degrees = 360 - self.degreesPerYaw * yaw
108 | # Turn degrees into pi-radians.
109 | theta = math.radians(degrees)
110 | # Turn position difference into pixels difference.
111 | x_reg = (new_x - live_x) * self.tiles_pixels
112 | y_reg = (live_y - n_y) * self.tiles_pixels
113 | # Formulas to compute norm of a vector in a rotated coordinate system.
114 | tiles_x = x_reg * math.cos(theta) + y_reg * math.sin(theta)
115 | tiles_y = -x_reg * math.sin(theta) + y_reg * math.cos(theta)
116 | return [round(tiles_x, 1), round(tiles_y, 1)]
117 | return [live_x, live_y]
118 |
119 | def change_position(self, center_mini: list, live_pos: list, new_pos: list):
120 | '''Clicks the minimap to change position'''
121 | tiles = self.compute_tiles(live_pos[0], live_pos[1], new_pos[0], new_pos[1])
122 | print("x:", center_mini[0] + tiles[0], "y:", center_mini[1] + tiles[1])
123 | print("y1:", center_mini[1], "y2:", tiles[1])
124 | pyautogui.click(center_mini[0] + tiles[0], center_mini[1] + tiles[1])
125 | #self.walking_wait(new_pos[0], new_pos[1])
126 | self.walking_wait_forgive(new_pos[0], new_pos[1])
127 |
128 | def walking_wait(self, new_x: int, new_y: int):
129 | '''Wait until finished walking.'''
130 | position_data = self.get_live_info('worldPoint')
131 | live_x, live_y = position_data['x'], position_data['y']
132 | while live_x != new_x or live_y != new_y:
133 | print(f"hasn't reach next point...current position ({live_x},{live_y}) next target ({new_x},{live_y})" )
134 | position_data = self.get_live_info('worldPoint')
135 | if position_data == None:
136 | live_x, live_y = live_x, live_y
137 | else:
138 | live_x, live_y = position_data['x'], position_data['y']
139 | continue
140 |
141 | def walking_wait_forgive(self, new_x: int, new_y: int):
142 | '''Wait until finished walking.'''
143 | t_end = time.time() + random.randrange(10, 15)
144 | position_data = self.get_live_info('worldPoint')
145 | while position_data is None:
146 | position_data = self.get_live_info('worldPoint')
147 | live_x, live_y = position_data['x'], position_data['y']
148 | while abs(new_x - live_x) > 2 or abs(new_y - live_y) > 2:
149 | if time.time() > t_end:
150 | print(time.time(), "| ", t_end)
151 | break
152 | time.sleep(0.1)
153 | print(f"hasn't reach next point...current position ({live_x},{live_y}) next target ({new_x},{live_y})" )
154 | position_data = self.get_live_info('worldPoint')
155 | print("position_data:", position_data)
156 | while position_data == None:
157 | position_data = self.get_live_info('worldPoint')
158 | if position_data == None:
159 | live_x, live_y = live_x, live_y
160 | else:
161 | live_x, live_y = position_data['x'], position_data['y']
162 | continue
163 |
164 |
165 | def turn_run_on(self) -> None:
166 | """Turns on run energy."""
167 | window = self.get_window(client_title)
168 | run_on = self.get_run_button(window)
169 | x = run_on[0] + random.randrange(-3, 3)
170 | y = run_on[1] + random.randrange(-3, 3)
171 | pyautogui.moveTo(x,y, duration = 0.2)
172 | pyautogui.click()
173 |
174 |
175 | def handle_running(self) -> None:
176 | """Turns on run if run energy is higher than 60."""
177 | # If run is off and run energy is larger than 60, turn on run.
178 | run_energy = update_run_energy()
179 | while run_energy is None:
180 | run_energy = update_run_energy()
181 | run_energy = update_run_energy()
182 | print(run_energy)
183 | if run_energy < 5 or run_energy == 100:
184 | self.run_bool = False
185 | if run_energy > 60 and self.run_bool == False:
186 | self.turn_run_on()
187 | self.run_bool = True
188 |
189 | def walk(self, path):
190 | '''Walks a path by clicking on the minimap'''
191 | window = self.get_window('OpenOSRS')
192 | center_minimap = self.find_center_minimap_resizable(window)
193 | pyautogui.moveTo(center_minimap)
194 | # center_window = self.find_center_window(window)
195 | # center_minimap = self.get_center_minimap(center_window)
196 | path = path
197 | position_data = self.get_live_info('worldPoint')
198 | print(position_data)
199 | while position_data is None:
200 | position_data = self.get_live_info('worldPoint')
201 | live_pos = [position_data['x'], position_data['y']]
202 | new_pos = path[0]
203 |
204 | # Walk while path has coordinates.
205 | while path:
206 | new_pos = path[0]
207 | print(f'target: ({new_pos[0]},{new_pos[1]})')
208 |
209 | # Turn on running if needed
210 | #self.handle_running()
211 |
212 | self.change_position(center_minimap, live_pos, new_pos)
213 | # Wait for the map to catch up with live position.
214 | sleep(2)
215 | # Update position data.
216 | position_data = self.get_live_info('worldPoint')
217 | while position_data == None:
218 | sleep(0.05)
219 | position_data = self.get_live_info('worldPoint')
220 | live_pos = position_data['x'], position_data['y']
221 | print(f'current: ({live_pos[0]},{live_pos[1]})')
222 | # Remove first coordinate.
223 | path.pop(0)
224 |
225 |
226 | #Paths = get_current_path()
227 | Paths = get_current_path_random()
228 | client_top_border = 30
229 | client_side_border = 50
230 | tiles_pixels = 4
231 | offset_minimap_x = 377.0
232 | offset_minimap_y = 195.0
233 | offset_minimap_x_resize = 72
234 | offset_minimap_y_resize = 81
235 | offset_run_button_x = 150
236 | offset_run_button_y = 130
237 | offset_logout_x = 10
238 | offset_logout_y = 10
239 | walker = Walking(client_top_border,
240 | client_side_border,
241 | tiles_pixels,
242 | offset_minimap_x,
243 | offset_minimap_y,
244 | offset_minimap_x_resize,
245 | offset_minimap_y_resize,
246 | offset_run_button_x,
247 | offset_run_button_y,
248 | offset_logout_x,
249 | offset_logout_y
250 | )
251 |
252 |
253 | client_top_border = 30
254 | client_side_border = 50
255 | tiles_pixels = 4
256 | offset_minimap_x = 377.0
257 | offset_minimap_y = 195.0
258 | offset_minimap_x_resize = 72
259 | offset_minimap_y_resize = 81
260 | offset_run_button_x = 150
261 | offset_run_button_y = 130
262 | offset_logout_x = 10
263 | offset_logout_y = 10
264 | degreesPerYaw: float = 360 / 2048
265 |
266 | walker.walk(Paths)
267 |
268 |
--------------------------------------------------------------------------------
/prayer.py:
--------------------------------------------------------------------------------
1 | import random
2 | import time
3 | import win32gui
4 | import cv2
5 | import numpy as np
6 | import pyautogui
7 | import win32gui
8 |
9 | #import functions
10 |
11 | offset_minimap_x_resize = 72
12 | offset_minimap_y_resize = 81
13 | client_top_border = 30
14 | client_side_border = 50
15 | def get_window(windowname):
16 | '''Returns the position of the window and the size of the window excluding the borders.'''
17 | # Get window handle.
18 | hwnd = win32gui.FindWindow(None, windowname)
19 | # Set window to foreground.
20 | win32gui.SetForegroundWindow(hwnd)
21 | # Get the window size.
22 | rect = win32gui.GetWindowRect(hwnd)
23 | # Adjust size for borders
24 | x = rect[0]
25 | y = rect[1] + client_top_border
26 | w = rect[2] - x - client_side_border
27 | h = rect[3] - y - client_top_border
28 | return [x, y, w, h]
29 |
30 | def findWindow(data): # find window name returns PID of the window
31 | global hwnd
32 | hwnd = win32gui.FindWindow(None, data)
33 | # hwnd = win32gui.GetForegroundWindow()860
34 | #print('findWindow:', hwnd)
35 | win32gui.SetActiveWindow(hwnd)
36 | # win32gui.ShowWindow(hwnd)
37 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
38 |
39 | def find_center_minimap(window_features):
40 | '''Returns the center of the window, excluding the borders.'''
41 | x, y, w, h = window_features
42 | map_center_x = x + (w - offset_minimap_x_resize)
43 | map_center_y = y + offset_minimap_y_resize
44 | return [map_center_x, map_center_y]
45 |
46 | def get_center_window(window_features):
47 | '''Returns the center of the window, excluding the borders.'''
48 | center_x = round(window_features[0] + window_features[2] / 2)
49 | center_y = round(window_features[1] + window_features[3] / 2)
50 | return [center_x, center_y]
51 |
52 | def get_screenshot():
53 | """Returns a screenshot with BGR colors"""
54 | image = pyautogui.screenshot()
55 | image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
56 | return image
57 |
58 | def find_object_contour(color):
59 | """Returns the contour of color marked objects on screen."""
60 | # define the list of boundaries
61 | # highlight purple = 0 / cyan = 1
62 | boundaries = [[[200, 0, 100], [255, 30, 190]], [[254, 0, 0], [255, 1, 0]]]
63 | lower = boundaries[color][0]
64 | upper = boundaries[color][1]
65 | # create NumPy arrays from the boundaries
66 | lower = np.array(lower, dtype="uint8")
67 | upper = np.array(upper, dtype="uint8")
68 | # find the colors within the specified boundaries and apply the mask
69 | image = get_screenshot()
70 | mask = cv2.inRange(image, lower, upper)
71 | _ = cv2.bitwise_and(image, image, mask=mask)
72 | _, thresh = cv2.threshold(mask, 40, 255, 0)
73 | contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
74 | return contours
75 |
76 | def find_closest_object(color):
77 | window = get_window('OpenOSRS')
78 | center_screen = get_center_window(window)
79 | """Returns the coordinates of the center of the closest object."""
80 | contours = find_object_contour(color)
81 | if contours == ():
82 | return []
83 | distance = []
84 | # Compute distance
85 | for c in contours:
86 | x, y, w, h = cv2.boundingRect(c)
87 | distance.append(np.sqrt((x - center_screen[0]) ** 2 + (y - center_screen[1]) ** 2))
88 | # Find the closest object
89 | min_value = min(distance)
90 | index_min = distance.index(min_value)
91 | x, y, w, h = cv2.boundingRect(contours[index_min])
92 | x_center = round(x + w / 2)
93 | y_center = round(y + h / 2)
94 | return [x_center, y_center]
95 |
96 | def image_Rec_clicker(image, event, iheight, iwidth, threshold, clicker, ispace=5):
97 | global icoord
98 | global iflag
99 | pyautogui.screenshot('screenshot.png')
100 | img_rgb = cv2.imread('screenshot.png')
101 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
102 | template = cv2.imread(image, 0)
103 | w, h = template.shape[::-1]
104 | pt = None
105 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
106 | threshold = threshold
107 | loc = np.where(res >= threshold)
108 | iflag = False
109 | event = event
110 | for pt in zip(*loc[::-1]):
111 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
112 | if pt is None:
113 | iflag = False
114 | else:
115 | iflag = True
116 | x = random.randrange(iwidth, iwidth + ispace)
117 | y = random.randrange(iheight, iheight + ispace)
118 | icoord = pt[0] + iheight + x
119 | icoord = (icoord, pt[1] + iwidth + y)
120 | b = random.uniform(0.1, 0.3)
121 | pyautogui.moveTo(icoord, duration=b)
122 | b = random.uniform(0.05, 0.15)
123 | pyautogui.click(icoord, duration=b, button=clicker)
124 | c = random.uniform(0.6, 1)
125 | time.sleep(c)
126 | return iflag
127 |
128 | def click_closest_object(color=0):
129 | """Clicks the marked object that is closest to the player."""
130 | x,y = find_closest_object(color)
131 | if x !=0 and y !=0:
132 | pyautogui.moveTo(x, y, 0.1)
133 | pyautogui.click()
134 | return True
135 | return False
136 |
137 |
138 | def gather_bones_prayer(Run_Duration_hours=3):
139 | t_end = time.time() + (60 * 60 * Run_Duration_hours)
140 | while time.time() < t_end:
141 | if click_closest_object(color=0):
142 | print('got item') # pick up highlighted loot
143 | c = random.uniform(5, 8)
144 | time.sleep(c)
145 | if image_Rec_clicker('bones_icon.png', 'bury bones', 5, 5, 0.7, 'left', 10):
146 | c = random.uniform(0.6, 1)
147 | time.sleep(c)
148 | c = random.uniform(0.1, 1)
149 | time.sleep(c)
150 |
151 | gather_bones_prayer(3)
152 |
--------------------------------------------------------------------------------
/pybot-config.yaml:
--------------------------------------------------------------------------------
1 | - Config:
2 | client_title: Runelite
3 | file_path_to_client: \.runelite\
4 | pc_profile: C:\Users\MMH
5 | tesseract_path: C:\Program Files\Tesseract-OCR\
6 | enable_on_start: true
7 |
--------------------------------------------------------------------------------
/read_path.py:
--------------------------------------------------------------------------------
1 | import random
2 | import yaml
3 |
4 | with open("pybot-config.yaml", "r") as yamlfile:
5 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
6 |
7 | pc_profile = data[0]['Config']['pc_profile']
8 |
9 | def get_current_path():
10 | with open(pc_profile + r'\Desktop\paths.txt', 'r') as file:
11 | path_array = []
12 | data = file.read().replace('\n', '')
13 | data = data.replace('[','')
14 | data = data.replace(']', '')
15 | final = data.split("), ")
16 | print(final)
17 | i = 0
18 | print(len(final))
19 | while i < len(final):
20 | x = final[i][final[i].find('x=') + 2: final[i].find('y=') - 2]
21 | y = final[i][final[i].find('y=') + 2: final[i].find('plane=') - 2]
22 | path_array.append([int(x), int(y)])
23 | i += 1
24 | print(path_array)
25 | return path_array
26 |
27 | def get_current_path_random():
28 | with open(pc_profile + r'\Desktop\paths.txt', 'r') as file:
29 | path_array = []
30 | data = file.read().replace('\n', '')
31 | data = data.replace('[','')
32 | data = data.replace(']', '')
33 | final = data.split("), ")
34 | print(final)
35 | i = 0
36 | print(len(final))
37 | while i < len(final):
38 | x = final[i][final[i].find('x=') + 2: final[i].find('y=') - 2]
39 | y = final[i][final[i].find('y=') + 2: final[i].find('plane=') - 2]
40 | path_array.append([int(x), int(y)])
41 | i += random.randrange(1, 15)
42 | if i > len(final):
43 | i = len(final) - 1
44 | x = final[i][final[i].find('x=') + 2: final[i].find('y=') - 2]
45 | y = final[i][final[i].find('y=') + 2: final[i].find('plane=') - 2]
46 | path_array.append([int(x), int(y)])
47 | break
48 | print(path_array)
49 | return path_array
50 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | MouseInfo>=0.1.3
2 | numpy>=1.20.2
3 | opencv-python>=4.5.1
4 | Pillow>=8.2.0
5 | PyAutoGUI>=0.9.52
6 | PyGetWindow>=0.0.9
7 | PyMsgBox>=1.0.9
8 | pyperclip>=1.8.2
9 | PyRect>=0.1.4
10 | PyScreeze>=0.1.26
11 | pytesseract>=0.3.3
12 | PyTweening>=1.0.3
13 | pywin32>=300
14 | pyyaml>=6.0
15 | requests>=2.27.1
16 | simplejson>=3.17.6
17 | urllib3>=1.26.9
18 | Shapely>=1.8.2
19 | keyboard>=0.13.5
20 | simplejson>=3.17.6
21 | requests>=2.28.1
22 |
23 |
--------------------------------------------------------------------------------
/server.py:
--------------------------------------------------------------------------------
1 | import json
2 | import simplejson
3 | import requests
4 |
5 |
6 | def run():
7 | c = s.get("http://localhost:8080/events", stream=True)
8 | data = simplejson.loads(c.text)
9 | print(data)
10 | with open(f"live_data.json", "w+") as outfile:
11 | json.dump(data, outfile)
12 | outfile.close()
13 |
14 | if __name__ == "__main__":
15 | s = requests.session()
16 | while True:
17 | run()
18 |
--------------------------------------------------------------------------------
/slyautomation_title.py:
--------------------------------------------------------------------------------
1 | print("""
2 | ----------------------------------------------------------------------
3 | ╔═╗┬─┐┌─┐┌─┐┌┬┐┌─┐┌┬┐ ╔╗ ┬ ┬ ╔═╗┬ ┬ ┬ ╔═╗┬ ┬┌┬┐┌─┐┌┬┐┌─┐┌┬┐┬┌─┐┌┐┌
4 | ║ ├┬┘├┤ ├─┤ │ ├┤ ││ ╠╩╗└┬┘ ╚═╗│ └┬┘ ╠═╣│ │ │ │ ││││├─┤ │ ││ ││││
5 | ╚═╝┴└─└─┘┴ ┴ ┴ └─┘─┴┘ ╚═╝ ┴ ╚═╝┴─┘ ┴ ╩ ╩└─┘ ┴ └─┘┴ ┴┴ ┴ ┴ ┴└─┘┘└┘
6 | ----------------------------------------------------------------------""")
7 |
--------------------------------------------------------------------------------
/smithing.py:
--------------------------------------------------------------------------------
1 | import core
2 | import yaml
3 | import pyautogui
4 | import random
5 | import time
6 | import win32gui
7 | from functions import invent_enabled, bank_ready, \
8 | Image_count, mini_map_image, skill_lvl_up, spaces, \
9 | pick_item, random_combat, random_quests, random_skills, \
10 | random_inventory, random_breaks, find_Object_precise, \
11 | exit_bank, Image_Rec_single, deposit_secondItem
12 |
13 | global hwnd, iflag, icoord, newTime_break, \
14 | timer, timer_break, ibreak
15 |
16 | iflag = False
17 | newTime_break = False
18 |
19 | def gfindWindow(data): # find window name returns PID of the window
20 | global hwnd
21 | hwnd = win32gui.FindWindow(None, data)
22 | # hwnd = win32gui.GetForegroundWindow()860
23 | #print('findWindow:', hwnd)
24 | win32gui.SetActiveWindow(hwnd)
25 | # win32gui.ShowWindow(hwnd)
26 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
27 |
28 |
29 | with open("pybot-config.yaml", "r") as yamlfile:
30 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
31 |
32 | try:
33 | gfindWindow(data[0]['Config']['client_title'])
34 | except BaseException:
35 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
36 | core.printWindows()
37 | pass
38 |
39 | try:
40 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
41 | except BaseException:
42 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
43 | core.printWindows()
44 | pass
45 |
46 | def random_break(start, c):
47 | global newTime_break
48 | startTime = time.time()
49 | # 1200 = 20 minutes
50 | a = random.randrange(0, 4)
51 | if startTime - start > c:
52 | options[a]()
53 | newTime_break = True
54 |
55 | def randomizer(timer_breaks, ibreaks):
56 | global newTime_break
57 | global timer_break
58 | global ibreak
59 | random_break(timer_breaks, ibreaks)
60 | if newTime_break == True:
61 | timer_break = timer()
62 | ibreak = random.randrange(600, 2000)
63 | newTime_break = False
64 |
65 | # b = random.uniform(4, 5)
66 |
67 | def timer():
68 | startTime = time.time()
69 | return startTime
70 |
71 | def random_pause():
72 | b = random.uniform(20, 250)
73 | print('pausing for ' + str(b) + ' seconds')
74 | time.sleep(b)
75 | newTime_break = True
76 |
77 |
78 | iflag = False
79 |
80 | options = {0: random_inventory,
81 | 1: random_combat,
82 | 2: random_skills,
83 | 3: random_quests,
84 | 4: random_pause}
85 |
86 | def pick_bucket():
87 | pick_item(1416 - 1280, 124)
88 | random_breaks(0.5, 1.5)
89 |
90 | def pick_iron_bars():
91 | pick_item(1655 - 1280, 162)
92 | random_breaks(0.5, 1.5)
93 |
94 | def pick_bronze_bars():
95 | pick_item(1655 - 1280, 123) #375
96 | random_breaks(0.5, 1.5)
97 |
98 | def pick_steel_bars():
99 | pick_item(1703 - 1280, 162)
100 | random_breaks(0.5, 1.5)
101 |
102 | def pick_mithril_bars():
103 | pick_item(1703 - 1280, 123)
104 | random_breaks(0.5, 1.5)
105 |
106 | def bank_spot_edgeville():
107 | find_Object_precise(1) #green
108 |
109 | def bank_spot_varrock():
110 | find_Object_precise(2) #amber
111 |
112 | def water_spot_edgeville():
113 | find_Object_precise(0, 0, 0, 610, 775) #red
114 |
115 | def smith_spot_varrock():
116 | find_Object_precise(0, 0, 0, 610, 775) #red
117 |
118 | def cast_superheat():
119 | pick_item(2029 - 1280, 573)
120 |
121 | def bucket_object(type):
122 | Image_Rec_single(type, 'water', 5, 5, 0.8, 'left', 10, False)
123 |
124 | def smith_object(type):
125 | Image_Rec_single(type, 'smith weapon/armour', 10, 10, 0.8, 'left', 20, True)
126 |
127 |
128 |
129 | def get_buckets(item):
130 | pick_options = {0: pick_bucket
131 | }
132 | print("bank inventory not found")
133 | while mini_map_image('edgeville_spot.png', 15, 15, 0.8, 'left', 5, 5) != True:
134 | print('finding bank area for water')
135 | random_breaks(7.5, 9)
136 | bank_spot_edgeville()
137 | random_breaks(3, 5)
138 | bank = Image_count('bank_deposit.png', 0.75)
139 | print("bank deposit open:", bank)
140 | bank = bank_ready()
141 | if bank == True:
142 | random_breaks(0.3, 0.5)
143 | pick_options[item]()
144 | exit_bank()
145 | bank_pass = True
146 | else:
147 | print("bank inventory not found")
148 | bank_pass = False
149 | return bank_pass
150 |
151 | def money_maker_water(num, item, Human_Break=True):
152 | bank_pass = False
153 | j = round((num) / 27) + 1
154 | pick_options = {0: pick_bucket
155 | }
156 | barlist = ['bucket.png']
157 | while j > 0:
158 | bank_pass = False
159 | while bank_pass == False:
160 | bank_pass = get_buckets(item)
161 | random_breaks(0.05, 0.2)
162 | invent = invent_enabled()
163 | print(invent)
164 | if invent == 0:
165 | pyautogui.press('esc')
166 | inv = Image_count(barlist[item], 0.85)
167 | bucket_object(barlist[item])
168 | water_spot_edgeville()
169 | while inv > 0:
170 | inv = Image_count(barlist[item], 0.95)
171 | print("buckets left:", inv)
172 | j -= 1
173 | if Human_Break:
174 | c = random.triangular(0.1, 50, 3)
175 | time.sleep(c)
176 |
177 | def smith_items(num, bar, vol, smith_item, Human_Break=True):
178 | j = round((num*vol) / 27) + 1
179 | pick_options = {0: pick_bronze_bars,
180 | 1: pick_iron_bars,
181 | 2: pick_steel_bars,
182 | 3: pick_mithril_bars
183 | }
184 | barlist = ['bronze_bar.png', 'iron_bar.png', 'steel_bar.png', 'mithril_bar.png']
185 | while j > 0:
186 | bank_spot_varrock()
187 | random_breaks(7.5, 9)
188 | deposit_secondItem()
189 | random_breaks(0.3, 0.5)
190 | pick_options[bar]()
191 | exit_bank()
192 | random_breaks(0.05, 0.2)
193 | invent = invent_enabled()
194 | print(invent)
195 | if invent == 0:
196 | pyautogui.press('esc')
197 | inv = Image_count(barlist[bar])
198 | smith_spot_varrock()
199 | random_breaks(7.5, 9)
200 | smith_object(smith_item + '.png')
201 | while inv > vol:
202 | if skill_lvl_up() != 0:
203 | print('level up')
204 | random_breaks(0.2, 3)
205 | pyautogui.press('space')
206 | random_breaks(0.1, 3)
207 | pyautogui.press('space')
208 | a = random.randrange(0, 2)
209 | # print(a)
210 | spaces(a)
211 | smith_spot_varrock()
212 | random_breaks(1, 2)
213 | smith_object(smith_item + '.png')
214 | inv = Image_count(barlist[bar])
215 | j -= 1
216 | if Human_Break:
217 | c = random.triangular(0.1, 50, 3)
218 | time.sleep(c)
219 |
220 | def smith_to_40():
221 | # ------ SMITH TO 40 ------- # 222 bronze # 485 iron # 600 steel
222 | smith_items(32, 0, 1, 'bronze_axe')
223 | smith_items(95, 0, 2, 'bronze_scimitar')
224 | smith_items(69, 1, 1, 'iron_axe')
225 | smith_items(208, 1, 2, 'iron_scimitar')
226 | smith_items(202, 2, 1, 'steel_axe')
227 | smith_items(198, 2, 2, 'steel_scimitar')
228 |
229 |
230 | if __name__ == "__main__":
231 | money_maker_water(6000, 0, Human_Break=True)
232 | #smith_items(1082, 2, 3, 'steel_chainbody')
233 | #steel_smithables = ['steel_axe', 'steel_scimitar', 'steel_nails', 'steel_chainbody']
234 |
--------------------------------------------------------------------------------
/thieving.py:
--------------------------------------------------------------------------------
1 | import core
2 | import yaml
3 | import numpy as np
4 | import cv2
5 | import pyautogui
6 | import random
7 | import time
8 | import keyboard
9 | from win32gui import Polygon
10 | from shapely.geometry import Polygon
11 | import functions
12 | import win32gui
13 | global hwnd
14 | global iflag
15 | global icoord
16 | from PIL import Image, ImageGrab
17 |
18 | iflag = False
19 | icoord = []
20 | from functions import image_Rec_inventory
21 |
22 | def gfindWindow(data): # find window name returns PID of the window
23 | global hwnd
24 | hwnd = win32gui.FindWindow(None, data)
25 | # hwnd = win32gui.GetForegroundWindow()860
26 | #print('findWindow:', hwnd)
27 | win32gui.SetActiveWindow(hwnd)
28 | # win32gui.ShowWindow(hwnd)
29 | win32gui.MoveWindow(hwnd, 0, 0, 865, 830, True)
30 |
31 |
32 | with open("pybot-config.yaml", "r") as yamlfile:
33 | data = yaml.load(yamlfile, Loader=yaml.FullLoader)
34 |
35 | try:
36 | gfindWindow(data[0]['Config']['client_title'])
37 | except BaseException:
38 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
39 | core.printWindows()
40 | pass
41 |
42 | try:
43 | x_win, y_win, w_win, h_win = core.getWindow(data[0]['Config']['client_title'])
44 | except BaseException:
45 | print("Unable to find window:", data[0]['Config']['client_title'], "| Please see list of window names below:")
46 | core.printWindows()
47 | pass
48 |
49 | def skill_lvl_up():
50 | counter = 0
51 | myScreenshot = pyautogui.screenshot()
52 | myScreenshot.save(r"screen.png")
53 | img_rgb = cv2.imread('screen.png')
54 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
55 | template = cv2.imread('images/' + 'Congrats_flag.png', 0)
56 | w, h = template.shape[::-1]
57 | res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
58 | threshold = 0.8
59 | loc = np.where(res >= threshold)
60 | for pt in zip(*loc[::-1]):
61 | cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
62 | counter += 1
63 | cv2.imwrite('res.png', img_rgb)
64 | return counter
65 |
66 |
67 |
68 | def xp_check():
69 | return bool_alpha('thieving.png', 0.8, 560, 95, 610, 135)
70 |
71 | def screen_I(left=0, top=0, right=0, bottom=0, name='screenshot.png'):
72 | if left != 0 or top != 0 or right != 0 or bottom != 0:
73 | myScreenshot = ImageGrab.grab(bbox=(left, top, right, bottom))
74 | else:
75 | myScreenshot = ImageGrab.grab()
76 | myScreenshot.save(name)
77 |
78 | def bool_alpha(temp, threshold=0.89, left=0, top=0, right=0, bottom=0):
79 | screen_I(left, top, right, bottom, name='screenshot_bool.png')
80 | # read screenshot
81 | img = cv2.imread('screenshot_bool.png')
82 | # read image template
83 | template = cv2.imread('images/' + temp, cv2.IMREAD_UNCHANGED)
84 | # extract base image and alpha channel and make alpha 3 channels
85 | temp_a = template[:, :, 0:3]
86 | alpha = template[:, :, 3]
87 | alpha = cv2.merge([alpha, alpha, alpha])
88 | # set threshold
89 | threshold = threshold
90 | # do masked template matching and save correlation image
91 | corr_img = cv2.matchTemplate(img, temp_a, cv2.TM_CCORR_NORMED, mask=alpha)
92 | # search for max score
93 | max_val = 1
94 | # find max value of correlation image
95 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(corr_img)
96 | return max_val
97 |
98 | def value_alpha(temp, threshold=0.89, left=0, top=0, right=0, bottom=0):
99 | screen_I(left, top, right, bottom, name='screenshot_bool.png')
100 | # read screenshot
101 | img = cv2.imread('screenshot_bool.png')
102 | # read image template
103 | template = cv2.imread('images/' + temp, cv2.IMREAD_UNCHANGED)
104 | # extract base image and alpha channel and make alpha 3 channels
105 | temp_a = template[:, :, 0:3]
106 | alpha = template[:, :, 3]
107 | alpha = cv2.merge([alpha, alpha, alpha])
108 | # set threshold
109 | threshold = threshold
110 | # do masked template matching and save correlation image
111 | corr_img = cv2.matchTemplate(img, temp_a, cv2.TM_CCORR_NORMED, mask=alpha)
112 | # search for max score
113 | max_val = 1
114 | # find max value of correlation image
115 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(corr_img)
116 | return min_val, max_val, min_loc, max_loc
117 |
118 | def Image_count_alpha(temp, threshold=0.89, left=0, top=0, right=0, bottom=0):
119 | counter = 0
120 | screen_I(left, top, right, bottom, name='screenshot.png')
121 | # read screenshot
122 | img = cv2.imread('screenshot.png')
123 | # read pawn image template
124 | # template = cv2.imread('chess_template.png', cv2.IMREAD_UNCHANGED)
125 | template = cv2.imread('images/' + temp, cv2.IMREAD_UNCHANGED)
126 | hh, ww = template.shape[:2]
127 | # extract pawn base image and alpha channel and make alpha 3 channels
128 | temp_a = template[:, :, 0:3]
129 | alpha = template[:, :, 3]
130 | alpha = cv2.merge([alpha, alpha, alpha])
131 | # set threshold
132 | threshold = threshold
133 | # do masked template matching and save correlation image
134 | corr_img = cv2.matchTemplate(img, temp_a, cv2.TM_CCORR_NORMED, mask=alpha)
135 | # search for max score
136 | result = img.copy()
137 | max_val = 1
138 | while max_val > threshold:
139 |
140 | # find max value of correlation image
141 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(corr_img)
142 | #print(max_val, max_loc)
143 |
144 | if max_val > threshold:
145 | # draw match on copy of input
146 | counter += 1
147 | cv2.rectangle(result, max_loc, (max_loc[0] + ww, max_loc[1] + hh), (0, 0, 255), 2)
148 | else:
149 | break
150 | return counter
151 |
152 | def thieve_object(item, left=0, top=0, right=860, bottom=775):
153 | screen_I(left, top, right, bottom)
154 | image = cv2.imread('screenshot.png')
155 | image = cv2.rectangle(image, pt1=(600, 0), pt2=(850, 200), color=(0, 0, 0), thickness=-1)
156 | image = cv2.rectangle(image, pt1=(0, 0), pt2=(150, 100), color=(0, 0, 0), thickness=-1)
157 |
158 | # define the list of boundaries
159 | # B, G, R
160 |
161 | red = ([0, 0, 180], [80, 80, 255]) # 0 Index
162 | green = ([0, 180, 0], [80, 255, 80]) # 1 Index
163 | amber = ([0, 200, 200], [60, 255, 255]) # 2 Index
164 | pickup_high = ([250, 0, 167], [255, 5, 172]) # 3 Index
165 | attack_blue = ([200, 200, 0], [255, 255, 5])
166 | object_list = [red, green, amber, pickup_high, attack_blue]
167 | boundaries = [object_list[item]]
168 |
169 | # loop over the boundaries
170 | for (lower, upper) in boundaries:
171 | # create NumPy arrays from the boundaries
172 | lower = np.array(lower, dtype="uint8")
173 | upper = np.array(upper, dtype="uint8")
174 | # find the colors within the specified boundaries and apply
175 | # the mask
176 | mask = cv2.inRange(image, lower, upper)
177 | output = cv2.bitwise_and(image, image, mask=mask)
178 | ret, thresh = cv2.threshold(mask, 40, 255, 0)
179 | contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
180 | if len(contours) != 0:
181 | # find the biggest countour (c) by the area
182 | c = max(contours, key=cv2.contourArea)
183 | # print(c)
184 | # print(np.squeeze(c))
185 | # print(Polygon(np.squeeze(c)))
186 | minx, miny, maxx, maxy = Polygon(np.squeeze(c)).bounds
187 | # print(minx, miny, maxx, maxy)
188 | x = random.randrange(minx + 1, max(maxx - 1, minx + 2))
189 | y = random.randrange(miny + 1, max(maxy - 1, miny + 2))
190 | # print('y: ', y)
191 | b = random.uniform(0.01, 0.02)
192 | pyautogui.moveTo(x, y, duration=b)
193 | b = random.uniform(0.01, 0.05)
194 | pyautogui.click(duration=b)
195 | return (x, y)
196 | return False
197 |
198 | def steal_man():
199 | pyautogui.PAUSE = 0
200 | global actions
201 | caps = False
202 | time_end = 0
203 | time_start = time.time()
204 | while True:
205 | caps = keyboard.is_pressed('capslock')
206 | if caps:
207 | print('thieving script stopped')
208 | exit()
209 | thieve_object(4)
210 | b = random.uniform(0.01, 0.09)
211 | time.sleep(b)
212 | thief = xp_check()
213 | if thief > 0.8:
214 | time_end = 0
215 | time_start = time.time()
216 | print('Thieving: %.2f' % thief + ' | seconds count: %.2f' % time_end)
217 | time_end = time.time() - time_start
218 | c = random.uniform(3, 5)
219 | if time_end > c:
220 | invent = functions.invent_enabled()
221 | if invent == 0:
222 | actions = 'opening inventory'
223 | pyautogui.press('esc')
224 | min_val, max_val, min_loc, max_loc = value_alpha('money_bag_2.png')
225 | if max_val == 1:
226 | x = max_loc[0] + random.randrange(1, 15)
227 | y = max_loc[1] + random.randrange(1, 15)
228 | b = random.uniform(0.01, 0.02)
229 | pyautogui.moveTo(x, y, duration=b)
230 | b = random.uniform(0.01, 0.05)
231 | pyautogui.click(duration=b)
232 | time_end = 0
233 | time_start = time.time()
234 | b = random.uniform(0.01, 0.15)
235 | time.sleep(b)
236 |
237 | def steal_tea():
238 | global actions
239 | caps = False
240 | while True:
241 | caps = keyboard.is_pressed('capslock')
242 | if caps:
243 | print('thieving script stopped')
244 | exit()
245 | thieve_object(0,0,0,860,750)
246 | b = random.uniform(6, 8)
247 | time.sleep(b)
248 | d = random.uniform(0.10, 0.23)
249 | e = random.uniform(0.10, 0.25)
250 | pyautogui.keyDown('shift')
251 | time.sleep(d)
252 | image_Rec_inventory('tea_icon.png')
253 | time.sleep(e)
254 | pyautogui.keyUp('shift')
255 |
256 | def steal_drop_fruit():
257 | global actions
258 | caps = False
259 | while True:
260 | caps = keyboard.is_pressed('capslock')
261 | if caps:
262 | print('thieving script stopped')
263 | exit()
264 | thieve_object(0,0,0,860,750)
265 | pyautogui.keyDown('shift')
266 | e = random.uniform(0.1, 1)
267 | time.sleep(e)
268 | image_Rec_inventory('apple_fruit.png')
269 | image_Rec_inventory('greenberry_fruit.png')
270 | image_Rec_inventory('strawberry_fruit.png')
271 | image_Rec_inventory('banana_fruit.png')
272 | image_Rec_inventory('exp_fruit.png')
273 | image_Rec_inventory('purple_fruit.png')
274 | image_Rec_inventory('lemon_fruit.png')
275 | image_Rec_inventory('pineapple_fruit.png')
276 | image_Rec_inventory('lime_fruit.png')
277 | image_Rec_inventory('papyaya_fruit.png')
278 | e = random.uniform(0.1, 1)
279 | time.sleep(e)
280 | pyautogui.keyUp('shift')
281 | pyautogui.press('shift')
282 |
283 | if __name__ == "__main__":
284 | steal_man()
285 | #steal_tea()
286 | #steal_drop_fruit()
287 |
288 |
--------------------------------------------------------------------------------