├── .gitignore
├── LICENSE
├── README.md
└── ahk
├── AbortLogoutAlarm.mp3
├── BankOrient.png
├── BlastFurnace.ahk
├── Break.ahk
├── CannonballSmelting.ahk
├── EditorConfig
├── .gitattributes
├── AHK
├── AtomStylesheet
├── Notepad++AHKSyntax.xml
├── ahktest.txt
└── notepad++ahklang
├── FlaxSpinning.ahk
├── HiAlch.ahk
├── Lib
├── AbortLogout.ahk
├── BankOrient.png
├── BriefLogout.ahk
├── CheckForGems.ahk
├── CheckStatsMining.ahk
├── CheckStatsSmithing.ahk
├── DisconnectCheck.ahk
├── EmptyInv.ahk
├── FullInvCheck.ahk
├── LogoutCheck.ahk
├── MinimapCheck.ahk
├── Orient1.PNG
├── OrientClient.ahk
├── RandomSleep.ahk
├── SelectChat.ahk
├── Stuck.ahk
└── Update.ahk
├── LoginScript.ahk
├── OSRSBlastFurnace
├── BlastFurnace.au3
├── BlastFurnace.exe
├── BlastFurnaceText.txt
├── BlastFurnaceTextDoc.txt
└── Orient1.PNG
├── OSRSCannonballSmelting
├── BankOrient.png
└── Orient1.PNG
├── OSRSDraynorFishing
├── AutoHotkey XML Format for Notepad++.lnk
├── AutoHotkey XML Format for Notepad++.xml
└── DraynorFishing.ahk
├── OSRSEarthRunecrafting
├── EarthRunecrafting.ahk
└── Orient1.PNG
├── OSRSFlaxSpinning
├── Orient1.PNG
└── PNGs
│ ├── BankOrient.png
│ └── PostLoginButton.png
├── OSRSMagicSplashing.ahk
├── OSRSMagicSplashing
└── Orient1.PNG
├── OSRSNatureRunecrafting
├── NatureRunecrafting.ahk
├── Orient1 1.png
└── Orient1.PNG
├── OSRSVarPowerMining
├── Orient1.PNG
└── PNGs
│ └── BankOrient.png
├── Orient1.PNG
├── Setupx64.exe
├── Universal GIMPs and PNGs
├── Orient1.PNG
├── loginmenu.png
└── loginmenupost.png
├── VarPowerMining.ahk
└── VarPowerMiningOld.ahk
/.gitignore:
--------------------------------------------------------------------------------
1 | venv/*
2 | .idea/*
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## OldSchoolRunescape AutoHotkey Scripts
2 |
3 | ### **This bot is deprecated and is being replaced by OCVBot (https://github.com/takelley1/OCVBot).**
4 |
5 | ---
6 |
7 |
8 | This repo contains scripts for cannonball smelting, magic splashing, mining, spinning flax, running the Blast Furnace, and runecrafting. Not all scripts are fully functional.
9 |
10 | The script with the most work and testing done is the `CannonballSmelting.ahk` script at the root of the directory tree. The script will run indefinitely without issues (I've tested it for 8+ hours at a time). Almost all interaction with the OSRS client is randomized to the greatest degree possible. Please read the comments at the top of each script file for information on how to properly configure your client. More detailed information and referenced files for each script are in their corresponding directories.
11 |
12 | AutoHotkey by itself is poor at image recognition, which is the primary reason I switched to Python for my next bot. As a result of this limitation, I was forced to use single-pixel color-matching rather than more tolerant image-matching methods. For the cannonball smelting script, a single image (the four-pointed star prayer icon) is used to locate the OSRS client and create a coordinate plane based on its location on your desktop (see https://github.com/takelley1/OSRS-AHKScripts/issues for troubleshooting). Beyond that, everything else is based on single-pixel color-matching, usually on certain icons within the minimap for navigation or certain pieces of text in menus for interacting with items and buttons.
13 |
14 | Because of these limitations, the bot may have difficulty locating and/or orienting itself on your particular setup. Unfortunately I cannot say with confidence that these scripts are friendly towards casual players with no scripting experience. A basic knowledge of AutoHotkey will be necessary to modify the pixel locations and/or color tolerances to adapt the script to your particular monitor and/or desktop's color properties.
15 |
16 |
17 | *This bot was written for educational purposes only. I am not responsible for how
18 | you use this software.*
19 |
--------------------------------------------------------------------------------
/ahk/AbortLogoutAlarm.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/AbortLogoutAlarm.mp3
--------------------------------------------------------------------------------
/ahk/BankOrient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/BankOrient.png
--------------------------------------------------------------------------------
/ahk/BlastFurnace.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | ; #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | ;BlastFurnaceTextDoc
6 | ;begin facing blast furnace bank chest with coin stack you intend to deposit into coffer
7 |
8 | ;7 runs can be completed before stopping for run energy to regenerate
9 |
10 | CoordMode, Pixel, Screen
11 | CoordMode, Mouse, Screen
12 | #Persistent
13 |
14 | ;orient client by searching whole screen for prayer hud icon
15 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png
16 | if ErrorLevel = 0
17 | {
18 | Sleep, 100
19 | MouseMove, OrientX, OrientY
20 | Sleep, 100
21 | ;move mouse to top left pixel of client to create new origin point for coordinate system
22 | MouseMove, -696, -171, 0, R ; 0, 0 coordinates from prayer icon
23 | MouseGetPos, ox, oy
24 | }
25 | else
26 | {
27 | MsgBox, Can’t find client!
28 | ExitApp
29 | }
30 |
31 | ;click compass to orient client North
32 | MouseMove, ox+561, oy+20, 0 ;compass
33 | Sleep, 500
34 | Click
35 | Sleep, 5
36 | Click
37 | Sleep, 5
38 | Send {Up down}
39 | Sleep, 750
40 | Send {Up up}
41 |
42 | ;configure client zoom settings to be fully zoomed out
43 | MouseMove, ox+675, oy+484, 0 ;options screen location
44 | Sleep, 100
45 | Click
46 | Sleep, 5
47 | Click
48 | Sleep, 100
49 | MouseMove, ox+675, oy+274, 0 ;options screen zoom bar location
50 | Sleep, 100
51 | Click
52 | Sleep, 100
53 | MouseClickDrag, L, ox+675, oy+274, ox+515, oy+274, 0
54 | Sleep, 100
55 | MouseMove, ox+642, oy+185, 0 ;inventory bag icon
56 | Sleep, 100
57 | Click
58 |
59 | ;deposit coin stack into coffer
60 | Gosub, Deposit/WithdrawalCoffer
61 |
62 | ;begin main loop
63 | Loop
64 | {
65 |
66 | ;check run energy. if above about 90, turn on run
67 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
68 | if ErrorLevel = 0
69 | {
70 | MouseMove, RunX, RunY, 0
71 | Sleep, 100
72 | Click
73 | }
74 |
75 | ;check run energy again, at 10% or lower, withdrawal money from coffer and wait till energy has restored itself, then deposit money back into coffer
76 | PixelSearch, RunOutX, RunOutY, ox+586, oy+147, ox+586, oy+147, 0x0B0B0B
77 | if ErrorLevel = 0
78 | {
79 |
80 | ;deposit inventory to allow room for coin stack
81 | Sleep, 100
82 | MouseMove, ox+264, oy+195, 0 ;open bank from starting position
83 | Sleep, 100
84 | Click
85 | Sleep, 1
86 | Click
87 |
88 | ;wait for bank screen to appear
89 | Loop, 250
90 | {
91 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
92 | if ErrorLevel = 0
93 | Goto, Continue0BankWindow
94 | else
95 | {
96 | Click
97 | Sleep, 50
98 | Click
99 | Sleep, 600
100 | Continue
101 | }}
102 | MsgBox, error with 0BankWindow loop
103 | ExitApp
104 | Continue0BankWindow:
105 |
106 | ;deposit inventory
107 | MouseMove, ox+444, oy+314, 0 ;deposit inventory button in bank window
108 | Sleep, 100
109 | Click
110 | Sleep, 3
111 | Click
112 | Sleep, 600
113 |
114 | ;wait for inventory to be deposited
115 | Loop, 50
116 | {
117 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
118 | if ErrorLevel = 0
119 | Goto, Continue0InvSlot1Empty
120 | else
121 | {
122 | MouseMove, ox+444, oy+314, 0 ;deposit inventory button in bank window
123 | Sleep, 100
124 | Click
125 | Sleep, 3
126 | Click
127 | Sleep, 300
128 | }}
129 | MsgBox, error with 0InvSlot1Empty loop
130 | ExitApp
131 | Continue0InvSlot1Empty:
132 |
133 | Sleep, 100
134 | MouseMove, ox+487, oy+23, 0 ;bank window close
135 | Click
136 | Sleep, 1
137 | Click
138 |
139 | ;withdrawal from coffer and return to start position
140 | Gosub, Deposit/WithdrawalCoffer
141 |
142 | ;keep checking every five seconds until run energy full
143 | Loop, 1800000
144 | {
145 | Sleep, 5000
146 |
147 | ;click on inventory icon periodically to prevent client timeout
148 | MouseMove, ox+642, oy+185, 0 ;inventory bag icon
149 | Sleep, 100
150 | Click
151 | PixelSearch, RunX, RunY, ox+549, oy+139, ox+549, oy+139, 0x00ff00 ;run 100% energy
152 | if ErrorLevel = 0
153 | {
154 |
155 | ;when run energy full, return money to coffer
156 | Gosub, Deposit/WithdrawalCoffer
157 | Goto, Start
158 | }}
159 | MsgBox, Error with run energy regeneration loop
160 | ExitApp
161 | }
162 |
163 | Start:
164 |
165 | ;open bank chest in front of you
166 | Sleep, 100
167 | MouseMove, ox+264, oy+195, 0 ;open bank from starting position
168 | Sleep, 100
169 | Click
170 | Sleep, 1
171 | Click
172 |
173 | ;wait for bank screen to appear
174 | Loop, 250
175 | {
176 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
177 | if ErrorLevel = 0
178 | Goto, ContinueBankWindow
179 | else
180 | {
181 | Click
182 | Sleep, 200
183 | Continue
184 | }}
185 | MsgBox, error with BankWindow loop
186 | ExitApp
187 | ContinueBankWindow:
188 |
189 | ;deposit held bars
190 | MouseMove, ox+665, oy+227, 0 ;right click third stack of items in inventory
191 | Sleep, 100
192 | Click, right
193 | Sleep, 100
194 | MouseMove, ox+656, oy+328, 0 ;select "all" on drop down third stack of items in inventory
195 | Sleep, 100
196 | Click
197 | Sleep, 100
198 |
199 | ;wait for inventory to be deposited
200 | Loop, 50
201 | {
202 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
203 | if ErrorLevel = 0
204 | Goto, Continue00InvSlot1Empty
205 | else
206 | {
207 | MouseMove, ox+665, oy+227, 0 ;right click third stack of items in inventory
208 | Sleep, 100
209 | Click, right
210 | Sleep, 100
211 | MouseMove, ox+656, oy+328, 0 ;select "all" on drop down third stack of items in inventory
212 | Sleep, 100
213 | Click
214 | Sleep, 100
215 | }}
216 | MsgBox, error with InvSlot1Empty loop
217 | Continue00InvSlot1Empty:
218 |
219 | ;look for ore, if not present, withdrawal all money from coffer and terminate
220 | PixelSearch, MainOreX, MainOreY, ox+80, oy+100, ox+80, oy+100, 0x48667f
221 | if ErrorLevel
222 | {
223 | Msgbox, No ore
224 | Gosub, Deposit/WithdrawalCoffer
225 | ExitApp
226 | }
227 |
228 | PixelSearch, CoalX, CoalY, ox+140, oy+100, ox+140, oy+100, 0x263739
229 | if ErrorLevel
230 | {
231 | Msgbox, No coal
232 | Gosub, Deposit/WithdrawalCoffer
233 | ExitApp
234 | }
235 |
236 | ;withdrawal ore if present
237 | Sleep, 10
238 | MouseMove, ox+89, oy+96, 0 ;main ore location in bank
239 | Sleep, 50
240 | Click, right
241 | Sleep, 50
242 | MouseMove, ox+89, oy+170, 0 ;main ore right click withdrawal saved X location in bank
243 | Sleep, 50
244 | Click
245 | Sleep, 50
246 | MouseMove, ox+140, oy+96, 0 ;coal ore location in bank
247 | Sleep, 50
248 | Click, right
249 | Sleep, 50
250 | MouseMove, ox+140, oy+166, 0 ;coal ore right click withdrawal saved X location in bank
251 | Sleep, 50
252 | Click
253 | Sleep, 50
254 |
255 | ;click minimap to move to belt
256 | GoingtoBelt:
257 | MouseMove, ox+618, oy+44, 0 ;belt location on minimap from start
258 | Sleep, 50
259 | Click
260 | Sleep, 1
261 | Click
262 | Sleep, 3000
263 |
264 | ;Keep checking water icon on minimap until you've arrived at belt
265 | Loop, 400
266 | {
267 | PixelSearch, BeltArriveX, BeltArriveY, ox+639, oy+128, ox+639, oy+128, 0xe78d7b
268 | if ErrorLevel = 0
269 | Goto, ContinueBeltArrive
270 | else
271 | Sleep, 100
272 | }
273 | MsgBox, error with BeltArrive loop
274 | ExitApp
275 | ContinueBeltArrive:
276 |
277 | ;deposit ore onto belt
278 | Sleep, 100
279 | MouseMove, ox+288, oy+174, 0 ;deposit ore onto belt location
280 | Sleep, 100
281 | Click
282 | Sleep, 1
283 | Click
284 | Sleep, 1
285 | Click
286 | Sleep, 500
287 |
288 | ;move to and open bar dispenser
289 | MouseMove, ox+213, oy+284, 0 ;dispenser location from belt
290 | Sleep, 100
291 | Click
292 | Sleep, 1
293 | Click
294 | Sleep, 1
295 | Click
296 | Sleep, 2500
297 |
298 | ;wait for character to arrive at dispenser and stop moving
299 | Loop, 800
300 | {
301 | PixelSearch, DispenserArriveX, DispenserArriveY, ox+647, oy+117, ox+647, oy+117, 0xe78d7b
302 | if ErrorLevel = 0
303 | Goto, ContinueDispenserArrive
304 | Else
305 | Sleep, 100
306 | }
307 | MsgBox, error with DispenserArrive loop
308 | ExitApp
309 | ContinueDispenserArrive:
310 |
311 | ;if dispenser window is not open, click on dispenser again since you may have a level up pending in the chat window
312 | Sleep, 100
313 | Loop, 100
314 | {
315 | PixelSearch, DispenserWindowX, DispenserWindowY, ox+332, oy+35, ox+332, oy+35, 0x1F98FF
316 | if ErrorLevel = 0
317 | Goto, CheckBars
318 | else
319 | Sleep, 600
320 | MouseMove, ox+263, oy+187, 0 ;at dispenser, open dispenser
321 | Sleep, 50
322 | Click
323 | Sleep, 50
324 | }
325 | MsgBox, error with opening dispenser window for the first time
326 | ExitApp
327 |
328 | ;check if finished bars are available, if not, close window and keep reopening until bars are available
329 | CheckBars:
330 | PixelSearch, DispenserBarsPresentX, DispenserBarsPresentY, ox+229, oy+143, ox+229, oy+143, 0x1F98FF
331 |
332 | ;if bars are available, immediately skip to withdrawing them
333 | if ErrorLevel = 0
334 | Goto, WithdrawalBars
335 |
336 | ;if bars not available, click on dispenser until window is open and recheck, if bars still not available, close and reopen window again, if you try 25 times and bars still aren’t there then coffer must be empty
337 | else
338 | {
339 | Loop, 25
340 | {
341 |
342 | ;wait 1/2 tick, then close window
343 | Sleep, 300
344 | MouseMove, ox+487, oy+42, 0 ;dispenser window close
345 | Sleep, 100
346 | Click
347 | Sleep, 100
348 |
349 | ;keep clicking on dispenser until dispenser window reopens, then recheck bars
350 | Loop, 50
351 | {
352 | PixelSearch, DispenserWindowX, DispenserWindowY, ox+332, oy+35, ox+332, oy+35, 0x1F98FF
353 | if ErrorLevel = 0
354 | Goto, CheckBars
355 | else
356 | MouseMove, ox+263, oy+187, 0 ;at dispenser, open dispenser
357 | Sleep, 100
358 | Click
359 | Sleep, 100
360 | }
361 | MsgBox, error with DispenserWindow loop
362 | ExitApp
363 | }
364 | MsgBox, error with loop DispenserWindow parent loop
365 | ExitApp
366 | }
367 |
368 | ;withdrawal bars, keep clicking until in inventory
369 | WithdrawalBars:
370 |
371 | MouseMove, ox+229, oy+143, 0 ;location to withdrawal steel bars at dispenser
372 | Click, 2
373 | Sleep, 700
374 |
375 | Loop, 10
376 | {
377 | PixelSearch, BarsGetX, BarsGetY, ox+581, oy+228, ox+581, oy+228, 0x868690
378 | if ErrorLevel = 0
379 | Goto, ContinueBarsGet
380 | else
381 | {
382 | MouseMove, ox+229, oy+143, 0 ;location to withdrawal steel bars at dispenser
383 | Click
384 | Sleep, 600
385 | }}
386 | MsgBox, error with BarsGet loop
387 | ContinueBarsGet:
388 |
389 | ;search for bank icon colors on minimap
390 | Loop, 100
391 | {
392 | PixelSearch, BankfromDispenserX, BankfromDispenserY, ox+674, oy+118, ox+674, oy+118, 0x026475
393 | if ErrorLevel = 0
394 | Goto, GoToBank
395 | else
396 | Sleep, 100
397 | }
398 | MsgBox, error with BankfromDispenser loop
399 | ExitApp
400 | GoToBank:
401 |
402 | ;if bank found, move mouse upwards slightly and click on icon
403 | MouseMove, BankfromDispenserX+1, BankfromDispenserY-6, 0 ;bank location on minimap from dispenser
404 | Sleep, 50
405 | Click
406 | Sleep, 50
407 | Click
408 | Sleep, 1000
409 |
410 | ;Keep checking water icon on minimap until you've returned to bank chest
411 | Loop, 500
412 | {
413 | PixelSearch, BankArriveX, BankArriveY, ox+615, oy+89, ox+615, oy+89, 0xe78d7b
414 | if ErrorLevel = 0
415 | Goto, ContinueBankArrive
416 | else
417 | Sleep, 100
418 | }
419 |
420 | ;if after 500 loops you haven't arrived at bank chest, try again since you may have a level up message pending in the chat menu
421 | Sleep, 100
422 | MouseMove, BankfromDispenserX+1, BankfromDispenserY-6, 0 ;bank location on minimap from dispenser
423 | Sleep, 100
424 | Click
425 | Sleep, 50
426 | Click
427 | Sleep, 1000
428 |
429 | Loop, 500
430 | {
431 | PixelSearch, BankArriveX, BankArriveY, ox+615, oy+89, ox+615, oy+89, 0xe78d7b
432 | if ErrorLevel = 0
433 | Goto, ContinueBankArrive
434 | else
435 | Sleep, 100
436 | }
437 | MsgBox, error with BankArrive loop
438 | ExitApp
439 | ContinueBankArrive:
440 | }
441 | ;end of main loop
442 |
443 |
444 |
445 |
446 | ;beginning of subroutines
447 | Deposit/WithdrawalCoffer:
448 | {
449 | MouseMove, ox+200, oy+170, 0 ;coffer location from bank
450 | Sleep, 200
451 | Click
452 | Sleep, 3
453 | Click
454 | Sleep, 1000
455 |
456 | ;wait for coffer prompt chat menu to appear
457 | Loop, 200
458 | {
459 | PixelSearch, CofferPromptX, CofferPromptY, ox+106, oy+368, ox+106, oy+368, 0x9c9f3f
460 | if ErrorLevel = 0
461 | Goto, ContinueCofferPrompt
462 | else
463 | Sleep, 100
464 | }
465 | MsgBox, error with CofferPrompt loop
466 | ExitApp
467 | ContinueCofferPrompt:
468 |
469 | Sleep, 200
470 | SendInput, {1}
471 | Sleep, 600
472 |
473 | ;wait for coffer prompt2 chat menu to appear
474 | Loop, 100
475 | {
476 | PixelSearch, CofferPrompt2X, CofferPrompt2Y, ox+259, oy+427, ox+259, oy+427, 0x800000
477 | if ErrorLevel = 0
478 | Goto, ContinueCofferPrompt2
479 | else
480 | Sleep, 100
481 | }
482 | MsgBox, error with CofferPrompt2 loop
483 | ExitApp
484 | ContinueCofferPrompt2:
485 |
486 | Sleep, 200
487 | SendInput, {Raw}999999999
488 | Sleep, 600
489 | SendInput, {Enter}
490 | Sleep, 600
491 |
492 | ;wait for coffer confirm chat menu to appear
493 | Loop, 100
494 | {
495 | PixelSearch, CofferConfirmX, CofferConfirmY, ox+66, oy+428, ox+66, oy+428, 0x48d1fb
496 | if ErrorLevel = 0
497 | Goto, ContinueCofferConfirm
498 | else
499 | Sleep, 100
500 | }
501 | MsgBox, error with CofferPrompt2 loop
502 | ExitApp
503 | ContinueCofferConfirm:
504 |
505 | SendInput, {Space}
506 | Sleep, 1200
507 | MouseMove, ox+646, oy+85, 0 ;bank location on minimap from coffer
508 | Sleep, 100
509 | Click
510 | Sleep, 3
511 | Click
512 | Sleep, 1000
513 | Return
514 | }
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 | /*
592 | ;drink stamina potion if potion effect isn't active
593 | PixelSearch, StaminaActiveX, StaminaActiveY, ox+584, oy+140, ox+584, oy+140, 0x3d73e4
594 | if ErrorLevel
595 | {
596 | MouseMove, ox+661, oy+447, 0 ;second-to-last inventory position
597 | Sleep, 100
598 | Click
599 | Sleep, 3
600 | Click
601 |
602 | ;check if potion effect has been activated, if not, get another potion because the current vial has been depleted
603 | Sleep, 1000
604 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
605 | if ErrorLevel
606 | {
607 |
608 | ;open bank chest in front of you
609 | Sleep, 200
610 | MouseMove, ox+297, oy+229, 0 ;open bank from starting position
611 | Sleep, 100
612 | Click
613 | Sleep, 1
614 | Click
615 |
616 | ;wait for bank screen to appear
617 | Loop, 25
618 | {
619 | PixelSearch, BankWindowX, BankWindowY, ox+362, oy+318, ox+362, oy+318, 0x3095DF
620 | if ErrorLevel
621 | {
622 | Click
623 | Sleep, 600
624 | }
625 | else
626 | Goto, Continue2
627 | }
628 | ExitApp
629 | Continue2:
630 |
631 | ;deposit inventory
632 | MouseMove, ox+444, oy+314, 0 ;deposit inventory button in bank window
633 | Sleep, 100
634 | Click
635 | Sleep, 3
636 | Click
637 | Sleep, 600
638 |
639 | ;wait for inventory to be deposited
640 | Loop, 25
641 | {
642 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
643 | if ErrorLevel
644 | {
645 | Click
646 | Sleep, 600
647 | }
648 | else
649 | Goto, Continue4
650 | }
651 | ExitApp
652 | Continue4:
653 |
654 | ;look for ore(s) and stamina potions if any, if not present, withdrawal all money from coffer and terminate
655 | PixelSearch, MainOreX, MainOreY, ox+80, oy+100, ox+80, oy+100, 0x48667f
656 | if ErrorLevel
657 | Goto, WithdrawalCoffer
658 |
659 | PixelSearch, CoalX, CoalY, ox+140, oy+100, ox+140, oy+100, 0x263739
660 | if ErrorLevel
661 | Goto, WithdrawalCoffer
662 |
663 | PixelSearch, PotionX, PotionY, ox+181, oy+96, ox+181, oy+96, 0x4c7fa6
664 | if ErrorLevel
665 | Goto, WithdrawalCoffer
666 |
667 | ;withdrawal ore(s) and stamina potion if present
668 | Sleep, 10
669 | MouseMove, ox+89, oy+96, 0 ;main ore location in bank
670 | Sleep, 50
671 | Click, right
672 | Sleep, 50
673 | MouseMove, ox+89, oy+170, 0 ;main ore right click withdrawal saved X location in bank
674 | Sleep, 50
675 | Click
676 | Sleep, 50
677 | MouseMove, ox+140, oy+96, 0 ;coal ore location in bank
678 | Sleep, 50
679 | Click, right
680 | Sleep, 50
681 | MouseMove, ox+140, oy+166, 0 ;coal ore right click withdrawal saved X location in bank
682 | Sleep, 50
683 | Click
684 | Sleep, 50
685 | MouseMove, ox+185, oy+100, 0 ;stamina potions location in bank
686 | Sleep, 50
687 | Click
688 | Sleep, 50
689 | Goto, GoingtoBelt
690 | }}
691 |
692 |
693 | */
694 | ;wait for ore to withdrawal
695 | ; Sleep, 600
696 | ; Loop, 25
697 | ; {
698 | ; PixelSearch, OreGetX, OreGetY, 635, 261, 635, 261, 0x425D74
699 |
700 | ;if ore takes too long to appear in inventory, try withdrawaling it again
701 | ; if ErrorLevel
702 | ; {
703 | ; Sleep, 100
704 | ; Click, right, 112, 130
705 | ; Sleep, 100
706 | ; Click, 101, 227
707 | ; Sleep, 100
708 | ; Continue
709 | ; }
710 | ; else
711 | ; {
712 | ; Click, 511, 54
713 | ; Sleep, 1000
714 | ; Click, 683, 479
715 | ; Sleep, 2
716 | ; Click, 683, 479
717 | ; Sleep, 1000
718 | ; Goto, GoingtoBelt
719 | ; }}}}
720 |
721 |
722 |
723 |
724 |
725 | ^q::ExitApp
726 |
727 |
728 |
729 |
730 |
731 |
732 |
--------------------------------------------------------------------------------
/ahk/Break.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ;Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | SetTimer, WorkTime, 1000 ;the amount of time before the timer "rings"
6 |
7 | WorkTime:
8 | SetTimer, BreakTimeUpdate, 1000 ;update the break timer every second
9 | BreakTime := 20 ;begin the break timer at X seconds
10 |
11 |
12 | BreakTimeUpdate: ;when the update time expires, reduce the amount of seconds on the break timer by 1
13 | BreakTime -= 1
14 | Gui, Add, Text,, Break! %BreakTime%
15 | Gui, Show, W: 1000, H: 500, Center
16 | Gui, Font, s100, Verdana
17 | Gui, Color, 000080
18 | if BreakTime < 1 ;restart once break timer expires
19 | {
20 | SetTimer, BreakTimeUpdate, Off
21 | Gui, Destroy
22 | Reload
23 | }
24 | else
25 | Return
26 |
27 |
28 |
29 | ;hotkeys
30 | z::
31 | {
32 | Gui, Destroy
33 | ListLines
34 | Pause
35 | }
36 |
37 | x::
38 | {
39 | Gui, Destroy
40 | ListVars
41 | Pause
42 | }
43 |
44 | shift:: ;manual kill switch — ADD listlines LOGGING
45 | {
46 | Gui, Destroy
47 | ExitApp
48 | }
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/AHK:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 00; 01 02 03/* 04*/
9 |
10 | 0x
11 |
12 | a b c d e f A B C D E F
13 |
14 |
15 |
16 | = < > * / + - ^ | \ % $ # @ ! ? ~ ` , _ . @ !
17 |
18 | {
19 |
20 | }
21 |
22 |
23 |
24 | ;
25 |
26 |
27 | Drivespacetotal Drivestatus Envget Envset Envupdate Eval Exp Filechangedir Fileclose Filecopy Filecreateshortcut Filedelete Fileexists Filefindfirstfile Filefindnextfile Filegetattrib Filegetlongname Filegetshortname Filegetsize Filegettime Filegetversion Fileinstall Filemove Fileopen Fileopendialog Fileread Filereadline Filerecycle Filerecycleempty Filesavedialog Fileselectfolder Filesetattrib Filesettime Filewrite Filewriteline Hex Hotkeyset Delete Read Write Inputbox Isadmin Isarray Isdeclared Isfloat Isint Isnumber Isstring Log Memgetstats Mod Mouseclick Mouseclickdrag Mousedown Mousegetcursor Mousegetpos MouseMove Mouseup Mousewheel Number Pixelchecksum Pixelgetcolor Pixelsearch Processclose Processexists Processsetpriority Processwait Processwaitclose Progressoff Progresson Progressset Regdelete Regenumkey Regenumval Regread Regwrite Round Run Runasset Runwait Send Seterror ShutdownSoundplay Soundsetwavevolume Splashimageon Splashoff Splashtexton Sqrt Statusbargettext String Stringaddcr Stringformat Stringinstr Stringisalnum Stringisalpha Stringisascii Stringisdigit Stringisfloat Stringisint Stringislower Stringisspace Stringisupper Stringisxdigit Stringleft Stringlen Stringlower Stringmid Stringreplace Stringright Stringsplit Stringstripcr Stringstripws Stringtrimleft Stringtrimright Stringupper Tan Timerstart Timerstop Tooltip Traytip Ubound Urldownloadtofile Winactivate Winactive Winclose Winexists Wingetcaretpos Wingetclasslist Wingetclientsize Wingethandle Wingetpos Wingetstate Wingettext Wingettitle Winkill Winmenuselectitem Winminimizeall Winminimizeallundo Winmove Winsetontop Winsetstate Winsettitle Winwait Winwaitactive Winwaitclose Winwaitnotactive Loop Click PixelSearch ImageSearch MouseMove ExitApp Pause
28 | Guicreate Guicreateex Guidefaultfont Guidelete Guigetcontrolstate Guihide Guimsg Guiread Guirecvmsg Guisendmsg Guisetcontrol Guisetcontroldata Guisetcontrolex Guisetcontrolfont Guisetcontrolnotify Guisetcoord Guisetcursor Guishow Guiwaitclose Guiwrite Gui MsgBox InputBox Text Destroy Show Add Msgbox
29 | and byref case const continuecase continueloop default dim else elseif endfunc endif endselect endswitch enum exit exitloop false for func global if local next not null or redim return select static step switch then to true until wend while Return CoordMode SendMode
30 | Random Sleep
31 | @appdatacommondir @appdatadir @autoitversion @commonfilesdir @compiled @computername @comspec @cr @crlf @desktopcommondir @desktopdir @desktopheight @desktopwidth @documentscommondir @error @favoritescommondir @favoritesdir @homedrive @homepath @homeshare @hour @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @lf @logondnsdomain @logondomain @logonserver @mday @min @mon @mydocumentsdir @osbuild @oslang @osservicepack @ostype @osversion @programfilesdir @programscommondir @programsdir @scriptdir @scriptfullpath @scriptname @sec @startmenucommondir @startmenudir @startupcommondir @startupdir @sw_hide @sw_maximize @sw_minimize @sw_restore @sw_show @systemdir @tab @tempdir @userprofiledir @username @wday @windowsdir @workingdir @yday @year
32 | Goto Gosub
33 | {!} {#} {^} {{} {}} {+} {alt} {altdown} {altup} {appskey} {asc} {backspace} {browser_back} {browser_favorites} {browser_forward} {browser_home} {browser_refresh} {browser_search} {browser_stop} {bs} {capslock} {ctrlbreak} {ctrldown} {ctrlup} {del} {delete} {down} {end} {enter} {esc} {escape} {f1} {f10} {f11} {f12} {f2} {f3} {f4} {f5} {f6} {f7} {f8} {f9} {home} {ins} {insert} {lalt} {launch_app1} {launch_app2} {launch_mail} {launch_media} {lctrl} {left} {lshift} {lwin} {lwindown} {media_next} {media_play_pause} {media_prev} {media_stop} {numlock} {numpad0} {numpad1} {numpad2} {numpad3} {numpad4} {numpad5} {numpad6} {numpad7} {numpad8} {numpad9} {numpadadd} {numpaddiv} {numpaddot} {numpadenter} {numpadmult} {numpadsub} {pause} {pgdn} {pgup} {printscreen} {ralt} {rctrl} {right} {rshift} {rwin} {rwindown} {scrolllock} {shiftdown} {shiftup} {sleep} {space} {tab} {up} {volume_down} {volume_mute} {volume_up} {raw} ::
34 | Up Down up down right
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/AtomStylesheet:
--------------------------------------------------------------------------------
1 | /*
2 | * Your Stylesheet
3 | *
4 | * This stylesheet is loaded when Atom starts up and is reloaded automatically
5 | * when it is changed and saved.
6 | *
7 | * Add your own CSS or Less to fully customize Atom.
8 | * If you are unfamiliar with Less, you can read more about it here:
9 | * http://lesscss.org
10 | */
11 |
12 |
13 | /*
14 | * Examples
15 | * (To see them, uncomment and save)
16 | */
17 |
18 | // style the background color of the tree view
19 | .tree-view {
20 | color: whitesmoke;
21 | }
22 |
23 | // style the background and foreground colors on the atom-text-editor-element itself
24 | atom-text-editor {
25 | color: white;
26 | background-color: black;
27 | }
28 |
29 | // style UI elements inside atom-text-editor
30 | atom-text-editor .cursor {
31 | // border-color: red;
32 | }
33 |
34 | .status-bar {
35 | //color: white;
36 | //background-color: black;
37 | }
38 |
39 | .tab-bar .title {
40 | font-size: 12px;
41 | color: yellow;
42 | }
43 |
44 | .tab-bar .tab.active .title {
45 | font-size: 19px;
46 | color: white;
47 | }
48 |
49 |
50 | .tab-bar {
51 | background-color: black;
52 | }
53 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/Notepad++AHKSyntax.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 00; 01 02 03/* 04*/
9 |
10 | 0x
11 |
12 | a b c d e f A B C D E F
13 |
14 |
15 |
16 | = < > * / + - ^ | \ % $ # @ ! ? ~ ` , _ . @ !
17 |
18 | {
19 |
20 | }
21 |
22 |
23 |
24 | ;
25 |
26 |
27 | Drivespacetotal Drivestatus Envget Envset Envupdate Eval Exp Filechangedir Fileclose Filecopy Filecreateshortcut Filedelete Fileexists Filefindfirstfile Filefindnextfile Filegetattrib Filegetlongname Filegetshortname Filegetsize Filegettime Filegetversion Fileinstall Filemove Fileopen Fileopendialog Fileread Filereadline Filerecycle Filerecycleempty Filesavedialog Fileselectfolder Filesetattrib Filesettime Filewrite Filewriteline Hex Hotkeyset Delete Read Write Inputbox Isadmin Isarray Isdeclared Isfloat Isint Isnumber Isstring Log Memgetstats Mod Mouseclick Mouseclickdrag Mousedown Mousegetcursor Mousegetpos MouseMove Mouseup Mousewheel Number Pixelchecksum Pixelgetcolor Pixelsearch Processclose Processexists Processsetpriority Processwait Processwaitclose Progressoff Progresson Progressset Regdelete Regenumkey Regenumval Regread Regwrite Round Run Runasset Runwait Send Seterror ShutdownSoundplay Soundsetwavevolume Splashimageon Splashoff Splashtexton Sqrt Statusbargettext String Stringaddcr Stringformat Stringinstr Stringisalnum Stringisalpha Stringisascii Stringisdigit Stringisfloat Stringisint Stringislower Stringisspace Stringisupper Stringisxdigit Stringleft Stringlen Stringlower Stringmid Stringreplace Stringright Stringsplit Stringstripcr Stringstripws Stringtrimleft Stringtrimright Stringupper Tan Timerstart Timerstop Tooltip Traytip Ubound Urldownloadtofile Winactivate Winactive Winclose Winexists Wingetcaretpos Wingetclasslist Wingetclientsize Wingethandle Wingetpos Wingetstate Wingettext Wingettitle Winkill Winmenuselectitem Winminimizeall Winminimizeallundo Winmove Winsetontop Winsetstate Winsettitle Winwait Winwaitactive Winwaitclose Winwaitnotactive Loop Click PixelSearch ImageSearch MouseMove ExitApp Pause
28 | Guicreate Guicreateex Guidefaultfont Guidelete Guigetcontrolstate Guihide Guimsg Guiread Guirecvmsg Guisendmsg Guisetcontrol Guisetcontroldata Guisetcontrolex Guisetcontrolfont Guisetcontrolnotify Guisetcoord Guisetcursor Guishow Guiwaitclose Guiwrite Gui MsgBox InputBox Text Destroy Show Add Msgbox
29 | and byref case const continuecase continueloop default dim else elseif endfunc endif endselect endswitch enum exit exitloop false for func global if local next not null or redim return select static step switch then to true until wend while Return CoordMode SendMode
30 | Random Sleep
31 | @appdatacommondir @appdatadir @autoitversion @commonfilesdir @compiled @computername @comspec @cr @crlf @desktopcommondir @desktopdir @desktopheight @desktopwidth @documentscommondir @error @favoritescommondir @favoritesdir @homedrive @homepath @homeshare @hour @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @lf @logondnsdomain @logondomain @logonserver @mday @min @mon @mydocumentsdir @osbuild @oslang @osservicepack @ostype @osversion @programfilesdir @programscommondir @programsdir @scriptdir @scriptfullpath @scriptname @sec @startmenucommondir @startmenudir @startupcommondir @startupdir @sw_hide @sw_maximize @sw_minimize @sw_restore @sw_show @systemdir @tab @tempdir @userprofiledir @username @wday @windowsdir @workingdir @yday @year
32 | Goto Gosub
33 | {!} {#} {^} {{} {}} {+} {alt} {altdown} {altup} {appskey} {asc} {backspace} {browser_back} {browser_favorites} {browser_forward} {browser_home} {browser_refresh} {browser_search} {browser_stop} {bs} {capslock} {ctrlbreak} {ctrldown} {ctrlup} {del} {delete} {down} {end} {enter} {esc} {escape} {f1} {f10} {f11} {f12} {f2} {f3} {f4} {f5} {f6} {f7} {f8} {f9} {home} {ins} {insert} {lalt} {launch_app1} {launch_app2} {launch_mail} {launch_media} {lctrl} {left} {lshift} {lwin} {lwindown} {media_next} {media_play_pause} {media_prev} {media_stop} {numlock} {numpad0} {numpad1} {numpad2} {numpad3} {numpad4} {numpad5} {numpad6} {numpad7} {numpad8} {numpad9} {numpadadd} {numpaddiv} {numpaddot} {numpadenter} {numpadmult} {numpadsub} {pause} {pgdn} {pgup} {printscreen} {ralt} {rctrl} {right} {rshift} {rwin} {rwindown} {scrolllock} {shiftdown} {shiftup} {sleep} {space} {tab} {up} {volume_down} {volume_mute} {volume_up} {raw} ::
34 | Up Down up down right
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/ahktest.txt:
--------------------------------------------------------------------------------
1 | HotKeySet("!d", "gettopleft")
2 | HotKeySet("!f", "getbottomright")
3 | HotKeySet("!g", "getColor")
4 | Global $topleft
5 | Global $bottomright
6 | Global $color = 0
7 |
8 | msgbox("","","press alt+d to set top left corner -- alt+f to set bottom right corner -- alt+g to set color of the tree inside the coordinates previously set)
9 |
10 | while 1 =1
11 | if $color > 0 Then
12 | _choptree()
13 | EndIf
14 |
15 | WEnd
16 |
17 | Func getColor()
18 | $point = MouseGetPos()
19 | $color = PixelGetColor($point[0], $point[1])
20 | EndFunc
21 |
22 | func gettopleft()
23 | $topleft = MouseGetPos()
24 | EndFunc
25 |
26 | func getbottomright()
27 | $bottomright = MouseGetPos()
28 |
29 | EndFunc
30 |
31 |
32 | func _choptree()
33 |
34 | $px3 = PixelSearch($topleft[0],$topleft[1],$bottomright[0],$bottomright[1],$color,0,1)
35 | If Not @error Then
36 | _clickchoptree()
37 | elseif @error Then
38 | _droplogs()
39 | EndIf
40 |
41 | EndFunc
42 |
43 |
44 | func _clickchoptree()
45 |
46 | MouseClick("left", $topleft[0], $topleft[1],1,1)
47 |
48 | $sleep3 = random(7000,10000)
49 | sleep($sleep3)
50 |
51 | Switch @SEC
52 | Case 50 to 60
53 | _droplogs()
54 | EndSwitch
55 | EndFunc
56 |
57 |
58 | 1 hour pre
59 | 2098 steel bars
60 | 124 stamina potion doses
61 | before starting
62 |
63 |
64 |
65 | 1 hour post
66 | 4087 steel
67 | 23 4dose stamina potions
68 |
--------------------------------------------------------------------------------
/ahk/EditorConfig/notepad++ahklang:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 00; 01 02 03 04
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | = < > * / + - ^ | \ % $ # @ ! ? ~ ` , _ .
17 |
18 | {
19 |
20 | }
21 |
22 |
23 |
24 | ;
25 |
26 |
27 | Drivespacetotal Drivestatus Envget Envset Envupdate Eval Exp Filechangedir Fileclose Filecopy Filecreateshortcut Filedelete Fileexists Filefindfirstfile Filefindnextfile Filegetattrib Filegetlongname Filegetshortname Filegetsize Filegettime Filegetversion Fileinstall Filemove Fileopen Fileopendialog Fileread Filereadline Filerecycle Filerecycleempty Filesavedialog Fileselectfolder Filesetattrib Filesettime Filewrite Filewriteline Hex Hotkeyset Delete Read Write Inputbox Isadmin Isarray Isdeclared Isfloat Isint Isnumber Isstring Log Memgetstats Mod Mouseclick Mouseclickdrag Mousedown Mousegetcursor Mousegetpos MouseMove Mouseup Mousewheel Number Pixelchecksum Pixelgetcolor Pixelsearch Processclose Processexists Processsetpriority Processwait Processwaitclose Progressoff Progresson Progressset Regdelete Regenumkey Regenumval Regread Regwrite Round Run Runasset Runwait Send Seterror ShutdownSoundplay Soundsetwavevolume Splashimageon Splashoff Splashtexton Sqrt Statusbargettext String Stringaddcr Stringformat Stringinstr Stringisalnum Stringisalpha Stringisascii Stringisdigit Stringisfloat Stringisint Stringislower Stringisspace Stringisupper Stringisxdigit Stringleft Stringlen Stringlower Stringmid Stringreplace Stringright Stringsplit Stringstripcr Stringstripws Stringtrimleft Stringtrimright Stringupper Tan Timerstart Timerstop Tooltip Traytip Ubound Urldownloadtofile Winactivate Winactive Winclose Winexists Wingetcaretpos Wingetclasslist Wingetclientsize Wingethandle Wingetpos Wingetstate Wingettext Wingettitle Winkill Winmenuselectitem Winminimizeall Winminimizeallundo Winmove Winsetontop Winsetstate Winsettitle Winwait Winwaitactive Winwaitclose Winwaitnotactive Loop Click PixelSearch ImageSearch MouseMove ExitApp Pause
28 | Guicreate Guicreateex Guidefaultfont Guidelete Guigetcontrolstate Guihide Guimsg Guiread Guirecvmsg Guisendmsg Guisetcontrol Guisetcontroldata Guisetcontrolex Guisetcontrolfont Guisetcontrolnotify Guisetcoord Guisetcursor Guishow Guiwaitclose Guiwrite Gui MsgBox InputBox Text Destroy Show Add Msgbox
29 | and byref case const continuecase continueloop default dim else elseif endfunc endif endselect endswitch enum exit exitloop false for func global if local next not null or redim return select static step switch then to true until wend while Return CoordMode SendMode
30 | Random Sleep
31 | @appdatacommondir @appdatadir @autoitversion @commonfilesdir @compiled @computername @comspec @cr @crlf @desktopcommondir @desktopdir @desktopheight @desktopwidth @documentscommondir @error @favoritescommondir @favoritesdir @homedrive @homepath @homeshare @hour @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @lf @logondnsdomain @logondomain @logonserver @mday @min @mon @mydocumentsdir @osbuild @oslang @osservicepack @ostype @osversion @programfilesdir @programscommondir @programsdir @scriptdir @scriptfullpath @scriptname @sec @startmenucommondir @startmenudir @startupcommondir @startupdir @sw_hide @sw_maximize @sw_minimize @sw_restore @sw_show @systemdir @tab @tempdir @userprofiledir @username @wday @windowsdir @workingdir @yday @year
32 | Goto Gosub
33 | {!} {#} {^} {{} {}} {+} {alt} {altdown} {altup} {appskey} {asc} {backspace} {browser_back} {browser_favorites} {browser_forward} {browser_home} {browser_refresh} {browser_search} {browser_stop} {bs} {capslock} {ctrlbreak} {ctrldown} {ctrlup} {del} {delete} {down} {end} {enter} {esc} {escape} {f1} {f10} {f11} {f12} {f2} {f3} {f4} {f5} {f6} {f7} {f8} {f9} {home} {ins} {insert} {lalt} {launch_app1} {launch_app2} {launch_mail} {launch_media} {lctrl} {left} {lshift} {lwin} {lwindown} {media_next} {media_play_pause} {media_prev} {media_stop} {numlock} {numpad0} {numpad1} {numpad2} {numpad3} {numpad4} {numpad5} {numpad6} {numpad7} {numpad8} {numpad9} {numpadadd} {numpaddiv} {numpaddot} {numpadenter} {numpadmult} {numpadsub} {pause} {pgdn} {pgup} {printscreen} {ralt} {rctrl} {right} {rshift} {rwin} {rwindown} {scrolllock} {shiftdown} {shiftup} {sleep} {space} {tab} {up} {volume_down} {volume_mute} {volume_up} {raw} ::
34 | Up Down up down right
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/ahk/FlaxSpinning.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | ;begin at lumbridge bank, middle booth
6 | ;client must be oriented north (click compass) and camera must be tilted all the way upwards (hold arrow key)
7 | ;client must also be fully zoomed out and brightness set at default
8 | ;run must be turned on with enough energy to get there and back
9 |
10 | CoordMode, Pixel, Screen
11 | CoordMode, Mouse, Screen
12 | #Persistent
13 |
14 | Orient()
15 |
16 | MouseMove, ox+262+varyby4, oy+132+varyby4, 0 ;open bank from starting position
17 | Sleep, wait200to500milis
18 | Click
19 | Random, DoubleClick, 200, 250
20 | Sleep, DoubleClick
21 | Click
22 | Sleep, wait800to1200milis
23 | Loop, 250 ;wait for bank screen to appear
24 | {
25 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
26 | if ErrorLevel = 0
27 | Goto, ContinueBankWindow
28 | else
29 | {
30 | Click
31 | Sleep, wait200to500milis*3
32 | }
33 | }
34 | Loop, 10 ;try again with longer wait intervals
35 | {
36 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
37 | if ErrorLevel = 0
38 | Goto, ContinueBankWindow
39 | else
40 | {
41 | Gosub, GetRandoms
42 | Click
43 | Sleep, wait200to500milis
44 | Click
45 | Sleep, wait2to5sec+1000
46 | }
47 | }
48 | MsgBox, error with BankWindow loop
49 | ExitApp
50 |
51 | ContinueBankWindow:
52 |
53 |
54 | Loop, 100 ;wait for inventory to be deposited
55 | {
56 | PixelSearch, InvSlot3EmptyX,InvSlot3EmptyY, ox+659, oy+229, ox+659, oy+229, 0x333c45
57 | if ErrorLevel = 0
58 | Goto, ContinueInvSlot3Empty
59 | else
60 | {
61 | MouseMove, ox+620+varyby4, oy+228+varyby3, 0 ;right click second stack of items in inventory
62 | Sleep, wait200to500milis
63 | Click, right
64 | Gosub, GetRandoms
65 | Sleep, wait200to500milis
66 | MouseMove, ox+620+varyby5, oy+328+varyby2, 0 ;select "all" on drop down second stack of items in inventory
67 | Sleep, wait200to500milis
68 | Click
69 | Gosub, GetRandoms
70 | Sleep, wait200to500milis
71 | }
72 | }
73 |
74 | ContinueInvSlot3Empty:
75 |
76 |
77 |
78 | Loop, 1000 ;look for flax
79 | {
80 | PixelSearch, FlaxX, FlaxY, ox+228, oy+133, ox+228, oy+133, 0xBBB756
81 | if ErrorLevel = 0
82 | Goto, Flaxwithdrawal
83 | else
84 | Sleep, 1
85 | }
86 |
87 | Flaxwithdrawal:
88 |
89 |
90 |
91 | Loop, 150 ;withdrawal and wait for flax to appear in inventory
92 | {
93 | PixelSearch, InvFlaxX,InvFlaxY, ox+574, oy+227, ox+574, oy+227, 0xBBB756
94 | if ErrorLevel = 0
95 | Goto, ContinueInvFlax
96 | else
97 | {
98 | MouseMove, ox+233+varyby4, oy+134+varyby3, 0
99 | Sleep, wait200to500milis
100 | Click, right
101 | Gosub, GetRandoms
102 | Sleep, wait200to500milis
103 | MouseMove, ox+233+varyby3, oy+234+varyby2, 0
104 | Sleep, wait200to500milis+50
105 | Click
106 | Gosub, GetRandoms
107 | Sleep, wait200to500milis
108 | }
109 | }
110 |
111 | ContinueInvFlax:
112 |
113 |
114 |
115 | MouseMove, ox+631+varyby2, oy+129+varyby2, 0 ;click on stairs on minimap
116 | Click
117 | Random, DoubleClick, 200, 250
118 | Sleep, DoubleClick
119 | Click
120 | Sleep, 4000
121 | Loop, 100 ;wait until bank teller minimap yellow dot moves towards top of minimap
122 | {
123 | PixelSearch, StairsAtTopX, StairsAtTopY, ox+657, oy+30, ox+657, oy+30, 0x13FEFE
124 | if ErrorLevel = 0
125 | Goto, StairsAtTop
126 | else
127 | Sleep, 100
128 | }
129 | StairsAtTop:
130 |
131 |
132 | ;go down stairs
133 | Sleep, 5000
134 | MouseMove, ox+253+varyby5, oy+205+varyby5, 0 ;top of stairs, click to go down
135 | Sleep, wait100to500milis
136 | Click
137 | Random, DoubleClick, 200, 250
138 | Sleep, DoubleClick
139 | Click
140 | Sleep, wait800to1200milis
141 | Loop, 500 ;wait until at bottom of stairs
142 | {
143 | PixelSearch, SpinningWheelIconX, SpinningWheelIconY, ox+671, oy+67, ox+671, oy+67, 0x406694
144 | if ErrorLevel = 0
145 | Goto, ContinueToWheel
146 | else
147 | Sleep, wait200to500milis
148 | }
149 | MsgBox, cant tell if at bottom of stairs, error with ContinueToWheel loop
150 | ExitApp
151 |
152 | ContinueToWheel:
153 |
154 |
155 |
156 | MouseMove, ox+337+varyby3, oy+81+varyby3, 0 ;spinning wheel, click to go to it, through wall
157 | Sleep, wait100to500milis
158 | Click
159 | Random, DoubleClick, 200, 250
160 | Sleep, DoubleClick
161 | Click
162 | Sleep, wait2to5sec
163 | Loop, 100 ;wait until at spinning wheel by looking for chat menu
164 | {
165 | PixelSearch, SpinningChatMenuX, SpinningChatMenuY, ox+468, oy+356, ox+468, oy+356, 0x7E9194
166 | if ErrorLevel = 0
167 | Goto, StartSpinning
168 | else
169 | Sleep, 40
170 | }
171 | Loop, 10
172 | {
173 | PixelSearch, StuckX, StuckY, ox+671, oy+98, ox+671, oy+98, 0xf6efe5 ;check if character has gotten stuck behind wall
174 | if ErrorLevel = 0
175 | {
176 | MouseMove, ox+320+varyby3, oy+166+varyby3, 0 ;click on spinning wheel again since character may be stuck behind wall
177 | Click
178 | Random, DoubleClick, 200, 250
179 | Sleep, DoubleClick
180 | Click
181 | }
182 | else
183 | Sleep, 100
184 | }
185 | Sleep, 3000
186 |
187 | Loop, 150 ;check if got unstuck and reached spinning wheel by looking for chat menu
188 | {
189 | PixelSearch, SpinningChatMenuX, SpinningChatMenuY, ox+468, oy+356, ox+468, oy+356, 0x7E9194
190 | if ErrorLevel = 0
191 | Goto, StartSpinning
192 | else
193 | Sleep, 100
194 | }
195 | StartSpinning:
196 |
197 |
198 |
199 |
200 |
201 | Send {Raw}3 ;hit 3 key to begin spinning bow strings
202 | Loop, 144 ;check if client has been disconnected twice per second for 72 seconds
203 | {
204 | Gosub, LogOutCheck
205 | Gosub, DisconnectCheck
206 | Sleep, 460
207 | }
208 | Gosub, GetRandoms
209 |
210 | Loop, 200 ;use final 3 seconds waiting for last flax to disappear from inventory
211 | {
212 | PixelSearch, DoneSpinningX, DoneSpinningY, ox+700, oy+335, ox+700, oy+335, 0xBBB756
213 | if ErrorLevel = 0
214 | Sleep, 50
215 | else
216 | Goto, AfterSpinning
217 | }
218 |
219 | AfterSpinning:
220 |
221 |
222 |
223 |
224 |
225 | MouseMove, ox+107+varyby2, oy+333+varyby2, 0 ;click on stairs within client, just above chat menu on left side
226 | Sleep, 150
227 | Click
228 | Random, DoubleClick, 200, 250
229 | Sleep, DoubleClick
230 | Click
231 | Sleep, wait2to5sec
232 | Loop, 2000 ;wait until stair climb option appears in chat menu
233 | {
234 | PixelSearch, StairsAtBottomX, StairsAtBottomY, ox+52, oy+369, ox+52, oy+369, 0x99D5DC
235 | if ErrorLevel = 0
236 | Goto, StairsAtBottom
237 | else
238 | Sleep, wait200to500milis
239 | }
240 |
241 | StairsAtBottom:
242 |
243 |
244 |
245 |
246 |
247 | Send {Raw}1 ;select chat option to climb up stairs
248 | Sleep, wait200to500milis
249 | Send {Raw}1
250 | Sleep, wait2to5sec+wait100to500milis
251 | Loop, 100 ;wait until bank teller minimap yellow dot appears towards top of minimap, indicating character is back on top floor
252 | {
253 | PixelSearch, StairsAtTopReturnX, StairsAtTopReturnY, ox+657, oy+30, ox+657, oy+30, 0x13FEFE
254 | if ErrorLevel = 0
255 | Goto, AfterLogin
256 | else
257 | Sleep, 100
258 | }
259 |
260 | AfterLogin:
261 |
262 |
263 |
264 |
265 |
266 | Loop, 100 ;look for bank on minimap
267 | {
268 | ImageSearch, BankReturnX, BankReturnY, ox+665, oy+40, ox+667, oy+41, BankOrient.png
269 | if ErrorLevel = 0
270 | Goto, BankReturn
271 | else
272 | Sleep, wait200to500milis
273 | }
274 | Loop, 3 ;try looking for bank again searching whole minimap (fourth try)
275 | {
276 | ImageSearch, BankReturnX, BankReturnY, ox+565, oy+3, ox+722, oy+162, BankOrient.png
277 | if ErrorLevel = 0
278 | Goto, BankReturn
279 | else
280 | Sleep, wait5to10sec
281 | }
282 | MsgBox, cant find bank on return or error with BankReturn loops
283 | ExitApp
284 |
285 | BankReturn:
286 |
287 |
288 |
289 |
290 |
291 | MouseMove, BankReturnX-11+varyby2, BankReturnY-2+varyby2, 0 ;click on bank booth on minimap to return to bank
292 | Click
293 | Random, DoubleClick, 200, 250
294 | Sleep, DoubleClick
295 | Click
296 | Sleep, wait2to5sec+3000
297 | Loop, 5000 ;wait until arrived at bank booth
298 | {
299 | PixelSearch, BankAtX, BankAtY, ox+646, oy+74, ox+646, oy+74, 0x0efefe
300 | if ErrorLevel = 0
301 | Goto, BankAt
302 | else
303 | Sleep, 5
304 | }
305 | Loop, 50 ;wait until arrived at bank booth again with longer wait intervals
306 | {
307 | PixelSearch, BankAtX, BankAtY, ox+646, oy+74, ox+646, oy+74, 0x0efefe
308 | if ErrorLevel = 0
309 | Goto, BankAt
310 | else
311 | Sleep, 100
312 | }
313 |
314 | BankAt:
315 |
316 |
317 |
318 |
319 | Gosub, GetRandoms
320 | /*
321 | Random, Behavior, 0, 101
322 | MsgBox, Generated Number %Behavior% ;debugging only
323 |
324 | if Behavior > 80 ;1/5 chance per trip to check crafting skill stats to mimic human
325 | Gosub, CheckStats
326 | if Behavior > 95 ;1/20 chance per trip to logout briefly to simulate a "bathroom break"
327 | Gosub, BriefLogout
328 | if Behavior > 5 ;1/20 chance per trip of stopping macro completely
329 | Goto, Start
330 | else
331 | ExitApp
332 | */
333 | Sleep, 65+wait100to500milis ;wait for character to stop moving
334 |
335 | Goto, Start
336 |
337 |
338 |
339 | WhereAmI: ;look for pixel colors at a handful of different locations on-screen to determine where character is after logging back in due to a disconnect
340 | Loop, 100 ;check if at spinning wheel by looking for corner of castle on minimap
341 | {
342 | PixelSearch, SpinningWheelAtX, SpinningWheelAtY, ox+672, oy+93, ox+672, oy+93, 0xf6efe5
343 | if ErrorLevel = 0
344 | Goto, AfterSpinning
345 | else
346 | Sleep, wait200to500milis
347 | }
348 | Loop, 100 ;check if at bottom of stairs by looking for spinning wheel on minimap
349 | {
350 | PixelSearch, SpinningWheelIconX, SpinningWheelIconY, ox+671, oy+67, ox+671, oy+67, 0x406694
351 | if ErrorLevel = 0
352 | Goto, StairsAtBottom
353 | else
354 | Sleep, wait200to500milis
355 | }
356 | Loop, 100 ;check if at top of stairs by looking for bank on minimap
357 | {
358 | ImageSearch, BankReturnX, BankReturnY, ox+665, oy+40, ox+667, oy+41, BankOrient.png
359 | if ErrorLevel = 0
360 | Goto, BankReturn
361 | else
362 | Sleep, wait200to500milis
363 | }
364 | Loop, 100 ;check if at bank booth
365 | {
366 | PixelSearch, BankAtX, BankAtY, ox+646, oy+74, ox+646, oy+74, 0x0efefe
367 | if ErrorLevel = 0
368 | Goto, BankAt
369 | else
370 | Sleep, wait200to500milis
371 | }
372 | MsgBox, cant tell where character is after loggin in after disconnect, or error with WhereAmI loop
373 | ExitApp
374 |
375 | ^q::ExitApp
376 | ^p::Pause
377 |
--------------------------------------------------------------------------------
/ahk/HiAlch.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | ;ControlFocus , , VirtualBox.exe
6 |
7 | CoordMode, Pixel, Screen
8 | CoordMode, Mouse, Screen
9 | #Persistent
10 |
11 | SetTimer, LogoutDisconnectCheck, 5000 ;check if client has been logged out or disconnected once every 5 seconds
12 |
13 | ;ControlFocus , , VirtualBox.exe
14 |
15 | OrientClient() ;orient to client coordinates
16 | Start()
17 |
18 | Start() ;click on spellbook icon
19 | {
20 | Global
21 | Random, varyby14, -14, 14
22 | Random, varyby12, -12, 12
23 | MouseMove, ox+varyby14+742, oy+varyby12+187, 0 ;click on spellbook icon
24 | Random, wait200to500milis, 200, 500
25 | Sleep, wait200to500milis
26 | Click, down
27 | Random, wait5to200milis, 5, 200
28 | Sleep, wait5to200milis
29 | Click, up
30 | Random, wait200to800milis, 200, 800
31 | Sleep, wait200to800milis
32 | Spellbook()
33 | }
34 |
35 | Spellbook() ;look for spellbook, then click on hi alch icon in spellbook
36 | {
37 | Global
38 |
39 | Loop, 100 ;look for spellbook
40 | {
41 | PixelSearch, SpellX, SpellY, ox+719, oy+330, ox+723, oy+334, 0x0cf6fa, 20, Fast
42 | if ErrorLevel = 0
43 | Goto, ContinueSpell
44 | else
45 | {
46 | Random, wait50to100milis, 50, 100
47 | Sleep, wait50to100milis ;wait 5-10sec in total for inventory to appear
48 | }
49 | }
50 | Gui, Destroy
51 | ;SetTimer, LogoutDisconnectCheck, Off
52 | Gui, Add, Text, ,AbortLogout called because cant find spellbook or out of runes
53 | Gui, Show, Y15, Msgbox
54 | SoundPlay, AbortLogoutAlarm.mp3
55 | Sleep, 5000
56 | AbortLogout()
57 | ExitApp
58 |
59 | ContinueSpell:
60 | Random, varyby10, -10, 10
61 | Random, varyby11, -11, 11
62 | MouseMove, ox+varyby10+716, oy+varyby11+328, 0 ;click on hi alch spell icon
63 | Random, wait200to2500milis, 200, 2500
64 | Sleep, wait200to2500milis
65 | Click, down
66 | Random, wait5to200milis, 5, 200
67 | Sleep, wait5to200milis
68 | Click, up
69 | Inventory()
70 | }
71 |
72 | Inventory() ;wait for inventory to appear, then click on item to be alched
73 | {
74 | Global
75 | Loop, 100 ;wait for inventory to appear after clicking spell icon
76 | {
77 | PixelSearch, InvX, InvY, ox+718, oy+325, ox+718, oy+325, 0x729eae, 25, Fast
78 | if ErrorLevel = 0
79 | Goto, ContinueInv
80 | else
81 | {
82 | Random, wait50to100milis, 5, 10
83 | Sleep, wait50to100milis ;wait 5-10sec in total for inventory to appear
84 | }
85 | }
86 | Gui, Destroy
87 | SetTimer, LogoutDisconnectCheck, Off
88 | Gui, Add, Text, ,AbortLogout called because cant find inventory
89 | Gui, Show, Y15, Msgbox
90 | SoundPlay, AbortLogoutAlarm.mp3
91 | Sleep, 5000
92 | AbortLogout()
93 | ExitApp
94 |
95 | ContinueInv:
96 | Random, varyby14, -14, 14
97 | Random, varyby11, -11, 11
98 | MouseMove, ox+varyby14+705, oy+varyby11+337, 0 ;click on item
99 | Random, wait200to2500milis, 200, 2500
100 | Sleep, wait200to2500milis
101 | Click, down
102 | Random, wait5to200milis, 5, 200
103 | Sleep, wait5to200milis
104 | Click, up
105 | Random, wait2to4sec, 2000, 4000 ;wait for alching to complete before checking for spellbook again
106 | Sleep, wait2to4sec
107 | Spellbook()
108 | }
109 |
110 | LogoutDisconnectCheck:
111 | LogoutCheck()
112 | if LogoutCheck() = 1 ;if function returns positive, look for bank to restart macro
113 | Start()
114 | DisconnectCheck()
115 | if DisconnectCheck() = 1
116 | Start()
117 | Return
118 |
119 | ;hotkeys
120 | z::
121 | {
122 | Gui, Destroy
123 | ListLines
124 | Pause
125 | }
126 |
127 | x::
128 | {
129 | Gui, Destroy
130 | ListVars
131 | Pause
132 | }
133 |
134 | shift:: ;manual kill switch — ADD listlines LOGGING
135 | {
136 | Gui, Destroy
137 | ExitApp
138 | }
139 |
--------------------------------------------------------------------------------
/ahk/Lib/AbortLogout.ahk:
--------------------------------------------------------------------------------
1 | AbortLogout()
2 | {
3 | Global
4 | Loop, 4 ;re-check to see if logout tab is now available on hud, do this 4 times
5 | {
6 | PixelSearch, LogOutButtonX, LogOutButtonY, ox+640, oy+473, ox+644, oy+473, 0x53af52, 10 ;check if logout button is available on hud to be clicked (player is not banking)
7 | if ErrorLevel = 0 ;if logout button is available, click it and logout
8 | {
9 | Gui, Destroy
10 | Random, varyby9, -9, 9
11 | Random, varyby10, -10, 10
12 | MouseMove, ox+varyby9+644, oy+varyby10+484, 0 ;logout tab on hud
13 | Random, wait400to1200milis, 400, 1200
14 | Sleep, wait400to1200milis
15 | Click, down
16 | Random, wait5to200milis, 5, 200
17 | Sleep, wait5to200milis
18 | Click, up
19 | Random, wait300to600milis, 300, 600
20 | Sleep, wait300to600milis
21 | Click, down
22 | Random, wait5to200milis, 5, 200
23 | Sleep, wait5to200milis
24 | Click, up
25 | Random, wait800to1200milis, 800, 1200
26 | Sleep, wait800to1200milis+500
27 | Random, varyby60, -60, 60
28 | Random, varyby9, -9, 9
29 | MouseMove, ox+varyby60+642, oy+varyby9+433, 0 ;"click here to logout" button within logout tab
30 | Random, wait400to1200milis, 400, 1200
31 | Sleep, wait400to1200milis
32 | Click, down
33 | Random, wait5to150milis, 5, 150
34 | Sleep, wait5to150milis
35 | Click, up
36 |
37 | Return
38 |
39 | }
40 | else ;if logout button is not present on hud, check to see if player is currently banking
41 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4, 3, Fast
42 | if ErrorLevel = 0 ;if player is currently banking, close bank window
43 | {
44 | Random, wait300to1500milis, 300, 1500
45 | Sleep, wait300to1500milis
46 | Random, varyby9, -9, 9
47 | Random, varyby8, -8, 8
48 | MouseMove, ox+varyby9+486, oy+varyby8+23, 0 ;X in top right corner of bank window
49 | Random, wait300to1500milis, 300, 1500
50 | Sleep, wait300to1500milis
51 | Click, down
52 | Random, wait5to100milis, 5, 100
53 | Sleep, wait5to100milis
54 | Click, up
55 | Random, wait300to1500milis, 300, 1500
56 | Sleep, wait300to1500milis
57 | }
58 | else ;if player is not currently banking, quit function
59 | {
60 | MsgBox, Cant find logout tab!
61 | ExitApp
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/ahk/Lib/BankOrient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Lib/BankOrient.png
--------------------------------------------------------------------------------
/ahk/Lib/BriefLogout.ahk:
--------------------------------------------------------------------------------
1 | BriefLogout() ;logout for a short period of time
2 | {
3 | Global
4 | Loop, 4 ;re-check to see if logout tab is now available on hud, do this 4 times
5 | {
6 | PixelSearch, LogOutButtonX, LogOutButtonY, ox+640, oy+473, ox+644, oy+473, 0x53af52, 5 ;check if logout button is available on hud to be clicked (player is not banking)
7 | if ErrorLevel = 0 ;if logout button is available, click it and logout
8 | {
9 | Gui, Destroy
10 | Random, varyby11, -11, 11
11 | Random, varyby12, -12, 12
12 | MouseMove, ox+varyby11+644, oy+varyby12+484, 0 ;logout tab on hud
13 | Random, wait400to1200milis, 400, 1200
14 | Sleep, wait400to1200milis
15 | Click, down
16 | Random, wait5to150milis, 5, 150
17 | Sleep, wait5to150milis
18 | Click, up
19 | Random, wait300to600milis, 300, 600
20 | Sleep, wait300to600milis
21 | Click, down
22 | Random, wait5to200milis, 5, 200
23 | Sleep, wait5to200milis
24 | Click, up
25 | Random, wait800to1200milis, 800, 1200
26 | Sleep, wait800to1200milis+500
27 | Random, varyby60, -60, 60
28 | Random, varyby9, -9, 9
29 | MouseMove, ox+varyby60+642, oy+varyby9+433, 0 ;"click here to logout" button within logout tab
30 | Random, wait400to1200milis, 400, 1200
31 | Sleep, wait400to1200milis
32 | Click, down
33 | Random, wait5to150milis, 5, 150
34 | Sleep, wait5to150milis
35 | Click, up
36 |
37 | Random, BriefLogoutDuration, 300000, 1200000 ;logout for 5-20min
38 | BriefLogoutDuration := BriefLogoutMin := 0 ;create a new variable to convert time to minutes for display purposes
39 | BriefLogoutMin /= 6000 ;convert miliseconds to minutes
40 | Gui, Destroy
41 | Gui, Add, Text, ,BriefLogout called for %BriefLogoutMin% minutes
42 | Gui, Show, Y15, Msgbox
43 | Sleep, BriefLogoutDuration
44 | Gui, Destroy
45 |
46 | LogoutCheck() ;use LogoutCheck function to log back in
47 | Return
48 |
49 | }
50 | else ;if logout button is not present on hud, check to see if player is currently banking
51 | PixelSearch, BoxWindowX, BoxWindowY, ox+140, oy+50, ox+140, oy+50, 0x1f98ff, 3, Fast
52 | if ErrorLevel = 0 ;if player is currently banking, close bank window
53 | {
54 | Random, wait200to900milis, 200, 900
55 | Sleep, wait200to900milis
56 | Random, varyby9, -9, 9
57 | Random, varyby8, -8, 8
58 | MouseMove, ox+varyby9+418, oy+varyby8+55, 0 ;close button of deposit box window
59 | Random, wait200to900milis, 200, 900
60 | Sleep, wait200to900milis
61 | Click, down
62 | Random, wait5to150milis, 5, 150
63 | Sleep, wait5to150milis
64 | Click, up
65 | Random, wait500to900milis, 500, 900
66 | Sleep, wait500to900milis
67 |
68 | }
69 | else ;if player is not currently banking, quit function
70 | {
71 | MsgBox, Cant find logout tab!
72 | ExitApp
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/ahk/Lib/CheckForGems.ahk:
--------------------------------------------------------------------------------
1 | CheckForGems()
2 | {
3 | CheckForGems:
4 | Global
5 | PixelSearch, SapphireX, SapphireY, ox+121, oy+78, ox+395, oy+235, 0x840a07, 3, Fast ;check for sapphires
6 | if ErrorLevel = 0
7 | {
8 | Random, wait200to900milis, 200, 900
9 | Sleep, wait200to900milis
10 | Random, varyby5, -5, 5
11 | Random, varyby7, -7, 7
12 | MouseMove, SapphireX+varyby7+7, SapphireY+varyby5+10, 0
13 | Random, wait200to900milis, 200, 900
14 | Sleep, wait200to900milis
15 | Click, down
16 | Random, wait5to150milis, 5, 150
17 | Sleep, wait5to150milis
18 | Click, up
19 | Random, wait700to900milis, 700, 900
20 | Sleep, wait700to900milis
21 | Random, DoubleClickRoll, 1, 10 ;chance to double-click on gem
22 | if DoubleClickRoll = 1
23 | {
24 | Random, wait90to250milis, 90, 250
25 | Sleep, wait90to250milis
26 | Click, down
27 | Random, wait5to150milis, 5, 150
28 | Sleep, wait5to150milis
29 | Click, up
30 | }
31 | Goto, CheckForGems
32 | }
33 | else
34 | {
35 | PixelSearch, EmeraldX,EmeraldY, ox+121, oy+78, ox+395, oy+235, 0x0a7b06, 3, Fast ;check for emeralds
36 | if ErrorLevel = 0
37 | {
38 | Random, wait200to900milis, 200, 900
39 | Sleep, wait200to900milis
40 | Random, varyby5, -5, 5
41 | Random, varyby7, -7, 7
42 | MouseMove, EmeraldX+varyby7+7, EmeraldY+varyby5+10, 0
43 | Random, wait200to900milis, 200, 900
44 | Sleep, wait200to900milis
45 | Click, down
46 | Random, wait5to150milis, 5, 150
47 | Sleep, wait5to150milis
48 | Click, up
49 | Random, wait700to900milis, 700, 900
50 | Sleep, wait700to900milis
51 | Random, DoubleClickRoll, 1, 10 ;chance to double-click on gem
52 | if DoubleClickRoll = 1
53 | {
54 | Random, wait90to250milis, 90, 250
55 | Sleep, wait90to250milis
56 | Click, down
57 | Random, wait5to150milis, 5, 150
58 | Sleep, wait5to150milis
59 | Click, up
60 | }
61 | Goto, CheckForGems
62 | }
63 | else
64 | {
65 | PixelSearch, RubyX,RubyY, ox+121, oy+78, ox+395, oy+235, 0x050c68, 3, Fast ;check for rubies
66 | if ErrorLevel = 0
67 | {
68 | Random, wait200to900milis, 200, 900
69 | Sleep, wait200to900milis
70 | Random, varyby5, -5, 5
71 | Random, varyby7, -7, 7
72 | MouseMove, RubyX+varyby7+7, RubyY+varyby5+10, 0
73 | Random, wait200to900milis, 200, 900
74 | Sleep, wait200to900milis
75 | Click, down
76 | Random, wait5to150milis, 5, 150
77 | Sleep, wait5to150milis
78 | Click, up
79 | Random, wait700to900milis, 700, 900
80 | Sleep, wait700to900milis
81 | Random, DoubleClickRoll, 1, 10 ;chance to double-click on gem
82 | if DoubleClickRoll = 1
83 | {
84 | Random, wait90to250milis, 90, 250
85 | Sleep, wait90to250milis
86 | Click, down
87 | Random, wait5to150milis, 5, 150
88 | Sleep, wait5to150milis
89 | Click, up
90 | }
91 | Goto, CheckForGems
92 | }
93 | else
94 | {
95 | PixelSearch, DiamondX, DiamondY, ox+121, oy+78, ox+395, oy+235, 0xafafb1, 3, Fast ;check for diamonds
96 | if ErrorLevel = 0
97 | {
98 | Random, wait200to900milis, 200, 900
99 | Sleep, wait200to900milis
100 | Random, varyby5, -5, 5
101 | Random, varyby7, -7, 7
102 | MouseMove, DiamondX+varyby7+7, DiamondY+varyby5+10, 0
103 | Random, wait200to900milis, 200, 900
104 | Sleep, wait200to900milis
105 | Click, down
106 | Random, wait5to150milis, 5, 150
107 | Sleep, wait5to150milis
108 | Click, up
109 | Random, wait700to900milis, 700, 900
110 | Sleep, wait700to900milis
111 | Random, DoubleClickRoll, 1, 10 ;chance to double-click on gem
112 | if DoubleClickRoll = 1
113 | {
114 | Random, wait90to250milis, 90, 250
115 | Sleep, wait90to250milis
116 | Click, down
117 | Random, wait5to150milis, 5, 150
118 | Sleep, wait5to150milis
119 | Click, up
120 | }
121 | Goto, CheckForGems
122 | }
123 | else
124 | Return
125 | }
126 |
127 | }
128 | }
129 | }
130 |
131 |
--------------------------------------------------------------------------------
/ahk/Lib/CheckStatsMining.ahk:
--------------------------------------------------------------------------------
1 | CheckStatsMining() ;check skill level
2 | {
3 | Global
4 | Gui, Destroy
5 | Gui, Add, Text, ,CheckStats called / %InvDeposited% Invs deposited (~%OreDeposited% Ore)
6 | Gui, Show, Y15, Msgbox
7 | Random, wait800to1200milis, 800, 1200
8 | Sleep, wait800to1200milis
9 | Random, varyby13, -13, 13
10 | Random, varyby14, -14, 14
11 | MouseMove, ox+varyby13+576, oy+varyby8+185, 0 ;stats icon
12 | Random, wait200to900milis, 200, 900
13 | Sleep, wait200to900milis+300
14 | LogoutCheck()
15 | DisconnectCheck()
16 | Click, down
17 | Random, wait5to150milis, 5, 150
18 | Sleep, wait5to150milis
19 | Click, up
20 | Random, wait800to1200milis, 800, 1200
21 | Random, wait200to500milis, 200, 500
22 | Sleep, wait800to1200milis+wait200to500milis
23 | Random, varyby22, -22, 22
24 | Random, varyby11, -11, 11
25 | MouseMove, ox+varyby22+705, oy+varyby11+222, 0 ;mining stat box
26 | Random, wait3to5sec, 3000, 5000
27 | Sleep, wait3to5sec+1500
28 | Random, varyby13, -13, 13
29 | Random, varyby14, -14, 14
30 | MouseMove, ox+varyby13+642, oy+varyby14+186, 0 ;inventory bag icon
31 | Random, wait200to900milis, 200, 900
32 | Sleep, wait200to900milis+900
33 | LogoutCheck()
34 | DisconnectCheck()
35 | Click, down
36 | Random, wait5to150milis, 5, 150
37 | Sleep, wait5to150milis
38 | Click, up
39 | Random, wait500to900milis, 500, 900
40 | Sleep, wait500to900milis
41 | Gui, Destroy
42 | Return
43 | }
44 |
--------------------------------------------------------------------------------
/ahk/Lib/CheckStatsSmithing.ahk:
--------------------------------------------------------------------------------
1 | CheckStatsSmithing()
2 | {
3 | Global
4 | CheckStats: ;check skill level
5 | Gui, Destroy
6 | Gui, Add, Text, ,CheckStats called ...
7 | Gui, Show, Y15, Msgbox
8 | Random, wait800to1200milis, 800, 1200
9 | Sleep, wait800to1200milis
10 | Random, varyby13, -13, 13
11 | Random, varyby14, -14, 14
12 | MouseMove, ox+varyby13+576, oy+varyby14+185, 0 ;stats icon
13 | Random, wait200to900milis, 200, 900
14 | Sleep, wait200to900milis+300
15 | LogOutCheck()
16 | DisconnectCheck()
17 | Click, down
18 | Random, wait5to100milis, 5, 100
19 | Sleep, wait5to100milis
20 | Click, up
21 | Random, wait800to1200milis, 800, 1200
22 | Random, wait200to500milis, 200, 500
23 | Sleep, wait800to1200milis+wait200to500milis
24 | Random, varyby22, -22, 22
25 | Random, varyby11, -11, 11
26 | MouseMove, ox+varyby22+705, oy+varyby11+254, 0 ;smelting stat box
27 | Random, wait3to5sec, 3000, 5000
28 | Sleep, wait3to5sec+1500
29 | Random, varyby13, -13, 13
30 | Random, varyby14, -14, 14
31 | MouseMove, ox+varyby13+642, oy+varyby14+186, 0 ;inventory bag icon
32 | Random, wait200to900milis, 200, 900
33 | Sleep, wait200to900milis+900
34 | LogOutCheck()
35 | DisconnectCheck()
36 | Click, down
37 | Random, wait5to100milis, 5, 100
38 | Sleep, wait5to100milis
39 | Click, up
40 | Random, wait200to900milis, 200, 900
41 | Sleep, wait200to900milis
42 | Random, varyby765, 0, 765
43 | Random, varyby503, 0, 503
44 | MouseMove, ox+varyby765, oy+varyby503, 0 ;move mouse to a random spot on the screen after checking stats
45 | Random, wait400to900milis, 200, 900
46 | Sleep, wait400to900milis
47 | Gui, Destroy
48 | Return
49 | }
50 |
--------------------------------------------------------------------------------
/ahk/Lib/DisconnectCheck.ahk:
--------------------------------------------------------------------------------
1 | DisconnectCheck() ;check if client has been unexpectedly disconnected and booted to post-login screen, if so, attempt to log back in
2 | {
3 | Global
4 | PixelSearch, PostLoginButtonX, PostLoginButtonY, ox+763, oy+500, ox+763, oy+500, 0x000000, 2, Fast ;look for post-login screen
5 | if ErrorLevel = 0 ;if found, click on big red button
6 | {
7 | Gui, Destroy
8 | Gui, Add, Text, ,Client disconnected, attempting to log back in...
9 | Gui, Show, Y15, Msgbox
10 | Random, wait2to5sec, 2000, 5000
11 | Sleep, wait2to5sec
12 | Random, varyby15, -15, 15
13 | Random, varyby14, -14, 14
14 | MouseMove, ox+varyby15+400, oy+varyby14+337, 0
15 | Random, wait1to3sec, 1000, 3000
16 | Sleep, wait1to3sec
17 | Click, down
18 | Random, wait5to150milis, 5, 150
19 | Sleep, wait5to150milis
20 | Click, up
21 | Random, DoubleClickRoll, 1, 10 ;chance to double-click on button
22 | if DoubleClickRoll = 10
23 | {
24 | Random, wait150to350milis, 150, 350
25 | Sleep, wait150to350milis
26 | Click, down
27 | Random, wait5to150milis, 5, 150
28 | Sleep, wait5to150milis
29 | Click, up
30 | }
31 | Random, wait2to5sec, 2000, 5000
32 | Sleep, wait2to5sec
33 | ;PixelSearch, LogoutX, LogoutY, ox+73, oy+485, ox+73, oy+485, 0xffffff ;check if client has successfully logged back in by checking for absence of white text in lower-left corner of client indicating World selection
34 | }
35 | else ;if not found, abort subroutine and return to location it was called from
36 | Return
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/ahk/Lib/FullInvCheck.ahk:
--------------------------------------------------------------------------------
1 | FullInvCheck()
2 | {
3 | Global
4 | PixelSearch, InvFullX, InvFullY, ox+705, oy+445, ox+705, oy+445, 0x3a424b, 5, Fast ;deposit inventory if an item is in the last inventory spot
5 | if ErrorLevel
6 | EmptyInv()
7 | else
8 | Return
9 | }
--------------------------------------------------------------------------------
/ahk/Lib/LogoutCheck.ahk:
--------------------------------------------------------------------------------
1 | LogoutCheck() ;if client has been unexpectedly booted to main login screen, attempt to log back in
2 | {
3 | Global
4 | PixelSearch, LogoutX, LogoutY, ox+73, oy+485, ox+73, oy+485, 0xffffff, 0, Fast
5 | if ErrorLevel = 0 ;if client logged out, log back in and go back to starting position
6 | {
7 | Gui, Destroy
8 | Gui, Add, Text, ,Client logged out, attempting to log back in...
9 | Gui, Show, Y15, Msgbox
10 | Random, wait5to10sec, 5000, 10000
11 | Sleep, wait5to10sec
12 | Random, varyby15, -15, 15
13 | Random, varyby14, -14, 14
14 | MouseMove, ox+varyby15+30, oy+varyby14+30 ;click on window to make sure it is in focus before attempting to login
15 | Random, wait200to900milis, 200, 900
16 | Sleep, wait200to900milis
17 | Click, down
18 | Random, wait5to150milis, 5, 150
19 | Sleep, wait5to150milis
20 | Click, up
21 | Random, DoubleClickRoll, 1, 15 ;chance to double-click
22 | if DoubleClickRoll = 1
23 | {
24 | Random, wait90to250milis, 90, 250
25 | Sleep, wait90to250milis
26 | Click, down
27 | Random, wait5to150milis, 5, 150
28 | Sleep, wait5to150milis
29 | Click, up
30 | }
31 |
32 | Send {Enter} ;same as clicking "existing user" button
33 | Random, wait1to3sec, 1000, 3000
34 | Sleep, wait1to3sec
35 | Send {Raw}username
36 | Random, wait1to3sec, 1000, 3000
37 | Sleep, wait1to3sec
38 | Send {Tab}
39 | Random, wait1to3sec, 1000, 3000
40 | Sleep, wait1to3sec
41 | Send {Raw}password
42 | Random, wait1to3sec, 1000, 3000
43 | Sleep, wait1to3sec
44 | Send {Enter}
45 | Random, wait1to3sec, 1000, 3000
46 | Sleep, wait1to3sec
47 |
48 | PostLogin:
49 | Loop, 5
50 | {
51 | PixelSearch, PostLoginButtonX, PostLoginButtonY, ox+763, oy+500, ox+763, oy+500, 0x000000, 3 ;check if post-login screen has been reached, if not, try hitting login button again
52 | if ErrorLevel = 0 ;if post-login screen reached, click on big red button
53 | {
54 | Random, varyby15, -15, 15
55 | Random, varyby14, -14, 14
56 | MouseMove, ox+varyby15+400, oy+varyby14+337, 0
57 | Random, wait1to3sec, 1000, 3000
58 | Sleep, wait1to3sec
59 | Click, down
60 | Random, wait5to150milis, 5, 150
61 | Sleep, wait5to150milis
62 | Click, up
63 | Random, DoubleClickRoll, 1, 35 ;chance to double-click on button
64 | if DoubleClickRoll = 5
65 | {
66 | Random, wait90to250milis, 90, 250
67 | Sleep, wait90to250milis
68 | Click, down
69 | Random, wait5to150milis, 5, 150
70 | Sleep, wait5to150milis
71 | Click, up
72 | }
73 | Gui, Destroy
74 | Random, wait2to5sec, 2000, 5000
75 | Sleep, wait2to5sec+2000
76 | PixelSearch, LogoutX, LogoutY, ox+73, oy+485, ox+73, oy+485, 0xffffff ;check if client has successfully logged back in by checking for absence of white text in lower-left corner of client indicating login screen World selection
77 | if ErrorLevel ;if logged back in, re-orient client and begin macro
78 | {
79 | OrientClient()
80 | Return 1
81 | }
82 | else
83 | Goto, PostLogin ;if not logged back in, return to post-login section of function
84 | }
85 |
86 | else ;if post-login screen not reached, try logging in again since login may have timed out due to poor network connectivity
87 | {
88 | Random, wait2to5sec, 2000, 5000
89 | Sleep, wait2to5sec
90 | Send {Enter} ;try hitting login button again if can't connect to server yet
91 | Random, wait2to5sec, 2000, 5000
92 | Sleep, wait2to5sec+5000
93 | }
94 |
95 | } ;if login loop fails repeatedly, stop macro
96 | MsgBox, Can't get past post-login, or error with LogoutCheck loop!
97 | ExitApp
98 | }
99 | else ;if client has not been logged out, stop function
100 | Return
101 | }
102 |
--------------------------------------------------------------------------------
/ahk/Lib/MinimapCheck.ahk:
--------------------------------------------------------------------------------
1 | MinimapCheck()
2 | {
3 | Global
4 | Gui, Destroy
5 | MiniMapCheck := 0
6 | Loop, 5000
7 | {
8 | PixelSearch, MiningSpot1X, MiningSpot1Y, ox+670, oy+132, ox+674, oy+136, 0x0000e4, 45, Fast ;check minimap to make sure character hasn't moved accidentally
9 | if ErrorLevel
10 | Sleep, 50
11 | else
12 | MiniMapCheck += 1
13 | PixelSearch, MiningSpot2X, MiningSpot2Y, ox+638, oy+151, ox+642, oy+155, 0x0000e4, 45, Fast ;check minimap to make sure character hasn't moved accidentally
14 | if ErrorLevel
15 | Sleep, 50
16 | else
17 | {
18 | MiniMapCheck += 1
19 | Break
20 | }
21 | LogoutCheck() ;check if character has been logged out accidentally
22 | DisconnectCheck() ;check if client has been disconnected accidentally
23 | }
24 | if MiniMapCheck = 2
25 | Return
26 | else
27 | {
28 | Gui, Destroy
29 | Gui, Add, Text, ,AbortLogout called because character not at mining spot / %InvDeposited% Invs deposited (~%OreDeposited% Ore)
30 | Gui, Show, Y15, Msgbox
31 | Random, wait800to1200milis, 800, 1200
32 | Sleep, wait800to1200milis
33 | AbortLogout()
34 | }
35 | }
--------------------------------------------------------------------------------
/ahk/Lib/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Lib/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/Lib/OrientClient.ahk:
--------------------------------------------------------------------------------
1 | OrientClient()
2 | {
3 | Global
4 |
5 | CoordMode, Pixel, Screen
6 | CoordMode, Mouse, Screen
7 |
8 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png ;orient client by searching whole screen for prayer hud icon
9 |
10 | if ErrorLevel = 0
11 | {
12 | MouseMove, OrientX, OrientY ;move mouse to top left pixel of prayer hud menu icon to create new origin point for coordinate system
13 | MouseMove, -696, -171, 0, R ; zero-X zero-Y (coordinates from prayer icon to origin point in top right corner)
14 | MouseGetPos, ox, oy ;use current position of mouse as origin point for coordinate system
15 | }
16 |
17 | else
18 | {
19 | MsgBox, Can’t find client!
20 | ExitApp
21 | }
22 |
23 | Return
24 | }
--------------------------------------------------------------------------------
/ahk/Lib/RandomSleep.ahk:
--------------------------------------------------------------------------------
1 | RandomSleep()
2 | {
3 | Global
4 | Random, RandomSleepRoll, 1, 3
5 | if RandomSleepRoll = 1
6 | {
7 | Random, RandomSleepOne, 3000, 30000
8 | SleepSeconds := 0
9 | SleepSeconds := RandomSleepOne ;convert sleep duration value into seconds to be displayed on gui
10 | SleepSeconds /= 1000
11 | Gui, Destroy
12 | Gui, Add, Text, ,RandomSleep called for %SleepSeconds% seconds
13 | Gui, Show, Y15, Msgbox
14 | Sleep, RandomSleepOne
15 | Gui, Destroy
16 | LogoutCheck()
17 | DisconnectCheck()
18 | }
19 | if RandomSleepRoll = 2
20 | {
21 | Random, RandomSleepTwo, 3000, 30000
22 | SleepSeconds := 0
23 | SleepSeconds := RandomSleepTwo ;convert sleep duration value into seconds to be displayed on gui
24 | SleepSeconds /= 1000
25 | Gui, Destroy
26 | Gui, Add, Text, ,RandomSleep called for %SleepSeconds% seconds
27 | Gui, Show, Y15, Msgbox
28 | Sleep, RandomSleepTwo
29 | Gui, Destroy
30 | LogoutCheck()
31 | DisconnectCheck()
32 | }
33 | if RandomSleepRoll = 3
34 | {
35 | Random, RandomSleepThree, 3000, 30000
36 | SleepSeconds := 0
37 | SleepSeconds := RandomSleepThree ;convert sleep duration value into seconds to be displayed on gui
38 | SleepSeconds /= 1000
39 | Gui, Destroy
40 | Gui, Add, Text, ,RandomSleep called for %SleepSeconds% seconds
41 | Gui, Show, Y15, Msgbox
42 | Sleep, RandomSleepThree
43 | Gui, Destroy
44 | LogoutCheck()
45 | DisconnectCheck()
46 | }
47 | else
48 | Return
49 | Random, RandomSleepRollExtra, 1, 10
50 | if RandomSleepRollExtra = 1
51 | {
52 | Random, RandomSleepOneExtra, 5000, 10000
53 | SleepSeconds := 0
54 | SleepSeconds := RandomSleepOneExtra ;convert sleep duration value into seconds to be displayed on gui
55 | SleepSeconds /= 1000
56 | Gui, Destroy
57 | Gui, Add, Text, ,RandomSleep Extra called for %SleepSeconds% seconds
58 | Gui, Show, Y15, Msgbox
59 | Sleep, RandomSleepOneExtra
60 | Gui, Destroy
61 | LogoutCheck()
62 | DisconnectCheck()
63 | Return
64 | }
65 | else
66 | Return
67 | }
68 |
--------------------------------------------------------------------------------
/ahk/Lib/SelectChat.ahk:
--------------------------------------------------------------------------------
1 | SelectChat()
2 | {
3 | Global
4 | Random, SelectChatRoll, 1, 60
5 | if SelectChatRoll != 1 ;chance per inventory to enter predetermined text into chat (chance should be lower than BriefLogout chances to prevent duplicate messages appearing to the same people)
6 | Return
7 | Random, wait500to900milis, 500, 900
8 | Sleep, wait500to900milis
9 | Random, varyby10, -10, 10
10 | Random, varyby9, -9, 9
11 | MouseMove, ox+varyby10+258, oy+varyby9+144, 0 ;click on rock
12 | Random, wait200to500milis, 200, 500
13 | Sleep, wait200to500milis
14 | Click, down
15 | Random, wait5to150milis, 5, 150
16 | Sleep, wait5to150milis
17 | Click, up
18 | Random, DoubleClickRoll, 1, 32 ;small chance to double-click on rock
19 | if DoubleClickRoll = 1
20 | {
21 | Random, wait180to500milis, 180, 500
22 | Sleep, wait180to500milis
23 | Click, down
24 | Random, wait5to150milis, 5, 150
25 | Sleep, wait5to150milis
26 | Click, up
27 | Random, wait300to600milis, 300, 600
28 | Sleep, wait300to600milis
29 | Gui, Destroy
30 | }
31 | Random, SelectChat, 1, 15 ;if macro decides to chat, determine which message it will type, with equal chances for each message
32 | if SelectChat = 1
33 | {
34 | Send {Raw}wonder how many bots here
35 | Random, wait400to700milis, 400, 700
36 | Sleep, wait400to700milis+1000
37 | Send {Enter}
38 | Return
39 | }
40 | if SelectChat = 2
41 | {
42 | Send {Raw}so board
43 | Random, wait400to700milis, 400, 700
44 | Sleep, wait400to700milis+1000
45 | Send {Enter}
46 | }
47 | if SelectChat = 3
48 | {
49 | Send {Raw}why is mining so slow to lvl
50 | Random, wait400to700milis, 400, 700
51 | Sleep, wait400to700milis+1000
52 | Send {Enter}
53 | }
54 | if SelectChat = 4
55 | {
56 | Send {Raw}12.99999m xp to 99!
57 | Random, wait400to700milis, 400, 700
58 | Sleep, wait400to700milis+1000
59 | Send {Enter}
60 | }
61 | if SelectChat = 5
62 | {
63 | Send {Raw}any other hoomanss?
64 | Random, wait400to700milis, 400, 700
65 | Sleep, wait400to700milis+1000
66 | Send {Enter}
67 | }
68 | if SelectChat = 6
69 | {
70 | Send {Raw}alguien habla espanol?
71 | Random, wait400to700milis, 400, 700
72 | Sleep, wait400to700milis+1000
73 | Send {Enter}
74 | }
75 | if SelectChat = 7
76 | {
77 | Send {Raw}meow!
78 | Random, wait400to700milis, 400, 700
79 | Sleep, wait400to700milis+1000
80 | Send {Enter}
81 | }
82 | if SelectChat = 8
83 | {
84 | Send {Raw}this place must be bot heaven
85 | Random, wait400to700milis, 400, 700
86 | Sleep, wait400to700milis+1000
87 | Send {Enter}
88 | }
89 | if SelectChat = 9
90 | {
91 | Send {Raw}botopolis
92 | Random, wait400to700milis, 400, 700
93 | Sleep, wait400to700milis+1000
94 | Send {Enter}
95 | }
96 | if SelectChat = 10
97 | {
98 | Send {Raw}mmmmmmeow
99 | Random, wait400to700milis, 400, 700
100 | Sleep, wait400to700milis+1000
101 | Send {Enter}
102 | }
103 | if SelectChat = 11
104 | {
105 | Send {Raw}mining is sooo fun
106 | Random, wait400to700milis, 400, 700
107 | Sleep, wait400to700milis+1000
108 | Send {Enter}
109 | }
110 | if SelectChat = 12
111 | {
112 | Send {Raw}mining = fun
113 | Random, wait400to700milis, 400, 700
114 | Sleep, wait400to700milis+1000
115 | Send {Enter}
116 | }
117 | if SelectChat = 13
118 | {
119 | Send {Raw}only 13m xp left till 99!
120 | Random, wait400to700milis, 400, 700
121 | Sleep, wait400to700milis+1000
122 | Send {Enter}
123 | }
124 | if SelectChat = 14
125 | {
126 | Send {Raw}diggy diggy hole
127 | Random, wait400to700milis, 400, 700
128 | Sleep, wait400to700milis+1000
129 | Send {Enter}
130 | }
131 | if SelectChat = 15
132 | {
133 | Send {Raw}oink
134 | Random, wait400to700milis, 400, 700
135 | Sleep, wait400to700milis+1000
136 | Send {Enter}
137 | }
138 | else
139 | Sleep, 1
140 | Gui, Destroy
141 | Gui, Add, Text, ,SelectChat (%SelectChat%) rolled / %InvDeposited% Invs deposited (~%OreDeposited% Ore)
142 | Gui, Show, Y15, Msgbox
143 | Random, wait300to600milis, 300, 600
144 | Sleep, wait300to600milis
145 | Gui, Destroy
146 | Return
147 | }
--------------------------------------------------------------------------------
/ahk/Lib/Stuck.ahk:
--------------------------------------------------------------------------------
1 |
2 |
3 | if ErrorLevel ;if not at furnace, check if stuck one tile north
4 | {
5 | PixelSearch, StuckNX, StuckNY, ox+640, oy+159, ox+640, oy+159, 0x0000ef, 15, Fast
6 | if ErrorLevel = 0
7 | {
8 | Random, varyby9, -9, 9
9 | Random, varyby9, -8, 8
10 | MouseMove, ox+varyby9+285, oy+varyby8+204, 0
11 | Random, wait200to900milis, 200, 900
12 | Sleep, wait200to900milis
13 | Click, down
14 | Random, wait5to150milis, 5, 150
15 | Sleep, wait5to150milis
16 | Click, up
17 | Random, wait2to4sec, 2000, 4000
18 | Sleep, wait2to4sec
19 | Goto, FurnaceAtCheck
20 | }
21 | else ;if not stuck one tile north, check if stuck one tile south
22 | {
23 | PixelSearch, StuckSWX, StuckSWY, ox+635, oy+138, ox+635, oy+138, 0x0000f5, 15, Fast
24 | if ErrorLevel = 0
25 | {
26 | Random, varyby8, -8, 8
27 | Random, varyby7, -7, 7
28 | MouseMove, ox+varyby8+284, oy+varyby7+146, 0 ;mining spot from StuckSW position
29 | Random, wait200to900milis, 200, 900
30 | Sleep, wait200to900milis
31 | Click, down
32 | Random, wait5to150milis, 5, 150
33 | Sleep, wait5to150milis
34 | Click, up
35 | Random, wait2to4sec, 2000, 4000
36 | Sleep, wait2to4sec
37 | Goto, FurnaceAtCheck
38 | }
39 | else ;if not stuck one tile north or south, check if stuck one tile west
40 | {
41 | PixelSearch, StuckEX, StuckEY, ox+628, oy+38, ox+628, oy+38, 0x0000e9, 15, Fast
42 | if ErrorLevel = 0
43 | {
44 | Random, varyby9, -9, 9
45 | Random, varyby8, -8, 8
46 | MouseMove, ox+varyby9+208, oy+varyby8+171, 0 ;mining spot from StuckSW position
47 | Random, wait200to900milis, 200, 900
48 | Sleep, wait200to900milis
49 | Click, down
50 | Random, wait5to150milis, 5, 150
51 | Sleep, wait5to150milis
52 | Click, up
53 | Random, wait2to4sec, 2000, 4000
54 | Sleep, wait2to4sec
55 | Goto, FurnaceAtCheck
56 | }
57 | }
58 | else ;if not at furnace and not stuck at any known location, logout
59 | {
60 | Random, wait100to200milis, 100, 200
61 | Sleep, wait100to200milis
62 | }
63 |
64 | }
65 | }
66 | }
67 | }
68 | */
69 |
--------------------------------------------------------------------------------
/ahk/Lib/Update.ahk:
--------------------------------------------------------------------------------
1 |
2 | Update() ;update log of most recently executed lines
3 |
4 | {
5 |
6 | ControlFocus, , ListLines
7 |
8 | Send {F5}
9 | ControlFocus, ,11700 ;
10 |
11 | Return
12 |
13 | }
--------------------------------------------------------------------------------
/ahk/LoginScript.ahk:
--------------------------------------------------------------------------------
1 | /*
2 | check for logout
3 | run login script
4 | refer to external script for login credentials
5 |
6 | include “D:\OneDrive\Documents (OneDrive)\login.ahk”
7 |
8 | use external script not on github to login
9 |
10 |
11 | (CFlatLogin)
--------------------------------------------------------------------------------
/ahk/OSRSBlastFurnace/BlastFurnace.au3:
--------------------------------------------------------------------------------
1 | ;BlastFurnaceTextDoc
2 |
3 | ;designed for 1600x900 screen inside windowed VM with official runescape client "snapped" to left half
4 | ;of screen
5 |
6 | CoordMode, Pixel, Screen
7 | CoordMode, Mouse, Screen
8 | #Persistent
9 |
10 | ;orient client by searching whole screen for prayer hud icon
11 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png
12 | if ErrorLevel
13 | {
14 | MsgBox, Can’t find client!
15 | ExitApp
16 | }
17 | else
18 | {
19 | Sleep, 100
20 | MouseMove, OrientX, OrientY
21 | Sleep, 100
22 | ;move mouse to top left pixel of client to create new origin point for coordinate system
23 | MouseMove, -696, -171, 0, R ; 0, 0 coordinates from prayer icon
24 | Sleep, 600
25 | MouseGetPos, ox, oy
26 | }
27 |
28 | ;click compass to orient client North
29 | Sleep, 100
30 | MouseMove, ox+562, oy+20, 0 ;compass
31 | Sleep, 100
32 | Click
33 | Sleep, 5
34 | Click
35 | Sleep, 5
36 | Send {Up down}
37 | Sleep, 750
38 | Send {Up up}
39 |
40 | ;check run energy. if above about 90, turn on run
41 | PixelSearch, RunX, RunY, ox+590, oy+138, ox+590, oy+138, 0x01a8ce ;run 90% energy
42 | if ErrorLevel = 0
43 | {
44 | MouseMove, RunX, RunY, 0
45 | Sleep, 100
46 | Click, RunX, RunY
47 | }
48 |
49 | ;begin main repeating routine
50 | Loop
51 | {
52 |
53 | ;check run energy again, if below a certain amount, withdrawal money from coffer and wait till energy has restored itself, then deposit money back into coffer
54 | PixelSearch, RunOutX, RunOutY, ox+576, oy+133, ox+576, oy+133, 0x0B0B0B ;run 10% energy
55 | if ErrorLevel = 0
56 | {
57 |
58 | ;deposit inventory to allow room for coin stack
59 | MouseMove, ox+297, oy+229, 0 ;open bank from starting position
60 | Sleep, 100
61 | Click
62 | Sleep, 3
63 | Click
64 | Sleep, 600
65 |
66 | ;wait for bank screen to appear
67 | Loop, 25
68 | {
69 | PixelSearch, BankWindowX, BankWindowY, ox+362, oy+318, ox+362, oy+318, 0x3095DF
70 | if ErrorLevel
71 | {
72 | Click
73 | Sleep, 600
74 | }
75 | else
76 | Goto, Continue1
77 | }
78 | ExitApp
79 | Continue1:
80 |
81 | ;deposit inventory
82 | MouseMove, ox+444, oy+314, 0 ;deposit inventory button in bank window
83 | Sleep, 100
84 | Click
85 | Sleep, 3
86 | Click
87 | Sleep, 600
88 |
89 | ;wait for inventory to be deposited
90 | Loop, 25
91 | {
92 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
93 | if ErrorLevel
94 | {
95 | Click
96 | Sleep, 600
97 | }
98 | else
99 | Goto, Continue2
100 | }
101 | ExitApp
102 | Continue2:
103 | Sleep, 100
104 | MouseMove, ox+487, oy+23, 0 ;bank window close
105 | Click
106 | Sleep, 1
107 | Click
108 |
109 | ;withdrawal from coffer and return to start position
110 | MouseMove, ox+205, oy+170, 0 ;coffer location from bank
111 | Sleep, 100
112 | Click
113 | Sleep, 3
114 | Click
115 | Sleep, 3000
116 | SendInput, {1}
117 | Sleep, 1000
118 | SendInput, {Raw}999999999
119 | Sleep, 1000
120 | SendInput, {Enter}
121 | Sleep, 1000
122 | SendInput, {Space}
123 | Sleep, 1000
124 | MouseMove, ox+285, oy+192, 0 ;bank location from coffer
125 | Sleep, 100
126 | Click
127 | Sleep, 3000
128 | MouseMove, ox+487, oy+23, 0 ;bank window close
129 | Sleep, 100
130 | Click
131 |
132 | ;keep checking every five seconds until run energy full
133 | Loop, 1800000
134 | {
135 | Sleep, 5000
136 |
137 | ;click on compass to prevent client timeout
138 | MouseMove, ox+562, oy+20, 0 ;compass
139 | Sleep, 100
140 | Click
141 | PixelSearch, RunX, RunY, ox+590, oy+138, ox+590, oy+138, 0x01a8ce ;run 90% energy
142 | if ErrorLevel = 0
143 | {
144 |
145 | ;if full, return money to coffer
146 | MouseMove, ox+205, oy+170, 0 ;coffer location from bank
147 | Sleep, 100
148 | Click
149 | Sleep, 3
150 | Click
151 | Sleep, 3000
152 | SendInput, {1}
153 | Sleep, 1000
154 | SendInput, {Raw}999999999
155 | Sleep, 1000
156 | SendInput, {Enter}
157 | Sleep, 1000
158 | SendInput, {Space}
159 | Sleep, 1000
160 | MouseMove, ox+285, oy+192, 0 ;bank location from coffer
161 | Sleep, 100
162 | Click
163 | Sleep, 3000
164 | MouseMove, ox+487, oy+23, 0 ;bank window close
165 | Sleep, 100
166 | Click
167 | Goto, Start
168 | }
169 | else
170 | ExitApp
171 | }}
172 |
173 | Start:
174 | ;drink stamina potion if potion effect isn't active
175 | PixelSearch, StaminaActiveX, StaminaActiveY, ox+584, oy+140, ox+584, oy+140, 0x3d73e4
176 | if ErrorLevel
177 | {
178 | MouseMove, ox+661, oy+447, 0 ;second-to-last inventory position
179 | Sleep, 100
180 | Click
181 | Sleep, 3
182 | Click
183 |
184 | ;check if potion effect has been activated, if not, get another potion because the current vial has been depleted
185 | Sleep, 1000
186 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
187 | if ErrorLevel
188 | {
189 |
190 | ;open bank chest in front of you
191 | Sleep, 200
192 | MouseMove, ox+297, oy+229, 0 ;open bank from starting position
193 | Sleep, 100
194 | Click
195 | Sleep, 1
196 | Click
197 |
198 | ;wait for bank screen to appear
199 | Loop, 25
200 | {
201 | PixelSearch, BankWindowX, BankWindowY, ox+362, oy+318, ox+362, oy+318, 0x3095DF
202 | if ErrorLevel
203 | {
204 | Click
205 | Sleep, 600
206 | }
207 | else
208 | Goto, Continue3
209 | }
210 | ExitApp
211 | Continue3:
212 |
213 | ;deposit inventory
214 | MouseMove, ox+444, oy+314, 0 ;deposit inventory button in bank window
215 | Sleep, 100
216 | Click
217 | Sleep, 3
218 | Click
219 | Sleep, 600
220 |
221 | ;wait for inventory to be deposited
222 | Loop, 25
223 | {
224 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
225 | if ErrorLevel
226 | {
227 | Click
228 | Sleep, 600
229 | }
230 | else
231 | Goto, Continue4
232 | }
233 | ExitApp
234 | Continue4:
235 |
236 | ;look for ore(s) and stamina potions if any, if not present, withdrawal all money from coffer and terminate
237 | PixelSearch, MainOreX, MainOreY, ox+80, oy+100, ox+80, oy+100, 0x48667f
238 | if ErrorLevel
239 | Goto, WithdrawalCoffer
240 |
241 | PixelSearch, CoalX, CoalY, ox+140, oy+100, ox+140, oy+100, 0x263739
242 | if ErrorLevel
243 | Goto, WithdrawalCoffer
244 |
245 | PixelSearch, PotionX, PotionY, ox+181, oy+96, ox+181, oy+96 0x4c7fa6
246 | if ErrorLevel
247 | Goto, WithdrawalCoffer
248 |
249 | ;withdrawal ore(s) and stamina potion if present
250 | Sleep, 10
251 | MouseMove, ox+89, oy+96, 0 ;main ore location in bank
252 | Sleep, 50
253 | Click, right
254 | Sleep, 50
255 | MouseMove, ox+89, oy+170, 0 ;main ore right click withdrawal saved X location in bank
256 | Sleep, 50
257 | Click
258 | Sleep, 50
259 | MouseMove, ox+140, oy+96, 0 ;coal ore location in bank
260 | Sleep, 50
261 | Click, right
262 | Sleep, 50
263 | MouseMove, ox+140, oy+166, 0 ;coal ore right click withdrawal saved X location in bank
264 | Sleep, 50
265 | Click
266 | Sleep, 50
267 | MouseMove, ox+185, oy+100, 0 ;stamina potions location in bank
268 | Sleep, 50
269 | Click
270 | Sleep, 50
271 | Goto, GoingtoBelt
272 | }}
273 |
274 | ;wait for ore to withdrawal
275 | ; Sleep, 600
276 | ; Loop, 25
277 | ; {
278 | ; PixelSearch, OreGetX, OreGetY, 635, 261, 635, 261, 0x425D74
279 |
280 | ;if ore takes too long to appear in inventory, try withdrawaling it again
281 | ; if ErrorLevel
282 | ; {
283 | ; Sleep, 100
284 | ; Click, right, 112, 130
285 | ; Sleep, 100
286 | ; Click, 101, 227
287 | ; Sleep, 100
288 | ; Continue
289 | ; }
290 | ; else
291 | ; {
292 | ; Click, 511, 54
293 | ; Sleep, 1000
294 | ; Click, 683, 479
295 | ; Sleep, 2
296 | ; Click, 683, 479
297 | ; Sleep, 1000
298 | ; Goto, GoingtoBelt
299 | ; }}}}
300 |
301 | ;the following is the banking procedure when a new stamina potion is NOT required
302 |
303 | ;open bank chest in front of you
304 | Sleep, 200
305 | MouseMove, ox+297, oy+229, 0 ;open bank from starting position
306 | Sleep, 100
307 | Click
308 | Sleep, 1
309 | Click
310 |
311 | ;wait for bank screen to appear
312 | Loop, 25
313 | {
314 | PixelSearch, BankWindowX, BankWindowY, ox+362, oy+318, ox+362, oy+318, 0x3095DF
315 | if ErrorLevel
316 | {
317 | Click
318 | Sleep, 600
319 | }
320 | else
321 | Goto, Continue3
322 | }
323 | ExitApp
324 | Continue3:
325 |
326 | ;deposit held bars
327 | MouseMove, ox+665, oy+227, 0 ;right click third stack of items in inventory
328 | Sleep, 500
329 | Click, right
330 | Sleep, 500
331 | MouseMove, ox+656, oy+328, 0 ;select "all" on drop down third stack of items in inventory
332 | Sleep, 500
333 | Click
334 | Sleep, 500
335 |
336 | ;wait for inventory to be deposited
337 | Loop, 25
338 | {
339 | PixelSearch, InvSlot1EmptyX,InvSlot1EmptyY, ox+579, oy+225, ox+579, oy+225, 0x354049
340 | if ErrorLevel
341 | {
342 | Click
343 | Sleep, 600
344 | }
345 | else
346 | Goto, Continue5
347 | }
348 | ExitApp
349 | Continue5:
350 |
351 | ;look for ore, if not present, withdrawal all money from coffer and terminate
352 | PixelSearch, MainOreX, MainOreY, ox+80, oy+100, ox+80, oy+100, 0x48667f
353 | if ErrorLevel
354 | Goto, WithdrawalCoffer
355 |
356 | PixelSearch, CoalX, CoalY, ox+140, oy+100, ox+140, oy+100, 0x263739
357 | if ErrorLevel
358 | Goto, WithdrawalCoffer
359 |
360 | ;withdrawal ore if present
361 | Sleep, 10
362 | MouseMove, ox+89, oy+96, 0 ;main ore location in bank
363 | Sleep, 50
364 | Click, right
365 | Sleep, 50
366 | MouseMove, ox+89, oy+170, 0 ;main ore right click withdrawal saved X location in bank
367 | Sleep, 50
368 | Click
369 | Sleep, 50
370 | MouseMove, ox+140, oy+96, 0 ;coal ore location in bank
371 | Sleep, 50
372 | Click, right
373 | Sleep, 50
374 | MouseMove, ox+140, oy+166, 0 ;coal ore right click withdrawal saved X location in bank
375 | Sleep, 50
376 | Click
377 | Sleep, 50
378 |
379 | ;click minimap to move to belt
380 | GoingtoBelt:
381 | MouseMove, ox+618, oy+44, 0 ;belt location on minimap from start
382 | Sleep, 500
383 | Click
384 | Sleep, 1
385 | Click
386 | Sleep, 3000
387 |
388 | ;Keep checking water icon on minimap until you've arrived at belt
389 | Loop, 400
390 | {
391 | PixelSearch, BeltArriveX, BeltArriveY, ox+639, oy+128, ox+639, oy+128, 0xE78d7b
392 | if ErrorLevel = 0
393 | Goto, Continue6
394 | else
395 | Sleep, 50
396 | }
397 | ExitApp
398 | Continue6:
399 |
400 | ;deposit ore onto belt
401 | Sleep, 100
402 | MouseMove, ox+288, oy+174, 0 ;deposit ore onto belt location
403 | Sleep, 500
404 | Click
405 | Sleep, 1
406 | Click
407 | Sleep, 1
408 | Click
409 | Sleep, 500
410 |
411 | ;move to and open bar dispenser
412 | MouseMove, ox+213, oy+295, 0 ;dispenser location from belt
413 | Sleep, 500
414 | Click
415 | Sleep, 1
416 | Click
417 | Sleep, 1
418 | Click
419 | Sleep, 2500
420 |
421 | ;wait for character to stop moving
422 | Loop, 800
423 | {
424 | PixelSearch, DispenserArriveX, DispenserArriveY, ox+673, oy+106, ox+673, oy+106, 0x42a0b3
425 | if ErrorLevel = 0
426 | Goto, Continue7
427 | Else
428 | Sleep, 50
429 | }
430 | ExitApp
431 | Continue7:
432 |
433 | ;check if finished bars are available, if not, close window and keep reopening until bars are available
434 | CheckBars:
435 | PixelSearch, DispenserBarsPresentX, DispenserBarsPresentY, ox+229, oy+143, ox+229, oy+143, 0x1F98FF
436 |
437 | ;if bars are available, immediately skip to withdrawing them
438 | if ErrorLevel = 0
439 | Goto, WithdrawalBars
440 |
441 | ;if bars not available, click on dispenser until window is open and recheck, if bars still not available, close and reopen window again, if you try 25 times and bars still aren’t there then coffer must be empty
442 | else
443 | {
444 | Loop, 25
445 | {
446 |
447 | ;wait 1 tick, then close window
448 | Sleep, 600
449 | MouseMove, ox+487, oy+42, 0 ;dispenser window close
450 | Sleep, 500
451 | Click
452 | Sleep, 500
453 |
454 | ;keep clicking on dispenser until dispenser window reopens, then recheck bars
455 | Loop, 1000
456 | {
457 | PixelSearch, DispenserWindowX, DispenserWindowY, ox+332, oy+35, ox+332, oy+35, 0x1F98FF
458 | if ErrorLevel = 0
459 | Goto, CheckBars
460 | else
461 | MouseMove, ox+263, oy+183, 0 ;at dispenser, open dispenser
462 | Sleep, 50
463 | Click
464 | Sleep, 50
465 | }
466 | ExitApp
467 | }
468 | ExitApp
469 | }
470 |
471 | ;withdrawal bars, keep clicking until in inventory
472 | WithdrawalBars:
473 | Loop, 25
474 | {
475 | PixelSearch, BarsGetX, BarsGetY, ox+710, oy+225, ox+710, oy+225, 0x868690
476 | if ErrorLevel = 0
477 | Goto, Continue8
478 | else
479 | {
480 | MouseMove, ox+229, oy+143, 0 ;location to withdrawal steel bars at dispenser
481 | Click
482 | Sleep, 100
483 | }}
484 | ExitApp
485 | Continue8:
486 |
487 | ;click on minimap to return to bank
488 | MouseMove, ox+674, oy+108, 0 ;bank location on minimap from dispenser
489 | Sleep, 100
490 | Click
491 | Sleep, 1
492 | Click
493 | Sleep, 2000
494 |
495 | ;Keep checking water icon on minimap until you've returned to bank chest
496 | Loop, 500
497 | {
498 | PixelSearch, BankArriveX, BankArriveY, ox+618, oy+83, ox+618, oy+83, 0xe78d7b
499 | if ErrorLevel = 0
500 | Goto, Continue9
501 | else
502 | Sleep, 50
503 | }
504 | ExitApp
505 | Continue9
506 | }
507 |
508 |
509 | WithdrawalCoffer:
510 | MouseMove, ox+205, oy+170, 0 ;coffer location from bank
511 | Sleep, 100
512 | Click
513 | Sleep, 3
514 | Click
515 | Sleep, 3000
516 | SendInput, {1}
517 | Sleep, 1000
518 | SendInput, {Raw}999999999
519 | Sleep, 1000
520 | SendInput, {Enter}
521 | Sleep, 1000
522 | SendInput, {Space}
523 | Sleep, 1000
524 | MouseMove, ox+285, oy+192, 0 ;bank location from coffer
525 | Sleep, 100
526 | Click
527 | Sleep, 3000
528 | MouseMove, ox+487, oy+23, 0 ;bank window close
529 | Sleep, 100
530 | Click
531 | ExitApp
532 |
533 |
534 | ^q::ExitApp
535 |
536 |
537 |
538 |
539 |
540 |
541 |
--------------------------------------------------------------------------------
/ahk/OSRSBlastFurnace/BlastFurnace.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSBlastFurnace/BlastFurnace.exe
--------------------------------------------------------------------------------
/ahk/OSRSBlastFurnace/BlastFurnaceText.txt:
--------------------------------------------------------------------------------
1 | ;designed for 1600x900 screen inside windowed VM with official runescape client "snapped" to left half
2 | ;of screen
3 |
4 | CoordMode, Screen
5 | #Persistent
6 |
7 |
8 | ;wait
9 | Sleep, 300
10 |
11 | ;orient client by searching whole screen for quest hud icon
12 | ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, *2 C:\Capturetest.png
13 | if ErrorLevel
14 | MsgBox, cant find
15 |
16 | else
17 | {
18 | Sleep, 500
19 | Click
20 | }
21 | ExitApp
22 |
23 |
24 |
25 |
26 | Click, 584, 49
27 | Sleep, 5
28 | Send {Up down}
29 | Sleep, 750
30 | Send {Up up}
31 |
32 | Loop
33 | {
34 | ;check run energy. if above about 90, turn on run
35 | PixelSearch, RunX, RunY, 605, 158, 605, 158, 0x7B8786
36 | if ErrorLevel = 0
37 | Click, 608, 168
38 |
39 | ;check run energy, if below a certain amount, withdrawal money from coffer and
40 | ;wait till energy has restored itself, then deposit money back into coffer
41 | PixelSearch, RunOutX, RunOutY, 678, 173, 678, 173, 0x131313
42 | if ErrorLevel = 0
43 | {
44 | Click, 511, 54
45 | Sleep, 200
46 | Click, 211, 209
47 | Sleep, 1500
48 | SendInput, {1}
49 | Sleep, 1000
50 | SendInput {Raw}999999999
51 | Sleep, 1000
52 | SendInput, {Enter}
53 | Sleep, 1000
54 | SendInput, {Space}
55 | Sleep, 1000
56 | Click, 396, 236
57 | Sleep, 2000
58 |
59 | Loop
60 | {
61 | Sleep, 10000
62 | Click, 316, 235
63 | PixelSearch, RunX, RunY, 605, 158, 605, 158, 0x7B8786
64 | if ErrorLevel = 0
65 | {
66 | Sleep, 1000
67 | Click, 511, 54
68 | Sleep, 200
69 | Click, 211, 209
70 | Sleep, 1500
71 | SendInput, {1}
72 | Sleep, 1000
73 | SendInput {Raw}999999999
74 | Sleep, 1000
75 | SendInput, {Enter}
76 | Sleep, 1000
77 | SendInput, {Space}
78 | Sleep, 1000
79 | Click, 316, 235
80 | Sleep, 1000
81 | Click, 511, 54
82 | Goto, Starthere
83 | }
84 | }
85 | }
86 |
87 |
88 | Starthere:
89 | ;drink stamina potion if potion effect isn't active
90 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
91 | if ErrorLevel
92 | {
93 | Click, 683, 479
94 | Sleep, 2
95 | Click, 683, 479
96 |
97 | ;check if potion effect has been reactivated, if not, get another potion
98 | Sleep, 1000
99 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
100 | if ErrorLevel
101 | {
102 |
103 | ;open bank chest in front of you
104 | Sleep, 200
105 | Click, 293, 241
106 |
107 | ;wait for bank screen to appear
108 | Loop
109 | {
110 | PixelSearch, BankX, BankY, 263, 352, 263, 352, 0x1D1F83
111 | if ErrorLevel
112 | {
113 | Sleep, 1000
114 | Click, 290, 241
115 | Continue
116 | }
117 | else
118 | Break
119 | Sleep, 10
120 | }
121 |
122 | ;deposit inventory
123 | Click, 462, 340
124 | Sleep, 20
125 | Click, 462, 340
126 |
127 | ;look for ore and stamina potions
128 | PixelSearch, MainOreX, MainOreY, 103, 128, 103, 128, 0x374E61
129 | if ErrorLevel
130 | Goto, WithdrawalCoffer
131 |
132 | PixelSearch, CoalX, CoalY, 160, 128, 160, 128, 0x202E2E
133 | if ErrorLevel
134 | Goto, WithdrawalCoffer
135 |
136 | PixelSearch, SPotX, SPotY, 208, 134, 208, 134, 0x406C8C
137 | if ErrorLevel
138 | Goto, WithdrawalCoffer
139 |
140 | ;withdrawal ore and stamina potion
141 | Sleep, 50
142 | Click, right, 112, 130
143 | Sleep, 50
144 | Click, 97, 197
145 | Sleep, 50
146 | Click, right, 161, 130
147 | Sleep, 50
148 | Click, 160, 197
149 | Sleep, 50
150 | Click, 207, 132
151 | Sleep, 50
152 |
153 | ;wait for ore to withdrawal
154 | Sleep, 600
155 | Loop
156 | {
157 | PixelSearch, OreX, OreY, 635, 261, 635, 261, 0x425D74
158 | if ErrorLevel
159 | {
160 | Sleep, 100
161 | Click, right, 112, 130
162 | Sleep, 100
163 | Click, 101, 227
164 | Sleep, 100
165 | Continue
166 | }
167 | else
168 | {
169 | Click, 511, 54
170 | Sleep, 1000
171 | Click, 683, 479
172 | Sleep, 2
173 | Click, 683, 479
174 | Sleep, 1000
175 | Goto, GoingtoBelt
176 | }
177 |
178 | }
179 | }
180 | }
181 |
182 | ;open bank chest in front of you
183 | Sleep, 200
184 | Click, 293, 241
185 |
186 | ;wait for bank screen to appear
187 | Loop
188 | {
189 | PixelSearch, BankX, BankY, 263, 352, 263, 352, 0x1D1F83
190 | if ErrorLevel
191 | {
192 | Sleep, 1000
193 | Click, 290, 241
194 | Continue
195 | }
196 | else
197 | Break
198 | Sleep, 10
199 | }
200 |
201 | ;deposit inventory
202 | Click, right, 605, 259
203 | Sleep, 100
204 | Click, 603, 354
205 | Sleep, 50
206 |
207 | ;look for ore and stamina potions
208 | PixelSearch, MainOreX, MainOreY, 103, 128, 103, 128, 0x374E61
209 | if ErrorLevel
210 | Goto, WithdrawalCoffer
211 |
212 | PixelSearch, CoalX, CoalY, 160, 128, 160, 128, 0x202E2E
213 | if ErrorLevel
214 | Goto, WithdrawalCoffer
215 |
216 | PixelSearch, SPotX, SPotY, 208, 134, 208, 134, 0x406C8C
217 | if ErrorLevel
218 | Goto, WithdrawalCoffer
219 |
220 | ;withdrawal ore
221 | Sleep, 20
222 | Click, right, 112, 130
223 | Sleep, 20
224 | Click, 97, 197
225 | Sleep, 20
226 | Click, right, 161, 130
227 | Sleep, 20
228 | Click, 160, 197
229 | Sleep, 20
230 |
231 | ;wait for ore to withdrawal
232 | Sleep, 600
233 | Loop
234 | {
235 | PixelSearch, OreX, OreY, 635, 261, 635, 261, 0x425D74
236 | if ErrorLevel
237 | {
238 | Sleep, 100
239 | Click, right, 112, 130
240 | Sleep, 100
241 | Click, 101, 227
242 | Sleep, 100
243 | Continue
244 | }
245 | else
246 | Break
247 | }
248 |
249 | ;click minimap to move to belt
250 | GoingtoBelt:
251 | Click, 643, 75
252 | Sleep, 3000
253 |
254 | ;Keep checking water icon on minimap until you've arrived at belt
255 | Loop
256 | {
257 | PixelSearch, BeltWaterX, BeltWaterY, 665, 161, 665, 161, 0xEDC7C5
258 | if ErrorLevel
259 | Continue
260 | else
261 | Break
262 | Sleep, 10
263 | }
264 |
265 | ;deposit ore onto belt
266 | Sleep, 85
267 | Click, 324, 202
268 | Sleep, 10
269 | Click, 324, 202
270 | Sleep, 10
271 | Click, 324, 202
272 | Sleep, 500
273 |
274 | ;move to dispenser bar
275 | Click, 211, 354
276 | Sleep, 5
277 | Click, 211, 354
278 | Sleep, 3300
279 |
280 | ;check if finished bars are available, if not, close window and reopen
281 | ;until bars are available
282 | CheckBars:
283 | PixelSearch, DispenserBarsX, DispenserBarsY, 258, 176, 258, 176, 0x1F98FF
284 | if ErrorLevel = 0
285 | Goto, WithdrawalIron
286 | else
287 | {
288 | Loop
289 | {
290 | ;close window
291 | Sleep, 300
292 | Click, 511, 70
293 | ;wait for window to close
294 | Loop
295 | {
296 | PixelSearch, DispenserCloseX, DispenserCloseY, 74, 59, 74, 59, 0x3E4A53
297 | if ErrorLevel
298 | Continue
299 | else
300 | Break
301 | Sleep, 5
302 | }
303 |
304 | ;click on dispenser until window is open and recheck
305 | ;if not, close and reopen window again
306 | Loop, 25
307 | {
308 | PixelSearch, DispenserX, DispenserY, 208, 69, 208, 69, 0x1F98FF
309 | if ErrorLevel
310 | {
311 | Sleep, 50
312 | Click, 288, 229
313 | Continue
314 | }
315 | else
316 | Goto, CheckBars
317 | Sleep, 5
318 | }
319 | }
320 | }
321 |
322 | ;withdrawal bars, keep clicking until in inventory
323 | WithdrawalIron:
324 |
325 | Click, 258, 176
326 | Sleep, 2
327 | Click, 258, 176
328 | Sleep, 200
329 | Loop, 25
330 | {
331 | PixelSearch, IronBars, IronBarsY, 646, 260, 646, 260, 0x868690
332 | if ErrorLevel
333 | {
334 | Click, 258, 176
335 | Sleep, 100
336 | Continue
337 | }
338 | else
339 | Break
340 | }
341 |
342 | ;click on minimap to return to bank
343 | Click, 699, 145
344 | Sleep, 2000
345 |
346 | ;Keep checking water icon on minimap until you've returned to bank chest
347 | Loop
348 | {
349 | PixelSearch, BankWaterX, BankWaterY, 642, 120, 642, 120, 0xF56539
350 | if ErrorLevel
351 | Continue
352 | else
353 | Break
354 | Sleep, 5
355 | }
356 | }
357 |
358 | WithdrawalCoffer:
359 | Click, 511, 54
360 | Sleep, 200
361 | Click, 211, 209
362 | Sleep, 1500
363 | SendInput, {1}
364 | Sleep, 1000
365 | SendInput {Raw}999999999
366 | Sleep, 1000
367 | SendInput, {Enter}
368 | Sleep, 1000
369 | SendInput, {Space}
370 | ExitApp
371 |
372 | ^q::ExitApp
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
--------------------------------------------------------------------------------
/ahk/OSRSBlastFurnace/BlastFurnaceTextDoc.txt:
--------------------------------------------------------------------------------
1 | ;designed for 1600x900 screen inside windowed VM with official runescape client "snapped" to left half
2 | ;of screen
3 |
4 | CoordMode, Screen
5 | #Persistent
6 |
7 |
8 | ;wait
9 | Sleep, 300
10 |
11 | ;orient client by searching whole screen for quest hud icon
12 | ImageSearch, FoundX, FoundY, 0, 0, 1920, 1080, *2 C:\Capturetest.png
13 | if ErrorLevel
14 | MsgBox, cant find
15 |
16 | else
17 | {
18 | Sleep, 500
19 | Click
20 | }
21 | ExitApp
22 |
23 |
24 |
25 |
26 | Click, 584, 49
27 | Sleep, 5
28 | Send {Up down}
29 | Sleep, 750
30 | Send {Up up}
31 |
32 | Loop
33 | {
34 | ;check run energy. if above about 90, turn on run
35 | PixelSearch, RunX, RunY, 605, 158, 605, 158, 0x7B8786
36 | if ErrorLevel = 0
37 | Click, 608, 168
38 |
39 | ;check run energy, if below a certain amount, withdrawal money from coffer and
40 | ;wait till energy has restored itself, then deposit money back into coffer
41 | PixelSearch, RunOutX, RunOutY, 678, 173, 678, 173, 0x131313
42 | if ErrorLevel = 0
43 | {
44 | Click, 511, 54
45 | Sleep, 200
46 | Click, 211, 209
47 | Sleep, 1500
48 | SendInput, {1}
49 | Sleep, 1000
50 | SendInput {Raw}999999999
51 | Sleep, 1000
52 | SendInput, {Enter}
53 | Sleep, 1000
54 | SendInput, {Space}
55 | Sleep, 1000
56 | Click, 396, 236
57 | Sleep, 2000
58 |
59 | Loop
60 | {
61 | Sleep, 10000
62 | Click, 316, 235
63 | PixelSearch, RunX, RunY, 605, 158, 605, 158, 0x7B8786
64 | if ErrorLevel = 0
65 | {
66 | Sleep, 1000
67 | Click, 511, 54
68 | Sleep, 200
69 | Click, 211, 209
70 | Sleep, 1500
71 | SendInput, {1}
72 | Sleep, 1000
73 | SendInput {Raw}999999999
74 | Sleep, 1000
75 | SendInput, {Enter}
76 | Sleep, 1000
77 | SendInput, {Space}
78 | Sleep, 1000
79 | Click, 316, 235
80 | Sleep, 1000
81 | Click, 511, 54
82 | Goto, Starthere
83 | }
84 | }
85 | }
86 |
87 |
88 | Starthere:
89 | ;drink stamina potion if potion effect isn't active
90 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
91 | if ErrorLevel
92 | {
93 | Click, 683, 479
94 | Sleep, 2
95 | Click, 683, 479
96 |
97 | ;check if potion effect has been reactivated, if not, get another potion
98 | Sleep, 1000
99 | PixelSearch, RunSX, RunSY, 605, 171, 605, 171, 0x3d73e4
100 | if ErrorLevel
101 | {
102 |
103 | ;open bank chest in front of you
104 | Sleep, 200
105 | Click, 293, 241
106 |
107 | ;wait for bank screen to appear
108 | Loop
109 | {
110 | PixelSearch, BankX, BankY, 263, 352, 263, 352, 0x1D1F83
111 | if ErrorLevel
112 | {
113 | Sleep, 1000
114 | Click, 290, 241
115 | Continue
116 | }
117 | else
118 | Break
119 | Sleep, 10
120 | }
121 |
122 | ;deposit inventory
123 | Click, 462, 340
124 | Sleep, 20
125 | Click, 462, 340
126 |
127 | ;look for ore and stamina potions
128 | PixelSearch, MainOreX, MainOreY, 103, 128, 103, 128, 0x374E61
129 | if ErrorLevel
130 | Goto, WithdrawalCoffer
131 |
132 | PixelSearch, CoalX, CoalY, 160, 128, 160, 128, 0x202E2E
133 | if ErrorLevel
134 | Goto, WithdrawalCoffer
135 |
136 | PixelSearch, SPotX, SPotY, 208, 134, 208, 134, 0x406C8C
137 | if ErrorLevel
138 | Goto, WithdrawalCoffer
139 |
140 | ;withdrawal ore and stamina potion
141 | Sleep, 50
142 | Click, right, 112, 130
143 | Sleep, 50
144 | Click, 97, 197
145 | Sleep, 50
146 | Click, right, 161, 130
147 | Sleep, 50
148 | Click, 160, 197
149 | Sleep, 50
150 | Click, 207, 132
151 | Sleep, 50
152 |
153 | ;wait for ore to withdrawal
154 | Sleep, 600
155 | Loop
156 | {
157 | PixelSearch, OreX, OreY, 635, 261, 635, 261, 0x425D74
158 | if ErrorLevel
159 | {
160 | Sleep, 100
161 | Click, right, 112, 130
162 | Sleep, 100
163 | Click, 101, 227
164 | Sleep, 100
165 | Continue
166 | }
167 | else
168 | {
169 | Click, 511, 54
170 | Sleep, 1000
171 | Click, 683, 479
172 | Sleep, 2
173 | Click, 683, 479
174 | Sleep, 1000
175 | Goto, GoingtoBelt
176 | }
177 |
178 | }
179 | }
180 | }
181 |
182 | ;open bank chest in front of you
183 | Sleep, 200
184 | Click, 293, 241
185 |
186 | ;wait for bank screen to appear
187 | Loop
188 | {
189 | PixelSearch, BankX, BankY, 263, 352, 263, 352, 0x1D1F83
190 | if ErrorLevel
191 | {
192 | Sleep, 1000
193 | Click, 290, 241
194 | Continue
195 | }
196 | else
197 | Break
198 | Sleep, 10
199 | }
200 |
201 | ;deposit inventory
202 | Click, right, 605, 259
203 | Sleep, 100
204 | Click, 603, 354
205 | Sleep, 50
206 |
207 | ;look for ore and stamina potions
208 | PixelSearch, MainOreX, MainOreY, 103, 128, 103, 128, 0x374E61
209 | if ErrorLevel
210 | Goto, WithdrawalCoffer
211 |
212 | PixelSearch, CoalX, CoalY, 160, 128, 160, 128, 0x202E2E
213 | if ErrorLevel
214 | Goto, WithdrawalCoffer
215 |
216 | PixelSearch, SPotX, SPotY, 208, 134, 208, 134, 0x406C8C
217 | if ErrorLevel
218 | Goto, WithdrawalCoffer
219 |
220 | ;withdrawal ore
221 | Sleep, 20
222 | Click, right, 112, 130
223 | Sleep, 20
224 | Click, 97, 197
225 | Sleep, 20
226 | Click, right, 161, 130
227 | Sleep, 20
228 | Click, 160, 197
229 | Sleep, 20
230 |
231 | ;wait for ore to withdrawal
232 | Sleep, 600
233 | Loop
234 | {
235 | PixelSearch, OreX, OreY, 635, 261, 635, 261, 0x425D74
236 | if ErrorLevel
237 | {
238 | Sleep, 100
239 | Click, right, 112, 130
240 | Sleep, 100
241 | Click, 101, 227
242 | Sleep, 100
243 | Continue
244 | }
245 | else
246 | Break
247 | }
248 |
249 | ;click minimap to move to belt
250 | GoingtoBelt:
251 | Click, 643, 75
252 | Sleep, 3000
253 |
254 | ;Keep checking water icon on minimap until you've arrived at belt
255 | Loop
256 | {
257 | PixelSearch, BeltWaterX, BeltWaterY, 665, 161, 665, 161, 0xEDC7C5
258 | if ErrorLevel
259 | Continue
260 | else
261 | Break
262 | Sleep, 10
263 | }
264 |
265 | ;deposit ore onto belt
266 | Sleep, 85
267 | Click, 324, 202
268 | Sleep, 10
269 | Click, 324, 202
270 | Sleep, 10
271 | Click, 324, 202
272 | Sleep, 500
273 |
274 | ;move to dispenser bar
275 | Click, 211, 354
276 | Sleep, 5
277 | Click, 211, 354
278 | Sleep, 3300
279 |
280 | ;check if finished bars are available, if not, close window and reopen
281 | ;until bars are available
282 | CheckBars:
283 | PixelSearch, DispenserBarsX, DispenserBarsY, 258, 176, 258, 176, 0x1F98FF
284 | if ErrorLevel = 0
285 | Goto, WithdrawalIron
286 | else
287 | {
288 | Loop
289 | {
290 | ;close window
291 | Sleep, 300
292 | Click, 511, 70
293 | ;wait for window to close
294 | Loop
295 | {
296 | PixelSearch, DispenserCloseX, DispenserCloseY, 74, 59, 74, 59, 0x3E4A53
297 | if ErrorLevel
298 | Continue
299 | else
300 | Break
301 | Sleep, 5
302 | }
303 |
304 | ;click on dispenser until window is open and recheck
305 | ;if not, close and reopen window again
306 | Loop, 25
307 | {
308 | PixelSearch, DispenserX, DispenserY, 208, 69, 208, 69, 0x1F98FF
309 | if ErrorLevel
310 | {
311 | Sleep, 50
312 | Click, 288, 229
313 | Continue
314 | }
315 | else
316 | Goto, CheckBars
317 | Sleep, 5
318 | }
319 | }
320 | }
321 |
322 | ;withdrawal bars, keep clicking until in inventory
323 | WithdrawalIron:
324 |
325 | Click, 258, 176
326 | Sleep, 2
327 | Click, 258, 176
328 | Sleep, 200
329 | Loop, 25
330 | {
331 | PixelSearch, IronBars, IronBarsY, 646, 260, 646, 260, 0x868690
332 | if ErrorLevel
333 | {
334 | Click, 258, 176
335 | Sleep, 100
336 | Continue
337 | }
338 | else
339 | Break
340 | }
341 |
342 | ;click on minimap to return to bank
343 | Click, 699, 145
344 | Sleep, 2000
345 |
346 | ;Keep checking water icon on minimap until you've returned to bank chest
347 | Loop
348 | {
349 | PixelSearch, BankWaterX, BankWaterY, 642, 120, 642, 120, 0xF56539
350 | if ErrorLevel
351 | Continue
352 | else
353 | Break
354 | Sleep, 5
355 | }
356 | }
357 |
358 | WithdrawalCoffer:
359 | Click, 511, 54
360 | Sleep, 200
361 | Click, 211, 209
362 | Sleep, 1500
363 | SendInput, {1}
364 | Sleep, 1000
365 | SendInput {Raw}999999999
366 | Sleep, 1000
367 | SendInput, {Enter}
368 | Sleep, 1000
369 | SendInput, {Space}
370 | ExitApp
371 |
372 | ^q::ExitApp
373 |
374 |
375 |
376 |
377 |
378 |
379 |
--------------------------------------------------------------------------------
/ahk/OSRSBlastFurnace/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSBlastFurnace/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSCannonballSmelting/BankOrient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSCannonballSmelting/BankOrient.png
--------------------------------------------------------------------------------
/ahk/OSRSCannonballSmelting/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSCannonballSmelting/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSDraynorFishing/AutoHotkey XML Format for Notepad++.lnk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSDraynorFishing/AutoHotkey XML Format for Notepad++.lnk
--------------------------------------------------------------------------------
/ahk/OSRSDraynorFishing/AutoHotkey XML Format for Notepad++.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 03/* 04*/ 00; 01 02
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | - ! & ( ) , . ^ | ~ + < = > { } :
18 | or and
19 | ; ***
20 |
21 | ;*
22 |
23 |
24 |
25 |
26 |
27 |
28 | AutoTrim
29 | BlockInput
30 | Break
31 | Click
32 | ClipWait
33 | Continue
34 | Control
35 | ControlClick
36 | ControlFocus
37 | ControlGet
38 | ControlGetFocus
39 | ControlGetPos
40 | ControlGetText
41 | ControlMove
42 | ControlSend
43 | ControlSendRaw
44 | ControlSetText
45 | CoordMode
46 | Critical
47 | DetectHiddenText
48 | DetectHiddenWindows
49 | DllCall
50 | Drive
51 | DriveGet
52 | DriveSpaceFree
53 | Else
54 | EndRepeat
55 | EnvAdd
56 | EnvDiv
57 | EnvGet
58 | EnvMult
59 | EnvSet
60 | EnvSub
61 | EnvUpdate
62 | Exit
63 | ExitApp
64 | FileAppend
65 | FileCopy
66 | FileCopyDir
67 | FileCreateDir
68 | FileCreateShortcut
69 | FileDelete
70 | FileGetAttrib
71 | FileGetShortcut
72 | FileGetSize
73 | FileGetTime
74 | FileGetVersion
75 | FileInstall
76 | FileMove
77 | FileMoveDir
78 | FileRead
79 | FileReadLine
80 | FileRecycle
81 | FileRecycleEmpty
82 | FileRemoveDir
83 | FileSelectFile
84 | FileSelectFolder
85 | FileSetAttrib
86 | FileSetTime
87 | FormatTime
88 | GetKeyState
89 | Gosub
90 | Goto
91 | GroupActivate
92 | GroupAdd
93 | GroupClose
94 | GroupDeactivate
95 | Gui
96 | GuiControl
97 | GuiControlGet
98 | HideAutoItWin
99 | Hotkey
100 | If
101 | IfEqual
102 | IfExist
103 | IfGreater
104 | IfGreaterOrEqual
105 | IfInString
106 | IfLess
107 | IfLessOrEqual
108 | IfMsgBox
109 | IfNotEqual
110 | IfNotExist
111 | IfNotInString
112 | IfWinActive
113 | IfWinExist
114 | IfWinNotActive
115 | IfWinNotExist
116 | ImageSearch
117 | IniDelete
118 | IniRead
119 | IniWrite
120 | Input
121 | InputBox
122 | IsLabel
123 | KeyHistory
124 | KeyWait
125 | ListHotkeys
126 | ListLines
127 | ListVars
128 | Loop
129 | Menu
130 | MouseClick
131 | MouseClickDrag
132 | MouseGetPos
133 | MouseMove
134 | MsgBox
135 | NumGet
136 | NumPut
137 | OnExit
138 | OnMessage
139 | OutputDebug
140 | Pause
141 | PixelGetColor
142 | PixelSearch
143 | PostMessage
144 | Process
145 | Progress
146 | Random
147 | RegDelete
148 | RegExMatch
149 | RegExReplace
150 | RegisterCallback
151 | RegRead
152 | RegWrite
153 | Reload
154 | Repeat
155 | Return
156 | Run
157 | RunAs
158 | RunWait
159 | Send
160 | SendMessage
161 | SendEvent
162 | SendInput
163 | SendMode
164 | SendPlay
165 | SendRaw
166 | SetBatchLines
167 | SetCapsLockState
168 | SetControlDelay
169 | SetDefaultMouseSpeed
170 | SetEnv
171 | SetFormat
172 | SetKeyDelay
173 | SetMouseDelay
174 | SetNumLockState
175 | SetScrollLockState
176 | SetStoreCapslockMode
177 | SetTimer
178 | SetTitleMatchMode
179 | SetWinDelay
180 | SetWorkingDir
181 | Shutdown
182 | Sleep
183 | Sort
184 | SoundBeep
185 | SoundGet
186 | SoundGetWaveVolume
187 | SoundPlay
188 | SoundSet
189 | SoundSetWaveVolume
190 | SplashImage
191 | SplashTextOff
192 | SplashTextOn
193 | SplitPath
194 | StatusBarGetText
195 | StatusBarWait
196 | StringCaseSense
197 | StringGetPos
198 | StringLeft
199 | StringLen
200 | StringLower
201 | StringMid
202 | StringReplace
203 | StringRight
204 | StringSplit
205 | StringTrimLeft
206 | StringTrimRight
207 | StringUpper
208 | Suspend
209 | SysGet
210 | Thread
211 | ToolTip
212 | Transform
213 | TrayTip
214 | URLDownloadToFile
215 | VarSetCapcity
216 | While
217 | WinActivate
218 | WinActivateBottom
219 | WinClose
220 | WinGet
221 | WinGetActiveStats
222 | WinGetActiveTitle
223 | WinGetClass
224 | WinGetPos
225 | WinGetText
226 | WinGetTitle
227 | WinHide
228 | WinKill
229 | WinMaximize
230 | WinMenuSelectItem
231 | WinMinimize
232 | WinMinimizeAll
233 | WinMinimizeAllUndo
234 | WinMove
235 | WinRestore
236 | WinSet
237 | WinSetTitle
238 | WinShow
239 | WinWait
240 | WinWaitActive
241 | WinWaitClose
242 | WinWaitNotActive
243 | local
244 | global
245 |
246 |
247 | add
248 | font
249 | show
250 | new
251 |
252 |
253 | %A_
254 | A_AhkPath
255 | A_AhkVersion
256 | A_AppData
257 | A_AppDataCommon
258 | A_AutoTrim
259 | A_BatchLines
260 | A_CaretX
261 | A_CaretY
262 | A_ComputerName
263 | A_ControlDelay
264 | A_Cursor
265 | A_DD
266 | A_DDD
267 | A_DDDD
268 | A_DefaultMouseSpeed
269 | A_Desktop
270 | A_DesktopCommon
271 | A_DetectHiddenText
272 | A_DetectHiddenWindows
273 | A_EndChar
274 | A_ExitReason
275 | A_FormatFloat
276 | A_FormatInteger
277 | A_Gui
278 | A_GuiControl
279 | A_EventInfo
280 | A_GuiX
281 | A_GuiY
282 | A_GuiEvent
283 | A_GuiControlEvent
284 | A_GuiHeight
285 | A_GuiWidth
286 | A_Hour
287 | A_IconFile
288 | A_IconHidden
289 | A_IconNumber
290 | A_IconTip
291 | A_Index
292 | A_IPAddress1
293 | A_IPAddress2
294 | A_IPAddress3
295 | A_IPAddress4
296 | A_ISAdmin
297 | A_IsCompiled
298 | A_IsPaused
299 | A_IsCritical
300 | A_IsSuspended
301 | A_KeyDelay
302 | A_Language
303 | A_LastError
304 | A_LineNumber
305 | A_LineFile
306 | A_LoopField
307 | A_LoopFileAttrib
308 | A_LoopFileDir
309 | A_LoopFileExt
310 | A_LoopFileFullPath
311 | A_LoopFileLongPath
312 | A_LoopFileName
313 | A_LoopFileShortName
314 | A_LoopFileShortPath
315 | A_LoopFileSize
316 | A_LoopFileSizeKB
317 | A_LoopFileSizeMB
318 | A_LoopFileTimeAccessed
319 | A_LoopFileTimeCreated
320 | A_LoopFileTimeModified
321 | A_LoopReadLine
322 | A_LoopRegKey
323 | A_LoopRegName
324 | A_LoopRegSubkey
325 | A_LoopRegTimeModified
326 | A_LoopRegType
327 | A_MDAY
328 | A_Min
329 | A_MM
330 | A_MMM
331 | A_MMMM
332 | A_MON
333 | A_MouseDelay
334 | A_MyDocuments
335 | A_Now
336 | A_NowUTC
337 | A_NumBatchLines
338 | A_OSType
339 | A_OSVersion
340 | A_PriorHotkey
341 | ProgramFiles
342 | A_ProgramFiles
343 | A_Programs
344 | A_ProgramsCommon
345 | A_ScreenHeight
346 | A_ScreenWidth
347 | A_ScriptDir
348 | A_ScriptFullPath
349 | A_ScriptName
350 | A_Sec
351 | A_Space
352 | A_StartMenu
353 | A_StartMenuCommon
354 | A_Startup
355 | A_StartupCommon
356 | A_StringCaseSense
357 | A_Tab
358 | A_Temp
359 | A_ThisHotkey
360 | A_ThisFunc
361 | A_ThisLabel
362 | A_ThisMenu
363 | A_ThisMenuItem
364 | A_ThisMenuItemPos
365 | A_TickCount
366 | A_TimeIdle
367 | A_TimeIdlePhysical
368 | A_TimeSincePriorHotkey
369 | A_TimeSinceThisHotkey
370 | A_TitleMatchMode
371 | A_TitleMatchModeSpeed
372 | A_UserName
373 | A_WDay
374 | A_WinDelay
375 | A_WinDir
376 | A_WorkingDir
377 | A_YDay
378 | A_YEAR
379 | A_YWeek
380 | A_YYYY
381 | Clipboard
382 | ComSpec
383 | ErrorLevel
384 | True
385 | False
386 | Off
387 | On
388 |
389 | activeX
390 | button
391 | checkbox
392 | combobox
393 | custom
394 | datetim
395 | dropdownbox
396 | edit
397 | groupbox
398 | hotkey
399 | link
400 | listbox
401 | listview
402 | monthcal
403 | picture
404 | progress
405 | radio
406 | slider
407 | statusbar
408 | tab2
409 | text
410 | treview
411 | updown
412 | lv_modifycol
413 | lv_add
414 | lv_insert
415 | lv_modify
416 | lv_delete
417 | lv_insertcol
418 | lv_deletecol
419 | lv_getcount
420 | lv_getnext
421 | lv_gettext
422 | il_create
423 | lv_setimagelist
424 | il_add
425 | il_destroy
426 | #AllowSameLineComments
427 | #ClipboardTimeout
428 | #CommentFlag
429 | #ErrorStdOut
430 | #EscapeChar
431 | #HotkeyInterval
432 | #HotkeyModIfierTimeout
433 | #Hotstring
434 | #Include
435 | #IncludeAgain
436 | #IfWinActive
437 | #IfWinExist
438 | #IfWinNotActive
439 | #IfWinNotExist
440 | #InstallKeybdHook
441 | #InstallMouseHook
442 | #KeyHistory
443 | #MaxHotkeysPerInterval
444 | #MaxMem
445 | #MaxThreads
446 | #MaxThreadsBuffer
447 | #MaxThreadsPerHotkey
448 | #NoEnv
449 | #NoTrayIcon
450 | #Persistent
451 | #SingleInstance
452 | #UseHook
453 | #WinActivateForce
454 | hwnd
455 |
456 | 00% 01 02((% EOL)) 03" 04 05" 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
--------------------------------------------------------------------------------
/ahk/OSRSDraynorFishing/DraynorFishing.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | ; #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | Draynor Fishing Macro
6 |
7 | CoordMode, Pixel, Screen
8 | CoordMode, Mouse, Screen
9 | #Persistent
10 |
11 | Gosub, GetRandoms ;generate random numbers for input delays and mouse clicks to mimic human behavior
12 |
13 | ;orient client by searching whole screen for prayer hud icon
14 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png
15 | if ErrorLevel = 0
16 | {
17 | Sleep, wait1to15milis
18 | MouseMove, OrientX, OrientY ;move mouse to top left pixel of client to create new origin point for coordinate system
19 | Sleep, wait1to15milis
20 | MouseMove, -696, -171, 0, R ; 0, 0 ;coordinates from prayer icon to origin point
21 | Sleep, wait1to15milis
22 | MouseGetPos, ox, oy
23 | }
24 | else
25 | {
26 | MsgBox, cant locate client or error with Orient search
27 | ExitApp
28 | }
29 |
30 | Start: ;begin main loop
31 |
32 | Gosub, GetRandoms
33 | Gosub, LogOutCheck ;check if client has been disconnected
34 | Gosub, DisconnectCheck
35 |
36 | ContinueInvSlot2Empty:
37 |
38 |
39 | Gosub, GetRandoms
40 | Gosub, LogOutCheck ;check if client has been disconnected
41 | Gosub, DisconnectCheck
42 |
43 | Gosub, LogOutCheck ;check if client has been disconnected
44 | Gosub, DisconnectCheck
45 |
46 | ;UPDATE THIS
47 | Loop, 100 ;look for fishing spot on minimap
48 | {
49 | PixelSearch, FishGoX, FishGoY, ox+610, oy+134, ox+610, oy+134, 0xc85107
50 | if ErrorLevel = 0
51 | Goto, FishGo
52 | else
53 | Sleep, 1
54 | }
55 | FurnaceGo:
56 |
57 |
58 | Gosub, GetRandoms
59 | Gosub, LogOutCheck ;check if client has been disconnected
60 | Gosub, DisconnectCheck
61 |
62 | MouseMove, FishGoX-1+varyby2, FishGoY-6+varyby2, 0 ;click on fishing spot on minimap
63 | Sleep, wait200to500milis
64 | Click
65 | Sleep, wait1to15milis+100
66 | Click
67 | Sleep, wait5to10sec
68 | Loop, 100 ;wait until at fishing spot
69 | {
70 | PixelSearch, FishAtX, FishAtY, ox+627, oy+82, ox+627, oy+82, 0x010000
71 | if ErrorLevel = 0
72 | Goto, FurnaceAt
73 | else
74 | Sleep, wait100to500milis-50
75 | }
76 |
77 | FishAt:
78 |
79 | Gosub, GetRandoms
80 | Gosub, LogOutCheck ;check if client has been disconnected
81 | Gosub, DisconnectCheck
82 |
83 | ;look for viable fishing spots by mousing over each possible spot until top left corner of screen indicates available fishing spot
84 |
85 |
86 | Loop, 10 ;look at spot one
87 | {
88 | MouseMove, ox+233+varyby4, ox+181+varyby4, 0
89 | Sleep, wait800to1200milis
90 | PixelSearch, ViableX, ViableY, ox+80, oy+13, ox+80, oy+13, 0x03d5d5
91 | if ErrorLevel = 0
92 | {
93 | Click, varyby1+3
94 | Sleep, wait100to500milis-50
95 | Goto, NowFishing
96 | }
97 | else
98 | Sleep, 300
99 | }
100 |
101 |
102 | Loop, 10 ;look at spot two
103 | {
104 | MouseMove, ox+233+varyby4, ox+181+varyby4, 0
105 | Sleep, wait800to1200milis
106 | PixelSearch, ViableX, ViableY, ox+80, oy+13, ox+80, oy+13, 0x03d5d5
107 | if ErrorLevel = 0
108 | {
109 | Click, varyby1+3
110 | Sleep, wait100to500milis-50
111 | Goto, AtSpotTwo
112 | }
113 | else
114 | Sleep, 300
115 | }
116 |
117 | NowFishing:
118 |
119 | Loop, 100 ;wait until inventory full or fishing spot empty
120 | {
121 | PixelSearch, ViableX, ViableY, ox+80, oy+13, ox+80, oy+13, 0x03d5d5 ;check fishing spot
122 | if ErrorLevel = 0
123 | {
124 | PixelSearch, InvFullX, InvFullY, ox+80, oy+13, ox+80, oy+13, 0x03d5d5 ;check inventory
125 | if ErrorLevel = 0
126 | Goto, DoneFishing
127 | else
128 | Continue
129 | }
130 | else
131 | Goto, FishAt
132 | }
133 |
134 |
135 |
136 |
137 |
138 |
139 | Gosub, ChatBot
140 |
141 | Loop, 150 ;check if client has been disconnected for 150 seconds
142 | {
143 | Gosub, LogOutCheck
144 | Gosub, DisconnectCheck
145 | Gosub, GetRandoms
146 | Sleep, 850+wait100to500milis
147 | }
148 | Loop, 800 ;spend remaining seconds waiting for last fish to appear inventory
149 | {
150 | PixelSearch, DoneGatheringX, DoneGatheringY, ox+706, oy+446, ox+706, oy+446, 0x868690
151 | if ErrorLevel = 0
152 | Goto, AfterLogin
153 | else
154 | Gosub, GetRandoms
155 | Sleep, 850+wait100to500milis
156 | }
157 |
158 | AfterLogin:
159 |
160 |
161 | Gosub, GetRandoms
162 | Gosub, LogOutCheck ;check if client has been disconnected
163 | Gosub, DisconnectCheck
164 |
165 | Loop, 100 ;look for Box on minimap
166 | {
167 | ImageSearch, BoxReturnX, BoxReturnY, ox+585, oy+108, ox+587, oy+110, BoxOrient.png
168 | if ErrorLevel = 0
169 | Goto, BoxReturn
170 | else
171 | Sleep, wait1to15milis
172 | }
173 | Loop, 10 ;try looking for Box again with longer wait intervals and wider search range
174 | {
175 | ImageSearch, BoxReturnX, BoxReturnY, ox+579, oy+102, ox+599, oy+122, BoxOrient.png
176 | if ErrorLevel = 0
177 | Goto, BoxReturn
178 | else
179 | Sleep, wait100to500milis
180 | }
181 | Loop, 5 ;try looking for Box again with even longer wait intervals and even wider search range (third try)
182 | {
183 | ImageSearch, BoxReturnX, BoxReturnY, ox+569, oy+92, ox+609, oy+132, BoxOrient.png
184 | if ErrorLevel = 0
185 | Goto, BoxReturn
186 | else
187 | Sleep, wait2to5sec
188 | }
189 | Loop, 3 ;try looking for Box again searching whole minimap (fourth try)
190 | {
191 | ImageSearch, BoxReturnX, BoxReturnY, ox+565, oy+3, ox+722, oy+162, BoxOrient.png
192 | if ErrorLevel = 0
193 | Goto, BoxReturn
194 | else
195 | Sleep, wait5to10sec
196 | }
197 | MsgBox, error with BoxReturn loops
198 | ExitApp
199 |
200 | BoxReturn:
201 |
202 |
203 | Gosub, GetRandoms
204 | Gosub, LogOutCheck ;check if client has been disconnected
205 | Gosub, DisconnectCheck
206 |
207 | MouseMove, BoxReturnX+5, BoxReturnY-3, 0 ;click on Box booth on minimap to return to Box
208 | Click
209 | Sleep, wait1to15milis+120
210 | Click
211 | Sleep, wait2to5sec
212 |
213 | BoxReturnWait:
214 |
215 |
216 | Gosub, GetRandoms
217 | Gosub, LogOutCheck ;check if client has been disconnected
218 | Gosub, DisconnectCheck
219 |
220 | Loop, 5000 ;wait until arrived at Box booth
221 | {
222 | PixelSearch, BoxAt2X, BoxAt2Y, ox+595, oy+47, ox+595, oy+47, 0xe78d7b
223 | if ErrorLevel = 0
224 | Goto, BoxAt
225 | else
226 | Sleep, 1
227 | }
228 | Loop, 10 ;wait until arrived at Box booth again with longer wait intervals
229 | {
230 | PixelSearch, BoxAt2X, BoxAt2Y, ox+595, oy+47, ox+595, oy+47, 0xe78d7b
231 | if ErrorLevel = 0
232 | Goto, BoxAt
233 | else
234 | Sleep, wait100to500milis
235 | }
236 | Loop, 5 ;wait until arrived at Box booth again with even longer wait intervals (third try)
237 | {
238 | PixelSearch, BoxAt2X, BoxAt2Y, ox+595, oy+47, ox+595, oy+47, 0xe78d7b
239 | if ErrorLevel = 0
240 | Goto, BoxAt
241 | else
242 | Sleep, wait5to10sec+1000
243 | }
244 | Loop, 100 ;if still not at Box booth yet, look for Box again on minimap with longer wait intervals
245 | {
246 | ImageSearch, BoxReturn2X, BoxReturn2Y, ox+585, oy+108, ox+587, oy+110, BoxOrient.png
247 | if ErrorLevel = 0
248 | Goto, BoxReturn2
249 | else
250 | Sleep, wait1to15milis
251 | }
252 | Loop, 5 ;look for Box again on minimap with even longer wait intervals (third try)
253 | {
254 | ImageSearch, BoxReturn2X, BoxReturn2Y, ox+565, oy+3, ox+722, oy+162, BoxOrient.png
255 | if ErrorLevel = 0
256 | Goto, BoxReturn2
257 | else
258 | Sleep, wait5to10sec+500
259 | }
260 | MsgBox, error with BoxAt2/BoxReturn2 loops
261 | ExitApp
262 |
263 | BoxReturn2:
264 |
265 |
266 | Gosub, GetRandoms
267 | Gosub, LogOutCheck ;check if client has been disconnected
268 | Gosub, DisconnectCheck
269 |
270 | MouseMove, BoxReturn2X+5, BoxReturn2Y-3, 10 ;click on Box booth on minimap to return to Box with longer wait intervals
271 | Sleep, wait5to10sec+2000
272 | Click
273 | Sleep, wait1to15milis+20
274 | Click
275 | Sleep, wait5to10sec+2000
276 | Loop, 100 ;wait until arrived at Box booth
277 | {
278 | PixelSearch, BoxAt2X, BoxAt2Y, ox+595, oy+47, ox+595, oy+47, 0xe78d7b
279 | if ErrorLevel = 0
280 | Goto, BoxAt
281 | else
282 | Sleep, wait100to500milis
283 | }
284 | Loop, 10 ;try again with longer wait intervals
285 | {
286 | PixelSearch, BoxAt2X, BoxAt2Y, ox+595, oy+47, ox+595, oy+47, 0xe78d7b
287 | if ErrorLevel = 0
288 | Goto, BoxAt
289 | else
290 | Sleep, wait5to10sec+2000
291 | }
292 | MsgBox, error with BoxAt2/BoxReturn2 loops
293 | ExitApp
294 |
295 | BoxAt:
296 |
297 | MouseMove, ox+varyby4+256, oy+varyby4+186, 0 ;open deposit box
298 | Sleep, wait100to500milis
299 | Click, varyby2+4
300 | Gosub, GetRandoms
301 | Sleep, wait100to500milis+300
302 | Loop, 1000 ;wait for box screen to appear
303 | {
304 | Gosub, GetRandoms
305 | PixelSearch, BoxWindowX, BoxWindowY, ox+140, oy+50, ox+140, oy+50, 0x1f98ff
306 | if ErrorLevel = 0
307 | Goto, ContinueBoxWindow
308 | else
309 | {
310 | MouseMove, ox+varyby4+256, oy+varyby4+186, 0
311 | Sleep, 300
312 | Click
313 | Sleep, wait100to500milis+300
314 | }
315 | }
316 |
317 | ContinueBoxWindow:
318 |
319 |
320 | Gosub, LogOutCheck ;check if client has been disconnected
321 | Gosub, DisconnectCheck
322 |
323 | Loop, 10 ;deposit inventory
324 | {
325 | Gosub, GetRandoms
326 | PixelSearch, InvSlot2EmptyX,InvSlot2EmptyY, ox+620, oy+220, ox+620, oy+230, 0x354049
327 | if ErrorLevel = 0
328 | Goto, ContinueInvSlot2Empty
329 | else
330 | {
331 | MouseMove, ox+varyby4+177, oy+varyby4+95, 0 ;right click second stack of items in deposit box window
332 | Sleep, wait200to500milis
333 | Click, right
334 | Gosub, GetRandoms
335 | Sleep, wait200to500milis
336 | MouseMove, ox+varyby10+177, oy+varyby4+168, 0 ;select "all" on drop down second stack of items in inventory
337 | Gosub, GetRandoms
338 | Sleep, wait200to500milis
339 | Click
340 | Gosub, GetRandoms
341 | Sleep, wait800to1200milis+400
342 | }
343 | }
344 |
345 |
346 | Gosub, GetRandoms
347 | Gosub, LogOutCheck ;check if client has been disconnected
348 | Gosub, DisconnectCheck
349 |
350 | ;debugging only
351 | MsgBox, Generated Number %Behavior%
352 | ;1/5 chance per trip to check fishing skill stats to better mimic human getting impatient while training
353 | if Behavior > 80
354 | Gosub, CheckFishingStats
355 | ;1/20 chance per trip to logout briefly to simulate a "bathroom break"
356 | if Behavior > 95
357 | Gosub, BriefLogout
358 | ;1/10 chance per trip of stopping macro completely
359 | if Behavior > 10
360 | Goto, Start
361 | else
362 | ExitApp
363 |
364 | ;beginning of subroutines
365 |
366 | LogOutCheck: ;if client has been unexpectedly booted to main login screen, attempt to log back in
367 | PixelSearch, LogOutX, LogOutY, ox+73, oy+485, ox+73, oy+485, 0xffffff
368 | if ErrorLevel = 0 ;if client logged out, log back in and go back to starting position
369 | {
370 |
371 | Sleep, wait5to10sec+2000
372 | Send {Enter} ;same as clicking "existing user" button
373 | Random, wait2to5sec, 2000, 5000
374 | Sleep, wait2to5sec-1000
375 | Send {Raw}B
376 | Random, wait2to5sec, 2000, 5000
377 | Sleep, wait2to5sec-1000
378 | Send {Tab}
379 | Random, wait2to5sec, 2000, 5000
380 | Sleep, wait2to5sec-1500
381 | Send {Raw}zkRE6rJc3URG8ic6Vwyt
382 | Random, wait2to5sec, 2000, 5000
383 | Sleep, wait2to5sec-1000
384 | Send {Enter}
385 | Random, wait5to10sec, 2000, 5000
386 | Sleep, wait5to10sec
387 | Random, wait5to10sec, 2000, 5000
388 | PostLogin:
389 | Loop, 25
390 | {
391 | PixelSearch, PostLoginX, PostLoginY, ox+762, oy+500, ox+762, oy+500, 0x000000 ;look for black pixel in bottom right corner of screen where HUD should be
392 | if Errorlevel = 0
393 | {
394 | ImageSearch, PostLoginButtonX, PostLoginButtonY, 0, 0, A_Screenwidth, A_Screenheight, PostLoginButton.png ;check if post-login screen has been reached, if not, try hitting login button again
395 | if ErrorLevel = 0
396 | {
397 | MouseMove, PostLoginButtonX+varyby8+35, PostLoginButtonY+varyby8+25, 50
398 | Sleep, wait1to3sec
399 | Click
400 | Random, wait5to10sec, 2000, 5000
401 | Sleep, wait5to10sec+2000
402 | PixelSearch, LogOutX, LogOutY, ox+73, oy+485, ox+73, oy+485, 0xffffff ;check if client has successfully logged back in by checking for absence of white text in lower-left corner of client indicating World selection
403 | if ErrorLevel
404 | Goto, AfterLogin
405 | else
406 | Goto, PostLogin
407 | }
408 | else
409 | {
410 | Random, wait2to5sec, 2000, 5000
411 | Sleep, Wait2to5sec
412 | Send {Enter} ;try hitting login button again if can't connect to server yet
413 | Random, wait5to10sec, 2000, 5000
414 | Sleep, wait5to10sec+5000
415 | }
416 | }
417 | else
418 | {
419 | Random, wait2to5sec, 2000, 5000
420 | Sleep, Wait2to5sec
421 | Send {Enter} ;try hitting login button again if can't connect to server yet
422 | Random, wait5to10sec, 2000, 5000
423 | Sleep, wait5to10sec+5000
424 | }
425 | }
426 | MsgBox, cant get past post-login or error with LogOutCheck loop
427 | ExitApp
428 | }
429 | else
430 | Return ;abort subroutine and return to location it was called from
431 | DisconnectCheck: ;check if client has been unexpectedly disconnected and booted to post-login screen; if so, attempt to log back in
432 | PixelSearch, PostLoginX, PostLoginY, ox+762, oy+500, ox+762, oy+500, 0x000000 ;look for black pixel in bottom right corner of screen where HUD should be
433 | if ErrorLevel = 0
434 | {
435 | ImageSearch, PostLoginButtonX, PostLoginButtonY, 0, 0, A_Screenwidth, A_Screenheight, PostLoginButton.png ;to make sure client has been disconnected, look for post-login button
436 | if ErrorLevel = 0
437 | {
438 | Random, wait2to5sec, 2000, 5000
439 | Sleep, wait2to5sec
440 | MouseMove, PostLoginButtonX+varyby8+40, PostLoginButtonY+varyby4+20, 50
441 | Random, wait2to5sec, 2000, 5000
442 | Sleep, wait2to5sec
443 | Click
444 | Random, wait5to10sec, 2000, 5000
445 | Sleep, wait5to10sec
446 | PixelSearch, LogOutX, LogOutY, ox+73, oy+485, ox+73, oy+485, 0xffffff ;check if client has successfully logged back in by checking for absence of white text in lower-left corner of client indicating World selection
447 | if ErrorLevel
448 | Goto, AfterLogin
449 | else
450 | Goto, DisconnectCheck
451 | }
452 | else
453 | Return ;abort subroutine and return to location it was called from
454 | }
455 | else
456 | Return ;abort subroutine and return to location it was called from
457 | GetRandoms:
458 | ;generate random delays for character actions
459 | Random, wait1to5milis, 1, 5
460 | Random, wait1to15milis, 1, 15
461 | Random, wait100to500milis, 100, 500
462 | Random, wait200to500milis, 200, 500
463 | Random, wait800to1200milis, 800, 1200
464 | Random, wait1to3sec, 1000, 3000
465 | Random, wait2to5sec, 2000, 5000
466 | Random, wait5to10sec, 5000, 10000
467 |
468 | ;generate random numbers for varying mouse clicking coordinates
469 | Random, varyby1, -1, 1
470 | Random, varyby2, -2, 2
471 | Random, varyby4, -4, 4
472 | Random, varyby6, -6, 6
473 | Random, varyby8, -8, 8
474 | Random, varyby10, -10, 10
475 | Random, varyby12, -12, 12
476 | Return
477 |
478 | ChatBot:
479 | Sleep, wait5to10sec+10000
480 | Random, wait5to10sec, 5000, 10000
481 | Sleep, wait5to10sec+3000
482 | Random, ChatBehavior, 1, 10 ;generate random number for determining if macro will chat while fishing
483 |
484 | if ChatBehavior > 9 ;1/10 chance per trip of typing something into chat
485 | {
486 | Random, SelectChat, 0, 101 ;if macro decides to chat, determine which message it will type
487 | if 40 > SelectChat > 20 ;type the following if number is between 20 and 40
488 | {
489 | Send {Raw}love me sum fishez
490 | Send {Enter}
491 | Return
492 | }
493 | if 60 > SelectChat > 40
494 | {
495 | Send {Raw}wonder how many of you are bots
496 | Send {Enter}
497 | Return
498 | }
499 | if 80 > SelectChat > 60
500 | {
501 | Send {Raw}fish/wc lvls?
502 | Send {Enter}
503 | Sleep, wait5to10sec+2000
504 | Send {Raw}mine is OVER 9000!!!!
505 | Send {Enter}
506 | Sleep, wait2to5sec+1000
507 | Send {Raw}jk its like two
508 | Send {Enter}
509 | Return
510 | }
511 | if 100 > SelectChat > 60
512 | {
513 | Send {Raw}so boward
514 | Send {Enter}
515 | }
516 | else
517 | Return
518 | ;hotkeys
519 | ^q::ExitApp
520 | ^p::Pause
521 |
--------------------------------------------------------------------------------
/ahk/OSRSEarthRunecrafting/EarthRunecrafting.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | ;begin at varrock east bank in third-to-last booth from the left, with rune pouch in inventory and rune essence first slot in bank
6 | ;client must be oriented north (click compass) and camera must be tilted all the way upwards (hold arrow key)
7 | ;client must also be fully zoomed out and brightness set at default
8 |
9 |
10 |
11 | CoordMode, Pixel, Screen
12 | CoordMode, Mouse, Screen
13 | #Persistent
14 |
15 |
16 | ;orient client by searching whole screen for prayer hud icon
17 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png
18 | if ErrorLevel = 0
19 | {
20 | Sleep, wait100to500milis
21 | Gosub, GetRandoms
22 | MouseMove, OrientX, OrientY
23 | Sleep, wait100to500milis
24 | ;move mouse to top left pixel of client to create new origin point for coordinate system
25 | MouseMove, -696, -171, 0, R ; 0, 0 coordinates from prayer icon
26 | MouseGetPos, ox, oy
27 | }
28 | else
29 | {
30 | MsgBox, Can’t find client!
31 | ExitApp
32 | }
33 |
34 | ;click compass to orient client North
35 | MouseMove, ox+561, oy+20, 0 ;compass
36 | Sleep, 50
37 | Click, 2
38 | Sleep, 5
39 | Send {Up down}
40 | Sleep, 750
41 | Send {Up up}
42 | Sleep, 100
43 |
44 | ;configure client zoom settings to be fully zoomed out
45 | MouseMove, ox+675, oy+484, 0 ;options screen location
46 | Sleep, 100
47 | Click, 2
48 | Sleep, 100
49 | MouseMove, ox+675, oy+274, 0 ;options screen zoom bar location
50 | Sleep, 100
51 | Click
52 | Sleep, 100
53 | MouseClickDrag, L, ox+675, oy+274, ox+515, oy+274, 0
54 | Sleep, 100
55 | MouseMove, ox+642, oy+185, 0 ;inventory bag icon
56 | Sleep, 100
57 | Click, 2
58 | Sleep, 100
59 |
60 | ;Loop ;begin main loop
61 | {
62 |
63 | ;check run energy. if above about 90, turn on run
64 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
65 | if ErrorLevel = 0
66 | {
67 | MouseMove, RunX, RunY, 0
68 | Sleep, 10
69 | Click
70 | }
71 |
72 | MouseMove, ox+260, oy+191, 0 ;open bank from starting position
73 | Sleep, 10
74 | Click, 2
75 | Loop, 250 ;wait for bank screen to appear
76 | {
77 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
78 | if ErrorLevel = 0
79 | Goto, ContinueBankWindow
80 | else
81 | {
82 | Click
83 | Sleep, 50
84 | Click, 2
85 | Sleep, 1000
86 | Continue
87 | }}
88 | MsgBox, error with BankWindow loop
89 | ExitApp
90 | ContinueBankWindow:
91 |
92 | ;deposit runes
93 | MouseMove, ox+621, oy+228, 0 ;right click second stack of items in inventory
94 | Sleep, 10
95 | Click, right
96 | Sleep, 10
97 | MouseMove, ox+621, oy+328, 0 ;select "all" on drop down second stack of items in inventory
98 | Sleep, 10
99 | Click, 2
100 | Sleep, 10
101 |
102 | Loop, 50 ;wait for inventory to be deposited
103 | {
104 | PixelSearch, InvSlot2EmptyX,InvSlot2EmptyY, ox+620, oy+220, ox+620, oy+230, 0x354049
105 | if ErrorLevel = 0
106 | Goto, ContinueInvSlot2Empty
107 | else
108 | {
109 | MouseMove, ox+620, oy+228, 0 ;right click second stack of items in inventory
110 | Sleep, 10
111 | Click, right
112 | Sleep, 10
113 | MouseMove, ox+620, oy+328, 0 ;select "all" on drop down second stack of items in inventory
114 | Sleep, 10
115 | Click
116 | Sleep, 10
117 | }}
118 | MsgBox, error with InvSlot2Empty loop
119 | ContinueInvSlot2Empty:
120 |
121 |
122 | Loop, 10 ;look for regular rune essence
123 | {
124 | PixelSearch, regx, regy, ox+101, oy+95, ox+101, oy+95, 0x83838d
125 | if ErrorLevel = 0
126 | Goto, runeswithdrawal
127 | else
128 | Sleep, 100
129 | }
130 |
131 | Loop, 100 ;look for pure rune essence
132 | {
133 | PixelSearch, purex, purey, ox+101, oy+95, ox+101, oy+95, 0xbabbc3
134 | if ErrorLevel = 0
135 | Goto, runeswithdrawal
136 | else
137 | Sleep, 100
138 | }
139 | MsgBox, out of runes
140 | ExitApp
141 | runeswithdrawal:
142 |
143 | ;withdrawal essence
144 | MouseMove, ox+89, oy+96, 0 ;first bank slot
145 | Sleep, 100
146 | Click, right
147 | Sleep, 100
148 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
149 | Sleep, 100
150 | Click
151 | Sleep, 100
152 |
153 | Loop, 10 ;check if essence are in inventory
154 | {
155 | PixelSearch, invessX, invessY, ox+575, oy+251, ox+575, oy+251, 0x010000
156 | if ErrorLevel = 0
157 | Goto, invess
158 | else
159 | MouseMove, ox+89, oy+96, 0 ;first bank slot
160 | Sleep, 100
161 | Click, right
162 | Sleep, 100
163 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
164 | Sleep, 100
165 | Click
166 | Sleep, 100
167 | }
168 | MsgBox, error with invess loop
169 | ExitApp
170 | invess:
171 |
172 | MouseMove, ox+486, oy+23, 0 ;close bank window
173 | Sleep, 10
174 | Click
175 | Sleep, 500
176 |
177 | MouseMove, ox+577, oy+233, 0 ;fill pouch
178 | Sleep, 10
179 | Click, 5
180 | Sleep, 500
181 |
182 | MouseMove, ox+260, oy+191, 0 ;open bank from starting position
183 | Sleep, 10
184 | Click, 2
185 | Loop, 250 ;wait for bank screen to appear
186 | {
187 | PixelSearch, BankWindow2X, BankWindow2Y, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
188 | if ErrorLevel = 0
189 | Goto, ContinueBankWindow2
190 | else
191 | {
192 | Click
193 | Sleep, 50
194 | Click, 2
195 | Sleep, 1000
196 | Continue
197 | }}
198 | MsgBox, error with BankWindow2 loop
199 | ExitApp
200 | ContinueBankWindow2:
201 |
202 | Loop, 2 ;look for regular rune essence
203 | {
204 | PixelSearch, reg2x, reg2y, ox+101, oy+95, ox+101, oy+95, 0x83838d
205 | if ErrorLevel = 0
206 | Goto, runeswithdrawal2
207 | else
208 | Sleep, 1
209 | }
210 |
211 | Loop, 100 ;look for pure rune essence
212 | {
213 | PixelSearch, pure2x, pure2y, ox+101, oy+95, ox+101, oy+95, 0xbabbc3
214 | if ErrorLevel = 0
215 | Goto, runeswithdrawal2
216 | else
217 | Sleep, 100
218 | }
219 | MsgBox, out of runes
220 | ExitApp
221 | runeswithdrawal2:
222 |
223 | ;withdrawal essence
224 | MouseMove, ox+89, oy+96, 0 ;first bank slot
225 | Sleep, 100
226 | Click, right
227 | Sleep, 100
228 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
229 | Sleep, 100
230 | Click
231 | Sleep, 100
232 |
233 | Loop, 10 ;check if essence are in inventory
234 | {
235 | PixelSearch, invess2X, invess2Y, ox+617, oy+215, ox+617, oy+215, 0x010000
236 | if ErrorLevel = 0
237 | Goto, invess2
238 | else
239 | MouseMove, ox+89, oy+96, 0 ;first bank slot
240 | Sleep, 100
241 | Click, right
242 | Sleep, 100
243 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
244 | Sleep, 100
245 | Click
246 | Sleep, 100
247 | }
248 | MsgBox, error with invess loop
249 | ExitApp
250 | invess2:
251 |
252 | MouseMove, ox+705, oy+48, 0 ;click on first checkpoint
253 | Sleep, 10
254 | Click
255 | Sleep, 8500
256 |
257 | Loop, 100 ;look for first checkpoint
258 | {
259 | PixelSearch, checkpoint1X, checkpoint1Y, ox+355, oy+259, ox+355, oy+259, 0x111115
260 | if ErrorLevel = 0
261 | Goto, checkpoint1
262 | else
263 | Sleep, 100
264 | }
265 | MsgBox, error with checkpoint1 loop
266 | ExitApp
267 | checkpoint1:
268 |
269 | MouseMove, ox+705, oy+48, 0 ;click on second checkpoint
270 | Sleep, 10
271 | Click
272 | Sleep, 8500
273 |
274 | Loop, 100 ;look for second checkpoint
275 | {
276 | PixelSearch, checkpoint2X, checkpoint2Y, ox+87, oy+141, ox+87, oy+141, 0xa7a8b2
277 | if ErrorLevel = 0
278 | Goto, checkpoint2
279 | else
280 | Sleep, 100
281 | }
282 | MsgBox, error with checkpoint2 loop
283 | ExitApp
284 | checkpoint2:
285 |
286 | MouseMove, ox+673, oy+19, 0 ;click on third checkpoint
287 | Sleep, 10
288 | Click
289 | Sleep, 8500
290 |
291 | Loop, 100 ;look for third checkpoint
292 | {
293 | PixelSearch, checkpoint3X, checkpoint3Y, ox+470, oy+200, ox+470, oy+200, 0x355873
294 | if ErrorLevel = 0
295 | Goto, checkpoint3
296 | else
297 | Sleep, 100
298 | }
299 | MsgBox, error with checkpoint3 loop
300 | ExitApp
301 | checkpoint3:
302 |
303 | MouseMove, ox+676, oy+18, 0 ;click on fourth checkpoint
304 | Sleep, 10
305 | Click
306 | Sleep, 8000
307 |
308 | Loop, 100 ;look for fourth checkpoint
309 | {
310 | PixelSearch, checkpoint4X, checkpoint4Y, ox+220, oy+168, ox+220, oy+168, 0x355873
311 | if ErrorLevel = 0
312 | Goto, checkpoint4
313 | else
314 | Sleep, 100
315 | }
316 | MsgBox, error with checkpoint4 loop
317 | ExitApp
318 | checkpoint4:
319 |
320 | MouseMove, ox+328, oy+80, 0 ;click to enter ruins (checkpoint5)
321 | Sleep, 50
322 | Click, 3
323 | Sleep, 2000
324 |
325 | Loop, 100 ;look for fifth checkpoint
326 | {
327 | PixelSearch, checkpoint5tX, checkpoint5Y, ox+399, oy+303, ox+399, oy+303, 0x3f7688
328 | if ErrorLevel = 0
329 | Goto, checkpoint5
330 | else
331 | Sleep, 100
332 | }
333 | MsgBox, error with checkpoint5 loop
334 | ExitApp
335 | checkpoint5:
336 |
337 | MouseMove, ox+643, oy+62, 0 ;click to approach altar (checkpoint6)
338 | Sleep, 50
339 | Click, 3
340 | Sleep, 5000
341 |
342 | Loop, 100 ;look for sixth checkpoint
343 | {
344 | PixelSearch, checkpoint6X, checkpoint6Y, ox+305, oy+158, ox+305, oy+158, 0x6f7376
345 | if ErrorLevel = 0
346 | Goto, checkpoint6
347 | else
348 | Sleep, 100
349 | }
350 | MsgBox, error with checkpoint6 loop
351 | ExitApp
352 | checkpoint6:
353 |
354 | MouseMove, ox+283, oy+74, 0 ;click to craft runes (checkpoint 7)
355 | Sleep, 50
356 | Click, 3
357 | Sleep, 6000
358 |
359 |
360 | Loop, 100 ;look for seventh checkpoint
361 | {
362 | PixelSearch, checkpoint7X, checkpoint7Y, ox+250, oy+191, ox+250, oy+191, 0x5b6168
363 | if ErrorLevel = 0
364 | Goto, checkpoint7
365 | else
366 | Sleep, 100
367 | }
368 | MsgBox, error with checkpoint7 loop
369 | ExitApp
370 | checkpoint7:
371 |
372 | MouseMove, ox+577, oy+233, 0 ;empty pouch
373 | Sleep, 10
374 | Click, right
375 | MouseMove, ox+530, oy+273, 0
376 | Sleep, 10
377 | Click
378 | MouseMove, ox+577, oy+233, 0 ;empty pouch
379 | Sleep, 10
380 | Click, right
381 | MouseMove, ox+530, oy+273, 0
382 | Sleep, 10
383 | Click
384 |
385 | MouseMove, ox+290, oy+125, 0 ;click to craft runes from pouch
386 | Sleep, 50
387 | Click, 3
388 | Sleep, 6000
389 |
390 |
391 | MouseMove, ox+642, oy+120, 0 ;click to approach portal (checkpoint 8)
392 | Sleep, 50
393 | Click, 3
394 | Sleep, 100
395 | Click, 5
396 | Sleep, 5000
397 |
398 | Loop, 100 ;look for eighth checkpoint
399 | {
400 | PixelSearch, checkpoint8tX, checkpoint8Y, ox+396, oy+307, ox+396, oy+307, 0x3f7688
401 | if ErrorLevel = 0
402 | Goto, checkpoint8
403 | else
404 | Sleep, 100
405 | }
406 | MsgBox, error with checkpoint8 loop
407 | ExitApp
408 | checkpoint8:
409 |
410 | MouseMove, ox+199, oy+207, 0 ;click to enter portal (checkpoint 9)
411 | Sleep, 50
412 | Click, 3
413 | Sleep, 5000
414 |
415 | Loop, 100 ;look for ninth checkpoint
416 | {
417 | PixelSearch, checkpoint9tX, checkpoint9Y, ox+139, oy+140, ox+139, oy+140, 0x2c4960
418 | if ErrorLevel = 0
419 | Goto, checkpoint9
420 | else
421 | Sleep, 100
422 | }
423 | MsgBox, error with checkpoint9 loop
424 | ExitApp
425 | checkpoint9:
426 |
427 | ;check run energy. if above about 90, turn on run
428 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
429 | if ErrorLevel = 0
430 | {
431 | MouseMove, RunX, RunY, 0
432 | Sleep, 10
433 | Click
434 | }
435 |
436 | MouseMove, ox+626, oy+152, 0 ;click on tenth checkpoint
437 | Sleep, 50
438 | Click, 3
439 | Sleep, 8500
440 |
441 | Loop, 100 ;look for tenth checkpoint
442 | {
443 | PixelSearch, checkpoint10X, checkpoint10Y, ox+340, oy+24, ox+340, oy+24, 0x3f6a88
444 | if ErrorLevel = 0
445 | Goto, checkpoint10
446 | else
447 | Sleep, 100
448 | }
449 | MsgBox, error with checkpoint10 loop
450 | ExitApp
451 | checkpoint10:
452 |
453 | MouseMove, ox+626, oy+152, 0 ;click on eleventh checkpoint
454 | Sleep, 50
455 | Click, 3
456 | Sleep, 8500
457 |
458 | Loop, 100 ;look for eleventh checkpoint
459 | {
460 | PixelSearch, checkpoint11X, checkpoint11Y, ox+380, oy+240, ox+380, oy+240, 0x355873
461 | if ErrorLevel = 0
462 | Goto, checkpoint11
463 | else
464 | Sleep, 100
465 | }
466 | MsgBox, error with checkpoint11 loop
467 | ExitApp
468 | checkpoint11:
469 |
470 | MouseMove, ox+611, oy+135, 0 ;click on twelfth checkpoint
471 | Sleep, 50
472 | Click, 3
473 | Sleep, 8500
474 |
475 | Loop, 100 ;look for twelfth checkpoint
476 | {
477 | PixelSearch, checkpoint12X, checkpoint12Y, ox+128, oy+96, ox+128, oy+96, 0x203748
478 | if ErrorLevel = 0
479 | Goto, checkpoint12
480 | else
481 | Sleep, 100
482 | }
483 | MsgBox, error with checkpoint12 loop
484 | ExitApp
485 | checkpoint12:
486 |
487 | MouseMove, ox+572, oy+93, 0 ;click on thirteenth checkpoint
488 | Sleep, 50
489 | Click, 3
490 | Sleep, 8500
491 |
492 | Loop, 100 ;look for thirteenth checkpoint
493 | {
494 | PixelSearch, checkpoint13X, checkpoint13Y, ox+471, oy+112, ox+471, oy+112, 0x395d7a
495 | if ErrorLevel = 0
496 | Goto, checkpoint13
497 | else
498 | Sleep, 100
499 | }
500 | MsgBox, error with checkpoint14 loop
501 | ExitApp
502 | checkpoint13:
503 |
504 | MouseMove, ox+583, oy+117, 0 ;click on fourteenth (final) checkpoint
505 | Sleep, 50
506 | Click, 3
507 | Sleep, 8500
508 |
509 | Loop, 100 ;look for fourteenth checkpoint (starting position)
510 | {
511 | PixelSearch, checkpoint14X, checkpoint14Y, ox+157, oy+215, ox+157, oy+215, 0x00001d
512 | if ErrorLevel = 0
513 | Goto, checkpoint14
514 | else
515 | Sleep, 100
516 | }
517 | MsgBox, error with checkpoint14 loop
518 | ExitApp
519 | checkpoint14:
520 |
521 | }
522 |
523 |
524 | ^q::ExitApp
525 |
526 |
527 |
528 |
529 |
--------------------------------------------------------------------------------
/ahk/OSRSEarthRunecrafting/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSEarthRunecrafting/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSFlaxSpinning/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSFlaxSpinning/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSFlaxSpinning/PNGs/BankOrient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSFlaxSpinning/PNGs/BankOrient.png
--------------------------------------------------------------------------------
/ahk/OSRSFlaxSpinning/PNGs/PostLoginButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSFlaxSpinning/PNGs/PostLoginButton.png
--------------------------------------------------------------------------------
/ahk/OSRSMagicSplashing.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 | #Persistent
5 |
6 | OrientClient()
7 |
8 | Loop
9 | {
10 | Runes := 0
11 | PixelSearch, MindRuneX, MindRuneY, ox+628, oy+235, ox+628, oy+235, 0x127bd8, 5, Fast ;make sure character still has mind runes in inventory (2nd spot)
12 | if ErrorLevel = 0
13 | Runes ++ ;increase variable by 1
14 | else
15 | {
16 | Random, wait1to20sec, 1000, 20000
17 | Sleep, wait1to20sec
18 | AbortLogout()
19 | MsgBox, Out of Mind Runes!
20 | ExitApp
21 | }
22 | PixelSearch, AirRuneX, AirRuneY, ox+585, oy+233, ox+585, oy+233, 0xdcdce0, 5, Fast ;make sure character still has air runes in inventory (1st spot)
23 | if ErrorLevel = 0
24 | Runes ++
25 | else
26 | {
27 | Random, wait1to20sec, 1000, 20000
28 | Sleep, wait1to20sec
29 | AbortLogout()
30 | MsgBox, Out of Air Runes!
31 | ExitApp
32 | }
33 |
34 | if Runes = 2 ;if both runes are present, continue macro
35 | {
36 | ;PixelSearch, GuardX, GuardY, ox+255, oy+192, ox+265, oy+210, 0x213b42, 2, Fast
37 | ;if ErrorLevel = 0 ;if guard has been found, continue macro
38 | ;{
39 | Gui, Destroy
40 | Gui, Add, Text, ,Found guard
41 | Gui, Show, Y15, Msgbox
42 | Random, varyby100, -100, 100
43 | Random, varyby80, -80, 80
44 | MouseMove, ox+varyby100+645, oy+varyby80+378, 0 ;click mouse anywhere in inventory to maintain client activity
45 | Random, wait300to8000milis, 300, 8000
46 | Sleep, wait300to8000milis
47 | Click, down
48 | Random, wait80to400milis, 80, 400
49 | Sleep, wait80to400milis
50 | Click, up
51 | Random, loopcount, 30000, 210000 ;wait a random amount of time before clicking again (30s-4min10s)
52 | loopinseconds := 0
53 | loopcount /= 500 ;total wait time is divided by 500 since loop has a 500 milisecond sleep every iteration
54 | loopinseconds := loopcount ;convert random loop count into number of seconds macro will wait before performing another action, this is only used for display purposes
55 | loopinseconds *= 500 ;revert loopcount division
56 | loopinseconds /= 1000 ;convert miliseconds into seconds
57 | Gui, Destroy
58 | Gui, Add, Text, ,Found guard, waiting %loopinseconds% seconds
59 | Gui, Show, Y15, Msgbox
60 |
61 | Loop, %loopcount% ;loop a random number of times equivalent to 1-4min
62 | {
63 | PixelSearch, LevelUpX, LevelUpY, ox+452, oy+387, ox+452, oy+387, 0x800000, 2, Fast ;look for magic level up screen in chat menu and dismiss with spacebar
64 | if ErrorLevel = 0 ;if level up message has been found, confirm it to close
65 | {
66 | ;Gui, Destroy
67 | ;Gui, Add, Text, ,Confirming levelup message ...
68 | ; Gui, Show, Y15, Msgbox
69 | ; Random, wait800to5000milis, 800, 5000
70 | ; Sleep, wait800to5000milis
71 | ; Send {Space down}
72 | ; Random, wait80to400milis, 80, 400
73 | ; Sleep, wait80to400milis
74 | ; Send {Space up}
75 | ; Random, wait800to3000milis, 1000, 3000
76 | ; Sleep, wait800to3000milis
77 | ; Send {Space down} ;hit space twice since two messages may have to be confirmed before player will resume actions
78 | ; Random, wait80to400milis, 80, 400
79 | ; Sleep, wait80to400milis
80 | ; Send {Space up}
81 | Gui, Destroy
82 | LogoutCheck()
83 | }
84 | else ;if level up message has not been found, wait half a second before checking again
85 | Sleep, 500
86 | LogoutCheck()
87 | }
88 | ;}
89 | ;else ;if guard has not been found, logout
90 | ;{
91 | ;AbortLogout()
92 | ;MsgBox, Cant find Guard!
93 | ;ExitApp
94 | ;}
95 | }
96 | else ;if both runes are not present, logout
97 | {
98 | Random, wait1to10sec, 1000, 10000
99 | Sleep, wait1to10sec
100 | AbortLogout()
101 | MsgBox, Out of Runes - Error!
102 | ExitApp
103 | }
104 | }
105 |
106 | ^q::
107 | {
108 | Gui, Destroy
109 | ExitApp
110 | }
111 | ^p::
112 | {
113 | Gui, Destroy
114 | ListVars
115 | ListLines
116 | KeyHistory
117 | Pause
118 | }
119 |
--------------------------------------------------------------------------------
/ahk/OSRSMagicSplashing/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSMagicSplashing/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSNatureRunecrafting/NatureRunecrafting.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 |
5 | ;begin at edgeville bank in second-closest booth to furnace, with rune pouch in inventory and rune essence first slot in bank
6 |
7 | CoordMode, Pixel, Screen
8 | CoordMode, Mouse, Screen
9 | #Persistent
10 |
11 | ;orient client by searching whole screen for prayer hud icon
12 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png
13 | if ErrorLevel = 0
14 | {
15 | Sleep, 50
16 | MouseMove, OrientX, OrientY
17 | Sleep, 50
18 | ;move mouse to top left pixel of client to create new origin point for coordinate system
19 | MouseMove, -696, -171, 0, R ; 0, 0 coordinates from prayer icon
20 | MouseGetPos, ox, oy
21 | }
22 | else
23 | {
24 | MsgBox, Can’t find client!
25 | ExitApp
26 | }
27 |
28 | ;click compass to orient client North
29 | MouseMove, ox+561, oy+20, 0 ;compass
30 | Sleep, 50
31 | Click, 2
32 | Sleep, 5
33 | Send {Up down}
34 | Sleep, 750
35 | Send {Up up}
36 | Sleep, 100
37 |
38 | ;configure client zoom settings to be fully zoomed out
39 | MouseMove, ox+675, oy+484, 0 ;options screen location
40 | Sleep, 100
41 | Click, 2
42 | Sleep, 100
43 | MouseMove, ox+675, oy+274, 0 ;options screen zoom bar location
44 | Sleep, 100
45 | Click
46 | Sleep, 100
47 | MouseClickDrag, L, ox+675, oy+274, ox+515, oy+274, 0
48 | Sleep, 100
49 | MouseMove, ox+642, oy+185, 0 ;inventory bag icon
50 | Sleep, 100
51 | Click, 2
52 | Sleep, 100
53 |
54 |
55 |
56 | Loop ;begin main loop
57 | {
58 |
59 | ;check run energy. if above about 90, turn on run
60 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
61 | if ErrorLevel = 0
62 | {
63 | MouseMove, RunX, RunY, 0
64 | Sleep, 10
65 | Click
66 | }
67 |
68 | MouseMove, ox+260, oy+191, 0 ;open bank from starting position
69 | Sleep, 10
70 | Click, 2
71 | Loop, 250 ;wait for bank screen to appear
72 | {
73 | PixelSearch, BankWindowX, BankWindowY, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
74 | if ErrorLevel = 0
75 | Goto, ContinueBankWindow
76 | else
77 | {
78 | Click
79 | Sleep, 50
80 | Click, 2
81 | Sleep, 1000
82 | Continue
83 | }}
84 | MsgBox, error with BankWindow loop
85 | ExitApp
86 | ContinueBankWindow:
87 |
88 | ;deposit runes
89 | MouseMove, ox+621, oy+228, 0 ;right click second stack of items in inventory
90 | Sleep, 10
91 | Click, right
92 | Sleep, 10
93 | MouseMove, ox+621, oy+328, 0 ;select "all" on drop down second stack of items in inventory
94 | Sleep, 10
95 | Click, 2
96 | Sleep, 10
97 |
98 | Loop, 50 ;wait for inventory to be deposited
99 | {
100 | PixelSearch, InvSlot2EmptyX,InvSlot2EmptyY, ox+620, oy+220, ox+620, oy+230, 0x354049
101 | if ErrorLevel = 0
102 | Goto, ContinueInvSlot2Empty
103 | else
104 | {
105 | MouseMove, ox+620, oy+228, 0 ;right click second stack of items in inventory
106 | Sleep, 10
107 | Click, right
108 | Sleep, 10
109 | MouseMove, ox+620, oy+328, 0 ;select "all" on drop down second stack of items in inventory
110 | Sleep, 10
111 | Click
112 | Sleep, 10
113 | }}
114 | MsgBox, error with InvSlot2Empty loop
115 | ContinueInvSlot2Empty:
116 |
117 |
118 | Loop, 10 ;look for regular rune essence
119 | {
120 | PixelSearch, regx, regy, ox+101, oy+95, ox+101, oy+95, 0x83838d
121 | if ErrorLevel = 0
122 | Goto, runeswithdrawal
123 | else
124 | Sleep, 100
125 | }
126 |
127 | Loop, 100 ;look for pure rune essence
128 | {
129 | PixelSearch, purex, purey, ox+101, oy+95, ox+101, oy+95, 0xbabbc3
130 | if ErrorLevel = 0
131 | Goto, runeswithdrawal
132 | else
133 | Sleep, 100
134 | }
135 | MsgBox, out of runes
136 | ExitApp
137 | runeswithdrawal:
138 |
139 | ;withdrawal essence
140 | MouseMove, ox+89, oy+96, 0 ;first bank slot
141 | Sleep, 100
142 | Click, right
143 | Sleep, 100
144 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
145 | Sleep, 100
146 | Click
147 | Sleep, 100
148 |
149 | Loop, 10 ;check if essence are in inventory
150 | {
151 | PixelSearch, invessX, invessY, ox+575, oy+251, ox+575, oy+251, 0x010000
152 | if ErrorLevel = 0
153 | Goto, invess
154 | else
155 | MouseMove, ox+89, oy+96, 0 ;first bank slot
156 | Sleep, 100
157 | Click, right
158 | Sleep, 100
159 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
160 | Sleep, 100
161 | Click
162 | Sleep, 100
163 | }
164 | MsgBox, error with invess loop
165 | ExitApp
166 | invess:
167 |
168 | MouseMove, ox+486, oy+23, 0 ;close bank window
169 | Sleep, 10
170 | Click
171 | Sleep, 500
172 |
173 | MouseMove, ox+577, oy+233, 0 ;fill pouch
174 | Sleep, 10
175 | Click, 5
176 | Sleep, 500
177 |
178 | MouseMove, ox+260, oy+191, 0 ;open bank from starting position
179 | Sleep, 10
180 | Click, 2
181 | Loop, 250 ;wait for bank screen to appear
182 | {
183 | PixelSearch, BankWindow2X, BankWindow2Y, ox+360, oy+315, ox+360, oy+315, 0x42b2f4
184 | if ErrorLevel = 0
185 | Goto, ContinueBankWindow2
186 | else
187 | {
188 | Click
189 | Sleep, 50
190 | Click, 2
191 | Sleep, 1000
192 | Continue
193 | }}
194 | MsgBox, error with BankWindow2 loop
195 | ExitApp
196 | ContinueBankWindow2:
197 |
198 | Loop, 2 ;look for regular rune essence
199 | {
200 | PixelSearch, reg2x, reg2y, ox+101, oy+95, ox+101, oy+95, 0x83838d
201 | if ErrorLevel = 0
202 | Goto, runeswithdrawal2
203 | else
204 | Sleep, 1
205 | }
206 |
207 | Loop, 100 ;look for pure rune essence
208 | {
209 | PixelSearch, pure2x, pure2y, ox+101, oy+95, ox+101, oy+95, 0xbabbc3
210 | if ErrorLevel = 0
211 | Goto, runeswithdrawal2
212 | else
213 | Sleep, 100
214 | }
215 | MsgBox, out of runes
216 | ExitApp
217 | runeswithdrawal2:
218 |
219 | ;withdrawal essence
220 | MouseMove, ox+89, oy+96, 0 ;first bank slot
221 | Sleep, 100
222 | Click, right
223 | Sleep, 100
224 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
225 | Sleep, 100
226 | Click
227 | Sleep, 100
228 |
229 | Loop, 10 ;check if essence are in inventory
230 | {
231 | PixelSearch, invess2X, invess2Y, ox+617, oy+215, ox+617, oy+215, 0x010000
232 | if ErrorLevel = 0
233 | Goto, invess2
234 | else
235 | MouseMove, ox+89, oy+96, 0 ;first bank slot
236 | Sleep, 100
237 | Click, right
238 | Sleep, 100
239 | MouseMove, ox+89, oy+195, 0 ;right click withdrawal all location in bank
240 | Sleep, 100
241 | Click
242 | Sleep, 100
243 | }
244 | MsgBox, error with invess loop
245 | ExitApp
246 | invess2:
247 |
248 |
249 |
250 |
251 |
252 | MouseMove, ox+714, oy+48, 0 ;click on first checkpoint
253 | Sleep, 10
254 | Click
255 | Sleep, 8500
256 |
257 | Loop, 500 ;look for first checkpoint
258 | {
259 | PixelSearch, checkpoint1X, checkpoint1Y, ox+222, oy+145, ox+222, oy+145, 0x355873
260 | if ErrorLevel = 0
261 | Goto, checkpoint1
262 | else
263 | Sleep, 100
264 | }
265 | MsgBox, error with checkpoint1 loop
266 | ExitApp
267 | checkpoint1:
268 |
269 | MouseMove, ox+698, oy+111, 0 ;click on second checkpoint
270 | Sleep, 10
271 | Click
272 | Sleep, 17500
273 |
274 |
275 | ;check run energy. if above about 90, turn on run
276 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
277 | if ErrorLevel = 0
278 | {
279 | MouseMove, RunX, RunY, 0
280 | Sleep, 10
281 | Click
282 | }
283 |
284 | Loop, 500 ;look for second checkpoint
285 | {
286 | PixelSearch, checkpoint2X, checkpoint2Y, ox+333, oy+99, ox+333, oy+99, 0x30516a
287 | if ErrorLevel = 0
288 | Goto, checkpoint2
289 | else
290 | Sleep, 100
291 | }
292 | MsgBox, error with checkpoint2 loop
293 | ExitApp
294 | checkpoint2:
295 |
296 | MouseMove, ox+285, oy+203, 0 ;click on third checkpoint (right click fairy ring)
297 | Sleep, 10
298 | Click, right
299 | Sleep, 10
300 | MouseMove, ox+285, oy+245, 0 ;click on third checkpoint (click fairy ring)
301 | Sleep, 10
302 | Click
303 | Sleep, 3000
304 | MouseMove, ox+594, oy+305, 0 ;click on third checkpoint (destination fairy ring)
305 | Sleep, 10
306 | Click, 3
307 | Sleep, 3000
308 | MouseMove, ox+258, oy+288, 0 ;click on third checkpoint (travel fairy ring)
309 | Sleep, 10
310 | Click, 3
311 | Sleep, 6000
312 |
313 | Loop, 10 ;look for third checkpoint
314 | {
315 | PixelSearch, checkpoint3X, checkpoint3Y, ox+251, oy+250, ox+251, oy+250, 0x4ca381
316 | if ErrorLevel = 0
317 | Goto, checkpoint3
318 | else
319 | Sleep, 100
320 | }
321 | MsgBox, error with checkpoint3 loop
322 | ExitApp
323 | checkpoint3:
324 |
325 | MouseMove, ox+640, oy+64, 0 ;click on fourth checkpoint
326 | Sleep, 10
327 | Click
328 | Sleep, 15000
329 |
330 | Loop, 500 ;look for fourth checkpoint
331 | {
332 | PixelSearch, checkpoint4X, checkpoint4Y, ox+84, oy+115, ox+84, oy+115, 0x457b96
333 | if ErrorLevel = 0
334 | Goto, checkpoint4
335 | else
336 | Sleep, 100
337 | }
338 | MsgBox, error with checkpoint4 loop
339 | ExitApp
340 | checkpoint4:
341 |
342 | MouseMove, ox+713, oy+82, 0 ;click on fifth checkpoint
343 | Sleep, 50
344 | Click, 3
345 | Sleep, 8000
346 |
347 | Loop, 500 ;look for fifth checkpoint
348 | {
349 | PixelSearch, checkpoint5tX, checkpoint5Y, ox+298, oy+261, ox+298, oy+261, 0x2e4654
350 | if ErrorLevel = 0
351 | Goto, checkpoint5
352 | else
353 | Sleep, 100
354 | }
355 | MsgBox, error with checkpoint5 loop
356 | ExitApp
357 | checkpoint5:
358 |
359 | MouseMove, ox+712, oy+85, 0 ;click on sixth checkpoint
360 | Sleep, 50
361 | Click, 3
362 | Sleep, 8000
363 |
364 | Loop, 500 ;look for sixth checkpoint
365 | {
366 | PixelSearch, checkpoint6X, checkpoint6Y, ox+340, oy+258, ox+340, oy+258, 0x699cb9
367 | if ErrorLevel = 0
368 | Goto, checkpoint6
369 | else
370 | Sleep, 100
371 | }
372 | MsgBox, error with checkpoint6 loop
373 | ExitApp
374 | checkpoint6:
375 |
376 | MouseMove, ox+711, oy+90, 0 ;click on seventh checkpoint
377 | Sleep, 50
378 | Click, 3
379 | Sleep, 8000
380 |
381 | Loop, 500 ;look for seventh checkpoint
382 | {
383 | PixelSearch, checkpoint7X, checkpoint7Y, ox+394, oy+134, ox+394, oy+134, 0x3c6b83
384 | if ErrorLevel = 0
385 | Goto, checkpoint7
386 | else
387 | Sleep, 100
388 | }
389 | MsgBox, error with checkpoint7 loop
390 | ExitApp
391 | checkpoint7:
392 |
393 | MouseMove, ox+712, oy+58, 0 ;click on eighth checkpoint
394 | Sleep, 50
395 | Click, 3
396 | Sleep, 8000
397 |
398 | Loop, 500 ;look for eighth checkpoint
399 | {
400 | PixelSearch, checkpoint8tX, checkpoint8Y, ox+278, oy+106, ox+278, oy+106, 0x626d75
401 | if ErrorLevel = 0
402 | Goto, checkpoint8
403 | else
404 | Sleep, 100
405 | }
406 | MsgBox, error with checkpoint8 loop
407 | ExitApp
408 | checkpoint8:
409 |
410 | MouseMove, ox+188, oy+89, 0 ;click to enter ruins (checkpoint 9)
411 | Sleep, 50
412 | Click, 3
413 | Sleep, 5000
414 |
415 | Loop, 500 ;look for ninth checkpoint
416 | {
417 | PixelSearch, checkpoint9tX, checkpoint9Y, ox+310, oy+170, ox+310, oy+170, 0x1de3f3
418 | if ErrorLevel = 0
419 | Goto, checkpoint9
420 | else
421 | Sleep, 100
422 | }
423 | MsgBox, error with checkpoint9 loop
424 | ExitApp
425 | checkpoint9:
426 |
427 | ;check run energy. if above about 90, turn on run
428 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
429 | if ErrorLevel = 0
430 | {
431 | MouseMove, RunX, RunY, 0
432 | Sleep, 10
433 | Click
434 | }
435 |
436 | MouseMove, ox+257, oy+60, 0 ;click to craft runes (checkpoint 10)
437 | Sleep, 50
438 | Click, 3
439 | Sleep, 6500
440 |
441 | Loop, 500 ;look for tenth checkpoint
442 | {
443 | PixelSearch, checkpoint10X, checkpoint10Y, ox+316, oy+287, ox+316, oy+287, 0x1de5f6
444 | if ErrorLevel = 0
445 | Goto, checkpoint10
446 | else
447 | Sleep, 100
448 | }
449 | MsgBox, error with checkpoint10 loop
450 | ExitApp
451 | checkpoint10:
452 |
453 | MouseMove, ox+577, oy+233, 0 ;empty pouch
454 | Sleep, 100
455 | Click, right
456 | MouseMove, ox+530, oy+273, 0
457 | Sleep, 100
458 | Click
459 | MouseMove, ox+577, oy+233, 0 ;empty pouch
460 | Sleep, 100
461 | Click, right
462 | MouseMove, ox+530, oy+273, 0
463 | Sleep, 100
464 | Click
465 |
466 | MouseMove, ox+260, oy+146, 0 ;click to craft runes from pouch
467 | Sleep, 50
468 | Click, 3
469 | Sleep, 10
470 | Click, 3
471 | Sleep, 3900
472 |
473 | MouseMove, ox+259, oy+323, 0 ;click to exit portal (eleventh checkpoint)
474 | Sleep, 50
475 | Click, 3
476 | Sleep, 6500
477 |
478 |
479 | Loop, 500 ;look for eleventh checkpoint
480 | {
481 | PixelSearch, checkpoint11X, checkpoint11Y, ox+255, oy+208, ox+255, oy+208, 0x252a2e
482 | if ErrorLevel = 0
483 | Goto, checkpoint11
484 | else
485 | Sleep, 100
486 | }
487 | MsgBox, error with checkpoint11 loop
488 | ExitApp
489 | checkpoint11:
490 |
491 | MouseMove, ox+617, oy+140, 0 ;click on twelfth checkpoint
492 | Sleep, 50
493 | Click, 3
494 | Sleep, 8500
495 |
496 |
497 | Loop, 500 ;look for twelfth checkpoint
498 | {
499 | PixelSearch, checkpoint12X, checkpoint12Y, ox+174, oy+132, ox+174, oy+132, 0x376176
500 | if ErrorLevel = 0
501 | Goto, checkpoint12
502 | else
503 | Sleep, 100
504 | }
505 | MsgBox, error with checkpoint12 loop
506 | ExitApp
507 | checkpoint12:
508 |
509 | MouseMove, ox+572, oy+88, 0 ;click on thirteenth checkpoint
510 | Sleep, 50
511 | Click, 3
512 | Sleep, 8500
513 |
514 |
515 | Loop, 500 ;look for thirteenth checkpoint
516 | {
517 | PixelSearch, checkpoint13X, checkpoint13Y, ox+296, oy+91, ox+296, oy+91, 0x39667d
518 | if ErrorLevel = 0
519 | Goto, checkpoint13
520 | else
521 | Sleep, 100
522 | }
523 | MsgBox, error with checkpoint14 loop
524 | ExitApp
525 | checkpoint13:
526 |
527 | MouseMove, ox+570, oy+68, 0 ;click on fourteenth checkpoint
528 | Sleep, 50
529 | Click, 3
530 | Sleep, 8500
531 |
532 | Loop, 500 ;look for fourteenth checkpoint
533 | {
534 | PixelSearch, checkpoint14X, checkpoint14Y, ox+195, oy+115, ox+195, oy+115, 0x3f7088
535 | if ErrorLevel = 0
536 | Goto, checkpoint14
537 | else
538 | Sleep, 100
539 | }
540 | MsgBox, error with checkpoint14 loop
541 | ExitApp
542 | checkpoint14:
543 |
544 | MouseMove, ox+574, oy+97, 0 ;click on fifteenth checkpoint
545 | Sleep, 10
546 | Click
547 | Sleep, 8500
548 |
549 | Loop, 500 ;look for fifteenth checkpoint
550 | {
551 | PixelSearch, checkpoint15X, checkpoint15Y, ox+115, oy+288, ox+115, oy+288, 0x22323c
552 | if ErrorLevel = 0
553 | Goto, checkpoint15
554 | else
555 | Sleep, 100
556 | }
557 | MsgBox, error with checkpoint15 loop
558 | ExitApp
559 | checkpoint15:
560 |
561 | MouseMove, ox+604, oy+104, 0 ;click on sixteenth checkpoint
562 | Sleep, 10
563 | Click
564 | Sleep, 8500
565 |
566 | ;check run energy. if above about 90, turn on run
567 | PixelSearch, RunX, RunY, ox+588, oy+131, ox+588, oy+131, 0x596160 ;run 90% energy
568 | if ErrorLevel = 0
569 | {
570 | MouseMove, RunX, RunY, 0
571 | Sleep, 10
572 | Click
573 | }
574 |
575 | Loop, 500 ;look for sixteenth checkpoint
576 | {
577 | PixelSearch, checkpoint16X, checkpoint16Y, ox+308, oy+197, ox+308, oy+197, 0x6293ae
578 | if ErrorLevel = 0
579 | Goto, checkpoint16
580 | else
581 | Sleep, 100
582 | }
583 | MsgBox, error with checkpoint16 loop
584 | ExitApp
585 | checkpoint16:
586 |
587 | MouseMove, ox+375, oy+198, 0 ;click on seventeenth checkpoint (right click fairy ring)
588 | Sleep, 100
589 | Click, right
590 | Sleep, 100
591 | MouseMove, ox+375, oy+236, 0 ;click on seventeenth checkpoint (click fairy ring)
592 | Sleep, 100
593 | Click
594 | Sleep, 8000
595 | MouseMove, ox+594, oy+267, 0 ;click on seventeenth checkpoint (destination fairy ring)
596 | Sleep, 10
597 | Click, 3
598 | Sleep, 6000
599 | MouseMove, ox+258, oy+288, 0 ;click on seventeenth checkpoint (travel fairy ring)
600 | Sleep, 10
601 | Click, 3
602 | Sleep, 7000
603 |
604 | Loop, 500 ;look for seventeenth checkpoint
605 | {
606 | PixelSearch, checkpoint17X, checkpoint17Y, ox+57, oy+249, ox+57, oy+249, 0x1a2432
607 | if ErrorLevel = 0
608 | Goto, checkpoint17
609 | else
610 | Sleep, 100
611 | }
612 | MsgBox, error with checkpoint17 loop
613 | ExitApp
614 | checkpoint17:
615 |
616 | MouseMove, ox+572, oy+89, 0 ;click on eighteenth checkpoint
617 | Sleep, 10
618 | Click
619 | Sleep, 18500
620 |
621 | Loop, 500 ;look for eighteenth checkpoint
622 | {
623 | PixelSearch, checkpoint18X, checkpoint18Y, ox+22, oy+241, ox+22, oy+241, 0x203a48
624 | if ErrorLevel = 0
625 | Goto, checkpoint18
626 | else
627 | Sleep, 100
628 | }
629 | MsgBox, error with checkpoint18 loop
630 | ExitApp
631 | checkpoint18:
632 |
633 | MouseMove, ox+578, oy+89, 0 ;click on nineteenth (final) checkpoint
634 | Sleep, 10
635 | Click
636 | Sleep, 12000
637 | continue
638 | }
639 |
640 |
641 | ^q::ExitApp
642 |
643 |
644 |
645 |
646 |
--------------------------------------------------------------------------------
/ahk/OSRSNatureRunecrafting/Orient1 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSNatureRunecrafting/Orient1 1.png
--------------------------------------------------------------------------------
/ahk/OSRSNatureRunecrafting/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSNatureRunecrafting/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSVarPowerMining/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSVarPowerMining/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/OSRSVarPowerMining/PNGs/BankOrient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/OSRSVarPowerMining/PNGs/BankOrient.png
--------------------------------------------------------------------------------
/ahk/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/Setupx64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Setupx64.exe
--------------------------------------------------------------------------------
/ahk/Universal GIMPs and PNGs/Orient1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Universal GIMPs and PNGs/Orient1.PNG
--------------------------------------------------------------------------------
/ahk/Universal GIMPs and PNGs/loginmenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Universal GIMPs and PNGs/loginmenu.png
--------------------------------------------------------------------------------
/ahk/Universal GIMPs and PNGs/loginmenupost.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/takelley1/OSRS-AHKScripts/ab2c900c320e214d7e100106d6483e13e8f97b5a/ahk/Universal GIMPs and PNGs/loginmenupost.png
--------------------------------------------------------------------------------
/ahk/VarPowerMining.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases.
2 | #NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases.
3 | #Warn ;Enable warnings to assist with detecting common errors.
4 | SendMode Input ;Recommended for new scripts due to its superior speed and reliability.
5 |
6 | ;begin in mining guild in dwarven mine at iron patch closest to bank chest
7 | ;client must be oriented north (click compass) and camera must be tilted all the way upwards (hold "Up" arrow key)
8 | ;client must also be fully zoomed out and brightness set at default (second tick mark from the left)
9 | ;logot menu tab must be situated so "click here to logout" button is visible, NOT the world-switcher list
10 |
11 | ;about 2 min to fill inventory
12 | ;right click menu options have a vertical height of 14 pixels
13 |
14 | CoordMode, Pixel, Screen
15 | CoordMode, Mouse, Screen
16 | #Persistent
17 | InvDeposited := 0
18 | OreDeposited := 0
19 |
20 | Random, TimerVariationRoll, 10000, 20000
21 | SetTimer, AbortLogout, 3600000
22 | Mining()
23 |
24 | Mining()
25 | {
26 | Global
27 | ImageSearch, OrientX, OrientY, 0, 0, A_Screenwidth, A_Screenheight, Orient1.png ;orient client by searching whole screen for prayer hud icon
28 | if ErrorLevel = 0
29 | {
30 | MouseMove, OrientX, OrientY ;move mouse to top left pixel of prayer hud menu icon to create new origin point for coordinate system
31 | MouseMove, -696, -171, 0, R ;0, 0 ;coordinates from prayer icon to origin point
32 | MouseGetPos, ox, oy ;use current position of mouse as origin point for coordinate system
33 | }
34 | else
35 | {
36 | MsgBox, Can’t find client!
37 | ExitApp
38 | }
39 |
40 | CheckFirstRock:
41 | FullInvCheck()
42 | MinimapCheck() ;check if character is in the correct position
43 |
44 | PixelSearch, FirstFullX, FirstFullY, ox+274, oy+153, ox+274, oy+153, 0x313137, 15, Fast ;check if First rock is "full" (contains mine-able ore) by looking for absence of the "depleted" color
45 | if ErrorLevel ;if rock is full, mine ore
46 | {
47 | Random, varyby6, -6, 6
48 | Random, varyby7, -7, 7
49 | MouseMove, ox+varyby6+257, oy+varyby7+146, 0 ;click on rock
50 | Random, wait150to350milis, 150, 350
51 | Sleep, wait150to350milis
52 | Click, down
53 | Random, wait5to150milis, 5, 150
54 | Sleep, wait5to150milis
55 | Click, up
56 | Random, DoubleClickRoll, 1, 50 ;small chance to double-click on rock
57 | if DoubleClickRoll = 1
58 | {
59 | Random, wait90to250milis, 90, 250
60 | Sleep, wait90to250milis
61 | Click, down
62 | Random, wait5to150milis, 5, 150
63 | Sleep, wait5to150milis
64 | Click, up
65 | }
66 | ResumeMiningRoll := RandomSleep()
67 | if ResumeMiningRoll = 1
68 | Goto, CheckFirstRock
69 | if ResumeMiningRoll = 2
70 | Goto, CheckSecondRock
71 | Gui, Destroy
72 | Loop, 150 ;wait until rock has been mined (either by you or someone else)
73 | {
74 | PixelSearch, FirstEmptyX, FirstEmptyY, ox+274, oy+153, ox+274, oy+153, 0x313137, 15, Fast
75 | if ErrorLevel = 0 ;if rock has been mined, check if inv is full
76 | {
77 | Gui, Destroy
78 | FullInvCheck()
79 | Goto, CheckSecondRock ;if inv is not full, check the other rock for ore
80 | }
81 | else ;if rock has not been mined, wait and check again
82 | {
83 | Sleep, 5
84 | LogoutCheck()
85 | DisconnectCheck()
86 | Gui, Add, Text, ,Waiting until First Rock is depleted / %InvDeposited% Invs deposited (~%OreDeposited% Ore)
87 | Gui, Show, Y15, Msgbox
88 | }
89 | }
90 | Gui, Destroy
91 | Goto, CheckSecondRock ;if waiting for rock to be mined times out, check other rock
92 | }
93 | else ;if rock is not full, check other rock
94 | Goto, CheckSecondRock
95 |
96 | CheckSecondRock:
97 | FullInvCheck()
98 | MinimapCheck()
99 |
100 | PixelSearch, SecondFullX, SecondFullY, ox+290, oy+170, ox+294, oy+174, 0x3b3b40, 15, Fast ;check if Second rock is full
101 | if ErrorLevel ;if rock is full, mine ore
102 | {
103 | Random, varyby6, -6, 6
104 | Random, varyby7, -7, 7
105 | MouseMove, ox+varyby6+282, oy+varyby7+171, 0
106 | Random, wait150to350milis, 150, 350
107 | Sleep, wait150to350milis
108 | Click, down
109 | Random, wait5to150milis, 5, 150
110 | Sleep, wait5to150milis
111 | Click, up
112 | Random, DoubleClickRoll, 1, 50 ;small chance to double-click on rock
113 | if DoubleClickRoll = 1
114 | {
115 | Random, wait90to250milis, 90, 250
116 | Sleep, wait90to250milis
117 | Click, down
118 | Random, wait5to150milis, 5, 150
119 | Sleep, wait5to150milis
120 | Click, up
121 | }
122 | ResumeMiningRoll := RandomSleep()
123 | if ResumeMiningRoll = 1
124 | Goto, CheckFirstRock
125 | if ResumeMiningRoll = 2
126 | Goto, CheckSecondRock
127 | Gui, Destroy
128 | Loop, 150 ;wait until rock has been mined or is empty
129 | {
130 | PixelSearch, SecondEmptyX, SecondEmptyY, ox+290, oy+170, ox+294, oy+174, 0x3b3b40, 15, Fast
131 | if ErrorLevel = 0 ;if rock has been mined, check if inv is full
132 | {
133 | FullInvCheck()
134 | Goto, CheckFirstRock
135 | }
136 | else ;if rock has not been mined, wait and check again
137 | {
138 | Sleep, 5
139 | LogoutCheck()
140 | DisconnectCheck()
141 | Gui, Add, Text, ,Waiting until Second Rock is depleted / %InvDeposited% Invs deposited (~%OreDeposited% Ore)
142 | Gui, Show, Y15, Msgbox
143 | }
144 | }
145 | Gui, Destroy
146 | Goto, CheckFirstRock
147 | }
148 | else ;if Second rock is empty, wait, then check First rock again
149 | {
150 | Random, wait200to500milis, 200, 500
151 | Sleep, wait200to500milis
152 | Goto, CheckFirstRock
153 | }
154 | Goto, CheckFirstRock
155 | }
156 |
157 | ^q::ExitApp
158 | ^p::Pause
159 |
--------------------------------------------------------------------------------