Guest User

Utip automatic bot viewer for Mac OS X (applescript)

a guest
Apr 5th, 2020
511
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/osascript
  2.  
  3. -- THIS SCRIPT IS AN uTiP.io AUTOCLICK TOOL FOR MAC OS X, BASED ON :
  4. -- * A REGULAR SCREENCAPTURE TOOL FOR MAC OS X (already installed)
  5. -- * A COORDINATES & PIXEL-COLOR BASED FAST ANALYSIS OF THE PICTURE
  6. --    "IMAGEMAGICK" : must be installed, i use macport but other should be fine
  7. -- * AN AUTOLICK TOOL
  8. --   "CLICLICK" : must be installed, i use macport but other should be fine
  9.  
  10. -- IT HAS BEEN TESTED ON FIREFOX : THIS GIVES LIMITED ACCESS PER DAY AND PER IP
  11. -- (~ 30 ADS or 150 points)
  12. -- BUT ... SEE THE [EXTRA NOTE] TO GET MORE !!
  13.  
  14.  
  15. -- [INSTALLING] : SEE [A] and [B] Below BEFORE, VERY IMPORTANT !!
  16.  
  17. -- [RUNNING] :
  18. -- (a) just start firefox on the right part of the screen
  19. -- (b) load a utip url
  20. -- (c) possibly logs-in on utip if you want
  21. -- (d) run the script and look where the script is moving the mouse (change according to your screen size below ~ see lines 50-60)
  22.  
  23. -- [EXTRA NOTE] :
  24. --  IF you reach the "FireTipR" using this script THEN i will give you the full version WITH EXTRA PROXY ACCESS
  25. --  * reaching the "FireTipR" is very easy for free:
  26. --       (1) dont delete the example urls below,
  27. --       (2) just add few other ones,
  28. --       (3) run the tool once a day [or] night
  29. --  * YOU MUST LOG WITH YOUR UTIP ACCOUNT WHEN THE SCRIPT IS RUNNING
  30. --   (just logs in in firefox BEFORE the script start)
  31. --
  32. --    possibilities (i can see) to get in touch with me :
  33. --    - just put (nice of course ;-) ) comments/thumbs on some of my utube videos to know who u ar.
  34. --    - just get it touch with me, with your utube account
  35.  
  36.  
  37. -- [A] WHAT IS NEEDED TO SET/FIX BEFORE RUNNING :
  38. -- * the "cliclick" tool ==> "sudo port install cliclick" after having macports, (or other procedure for homebrew) installed
  39. Property Cliclick_bin : "/opt/local/bin/cliclick"
  40. -- * "ImageMagick" tool to get "convert" ==> see just before
  41. Property Convert_bin : "/opt/local/bin/convert"
  42. -- *  Browser with close warnings disabled (start it/close it on the utip webpage before, start it onnthe right webpage before running the script)
  43. Property Browser_ap : "Firefox"
  44. Property Browser_process : "firefox"
  45.  
  46. -- [B] TODO DURING FIRST RUNNING :
  47. -- * "Security and Confidentiality" --> "Confidentiality" -> "Automaton" : Allow "Terminal" to use "System Events"
  48. -- ** Check with "Cmd"+"Shift"+"4" the approximate coordinates of the middle betwen "Next" and "WatchAdd" buttons and "Start" Button, and put them below  /or/ put the browser to the right place ;-)
  49. -- *** Check also the "Cookie" Button coordinates
  50.  
  51. property Utip_urls : {"https://utip.io/stardust","https://www.utip.io/astec","https://utip.io/squeme","https://utip.io/monsieurbidouille","https://utip.io/qtgeekes"}
  52.  
  53.  
  54. -- moving mouse grid for "next"/"start" buttons (mouse coordinates, you have to multiply by 2 to get "pixels")
  55. property X_Next : 900  + random number from -1 to 1 -- IF BROWSER ON THE RIGHT-PART OF THE SCREEN [x|v] : non-retina : 900 -- retina : 1250
  56. property Y_Next : 550  + random number from -1 to 1 -- IF BROWSER ON THE RIGHT-PART OF THE SCREEN [x|v] : non-retina : 550 -- retina : 600
  57. property X_Nb_Next : 2 -- number of steps (1 means "3 steps around", 2 means "5 steps around", ... many will take much more of you CPU !!)
  58. property Y_Nb_Next : 7
  59. property X_Jump_Next : 20 -- shifting mouse coordinates (on retina : replace these two values)
  60. property Y_Jump_Next : 20
  61.  
  62. -- moving mouse grid for "cookie" button (mouse coordinates, you have to multiply by 2 to get "pixels")
  63. property X_Cookie : 1250  + random number from -1 to 1 -- non-retina  : 1250 -- retina : 1550
  64. property Y_Cookie : 750 + random number from -1 to 1  -- non-retina : 750 -- retina : 950
  65. property X_Nb_Cookie : 1  -- number of steps (1 means "3 steps around", 2 means "5 steps around", ... many will take much more of you CPU !!)
  66. property Y_Nb_Cookie : 1
  67. property X_Jump_Cookie : 20 -- shifting mouse coordinates (on retina : x1.5 these two values)
  68. property Y_Jump_Cookie : 20
  69.  
  70.  
  71. -- SLEEP AND LOADING PARAMETERS
  72. -- number of tabs simulaneously load (just help to "fast load" and "caching", does not speed "ads watching")
  73. Property nbTab : 2
  74.  
  75. -- last position that was matching (avoid multiple tests), set to -1 when starting
  76. property X_last_Next : -1
  77. property Y_last_Next : -1
  78.  
  79. property X_last_Start : -1
  80. property Y_last_Start : -1
  81.  
  82. property X_last_Cookie : -1
  83. property Y_last_Cookie : -1
  84.  
  85. property X_last_NoMore : -1
  86. property Y_last_NoMore : -1
  87.  
  88. -- border colors for "start" button (this button is not homogeneous, so i use a vector product)
  89. property R_Start_A : 60
  90. property G_Start_A : 123
  91. property B_Start_A : 234
  92.  
  93. property R_Start_B : 250
  94. property G_Start_B : 107
  95. property B_Start_B : 190
  96.  
  97.  
  98.  
  99. -- These variables are set Once !!
  100.  
  101. -- Restart parameters (seconds) [one before a Start/Next button, the other is addtional time between several Next ]
  102. global max_cRestartExtraTime
  103. set max_cRestartExtraTime to 180
  104.  
  105. global max_cNoAction
  106. set max_cNoAction to 60 * nbTab
  107.  
  108. -- [C] These variable will Change along the script !!
  109.  
  110. -- Number of No Actions cycles counted (seconds), must restart after some  max_cNoAction
  111. global cNoAction
  112. set cNoAction to 0
  113.  
  114. -- Number of NoMore ads found without any ads !! at some point you mest restart
  115. global cNoMoreChanges
  116. set cNoMoreChanges to 0
  117.  
  118. -- Set to True when a "Start" or "Next is encountered, Set to False when restarting browser
  119. global cStart
  120. set cStart to False
  121.  
  122. -- Extra time given to load urls at a new start
  123. global cRestartExtraTime
  124. set cRestartExtraTime to max_cRestartExtraTime
  125.  
  126. -- Count of the number of "Next" passed since last "restart"
  127. global cNext
  128. set cNext to 0
  129.  
  130.  
  131.  
  132.  
  133.  
  134. -- restart and choose URL
  135. restart_browser(False)
  136.  
  137. -- THESE MOUSE MOVES ARE HERE TO SHOW THE GRID PATTERNS USED !!
  138. -- move clic pos only
  139. multiclic(X_Next,Y_Next,X_Nb_Next,Y_Nb_Next,X_Jump_Next,Y_Jump_Next,"m")
  140. -- move cookie pos only
  141. multiclic(X_Cookie,Y_Cookie,X_Nb_Cookie,Y_Nb_Cookie,X_Jump_Cookie,Y_Jump_Cookie,"m")
  142.  
  143. -- cookie test and press before
  144. cookie_test()
  145.  
  146. repeat 100 times
  147.  
  148.    repeat nbTab times
  149.  
  150.       -- test a full screenshot
  151.       set value to screen_and_check_color(X_Next,Y_Next,X_Nb_Next,Y_Nb_Next,X_Jump_Next,Y_Jump_Next)
  152.       set aValues to my theSplit(value, ";")
  153.       repeat with a from 1 to length of aValues
  154.          set theCurrentListItem to item a of aValues
  155.          if a = 1 then
  156.             set value to theCurrentListItem
  157.          end if
  158.          if a = 2 then
  159.             set coords to theCurrentListItem
  160.          end if
  161.       end  repeat
  162.  
  163.       if value = "NEXT" then
  164.          tell application Browser_ap to activate
  165.          do shell script Cliclick_bin & " m:" & coords
  166.          do shell script Cliclick_bin & " c:" & coords
  167.          set cNoAction to 0
  168.          set cNoMoreChanges to 0
  169.          set cStart to True
  170.       end if
  171.  
  172.       if value = "START" then
  173.          tell application Browser_ap to activate
  174.          do shell script Cliclick_bin & " m:" & coords
  175.          do shell script Cliclick_bin & " c:" & coords
  176.          set cStart to True
  177.       end if
  178.  
  179.       if value = "NO MORE" then
  180.  
  181.          -- ALLOW ANOTHER ACCOUNT TEST CHANGE
  182.          set cNoMoreChanges to cNoMoreChanges+1
  183.  
  184.          if cNoMoreChanges > nbTab then
  185.             -- RESTART THE BROWSER
  186.             --say "NO ACTION"
  187.             restart_browser(True)
  188.          else
  189.             -- CLOSE THE TAB
  190.             tell application Browser_ap to activate
  191.             tell application "System Events"
  192.                tell process Browser_process
  193.                   keystroke "w" using {command down}
  194.                end tell
  195.             end tell
  196.  
  197.             -- REOPEN THE TAB
  198.             set Utip_url to some item of Utip_urls
  199.             tell application Browser_ap to open location Utip_url
  200.          end if
  201.       end if
  202.  
  203.       if (cStart and cNoAction > max_cNoAction + cRestartExtraTime) or (cNoAction > max_cNoAction) then
  204.          --say "NO ACTION"
  205.          restart_browser(True)
  206.       end if
  207.  
  208.  
  209.       -- SLEEP
  210.       set randomNumber to (random number from 1 to 4)
  211.       delay randomNumber
  212.  
  213.  
  214.       -- NEXT TAB BETWEEN TWO SLEEPS
  215.       tell application Browser_ap to activate
  216.       tell application "System Events" to key code 124 using {command down, option down}
  217.  
  218.       -- SLEEP
  219.       set randomNumber to (random number from 2 to 12)
  220.       delay randomNumber
  221.  
  222.       set cNoAction to cNoAction+randomNumber
  223.  
  224.       -- REDUCE THE RESTART EXTRA TIME
  225.       if cRestartExtraTime > randomNumber then
  226.          set cRestartExtraTime to cRestartExtraTime - randomNumber
  227.       end if
  228.    end repeat
  229. end repeat
  230.  
  231.  
  232. -- multiclic
  233. on multiclic(xStart,yStart,xNb,yNb,xJump,yJump,even)
  234.       -- window front
  235.       tell application Browser_ap to activate
  236.  
  237.       -- double loops coordinates for the grid
  238.       set xPos to (xStart - xNb * xJump)
  239.       repeat 2*xNb+1 times
  240.          set yPos to (yStart - yNb * yJump)
  241.          repeat 2*yNb+1 times
  242.             -- set click on the grid
  243.             set coords to "" & xPos & "," & yPos
  244.             do shell script Cliclick_bin & " " & even & ":" & coords
  245.             set yPos to yPos + yJump
  246.          end repeat
  247.             set xPos to xPos + xJump
  248.        end repeat
  249. end multiclic
  250.  
  251.  
  252.  
  253. -- tor restart tool
  254. on restart_browser(stop_browser)
  255.  
  256.       set cRestartExtraTime to max_cRestartExtraTime
  257.       set cStart to False
  258.       set cNoAction to 0
  259.       set cNoMoreChanges to 0
  260.       set cNext to 0
  261.  
  262.       tell application Browser_ap to activate
  263.  
  264.       -- (1) STOP THE BROWSER
  265.       if stop_browser then
  266.          tell application "System Events"
  267.             tell process Browser_process
  268.                keystroke "q" using {command down}
  269.                delay 3
  270.             end tell
  271.          end tell
  272.       end if
  273.  
  274.       -- (2) RESTART
  275.       tell application Browser_ap to activate
  276.  
  277.       -- FIREFOX : SOME EXTRA DELAY TO RESTART
  278.       set randomNumber to (random number from 5 to 10)
  279.       delay randomNumber
  280.  
  281.       -- (3) LOAD URL
  282.       set Utip_url to some item of Utip_urls
  283.       tell application Browser_ap to open location Utip_url
  284.       repeat nbTab times
  285.          set Utip_url to some item of Utip_urls
  286.          tell application Browser_ap to open location Utip_url
  287.  
  288.          set randomNumber to (random number from 2 to 5)
  289.          delay randomNumber
  290.       end repeat
  291.  
  292.       tell application Browser_ap to activate
  293.  
  294.       set randomNumber to (random number from 8 to 15)
  295.       delay randomNumber
  296.  
  297.       repeat nbTab times
  298.          -- NEXT TAB
  299.          tell application Browser_ap to activate
  300.          tell application "System Events" to key code 124 using {command down, option down}
  301.  
  302.          cookie_test()
  303.  
  304.          set randomNumber to (random number from 2 to 5)
  305.          delay randomNumber
  306.       end repeat
  307. end restart_browser
  308.  
  309.  
  310.  
  311.  
  312. on cookie_test()
  313.    set picPath to ((POSIX path of (path to desktop)) & "Picture.png") as string
  314.  
  315.    -- FAST COOKIE TEST
  316.    if X_last_Cookie >= 0 and Y_last_Cookie >= 0 then
  317.       -- RANDOMIZE A LITTLE
  318.       set X_last_Cookie to X_last_Cookie + random number from -1 to 1
  319.       set Y_last_Cookie to Y_last_Cookie + random number from -1 to 1
  320.       --
  321.       set coords_cookie to "" & (2*X_last_Cookie) & "," & (2*Y_last_Cookie)
  322.       set srgba_cookie to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords_cookie & "}]\" info:"
  323.       if srgba_cookie = "srgba(8,122,244,1)" or  srgba_cookie = "srgba(0,113,236,1)" then -- cookie on white/black background
  324.           --say "COOKIE FAST;" & (X_last_Cookie) & "," & (Y_last_Cookie)
  325.           tell application Browser_ap to activate
  326.           do shell script Cliclick_bin & " m:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  327.           do shell script Cliclick_bin & " c:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  328.           return
  329.       end if
  330.    end if
  331.  
  332.    -- SLOW COOKIE TEST ON GRID
  333.    set value_cookie to screen_and_check_color(X_Cookie,Y_Cookie,X_Nb_Cookie,Y_Nb_Cookie,X_Jump_Cookie,Y_Jump_Cookie)
  334.  
  335. end cookie_test
  336.  
  337.  
  338. --
  339. -- Compute the vector product : must be close to 0 if the 3 dots are aligned
  340. -- (used for color button match)
  341. --
  342. on vector_product(r_1,g_1,b_1,r_2,g_2,b_2,r_3,g_3,b_3)
  343.    set r21 to r_2 - r_1
  344.    set g21 to g_2 - g_1
  345.    set b21 to b_2 - b_1
  346.    set r31 to r_3 - r_1
  347.    set g31 to g_3 - g_1
  348.    set b31 to b_3 - b_1
  349.    return r21*g31-r31*g21 + g21*b31-g31*b21  + b21*r31-b31*r21
  350. end vector_product
  351.  
  352.  
  353. --
  354. -- Split according to a list of delimiters
  355. -- (from https://erikslab.com/2007/08/31/applescript-how-to-split-a-string/ ? )
  356. --
  357.  
  358. on theSplit(theString, theDelimiter)
  359.    -- save delimiters to restore old settings
  360.    set oldDelimiters to AppleScript's text item delimiters
  361.    -- set delimiters to delimiter to be used
  362.    set AppleScript's text item delimiters to theDelimiter
  363.    -- create the array
  364.    set theArray to every text item of theString
  365.    -- restore the old setting
  366.    set AppleScript's text item delimiters to oldDelimiters
  367.    -- return the result
  368.    return theArray
  369. end theSplit
  370.  
  371.  
  372. --
  373. -- Screen Capture and Analysis With Position Return
  374. --
  375. on screen_and_check_color(xStart,yStart,xNb,yNb,xJump,yJump)
  376.    -- screenshot
  377.    set picPath to ((POSIX path of (path to desktop)) & "Picture.png") as string
  378.    do shell script "screencapture -tpng " & quoted form of picPath
  379.  
  380.    -- (A) single test if positions already available
  381.    set singleTest to 0
  382.  
  383.    -- (A.1) test the "Cookie" button fast
  384.    if X_last_Cookie >= 0 and Y_last_Cookie >= 0 then
  385.       set singleTest to singleTest+1
  386.  
  387.       -- RANDOMIZE A LITTLE
  388.       set X_last_Cookie to X_last_Cookie + random number from -1 to 1
  389.       set Y_last_Cookie to Y_last_Cookie + random number from -1 to 1
  390.       --
  391.       set coords to "" & (2*X_last_Cookie) & "," & (2*Y_last_Cookie)
  392.  
  393.       set srgba to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords & "}]\" info:"
  394.  
  395.       if srgba = "srgba(8,122,244,1)" or srgba = "srgba(0,113,236,1)" then -- cookie on white/black background
  396.          --say "COOKIE FAST;"  & (X_last_Cookie) & "," & (Y_last_Cookie)
  397.          tell application Browser_ap to activate
  398.          do shell script Cliclick_bin & " m:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  399.          do shell script Cliclick_bin & " c:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  400.       end if
  401.    end if
  402.  
  403.    -- (A.2) test the "Next" button fast
  404.    if X_last_Next >= 0 and Y_last_Next >= 0 then
  405.       set singleTest to singleTest+1
  406.  
  407.       -- RANDOMIZE A LITTLE
  408.       set X_last_Next_Test to X_last_Next + random number from -3 to 3
  409.       set Y_last_Next_Test to Y_last_Next + random number from -1 to 1
  410.       --
  411.       set coords to "" & (2*X_last_Next_Test) & "," & (2*Y_last_Next_Test)
  412.  
  413.       set srgba to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords & "}]\" info:"
  414.       if srgba = "srgba(247,232,50,1)" then -- yellow next button
  415.          set X_last_Next to X_last_Next_Test
  416.          set Y_last_Next to Y_last_Next_Test
  417.          --say  "NEXT FAST;"  & (X_last_Next) & "," & (Y_last_Next)
  418.          set cNext to cNext+1
  419.          return "NEXT;"  & (X_last_Next) & "," & (Y_last_Next)
  420.       end if
  421.    end if
  422.  
  423.    -- (A.3) test the "NoMore" button fast
  424.    if X_last_NoMore >= 0 and Y_last_NoMore >= 0 then
  425.       set singleTest to singleTest+1
  426.  
  427.       -- RANDOMIZE A LITTLE
  428.       set X_last_NoMore_Test to X_last_NoMore + random number from -1 to 1
  429.       set Y_last_NoMore_Test to Y_last_NoMore + random number from -1 to 1
  430.       --
  431.       set coords to "" & (2*X_last_NoMore_Test) & "," & (2*Y_last_NoMore_Test)
  432.  
  433.       set srgba to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords & "}]\" info:"
  434.       if srgba = "srgba(47,46,65,1)" or srgba = "srgba(255,193,7,1)" or srgba = "srgba(255,205,0,1)" then -- gray guy or yellow hat
  435.           set X_last_NoMore to X_last_NoMore_Test
  436.           set Y_last_NoMore to Y_last_NoMore_Test
  437.           --say "NO MORE FAST;"  & (X_last_NoMore) & "," & (Y_last_NoMore)
  438.           return "NO MORE;"  & (X_last_NoMore) & "," & (Y_last_NoMore)
  439.       end if
  440.    end if
  441.  
  442.    -- (A.4) test the "Start" Button fast
  443.    if X_last_Start >= 0 and Y_last_Start >= 0 then
  444.       set singleTest to singleTest+1
  445.  
  446.       -- RANDOMIZE A LITTLE
  447.       set X_last_Start_Test to X_last_Start + random number from -2 to 2
  448.       set Y_last_Start_Test to Y_last_Start + random number from -1 to 1
  449.       --
  450.       set coords to "" & (2*X_last_Start_Test) & "," & (2*Y_last_Start_Test)
  451.  
  452.       set srgba to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords & "}]\" info:"
  453.       if not srgba = "srgba(66,133,244,1)" then -- common color used for game button
  454.          -- test correlation with button
  455.          set r to 0
  456.          set g to 0
  457.          set b to 0
  458.          set srgbaArray to my theSplit(srgba, {"(",")",","})
  459.          repeat with a from 1 to length of srgbaArray
  460.             set theCurrentListItem to item a of srgbaArray
  461.             if a = 2 then
  462.                set r to theCurrentListItem
  463.             end if
  464.             if a = 3 then
  465.                set g to theCurrentListItem
  466.             end if
  467.             if a = 4 then
  468.                set b to theCurrentListItem
  469.             end if
  470.          end repeat
  471.          set vecProd to vector_product(R_Start_A,G_Start_A,B_Start_A,r,g,b,R_Start_B,G_Start_B,B_Start_B)
  472.          if vecProd > -300 and vecProd < 300 then
  473.             set X_last_Start to X_last_Start_Test
  474.             set Y_last_Start to Y_last_Start_Test
  475.             --say  "START FAST;"  & (X_last_Start) & "," & (Y_last_Start) & "=" & vecProd
  476.             return "START;"  & (X_last_Start) & "," & (Y_last_Start)
  477.          end if
  478.       end if
  479.    end if
  480.  
  481.    -- (B) double loops grid coordinates
  482.    set xPos to 2*(xStart - xNb * xJump)
  483.    set xPosMouse to (xStart - xNb * xJump)
  484.    repeat 2*xNb+1 times
  485.       set yPos to 2*(yStart - yNb * yJump)
  486.       set yPosMouse to (yStart - yNb * yJump)
  487.       repeat 2*yNb+1 times
  488.          -- get pixel colors
  489.          set coords to "" & xPos & "," & yPos
  490.          set srgba to do shell script Convert_bin & " " & quoted form of picPath & " -format \"%[pixel:p{" & coords & "}]\" info:"
  491.  
  492.          if srgba = "srgba(8,122,244,1)" or srgba = "srgba(0,113,236,1)" then -- cookie on white/black background
  493.             --say "COOKIE"
  494.             set X_last_Cookie to xPosMouse
  495.             set Y_last_Cookie to yPosMouse
  496.             tell application Browser_ap to activate
  497.             do shell script Cliclick_bin & " m:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  498.             do shell script Cliclick_bin & " c:" & (X_last_Cookie) & "," & (Y_last_Cookie)
  499.             return "OTHER;0,0"
  500.          end if
  501.  
  502.          if srgba = "srgba(247,232,50,1)" then -- yellow next button
  503.             --say "NEXT"
  504.             set X_last_Next to xPosMouse
  505.             set Y_last_Next to yPosMouse
  506.             set cNext to cNext+1
  507.             return "NEXT;"  & (xPosMouse) & "," & (yPosMouse)
  508.          end if
  509.  
  510.          if srgba = "srgba(47,46,65,1)" or srgba = "srgba(255,193,7,1)" then -- gray guy or yellow hat
  511.             --say "NO MORE"
  512.             set X_last_NoMore to xPosMouse
  513.             set Y_last_NoMore to yPosMouse
  514.             return "NO MORE;"  & (xPosMouse) & "," & (yPosMouse)
  515.          end if
  516.  
  517.          if not srgba = "srgba(66,133,244,1)" then -- common color used for game button
  518.             -- test correlation with button
  519.             set r to 0
  520.             set g to 0
  521.             set b to 0
  522.             set srgbaArray to my theSplit(srgba, {"(",")",","})
  523.             repeat with a from 1 to length of srgbaArray
  524.                set theCurrentListItem to item a of srgbaArray
  525.                if a = 2 then
  526.                   set r to theCurrentListItem
  527.                end if
  528.                if a = 3 then
  529.                   set g to theCurrentListItem
  530.                end if
  531.                if a = 4 then
  532.                   set b to theCurrentListItem
  533.                end if
  534.             end repeat
  535.  
  536.             set vecProd to vector_product(R_Start_A,G_Start_A,B_Start_A,r,g,b,R_Start_B,G_Start_B,B_Start_B)
  537.             if vecProd > -300 and vecProd < 300 then
  538.                --say "START" & "=" & vecProd
  539.                set X_last_Start to xPosMouse
  540.                set Y_last_Start to yPosMouse
  541.                return "START;"  & (xPosMouse) & "," & (yPosMouse)
  542.             end if
  543.          end if
  544.  
  545.          set yPos to yPos + 2*yJump
  546.          set yPosMouse to yPosMouse + yJump
  547.       end repeat
  548.       set xPos to xPos + 2*xJump
  549.       set xPosMouse to xPosMouse + xJump
  550.    end repeat
  551.    return "OTHER;0,0"
  552. end screen_and_check_color
RAW Paste Data