getpixelcolour problem
Best Answer Exaskryz , 09 October 2015 - 02:15 PM
Hello
use this script to get the pixels and then paste them in to your script, also make sure that WOW is activated
X:: Clipboard = MouseGetPos,xx,yy PixelGetcolor, pix, %xx%,%yy% Clipboard = PixelGetcolor, pix, %xx%,%yy%`nIfEqual, pix, %pix%, { `nsend {e}`nsleep 200`n} return #ifWinActive, World of Warcraft loop { break } return
- Download link of my scripts on Autohotkey.com 2/10/2015 [DOWNLAND]
- Contact Info: https://github.com/floowsnaake // FloowSnaake(A)gmail.com
- IF you need Help send me a PM,Email or Post on Github
- Quote by tank Posted 29 September 2015 - 06:14 PM
- "Eventually i will find a way to convert the DB back to PHPBB3. but i dont have the bandwidth right now. No one that has tried has had success. It is the Only way i can keep this open is if i could successfully convert it."
#ifWinActive, World of Warcraft
Loop
{
CoordMode, Pixel
PixelGetColor, castbar, 758, 402
if (castbar = "0x96C8C1"){
sleep 100
}
else if (castbar != "0x96C8C1"){
send {e}
sleep 100
}
}
return
@Everyone the #IfWinActive directive applies to hotkeys and hotstrings, not to auto-execute code. If you want a loop to run only for a particular window, see below.
@ajc1981, my suspicion is that you are using the British spelling of Colour. Try Color in PixelGetColor
. When I tried to put PixelGetColour into my script, I was told it was an unrecognized action.
For that window-sensitive loop, I would do it like this (there are multiple ways)
Loop { WinWaitActive, World of Warcraft pixelgetcolor, castbar, 758,402 IfNotEqual, castbar, 0x96C8C1 send e sleep 200 } return ; the script will technically never reach here
The return within a loop would end the loop because it ends the thread. I could have completely removed it from the script, but it's good habit to get used to putting return at the end of related lines.
I also noticed you had a typo on the IfNotEqual command. You put two i's instead of one. The rest of your code looks good to me.
Finally, you can see I used the command WinWaitActive.
hi guys thanks for the replys not had chance to look at this yet been busy with work will get round to doing this maybe this weekend and post back if i've got it to work
ok guys thank you so much for the help been trying all weekend to get this to work but it just keeps firing the key e all the time without a brake donno whats wrong as i think i have the right pixelcolor
Ok tried another script with no luck, here is the problem I have with the first script, it keeps spamming the e key all the time, so it's not picking up the changes to color I think or it's not seeing the game or something so I tried another script which is
The key "+0" does not exist, so when you specify a key {+0} nothing is sent. It's still trying to send it, but it fails. When you use +{0}
, the key "0" exists, so it can do Shift+0 for you.
Are you seeing the Traytip report back the value 0x1E0502 and it still does the Send command?
You can also try running your script as an administrator.
The key "+0" does not exist, so when you specify a key {+0} nothing is sent. It's still trying to send it, but it fails. When you use
+{0}
, the key "0" exists, so it can do Shift+0 for you.
Are you seeing the Traytip report back the value 0x1E0502 and it still does the Send command?
You can also try running your script as an administrator.
Ok, got it to work now at long last here is the main problem there was no way I could get fixed color so I had to make my own one it works now the traytip I added because I wanted to know if it could find the code but it was firing off the cmd all the time even thou traytip was saying a different code.
is there away to delay the key press to say 750ms once the color is found ?
worked it out now myself