Help to make a GUI

Ask gaming related questions (AHK v1.1 and older)
michelxd15
Posts: 132
Joined: 08 Aug 2019, 02:02

Help to make a GUI

Post by michelxd15 » 24 Jun 2020, 09:45

hello guys i have several codes i would like to create a GUI with them but i don't know how to do it and i need help
In the case each code below makes a function and I would like to place them in a GUI where each one would be linked by a checkbox,
can someone help me ?

below codes:

RUN CODE :

Code: Select all

#persistent
SetTimer, anti_paralyze, 100
anti_paralyze:
IfWinNotActive, Tibia
	Return
CoordMode, Pixel, Screen
PixelSearch,,, 1192, 314, 1254, 314, 0xE90404, 0, Fast RGB
If ErrorLevel
	Return 
Send {f2}
Return
HEALING CODE:

Code: Select all

#SingleInstance, Force
CoordMode, Pixel, Screen ; need this since you are using screen coordinates
Loop
{
	If WinActive("Tibia")
	{
		PixelGetColor, ExuraGran, 1285, 143, RGB
		PixelGetColor, ExuraVita, 1270, 143, RGB
		If (ExuraGran != 0xDB4F4F And ExuraVita != 0xDB4F4F) ; this assumes neither are found
			Send, {-}
		Else If (ExuraGran != 0xDB4F4F) ; this assumes the first one is not found
			Send, {=}
	}
	Sleep, 180
}
Return
ANTI PARALIZE

Code: Select all

#persistent
SetTimer, anti_paralyze, 100
anti_paralyze:
IfWinNotActive, Tibia
	Return
CoordMode, Pixel, Screen
PixelSearch,,, 1192, 314, 1254, 314, 0xE90404, 0, Fast RGB
If ErrorLevel
	Return 
Send {=}
Return
AUTO ATTACK:

Code: Select all

#IfWinActive, Tibia

Wheeldown::
Send {f5}
return
LOOT DROP

Code: Select all

#IfWinActive, Tibia
x := 675
y := 299

pgup::
SetMouseDelay, 2
 {
   mousegetpos, start_x, start_y
   send, {ctrl down}
   mouseClickDrag, left, %start_x%, %start_y%, %x%, %y%
   send, {ctrl up}
   send {enter}
   mousemove, %start_x%, %start_y%, 0
 }
return
ENERGY RING:

Code: Select all

#SingleInstance, Force
CoordMode, Pixel, Screen
Loop
{
	If WinActive("Tibia")
	{
		PixelGetColor, Life70, 1272, 143, RGB
		PixelGetColor, RingWorn, 1209, 272, RGB
		if (Life70 != 0xDB4F4F && RingWorn != 0x59E7B4) ; life is less than 70% and ring is not worn
			Send, {NumpadMult} ; put ring on

		PixelGetColor, Life90, 1285, 143, RGB
		PixelGetColor, RingWorn, 1209, 272, RGB
		if (Life90 = 0xDB4F4F && RingWorn = 0x59E7B4) ; life is at least 90% and ring is worn
			Send, {NumpadMult} ; remove ring
	}
	Sleep, 200
}
Return

remembering that each code corresponds to a function that will be activated only if the checkbox is selected
Last edited by BoBo on 24 Jun 2020, 10:04, edited 1 time in total.

jugs90
Posts: 14
Joined: 22 Jan 2022, 18:53

Re: HELP TO MAKE A GUI

Post by jugs90 » 24 Jan 2022, 08:33

Hello

i want to use it but tell me its works with obs ?

Code: Select all

#SingleInstance, Force
CoordMode, Pixel, Screen
Loop
{
	If WinActive("Tibia")
	{
		PixelGetColor, Life70, 1272, 143, RGB
		PixelGetColor, RingWorn, 1209, 272, RGB
		if (Life70 != 0xDB4F4F && RingWorn != 0x59E7B4) ; life is less than 70% and ring is not worn
			Send, {NumpadMult} ; put ring on

		PixelGetColor, Life90, 1285, 143, RGB
		PixelGetColor, RingWorn, 1209, 272, RGB
		if (Life90 = 0xDB4F4F && RingWorn = 0x59E7B4) ; life is at least 90% and ring is worn
			Send, {NumpadMult} ; remove ring
	}
	Sleep, 200
}
Return

Post Reply

Return to “Gaming Help (v1)”