My pixelbot for WoW gets slow sometimes, question with code

Ask gaming related questions (AHK v1.1 and older)
wdh1974
Posts: 2
Joined: 21 May 2022, 06:58

My pixelbot for WoW gets slow sometimes, question with code

Post by wdh1974 » 21 May 2022, 07:54

It will simply stop working until i move my character or manually press the button im wanting pressed. Im using the FFFFFF color, not sure if thats a problem. Its in world of warcraft game.


Code: Select all

#IfWinActive, World of Warcraft
#NoEnv
SetWorkingDir %A_ScriptDir%
SendMode Input
CoordMode, Pixel, Window

$Numpad4::

PixelGetColor, color, 758, 1310, RGB
If color = 0x12e9c4
{
Send, {F5}
Return
}

PixelGetColor, color, 770, 1298, RGB
If color = 0xe7d48a
{
Send, {F6}
Return
}

PixelGetColor, color, 765, 1298, RGB
If color = 0x6ac2ff
{
Send, {F7}
Return
}

PixelGetColor, color, 756, 1324, RGB
If color = 0xfcb6f7
{
Send, {F8}
Return
}

PixelGetColor, color, 791, 1315, RGB
If color = 0x3bd575
{
Send, {F9}
Return
}

Return
[Mod edit: [code][/code] tags added.]
Last edited by gregster on 21 May 2022, 08:51, edited 1 time in total.
Reason: Removed duplicate topic.

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: My pixelbot for WoW gets slow sometimes, question with code

Post by mikeyww » 21 May 2022, 08:23

You can understand what color is found by displaying its value. #If pertains only to hotkeys & hotstrings. Since you are using a hotkey, the routine requires triggering your hotkey-- because that is how you programmed the script. You can shorten your script to test just one pixel check. Get it working. After that, you can expand your script.

wdh1974
Posts: 2
Joined: 21 May 2022, 06:58

Re: My pixelbot for WoW gets slow sometimes, question with code

Post by wdh1974 » 21 May 2022, 09:04

i used windowspy and it says the colors of the location im focusing is FFFFFF, maybe solid white is the problem or the color has some opacity to it,

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: My pixelbot for WoW gets slow sometimes, question with code

Post by mikeyww » 21 May 2022, 09:38

I would shorten the script so that you can test just one pixel color. Display that color within the script itself. You can post your revision below.

Code: Select all

x = 758
y = 1310
winTitle = World of Warcraft

#If WinActive(winTitle)
Numpad4::
SoundBeep, 1500
MouseMove, x, y
PixelGetColor, rgb, x, y, RGB ; Coordinates relative to active window
MsgBox, 64, Color, %rgb%
Return
#If

Post Reply

Return to “Gaming Help (v1)”