Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;___________________
; [Options]
;___________________
StartAfk=F8
ExitApp=F9
;____________________
Hotkey,%StartAfk%,Start
Hotkey,%ExitApp%,Exit
Return
;____________________
Start:
WinMove, Minecraft, , , , 1280, 720
loop
{
Command("setspawn") ;\
Command("is") ; commands
Command("skyblock") ;/
InventoryChecking() ;inv check
Dig(10) ;lines
}
Return
;____________________
Exit:
ExitApp
Return
;____________________
Command(string){
SendInput {T}
Wait(500)
Send /%string%
Wait(1000)
SendInput {Enter}
Wait(200)
}
Dig(int){
SendInput {LButton down}
Move(int)
SendInput {LButton up}
}
Move(int){
loop, %int%{
Press("D", 159)
Press("S", 0)
Press("A", 159)
Press("W", 0)
}
}
InventoryChecking(){
x := 503
y := 385
l := 0
i := 0
SendInput {e}
loop, 27{ ;inv lines
if(i = 9){
i := 0
l++
}
Wait(200)
setMPos(x +36*i, y + 35*l)
DropGold()
i++
}
SendInput {e}
Wait(100)
}
dropGold(){
goldcolor := 0x808080
color:= getColor()
if(color = goldcolor){
sendInput, {LCtrl down}{Q}
Wait(100)
SendInput {LCtrl up}
}
}
getColor(){
MouseGetPos, X,Y
PixelGetColor, color, %X%, %Y%
return color
}
Press(charkey, dist){
t := getTimeFromDis(dist)
SendInput {%charkey% down}
Wait(t)
SendInput {%charkey% up}
}
getTimeFromDis(s){
t:=0
t:= s*235
return t
}
setMPos(x, y){
MouseMove,x,y
}
Wait(s){
sleep, s
}