Auto Boot Throw AHK Script

Posts 46–60 of 71 · Page 4 of 5
Quote Originally Posted by nilotaviano View Post
Bot is broken due to today's (23/07) patch
Someone already found the new offsets, so search in your script the following lines:
Code:
    WaterAddress := GetAddressWater(Base,0x00964208) 
    LavaAddress := GetAddressLava(Base,0x00964208) 
    ChocoAddress := GetAddressChoco(Base,0x00964208)
replace by this:
Code:
    WaterAddress := GetAddressWater(Base,0x0097E114) 
    LavaAddress := GetAddressLava(Base,0x0097E114) 
    ChocoAddress := GetAddressChoco(Base,0x0097E114)
Maybe your bot only have the WaterAddress line, then only change this line.


Or use this script, I'm not the author:
Quote Originally Posted by nilotaviano View Post
Testing it now.

Edit: Confirmed working for water, updated the pointer on my script. Still not working for Lava and Choco.

Ctrl + j to start it, ctrl + k to stop.

Code:
#WinActivateForce

^j::
  shouldRun = 1
  if !setupDone
  {
    WinGet, pidn, PID, A
    pid := pidn
    WinGet, hwnds, ID, A
    Handle := hwnds
    Base := getProcessBaseAddress()
    WaterAddress := GetAddressWater(Base,0x0097E114) 
    LavaAddress := GetAddressLava(Base,0x0097E114) 
    ChocoAddress := GetAddressChoco(Base,0x0097E114) 
    setupDone = 1
  }
  Loop
  {
    if shouldRun
    {
      ControlSend, , {c down}, ahk_pid %pid%
      Sleep, 86
      ControlSend, , {c up}, ahk_pid %pid%
      Sleep, 500
	  
      ControlSend, , {f down}, ahk_pid %pid%
      Sleep, 86
      ControlSend, , {f up}, ahk_pid %pid%
	  
      Catch := 0
      PoleCheck := 40

      While Catch = 0 
      {
        If (PoleCheckN = PoleCheck)
        {
          ControlSend, , {f down}, ahk_pid %pid%
          Sleep, 86
          ControlSend, , {f up}, ahk_pid %pid%
        }
        
        CaughtWater := ReadMemory(WaterAddress)
        CaughtLava := ReadMemory(LavaAddress)
        CaughtChoco := ReadMemory(ChocoAddress)
        
        If (CaughtWater = 1 or CaughtLava = 1 or CaughtChoco = 1)
        {
          ControlSend, , {f down}, ahk_pid %pid%
          Sleep, 86
          ControlSend, , {f up}, ahk_pid %pid%
          Random, Wait, 2000, 3500
          Sleep, %Wait%
          Catch := 1
        }
        else 
        {
          PoleCheckN := PoleCheckN +1
          Sleep, 1000
        }
        
        FindAndDropBoots()
      }
    }
    else
    {
      Return
    }
  }
Return

GetAddressWater(Base, Address)
{
  pointerBase := base + Address
  y1 := ReadMemory(pointerBase)
  y2 := ReadMemory(y1 + 0x144)
  y3 := ReadMemory(y2 + 0xe4)
  Return WaterAddress := (y3 + 0x70) 
}

GetAddressLava(Base, Address)
{
  pointerBase := base + Address
  y1 := ReadMemory(pointerBase)
  y2 := ReadMemory(y1 + 0x144)
  y3 := ReadMemory(y2 + 0xe4)
  Return LavaAddress := (y3 + 0x514) 
}

GetAddressChoco(Base, Address)
{
  pointerBase := base + Address
  y1 := ReadMemory(pointerBase)
  y2 := ReadMemory(y1 + 0x144)
  y3 := ReadMemory(y2 + 0xe4)
  Return ChocoAddress := (y3 + 0x2c0) 
}

getProcessBaseAddress()
{
  Global Handle
  return DllCall( A_PtrSize = 4
  ? "GetWindowLong"
  : "GetWindowLongPtr"
  , "Ptr", Handle
  , "Int", -6
  , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
  ; If DLL call fails, returned value will = 0
} 

ReadMemory(MADDRESS)
{
  Global pid
  VarSetCapacity(MVALUE,4,0)
  ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
  ;DllCall("ReadProcessMemory","UInt",ProcessHandle, "UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
  DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
  Loop 4
  result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
  return, result
}

FindAndDropBoots()
{
  Imagesearch, Foundx, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 c:\boot.bmp
  
  While errorlevel = 0
  {
    MouseClickDrag, Left, %FoundX%, %FoundY%, 779, 412
    Imagesearch, Foundx, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 c:\boot.bmp
  }
}

^k::
  shouldRun = 0
Return

Quote Originally Posted by die254 View Post
Hey, I havent checked it today, but since there was no updates to Trove I dont know why it is not working... Please check your code to see if you missed something.
Restart my PC did the work
@die254 wow bro very nice work do you mind if i put ur code into my thread?
Quote Originally Posted by taejim View Post
@die254 wow bro very nice work do you mind if i put ur code into my thread?
Use it at will
Quote Originally Posted by die254 View Post
Use it at will
do i need to screenshot only the boot alone in the inventory or what?

and can someone show me the original boot.bmp i cant find it.

EDIT : hey man i found the original boot.bmp and i downloaded it now it works , auto throwing the boots thank alot man keep up the good work BUT the weird thing is i need to put my mouse course in the inventory is that normal??
if someone want i have work code

#WinActivateForce

Numpad6::
WinGet, pidn, PID, A
pid := pidn
WinGet, hwnds, ID, A
Handle := hwnds
;InputBox, Lure, Lure's, How many Lure's do you have in inventory
Lure := 9999
Base := getProcessBaseAddress()
WaterAddress := GetAddressWater(Base,0x0097E114)
Loop %Lure%
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Sleep, 2000
CaughtWater := ReadMemory(WaterAddress)
Timer := 0
While Timer = 0
{
Loop
{
If (CaughtWater = 1)
{
Break
}
if Timer = 40
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Break
}
Sleep, 1000
CaughtWater := ReadMemory(WaterAddress)
Timer := Timer + 1
}
}
Timer := 0
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Sleep, 2000
}
ExitApp


Numpad9::
ExitApp

getProcessBaseAddress()
{
Global Handle
return DllCall( A_PtrSize = 4
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", Handle
, "Int", -6
, "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
; If DLL call fails, returned value will = 0
}

GetAddressWater(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return WaterAddress := (y3 + 0x70)
}

ReadMemory(MADDRESS)
{
Global pid
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
;DllCall("ReadProcessMemory","UInt",ProcessHandle, "UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}
If the *50 part is the percentage of pixels, you should use 10%. It won't throw out anything wrong and will work in more cases.
Quote Originally Posted by Milecar12 View Post
If the *50 part is the percentage of pixels, you should use 10%. It won't throw out anything wrong and will work in more cases.
its the shade variation:

*n (variation): Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, *2 would allow two shades of variation. This parameter is helpful if the coloring of the image varies slightly or if ImageFile uses a format such as GIF or JPG that does not accurately represent an image on the screen. If you specify 255 shades of variation, all colors will match. The default is 0 shades.

I can change it but I need someone to keep testing it till I find a good setting.


EDIT: Ive changed it to *70(It doesnt work with *100 or more) and it seems to work normally, can someone test it for me?

Its risky because it can throw away Rare Fish and other stuff.. I do need a tester

- - - Updated - - -

UPDATE: 25/7/15

This is an improvement to the Throw boots and an update to the fishing bot:

 
last working fishing bot(thanks to Taejim) and Throw boots
#WinActivateForce

Numpad6::
WinGet, pidn, PID, A
pid := pidn
WinGet, hwnds, ID, A
Handle := hwnds
Lure := 9999
Base := getProcessBaseAddress()
WaterAddress := GetAddressWater(Base,0x0097E114)
LavaAddress := GetAddressLava(Base,0x0097E114)
ChocoAddress := GetAddressChoco(Base,0x0097E114)

LureCount := 0
Loop %Lure%
{
LureCount := LureCount +1
ControlSend, , {c down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {c up}, ahk_pid %pid%
Sleep, 500
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Catch := 0
PoleCheck := 40

Loop
{
If (Catch = 1)
{
break
}
else
{
If (PoleCheckN = PoleCheck)
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
LureCount := 0
}
else
{
}
CaughtWater := ReadMemory(WaterAddress)
CaughtLava := ReadMemory(LavaAddress)
CaughtChoco := ReadMemory(ChocoAddress)
If (CaughtWater = 1 or CaughtLava = 1 or CaughtChoco = 1)
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Random, Wait, 2000, 3500
Sleep, %Wait%
Catch := 1
}
else
{
PoleCheckN := PoleCheckN +1
Sleep, 1000
}
}
Imagesearch, Foundx, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *70 c:\boot.bmp
if errorlevel = 0
{
MouseClickDrag, Left, %FoundX%, %FoundY%, 779, 412
}
}
}
ExitApp

Numpad7::
ExitApp

GetAddressWater(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return WaterAddress := (y3 + 0x70)
}

GetAddressLava(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return LavaAddress := (y3 + 0x514)
}

GetAddressChoco(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return ChocoAddress := (y3 + 0x2c0)
}

getProcessBaseAddress()
{
Global Handle
return DllCall( A_PtrSize = 4
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", Handle
, "Int", -6
, "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
; If DLL call fails, returned value will = 0
}

ReadMemory(MADDRESS)
{
Global pid
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
;DllCall("ReadProcessMemory","UInt",ProcessHandle, "UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}


Please give me some feedback to see if it is working better and to see if it doesnt throw away any other stuff.(Ive tested and for me its working perfectly) Thanks and Enjoy
Quote Originally Posted by die254 View Post
its the shade variation:

*n (variation): Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, *2 would allow two shades of variation. This parameter is helpful if the coloring of the image varies slightly or if ImageFile uses a format such as GIF or JPG that does not accurately represent an image on the screen. If you specify 255 shades of variation, all colors will match. The default is 0 shades.

I can change it but I need someone to keep testing it till I find a good setting.


EDIT: Ive changed it to *70(It doesnt work with *100 or more) and it seems to work normally, can someone test it for me?

Its risky because it can throw away Rare Fish and other stuff.. I do need a tester

- - - Updated - - -

UPDATE: 25/7/15

This is an improvement to the Throw boots and an update to the fishing bot:

 
last working fishing bot(thanks to Taejim) and Throw boots
#WinActivateForce

Numpad6::
WinGet, pidn, PID, A
pid := pidn
WinGet, hwnds, ID, A
Handle := hwnds
Lure := 9999
Base := getProcessBaseAddress()
WaterAddress := GetAddressWater(Base,0x0097E114)
LavaAddress := GetAddressLava(Base,0x0097E114)
ChocoAddress := GetAddressChoco(Base,0x0097E114)

LureCount := 0
Loop %Lure%
{
LureCount := LureCount +1
ControlSend, , {c down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {c up}, ahk_pid %pid%
Sleep, 500
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Catch := 0
PoleCheck := 40

Loop
{
If (Catch = 1)
{
break
}
else
{
If (PoleCheckN = PoleCheck)
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
LureCount := 0
}
else
{
}
CaughtWater := ReadMemory(WaterAddress)
CaughtLava := ReadMemory(LavaAddress)
CaughtChoco := ReadMemory(ChocoAddress)
If (CaughtWater = 1 or CaughtLava = 1 or CaughtChoco = 1)
{
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 86
ControlSend, , {f up}, ahk_pid %pid%
Random, Wait, 2000, 3500
Sleep, %Wait%
Catch := 1
}
else
{
PoleCheckN := PoleCheckN +1
Sleep, 1000
}
}
Imagesearch, Foundx, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *70 c:\boot.bmp
if errorlevel = 0
{
MouseClickDrag, Left, %FoundX%, %FoundY%, 779, 412
}
}
}
ExitApp

Numpad7::
ExitApp

GetAddressWater(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return WaterAddress := (y3 + 0x70)
}

GetAddressLava(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return LavaAddress := (y3 + 0x514)
}

GetAddressChoco(Base, Address)
{
pointerBase := base + Address
y1 := ReadMemory(pointerBase)
y2 := ReadMemory(y1 + 0x144)
y3 := ReadMemory(y2 + 0xe4)
Return ChocoAddress := (y3 + 0x2c0)
}

getProcessBaseAddress()
{
Global Handle
return DllCall( A_PtrSize = 4
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", Handle
, "Int", -6
, "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
; If DLL call fails, returned value will = 0
}

ReadMemory(MADDRESS)
{
Global pid
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
;DllCall("ReadProcessMemory","UInt",ProcessHandle, "UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}


Please give me some feedback to see if it is working better and to see if it doesnt throw away any other stuff.(Ive tested and for me its working perfectly) Thanks and Enjoy

The only problem you might have with shade variation could be with Ancient Fish - that's the only fish which has a similar color palette to the old boot.
i have a problem, my bot only drag a boot where i crop it from my screenshot. need helps thx.
Quote Originally Posted by ryuzryuz View Post
i have a problem, my bot only drag a boot where i crop it from my screenshot. need helps thx.
Maybe your taking a bad Screenshot. Take a look at the are from the original Boot.bmp make sure that your new image uses the same area.

Quote Originally Posted by Milecar12 View Post



The only problem you might have with shade variation could be with Ancient Fish - that's the only fish which has a similar color palette to the old boot.
For me its working perfectly, ive tested with the ancient fish and it works great, it doesnt throw them away.

Quote Originally Posted by mirabella View Post
Hello die254 and boys, I have the problem that I do not know how to put codes someone could help me?
Thank you.
Hey, Download the AutoHotKey program, create a new script and put the code there.
Hello die254 and boys, I have the problem that I do not know how to put codes someone could help me?
Thank you.
I don't get it how to make it throw the boots... I got it that I need a screenshot...
the mouse works on the screen shot but not in the game...
Quote Originally Posted by FrostBiteBN View Post
do i need to screenshot only the boot alone in the inventory or what?

and can someone show me the original boot.bmp i cant find it.

EDIT : hey man i found the original boot.bmp and i downloaded it now it works , auto throwing the boots thank alot man keep up the good work BUT the weird thing is i need to put my mouse course in the inventory is that normal??
No, you just need to have The Trove window open since this doesnt work in the background.

- - - Updated - - -

Quote Originally Posted by snipe76 View Post
I don't get it how to make it throw the boots... I got it that I need a screenshot...
the mouse works on the screen shot but not in the game...
Get the Boot.bmp from my first post and follow the instructions.
boots arent throwing anymore after update but the fishing is still working.
Nice seems to work really well.
Posts 46–60 of 71 · Page 4 of 5

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?