Code: Select all
#Include <classMemory>
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn All, Off ; #Warn eables warnings to assist with detecting common errors, while "all, off" makes them all disabled
#HotkeyInterval 1000 ; This is the default value (milliseconds).
#MaxHotkeysPerInterval 200
#MaxThreadsPerHotkey 1
#SingleInstance
#WinActivateForce ; need to test it
; #NoTrayIcon
DetectHiddenWindows, Off
SendMode Input
#Include Gdip_all_2.ahk
Gdip_Startup()
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetBatchLines, -1
SetWinDelay, -1
SetControlDelay, -1
CoordMode, Mouse, Screen
if (_ClassMemory.__Class != "_ClassMemory")
{
msgbox class memory not correctly installed.
ExitApp
}
mem := new _ClassMemory("ahk_exe ldvboxheadless.exe", "", hProcessCopy)
if !IsObject(mem)
{
if (hProcess = "")
msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
else msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter.
ExitApp
}
SetFormat, float, 0.0
access:
Gui, +HwndMainBotWindow
Gui +LastFound +AlwaysOnTop
Gui, +AlwaysOnTop +hwndGUIHwnd
Menu MenuMenu, Add, &Open...`tCtrl+O, open
Menu MenuMenu, Icon, &Open...`tCtrl+O, shell32.dll, 4
Menu MenuMenu, Add, &Save`tCtrl+S, save
Menu MenuMenu, Icon, &Save`tCtrl+S, shell32.dll, 259
Menu MenuBar, Add, &Menu, :MenuMenu
Gui Menu, MenuBar
Gui, Add, text, x+ y+ w60 h20 , Tempo:
Gui, Add, Edit, x50 y0 w60 h20 vTempo,
Gui Add, CheckBox, x8 y80 w60 h20 gbTest vtest, OK
gui, add, Checkbox, x20 y132 vcave2
gui, add, text, x10 y25 w45 h25 vandando,
gui, add, text, x55 y25 w55 h25 vmovendo,
Gui, Add, Edit, x110 y112 h60 ys w60 vText2 hwndhouse_pos_x1
Gui, Add, Edit, x170 y112 h60 ys w60 vText1 hwndhouse_pos_y1
;Gui, Add, Button, x160 y10 w60 h20 ggetpos_life_4 vgetpos_life_4, Area
Gui, Add, Button, x56 y110 w50 h20 ggetpos_point_1 vgetpos_point_1, get pos
gui, add, Checkbox, x20 y112 vcave
Gui Add, CheckBox, x4 y58 w120 h23 gblurando vlurando, Lurando
;Gui Add, Edit, x136 y55 w82 h21 gcod vlast_used_login Center ReadOnly , %last_used_login%
global house_pos_x1
global house_pos_y1
global tempo
global atk
global liberado
global house_pos_y8
global y1
global x1
global last_used_login
IniRead, last_used_login, Settings.ini, bot variables, last_used_login
GuiControl,, last_used_login, %last_used_login%
if last_used_login
gosub, cod
gui, Show,, Cave Bot
#Persistent
settimer, menu, 100 ; to overwrite settings only if main window has been shown
settimer, como, 100 ; to overwrite settings only if main window has been shownss
settimer, fechar, 500 ; to overwrite settings only if main window has been shown
;settimer, levelup, 1000 ; to overwrite settings only if main window has been shown
settimer, loot, 300 ; to overwrite settings only if main window has been shown
settimer, atk1, 800 ; to overwrite settings only if main window has been shown
settimer, clicar2, 3000 ; to overwrite settings only if main window has been shown
global manaa
global x
global y
global andando
global aandando
global target
global afk
global tempo
global t
global afk1
global level
global movendo
global c
global Contentsx
global Contentsy
global go
liberado = 1
return
cod:
gui,submit,nohide
global addressmana:= % "0x" . last_used_login
return
menu:
SetFormat, float, 0.0
vip := mem.write(addressmana + 0x1A4 ,16777472, "int")
x:= mem.read(addressmana + 0x168,"Int" )
y:= mem.read(addressmana + 0x16C,"Int" )
andando:= mem.read(addressmana + 0x16C,"Int" )
movendo:= mem.read(addressmana + 0x44,"UChar" )
manaa:= mem.read(addressmana, "Int")
target:= mem.read(addressmana - 0x5C, "UChar")
life:= mem.read(addressmana - 0x14,"Int" )
level:= mem.read(addressmana - 0x4, "Int")
return
open:
Gui, Submit, Nohide
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.ini)
if (SelectedFile = "")
return
IniRead, house_pos_x1, %SelectedFile%, bot variables, house_pos_x1
IniRead, house_pos_y1, %SelectedFile%, bot variables, house_pos_y1
GuiControl,, house_pos_x1, %house_pos_x1%
GuiControl,, house_pos_y1, %house_pos_y1%
return
fechar:
IfWinNotExist, Elder Bot 1.0
{
MsgBox, 16,, Abra o Bot primeiro !..
exitapp
}
return
getpos_point_1:
Gui Submit, NoHide
CoordMode, ToolTip, Window
CoordMode, Mouse, Window
CoordMode, Pixel, Window
WinActivate, LDPlayer
WinMinimize, ahk_id %MainBotWindow%
return
a::
Gui Submit, NoHide
While(!GetKeyState("ctrl")){
ToolTip,Press ""Ctrl"" to set Point
}
click
sleep, 300
if (x > -1)
if (y > -1)
posx:= x
posy:= y
Contentsx:= posx "`n" text1
Contentsy:= posy "`n" text2
GuiControl,,% house_pos_x1, % Contentsx
GuiControl,,% house_pos_y1, % Contentsy
WinActivate, ahk_id %MainBotWindow%
ToolTip
return
btest:
gui,submit,nohide
If (test=1){
settimer, test, on
t:= 0
}
else
{
settimer, test, off
t:= off
}
return
loot:
if( movendo = 0)
{
GuiControl,, movendo, Parado
go := 1
}
Else
{
GuiControl,, movendo, andando
ControlSend, RenderWindow1, {l}, LDPlayer
go := 0
}
return
atk1:
if( target = 0)
{
atk := 0
}
Else
{
atk := 1
}
return
blurando:
gui,submit,nohide
If (lurando=1){
atk:= 0
SetTimer, atk1, off
}
else
{
settimer, test, off
SetTimer, atk1, 800
}
return
levelup:
if (level = 124)
{
WinClose, LDPlayer
}
return
test:
Gui, Submit, NoHide
if (test)
SetFormat, float, 0.0
Images =
(LTrim
%Contentsx% %Contentsy%
)
loop{
Loop, Parse, Images, `n, `r
{
sleep, %tempo%
if (atk = 0)
{ ; pos 1
if (cave=1)
{
If (t = 0)
{
If (go = 1)
{
GuiControl,, Move, 1
posxx := mem.write(addressmana + 0x168 ,Contentsx, "int")
posyy := mem.write(addressmana + 0x16c ,Contentsy, "int")
gosub, show_it ;~1
}}}}
}}
return
show_it:
{
settimer, clicar, 300
sleep, 400
settimer, clicar, off
}
return
clicar:
CoordMode, Pixel, screen
PixelSearch,px,py,X_Pos,Y_Pos,cx2,cy2, 0x0000FF, 5, Fast RGB
If ((errorLevel = 0) AND (target = 0) AND (go = 1) )
loop,1
{
sleep, 300
py := py+4
px := px+1
ControlClick, x%px% y%py%, LDPlayer,, Left, 1, NA
sleep, 300
c := 1
}
return
clicar2:
CoordMode, Pixel, screen
PixelSearch,px,py,X_Pos,Y_Pos,cx2,cy2, 0x0000FF, 5, Fast RGB
If (errorLevel = 0)
{
if (go = 1)
{
if (c = 1)
{
loop,1
{
sleep, 300
py := py+4
px := px+1
ControlClick, x%px% y%py%, LDPlayer,, Left, 1, NA
c := 0
}
}}}
return
como:
if (x > "-1") && (y > "-1")
{
sleep, 1000
;GuiControl,, andando, Andando
vai := 1
}
else
{
sleep, 600
vai := 0
}
return
SetSystemCursor( Cursor = "", cx = 0, cy = 0 )
{
BlankCursor := 0, SystemCursor := 0, FileCursor := 0 ; init
SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS
,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE
,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL
,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP
If Cursor = ; empty, so create blank cursor
{
VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
BlankCursor = 1 ; flag for later
}
Else If SubStr( Cursor,1,4 ) = "IDC_" ; load system cursor
{
Loop, Parse, SystemCursors, `,
{
CursorName := SubStr( A_Loopfield, 6, 15 ) ; get the cursor name, no trailing space with substr
CursorID := SubStr( A_Loopfield, 1, 5 ) ; get the cursor id
SystemCursor = 1
If ( CursorName = Cursor )
{
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
Break
}
}
If CursorHandle = ; invalid cursor name given
{
Msgbox,, SetCursor, Error: Invalid cursor name
CursorHandle = Error
}
}
Else If FileExist( Cursor )
{
SplitPath, Cursor,,, Ext ; auto-detect type
If Ext = ico
uType := 0x1
Else If Ext in cur,ani
uType := 0x2
Else ; invalid file ext
{
Msgbox,, SetCursor, Error: Invalid file type
CursorHandle = Error
}
FileCursor = 1
}
Else
{
Msgbox,, SetCursor, Error: Invalid file path or cursor name
CursorHandle = Error ; raise for later
}
If CursorHandle != Error
{
Loop, Parse, SystemCursors, `,
{
If BlankCursor = 1
{
Type = BlankCursor
%Type%%A_Index% := DllCall( "CreateCursor"
, Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If SystemCursor = 1
{
Type = SystemCursor
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
%Type%%A_Index% := DllCall( "CopyImage"
, Uint,CursorHandle, Uint,0x2, Int,cx, Int,cy, Uint,0 )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If FileCursor = 1
{
Type = FileCursor
%Type%%A_Index% := DllCall( "LoadImageA"
, UInt,0, Str,Cursor, UInt,uType, Int,cx, Int,cy, UInt,0x10 )
DllCall( "SetSystemCursor", Uint,%Type%%A_Index%, Int,SubStr( A_Loopfield, 1, 5 ) )
}
}
}
}
return
RestoreCursors()
{
SPI_SETCURSORS := 0x57
DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 )
}
return
getpos_life_4:
WinActivate, LDPlayer
WinMinimize, ahk_id %MainBotWindow%
Set_Position()
return
Set_Position(){
SPOS()
}
#If (Pos_Setting_Active=1)
*Lbutton::
if(TL=1)
TL:=2
else if(TL=2&&OB=0){
Gui,3:Destroy
Pos_Setting_Active:=0
SetTimer,Draw_Cross,Off
MsgBox, Area Configurada.
WinActivate, ahk_id %MainBotWindow%
}
return
SPOS(){
global
Gui,3:-Caption -DPIScale +LastFound +E0x80000 +ToolWindow +AlwaysOnTop
Gui,3:Show,x0 y0 w%A_ScreenWidth% h%A_ScreenHeight% NA
hwnd1:=WinExist(),hbm := CreateDIBSection(A_ScreenWidth,A_ScreenHeight),hdc := CreateCompatibleDC(),obm := SelectObject(hdc,hbm)
G := Gdip_GraphicsFromHDC(hdc),Gdip_SetSmoothingMode(G,4),UpdateLayeredWindow(hwnd1, hdc, 0, 0,A_ScreenWidth,A_ScreenHeight)
Br1:=New_Brush("ff0066","ff"),Br2:=New_Brush("12e854","55"),Br3:=New_Brush("de0d0a","aa")
UpdateLayeredWindow(hwnd1, hdc),Pos_Setting_Active:=1,TL:=1
SetTimer,Draw_Cross,10
}
Draw_Cross:
Gdip_GraphicsClear(G)
if(TL=1){
MouseGetPos,cx,cy
Fill_Box(G,Br1,0,cy,A_ScreenWidth,1),Fill_Box(G,Br1,cx,0,1,A_ScreenHeight)
GuiControl,1:,X_Pos,% cx
GuiControl,1:,Y_Pos,% cy
X_Pos:=cx,Y_Pos:=cy
}
else if(TL=2){
MouseGetPos,cx2,cy2
if(cx2-cx>=0&&cy2-cy>=0){
OB:=0
Fill_Box(G,Br1,0,cy2,A_ScreenWidth,1),Fill_Box(G,Br1,cx2,0,1,A_ScreenHeight),Fill_Box(G,Br1,0,cy,A_ScreenWidth,1)
Fill_Box(G,Br1,cx,0,1,A_ScreenHeight),Fill_Box(G,Br2,cx,cy,cx2-cx,cy2-cy)
GuiControl,1:,W_Pos,% cx2 - cx
GuiControl,1:,H_Pos,% cy2 - cy
}
else if(cx2-cx>=0&&cy2-cy<0){
OB:=1
Fill_Box(G,Br1,0,cy2,A_ScreenWidth,1),Fill_Box(G,Br1,cx2,0,1,A_ScreenHeight),Fill_Box(G,Br1,0,cy,A_ScreenWidth,1)
Fill_Box(G,Br1,cx,0,1,A_ScreenHeight),Fill_Box(G,Br3,cx,cy2,cx2-cx,cy-cy2)
GuiControl,1:,W_Pos,% (cx2 - cx)
GuiControl,1:,H_Pos,% (cy2 - cy)*-1
}
else if(cx2-cx<0&&cy2-cy>=0){
OB:=1
Fill_Box(G,Br1,0,cy2,A_ScreenWidth,1),Fill_Box(G,Br1,cx2,0,1,A_ScreenHeight),Fill_Box(G,Br1,0,cy,A_ScreenWidth,1)
Fill_Box(G,Br1,cx,0,1,A_ScreenHeight),Fill_Box(G,Br3,cx2,cy,cx-cx2,cy2-cy)
GuiControl,1:,W_Pos,% (cx2 - cx)*-1
GuiControl,1:,H_Pos,% (cy2 - cy)
}
else if(cx2-cx<0&&cy2-cy<0){
OB:=1
Fill_Box(G,Br1,0,cy2,A_ScreenWidth,1),Fill_Box(G,Br1,cx2,0,1,A_ScreenHeight),Fill_Box(G,Br1,0,cy,A_ScreenWidth,1)
Fill_Box(G,Br1,cx,0,1,A_ScreenHeight),Fill_Box(G,Br3,cx2,cy2,cx-cx2,cy-cy2)
GuiControl,1:,W_Pos,% (cx2 - cx)*-1
GuiControl,1:,H_Pos,% (cy2 - cy)*-1
}
}
UpdateLayeredWindow(hwnd1, hdc)
return
New_Brush(colour:="000000",Alpha:="FF"){
new_colour := "0x" Alpha colour
DllCall("gdiplus\GdipCreateSolidFill", "UInt", new_colour, A_PtrSize ? "UPtr*" : "UInt*", pBrush)
return pBrush
}
Fill_Box(pGraphics,pBrush,x,y,w,h) {
Ptr := A_PtrSize ? "UPtr" : "UInt"
return DllCall("gdiplus\GdipFillRectangle", Ptr, pGraphics, Ptr, pBrush, "float", x, "float", y, "float", w, "float", h)
}
save(){
FileSelectFile, SelectedFile, S16, , Open a file, Text Documents (*.ini)
SelectedFile .= ".ini"
GuiControlGet, house_pos_x1,, house_pos_x1
GuiControlGet, house_pos_y1,, house_pos_y1
IniWrite, %house_pos_x1%, %SelectedFile%, bot variables, house_pos_x1
IniWrite, %house_pos_y1%, %SelectedFile%, bot variables, house_pos_y1
}
return
GuiClose:
ExitApp
return