What's new

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Some random ahk tips some people might find useful

G

GettinLazy

Member
Joined
Jan 28, 2021
Messages
3
There are three fun things I never see get used enough in ahk scripts for botting...


Here is a short example that uses all 3 in a simple form:



Random, YourVariable, 250, 500 ; the number %YourVariable% is a random number between 250 and 500
;furthermore the above variable format can be used for coordinate ranges as well wink wink nudge nudge
F1::
Goto Label1 ; Jumps to the Label 'Label1' when you press F1 and if no hotkey is specified it jumps automatically


Label1:
Loop,
{
PixelGetColor, Color, 730 , 400 ; searches the specified coordinates and saves the color in hex as the variable 'Color'
If Color = 0xFFFFFF ; If the variable 'Color' is 0xFFFFFF which is white it does what you put below
Break ;Hops out of the loop
Sleep, %YourVariable% ; 250 to 500 milliseconds randomly
}
Click, whatever, whatever
Run, anythingintotheground.exe ; literally do anything before jumping to the next label
Goto Label2 ; jumps to the next label

Label2:
Loop,
{
PixelGetColor, Color1, 1052, 733, RGB
PixelGetColor, Color2, 973, 462, RGB ; two different variables and two different coordinates

if (Color1 = 0xFFFFFF) or (Color2 = 0x000000) ; One of the countless simple ways to use if statements and variables to create logic
Break
Sleep, %YourVariable%
)
; You can extend the variable logic here and if you go nuts on predefining variables you can do just about anything
Goto Label3

Label3:
MsgBox, Today you learned PixelGetColor, basic variables, and goto statements are surprisingly effective.
Sleep, 5000
ExitApp



Edited for some clarity and extra tips.
 
Last edited:
T

TheXp

Member
Joined
Jan 29, 2021
Messages
6
is this the droppinbg script ? AHK pking scripts are great too :)
 
B

BigBoyDonkey

Member
Joined
Apr 23, 2021
Messages
5
Cool tips literally been making basic ass scripts
 
T

titball99

Member
Joined
May 1, 2021
Messages
5
Thanks you men very cool nice gogogogo
 
Top