Jump to content
AC Tool Forums

pktrainr1

Members
  • Content Count

    4
  • Joined

  • Last visited

About pktrainr1

  • Rank
    Newbie
  1. Thanks @The WABBIT! This was the part I couldn't figure out since several steps are needed. You laid it out for me perfectly and I now have an idea how to press forward. I do have 2 questions about this. 1. I defined the constants for $MatchPurpleR,G,B, however, the the values are often off by -2 to +2 for the same pixel. Any idea on how to get around this? This is what I previously used but I'm not sure if there's a better way around this. LoadRGB $TopBox compute $redvariance = ({RGBRed} - $tYellowR) * ({RGBRed} - $tYellowR) compute $greenvariance = ({RGBGreen} - $tYellowG) * ({RGBGreen} - $tYellowG) compute $bluevariance = ({RGBBlue} - $tYellowB) * ({RGBBlue} - $tYellowB) If $redvariance < 5 And $greenvariance < 5 And $bluevariance < 5 Set MatchColor = mYellow else //continue with all the colors end 2. Why is "IsRed,G,B" still needed in the beggining when LoadRGB already being used? I'm not quite understanding this. I appreciate you taking time to help me. Thanks!
  2. Thank you for all the tips @Ego @The WABBIT. I've taken what you've provided me so far to further speed up my script and it worked wonders. The script is for a mobile game with 7 different mini-games. Six of the games have static pixels so it wasn't really a problem to set up a script once I understood how to further use constants. The last game however, is a bit tricky. Please see the attached images. Basically, the top box is your goal to match. You must slide the bottom row left or right so that the color directly below the top box matches. A few key notes why I'm having issues. 1. The top row box is slightly transparent so the RGB values differ from the bottom row boxes. 2. There are 8 colors in total, so we can't even see the other colors that's off-screen until we slide the bottom row left or right. 3. You only have 3 tries when sliding (ie. dragto left and let go of mouse = 1 try) As for my script, I honestly don't even know where to start since I'm stumped. But this is a script I developed for one of the other mini-game using pretty much what you both mentioned. Apologies if it's a mess. I just started using AC Tool about a week ago and I only started using constants when Wabbit mentioned it. //-----PROCS for STM-----// Procedure STM_GetColor1 LoadRGB $STMmiddle SetConst STM_Red1 = {RGBRed} SetConst STM_Green1 = {RGBGreen} SetConst STM_Blue1 = {RGBBlue} End Procedure STM_GetColor2 LoadRGB $STMtop SetConst STM_Red2 = {RGBRed} SetConst STM_Green2 = {RGBGreen} SetConst STM_Blue2 = {RGBBlue} End Procedure STM_GetColor3 LoadRGB $STMright SetConst STM_Red3 = {RGBRed} SetConst STM_Green3 = {RGBGreen} SetConst STM_Blue3 = {RGBBlue} End Procedure STM_GetColor4 LoadRGB $STMbottom SetConst STM_Red4 = {RGBRed} SetConst STM_Green4 = {RGBGreen} SetConst STM_Blue4 = {RGBBlue} End Procedure STM_GetColor5 LoadRGB $STMleft SetConst STM_Red5 = {RGBRed} SetConst STM_Green5 = {RGBGreen} SetConst STM_Blue5 = {RGBBlue} End PROCEDURE STM While 1=1 delay 200 loadrgb $marker if {RGBRed} > 40 and {RGBRed} < 50 and {RGBGreen} > 16 and {RGBGreen} < 26 and {RGBBlue} > 56 and {RGBBlue} < 66 else Break end Call STM_GetColor1 Call STM_GetColor2 Call STM_GetColor3 Call STM_GetColor4 Call STM_GetColor5 compute $redvariance = ($STM_Red1 - $STM_Red2) * ($STM_Red1 - $STM_Red2) compute $greenvariance = ($STM_Green1 - $STM_Green2) * ($STM_Green1 - $STM_Green2) compute $bluevariance = ($STM_Blue1 - $STM_Blue2) * ($STM_Blue1 - $STM_Blue2) If $redvariance < 5 And $greenvariance < 5 And $bluevariance < 5 MousePos $STMtopclick Leftclick delay 100 Continue Else compute $redvariance = ($STM_Red1 - $STM_Red3) * ($STM_Red1 - $STM_Red3) compute $greenvariance = ($STM_Green1 - $STM_Green3) * ($STM_Green1 - $STM_Green3) compute $bluevariance = ($STM_Blue1 - $STM_Blue3) * ($STM_Blue1 - $STM_Blue3) If $redvariance < 5 And $greenvariance < 5 And $bluevariance < 5 MousePos $STMrightclick Leftclick delay 100 Continue Else compute $redvariance = ($STM_Red1 - $STM_Red4) * ($STM_Red1 - $STM_Red4) compute $greenvariance = ($STM_Green1 - $STM_Green4) * ($STM_Green1 - $STM_Green4) compute $bluevariance = ($STM_Blue1 - $STM_Blue4) * ($STM_Blue1 - $STM_Blue4) If $redvariance < 5 And $greenvariance < 5 And $bluevariance < 5 MousePos $STMbottomclick Leftclick delay 100 Continue Else compute $redvariance = ($STM_Red1 - $STM_Red5) * ($STM_Red1 - $STM_Red5) compute $greenvariance = ($STM_Green1 - $STM_Green5) * ($STM_Green1 - $STM_Green5) compute $bluevariance = ($STM_Blue1 - $STM_Blue5) * ($STM_Blue1 - $STM_Blue5) If $redvariance < 5 And $greenvariance < 5 And $bluevariance < 5 MousePos $STMleftclick Leftclick delay 100 Continue Else end end end end End END
  3. Thanks for the tip! That helped me a lot! I didn't know you could do that with constants. I was able to figure it out and finish part of my script. Now I'm a bit stuck on another part of my script. I was wondering if you could give me any tips on how to tackle it. Now that I know how to compare RGB values with set constants, my next issue is this. There are 4 boxes. Two boxes are visibly color purple but one is solid and the other is slightly transparent. Both are visibly color purple but the RGB values differ. The other two boxes are visibly orange, but like the first two, one is solid and the other is slightly transparent. Now for my question. How would I do or say that the "solid purple RGB" is equal to the "slightly transparent purple RGB" when the RGB values clearly aren't equal? Is there a way to tie both values together or am I going about this the wrong way? Thanks!
  4. I wanted to know if it's possible to use loadrgb at defined coords and see if that rgb is present at another coord. Basically, I want to see if I have a matching RGB at another predefined location. loadrgb $marker if {RGBRed} {RGBGreen} {RGBBlue} = {RGBRed} {RGBGreen} {RGBBlue} at $othermarker "do stuff" else Break end Can anyone help me with this? Thank you.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.