Idk if im just being stupid af but this code
Code: Select all
#SingleInstance, force
#NoEnv
#Include Gdip_All.ahk
SendMode Input
SetTitleMatchMode, 3
setbatchlines, -1
WinSetTitle, Minecraft 1.8.9,, Mine1
sleep, 10000
ControlSend, , {1}, %win_title%
global win_title:="Mine1"
pToken := Gdip_Startup()
Lobby()
{
SetKeyDelay, 0, 50
sleep, 500
ControlSend, , t, %win_title%
Sleep, 30
ControlSend, , /, %win_title%
Sleep, 30
ControlSend, , s, %win_title%
Sleep, 30
ControlSend, , k, %win_title%
Sleep, 30
ControlSend, , y, %win_title%
Sleep, 30
ControlSend, , b, %win_title%
Sleep, 30
ControlSend, , l, %win_title%
Sleep, 30
ControlSend, , o, %win_title%
Sleep, 30
ControlSend, , c, %win_title%
sleep, 30
ControlSend, , k, %win_title%
sleep, 30
ControlSend, , {enter}, %win_title%
Sleep, 5000
ControlSend, , t, %win_title%
Sleep, 30
ControlSend, , /, %win_title%
Sleep, 30
ControlSend, , i, %win_title%
Sleep, 30
ControlSend, , s, %win_title%
sleep, 30
ControlSend, , {enter}, %win_title%
sleep, 5000
Gdip_DisposeImage(pBitmap)
reload
}
loop
{
Loop, 16
{
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down, NA
sleep, 100
ControlSend, , {s up}, %win_title%
sleep, 100
ControlSend, , {a up}, %win_title%
sleep, 100
ControlSend, , {w down}, %win_title%
sleep, 100
ControlSend, , {d down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up, NA
ControlSend, , {w up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
pBitmap := Gdip_BitmapFromHWND(WinExist(win_title))
x:=9 , y:=37 ,w:=1899 ,h:=841
area_bitmap:=Gdip_CloneBitmapArea(pBitmap, x, y, w, h)
argb:=0xFF0000
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
Gdip_DisposeImage(pBitmap)
sleep,100
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down, NA
sleep, 100
ControlSend, , {w up}, %win_title%
sleep, 100
ControlSend, , {d up}, %win_title%
sleep, 100
ControlSend, , {w down}, %win_title%
sleep, 100
ControlSend, , {a down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up, NA
ControlSend, , {w up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
pBitmap := Gdip_BitmapFromHWND(WinExist(win_title))
x:=9 , y:=37 ,w:=1899 ,h:=841
area_bitmap:=Gdip_CloneBitmapArea(pBitmap, x, y, w, h)
argb:=0xFF0000
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
Gdip_DisposeImage(pBitmap)
}
sleep, 100
Loop, 16
{
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down, NA
sleep, 100
ControlSend, , {w up}, %win_title%
sleep, 100
ControlSend, , {a up}, %win_title%
sleep, 100
ControlSend, , {s down}, %win_title%
sleep, 100
ControlSend, , {d down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up, NA
ControlSend, , {s up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
pBitmap := Gdip_BitmapFromHWND(WinExist(win_title))
x:=9 , y:=37 ,w:=1899 ,h:=841
area_bitmap:=Gdip_CloneBitmapArea(pBitmap, x, y, w, h)
argb:=0xFF0000
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
Gdip_DisposeImage(pBitmap)
sleep, 100
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down, NA
sleep, 100
ControlSend, , {d up}, %win_title%
sleep, 100
ControlSend, , {s down}, %win_title%
sleep, 100
ControlSend, , {a down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up, NA
ControlSend, , {s up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
pBitmap := Gdip_BitmapFromHWND(WinExist(win_title))
x:=9 , y:=37 ,w:=1899 ,h:=841
area_bitmap:=Gdip_CloneBitmapArea(pBitmap, x, y, w, h)
argb:=0xFF0000
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
Gdip_DisposeImage(pBitmap)
}
}
;#####################################################################################
Gdip_PixelSearch(pBitmap, ARGB, ByRef x, ByRef y, variation)
{
static MCode_PixelSearch
if !MCode_PixelSearch
MCode_PixelSearch := MCode("2,x86:VVdWU4PsEItMJDCLRCQ0i3QkOIXJjVEDD0nRi0wkLMH6AoXJD46RAAAAicEPtvzHRCQIAAAAAA+26MH5EIk8JA+2+Yl8JASNPJUAAAAAiXwkDIt8JCSLRCQoMcmFwH5IixSPD7bCKeiJw8H7HzHYKdg58H8qD7bGKwQkicPB+x8x2CnYOfB/F8HqEA+20itUJASJ0MH4HzHCKcI58n5Bg8EBOUwkKHW4g0QkCAEDfCQMi0QkCDlEJCx1m4tEJDzHAP////+LRCRAxwD/////g8QQuP////9bXl9dw410JgCLRCQ8i3wkCIkIi0QkQIk4g8QQMcBbXl9dww==,x64:QVdBVkFVQVRVV1ZTSIPsGESLlCSIAAAARYXJQY1BA0GJ1UmJzEQPSMiLlCSAAAAARYnGQcH5AkSJTCQMRYXAD46KAAAAidcPtvZFMf8x7cH/EEQPttpJY91AD7b/RYXtfmBJY8cxyU2NDIQPH0QAAEGLFIkPtsJEKdhBicBBwfgfRDHARCnARDnQfy0PtsYp8EGJwEHB+B9EMcBEKcBEOdB/FsHqEA+20in6idDB+B8xwinCRDnSfj9Ig8EBSDnLda6DxQFEA3wkDEE57nWOSIuEJJAAAADHAP////9Ii4QkmAAAAMcA/////7j/////6xxmDx9EAABIi4QkkAAAAIkISIuEJJgAAACJKDHASIPEGFteX11BXEFdQV5BX8M=")
Gdip_GetImageDimensions(pBitmap, Width, Height)
if !(Width && Height)
return -1
if (E1 := Gdip_LockBits(pBitmap, 0, 0, Width, Height, Stride1, Scan01, BitmapData1))
return -2
x := y := 0
E := DllCall(MCode_PixelSearch, "ptr", Scan01, "int", Width, "int", Height, "int", Stride1, "uint", ARGB, "int", variation, "int*", x, "int*", y)
Gdip_UnlockBits(pBitmap, BitmapData1)
return (E = "") ? -3 : E
}
MCode(mcode)
{
static e := {1:4, 2:1}, c := (A_PtrSize=8) ? "x64" : "x86"
if (!regexmatch(mcode, "^([0-9]+),(" c ":|.*?," c ":)([^,]+)", m))
return
if (!DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", 0, "uint*", s, "ptr", 0, "ptr", 0))
return
p := DllCall("GlobalAlloc", "uint", 0, "ptr", s, "ptr")
if (c="x64")
DllCall("VirtualProtect", "ptr", p, "ptr", s, "uint", 0x40, "uint*", op)
if (DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", p, "uint*", s, "ptr", 0, "ptr", 0))
return p
DllCall("GlobalFree", "ptr", p)
}
^h::Exitapp
^k::Pause
this code
Code: Select all
#SingleInstance, force
#NoEnv
#Include Gdip_All.ahk
SendMode Input
SetTitleMatchMode, 3
setbatchlines, -1
WinSetTitle, Minecraft 1.8.9,, Mine1
sleep, 10000
ControlSend, , {1}, %win_title%
global win_title:="Mine1"
pToken := Gdip_Startup()
pBitmap := Gdip_BitmapFromHWND(WinExist(win_title))
x:=798 , y:=392 ,w:=1539 ,h:=845
area_bitmap:=Gdip_CloneBitmapArea(pBitmap, x, y, w, h)
argb:=0xFF0000
Lobby()
{
SetKeyDelay, 0, 50
sleep, 500
ControlSend, , t, %win_title%
Sleep, 30
ControlSend, , /, %win_title%
Sleep, 30
ControlSend, , s, %win_title%
Sleep, 30
ControlSend, , k, %win_title%
Sleep, 30
ControlSend, , y, %win_title%
Sleep, 30
ControlSend, , b, %win_title%
Sleep, 30
ControlSend, , l, %win_title%
Sleep, 30
ControlSend, , o, %win_title%
Sleep, 30
ControlSend, , c, %win_title%
sleep, 30
ControlSend, , k, %win_title%
sleep, 30
ControlSend, , {enter}, %win_title%
Sleep, 5000
ControlSend, , t, %win_title%
Sleep, 30
ControlSend, , /, %win_title%
Sleep, 30
ControlSend, , i, %win_title%
Sleep, 30
ControlSend, , s, %win_title%
sleep, 30
ControlSend, , {enter}, %win_title%
sleep, 5000
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
reload
}
loop
{
Loop, 16
{
SetKeyDelay, 50, 50
SetMouseDelay, 50
ControlClick, , %win_title%,, Left, , Down NA
sleep, 100
ControlSend, , {s up}, %win_title%
sleep, 100
ControlSend, , {a up}, %win_title%
sleep, 100
ControlSend, , {w down}, %win_title%
sleep, 100
ControlSend, , {d down}, %win_title%
sleep, 33650
ControlClick, , Minecraft2,, Left, , Up NA
ControlSend, , {w up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
sleep, 100
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
sleep,100
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down NA
sleep, 100
ControlSend, , {w up}, %win_title%
sleep, 100
ControlSend, , {d up}, %win_title%
sleep, 100
ControlSend, , {w down}, %win_title%
sleep, 100
ControlSend, , {a down}, %win_title%
sleep, 33650
ControlClick, , Minecraft2,, Left, , Up NA
ControlSend, , {w up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
sleep, 100
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
}
sleep, 100
Loop, 16
{
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down NA
sleep, 100
ControlSend, , {w up}, %win_title%
sleep, 100
ControlSend, , {a up}, %win_title%
sleep, 100
ControlSend, , {s down}, %win_title%
sleep, 100
ControlSend, , {d down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up NA
ControlSend, , {s up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
sleep, 100
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
sleep, 100
SetKeyDelay, 50, 50
ControlClick, , %win_title%,, Left, , Down NA
sleep, 100
ControlSend, , {d up}, %win_title%
sleep, 100
ControlSend, , {s down}, %win_title%
sleep, 100
ControlSend, , {a down}, %win_title%
sleep, 33650
ControlClick, , %win_title%,, Left, , Up NA
ControlSend, , {s up}, %win_title%
ControlSend, , {d up}, %win_title%
ControlSend, , {a up}, %win_title%
sleep, 100
if !Gdip_PixelSearch(pBitmap, ARGB, x, y, 3)
{
Lobby()
}
}
}
;#####################################################################################
Gdip_PixelSearch(pBitmap, ARGB, ByRef x, ByRef y, variation)
{
static MCode_PixelSearch
if !MCode_PixelSearch
MCode_PixelSearch := MCode("2,x86:VVdWU4PsEItMJDCLRCQ0i3QkOIXJjVEDD0nRi0wkLMH6AoXJD46RAAAAicEPtvzHRCQIAAAAAA+26MH5EIk8JA+2+Yl8JASNPJUAAAAAiXwkDIt8JCSLRCQoMcmFwH5IixSPD7bCKeiJw8H7HzHYKdg58H8qD7bGKwQkicPB+x8x2CnYOfB/F8HqEA+20itUJASJ0MH4HzHCKcI58n5Bg8EBOUwkKHW4g0QkCAEDfCQMi0QkCDlEJCx1m4tEJDzHAP////+LRCRAxwD/////g8QQuP////9bXl9dw410JgCLRCQ8i3wkCIkIi0QkQIk4g8QQMcBbXl9dww==,x64:QVdBVkFVQVRVV1ZTSIPsGESLlCSIAAAARYXJQY1BA0GJ1UmJzEQPSMiLlCSAAAAARYnGQcH5AkSJTCQMRYXAD46KAAAAidcPtvZFMf8x7cH/EEQPttpJY91AD7b/RYXtfmBJY8cxyU2NDIQPH0QAAEGLFIkPtsJEKdhBicBBwfgfRDHARCnARDnQfy0PtsYp8EGJwEHB+B9EMcBEKcBEOdB/FsHqEA+20in6idDB+B8xwinCRDnSfj9Ig8EBSDnLda6DxQFEA3wkDEE57nWOSIuEJJAAAADHAP////9Ii4QkmAAAAMcA/////7j/////6xxmDx9EAABIi4QkkAAAAIkISIuEJJgAAACJKDHASIPEGFteX11BXEFdQV5BX8M=")
Gdip_GetImageDimensions(pBitmap, Width, Height)
if !(Width && Height)
return -1
if (E1 := Gdip_LockBits(pBitmap, 0, 0, Width, Height, Stride1, Scan01, BitmapData1))
return -2
x := y := 0
E := DllCall(MCode_PixelSearch, "ptr", Scan01, "int", Width, "int", Height, "int", Stride1, "uint", ARGB, "int", variation, "int*", x, "int*", y)
Gdip_UnlockBits(pBitmap, BitmapData1)
return (E = "") ? -3 : E
}
MCode(mcode)
{
static e := {1:4, 2:1}, c := (A_PtrSize=8) ? "x64" : "x86"
if (!regexmatch(mcode, "^([0-9]+),(" c ":|.*?," c ":)([^,]+)", m))
return
if (!DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", 0, "uint*", s, "ptr", 0, "ptr", 0))
return
p := DllCall("GlobalAlloc", "uint", 0, "ptr", s, "ptr")
if (c="x64")
DllCall("VirtualProtect", "ptr", p, "ptr", s, "uint", 0x40, "uint*", op)
if (DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", p, "uint*", s, "ptr", 0, "ptr", 0))
return p
DllCall("GlobalFree", "ptr", p)
}
^h::Exitapp
^n::Pause
i would like to know why this happens