Hi, I need a simple tibia healer that checks pixel colors to determine my HP, if its low presses a hotkey.
I do found an old post with the following script but I cannot get working.
If anyone would help me out to get this working I would pay 10$ worth of Bitcoin or Etherium alternative Paypal. Thanks.
here is the script:
#SingleInstance, Force
SetKeyDelay,0
x40 := 1050
x75 := 1075
HealthY := 163
Loop,
{
If WinActive("Tibia")
{
PixelGetColor, Check75, %x75%, %HealthY%
PixelGetColor, Check40, %x40%, %HealthY%
If (Check75 != 0x7D7DFF And Check40 != 0x7D7DFF)
Send, {F2}
Else If (Check75 != 0x7D7DFF)
Send, {F3}
}
Sleep, 1000
}
Return
Tibia Healer
-
- Posts: 1
- Joined: 13 Feb 2018, 04:11
- eventhorizon
- Posts: 158
- Joined: 27 Oct 2016, 14:22
Re: Tibia Healer
the way i normally check for healing in mmo games is to put the mouse cursor on a specific place on the dharacter's health bar and record the color there. You can put the value and location in an ini file or directly into the script itself or even straight into a temporary variable then you make a hotkey routine to check for the color when you need to. I generally put the call to check the health in a gosub in my fight routine so each pass through the fight checks the health and heals if needed.
here are some short routines that you can use in your own code to check and verify colors on your screen. I can't write a full heal routine for you because 1. i don't have the game and 2. dont know the keybinds that would send your heal. Also save your money. i don't accept money for trying to help others on this board. I don't think many here will. All we ask is that you try to learn how to code using Autohotkey and help others as you grow.
Code: Select all
; this routine puts the x y and color in a variable and splits it off
; into the retval array. This allows you to grab color and location
; and use them directly in a script or routine.
;retvalary1 is the x location. retvalary2 is the y location and
;retvalary3 is the color found there. to use this routine place
; your mouse on the screen where you want to grab the color
;then press Shift-Alt-u to make the grab.
+!u:: ;<- returns retval string and retval array
suspend permit
tkFastGrab:
retval := fntkFastGrab() ;<- grab the color from the screen where the mouse is
;msgBox, 0x1000, Line%A_LineNumber%, retval = %retval% ;<- message box for testing
stringsplit, retvalary, retval, " " ;<- break the retval string down into parts in the retval array
return
; create a space separated retval loc & color string
fntkFastGrab()
{ MouseGetPos, fgmx, fgmy ;<- get the mouse position x and y coordinates
pixelGetColor, fgColor, %fgmx%, %fgmy%, Alt Slow RGB ;<- get the color where the mouse is
retval = %fgmx% %fgmy% %fgcolor% ;space separated values ;<- build a string with the x and y values and the color
;msgBox, 0x1000, Line%A_LineNumber%, coords=%fgmx%`,%fgmy% color=%fgcolor% ;<- message box for testing
return (retval) ;<- return the string you just built
}
;Use shift-alt-v to check the color you retrieved with the other routine against the color
; that is on the screen
+!v:: check the color at the xyc location in the retvalary
suspend, permit
checkAgainstRetval:
check := fnCheckColorAt(retvalary1, retvalary2, retvalary3) ;<- use the retval ary to check the color on screen
if (check) ;<- if color is good then no action needed
return
;color is bad so
msgbox, 0x1000, Line%A_LineNumber%, color check failed colors are different.
; do heal or other routine here
; here is where you'll put your sends, clicks, or whatever other actions you need
; to do to heal your character or respond to the color change you just detected.
; the message box is there to remind you that the colors were a mismatch.
; return
fnCheckColorAt(x,y,tstcolor) ;check color at xy loc
{ curcolor := fnGetColorAt(x,y) ;<- get color at the designated x y location on the screen
if (curcolor = tstcolor) ;<- if the two colors match it's all good
Return (True)
return (False)
}
fnGetColorAt(x,y) ;find color at xy loc
{ pixelGetColor, thiscolor, %x%, %y%, alt slow RGB
sleep 200
return (thiscolor)
}
A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila.
Re: Tibia Healer
I really tried to maky it on my own but i can't . Can u write to me in facebook or so and help me with it? will be very grateful
Who is online
Users browsing this forum: No registered users and 64 guests