Minecraft afk script

Ask gaming related questions
f1ghter
Posts: 1
Joined: 21 Jan 2021, 09:12

Minecraft afk script

Post by f1ghter » 21 Jan 2021, 09:21

Hi, i need help with this script. I want to remove inventory checking and drop items but when i delete it theres error always D: I want only move option ( a,d ), dig option and commands

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
}

Return to “Gaming”