Jump to content
AC Tool Forums
  • Sign Up
Sign in to follow this  
Nironior

Automating a Match-3 Game

Recommended Posts

Hey! I've used ACTool for a long time with only a limited amount of commands, so I had to get creative in order for things to work most of the time. I'm trying to get a bit better. I've successfully made a script which recognizes colors of gems in each of their possibly permutations which allow for a match. The thing is: It is still way less efficient than my really simple macro which just blindly matches the whole grid (8x8) in each of it's possibilities regardless of color by starting in the left/top corner and working down to the opposed corner horizontally and then vertically.

 

I feel like my Object based script which takes color into account could be way better though. Have you got any tips for me?

And more specifically: How could I turn this into a script which searches for any matching objects instead of one color at the time? Is that possible?

This is what the game looks like (and below that I'll include my script):

bH5qhhZ.png

 

 

Edit: Sorry, didn't know that Tabs would disappear, will use spaces from now on.

 

 

 

// Gems of War
//--------CONSTANTS--------
Constants // Coords of the first Gem in the grid
C = 429 // Needed for accurate Object values
D = 113
end
 
Constants
Color = blue
end
 
procedure c // leftclick
delay 55 // minimal time needed for two gems matches in row
leftclick
delay 45
end
 
//--------OBJECTS--------
 
ObjVar 20 // Can't go lower due to a randomized extra white pixel column in the game
 
(*COLORS*)
     
Object Yellow // Yellow Gems
  255=0,0|228=0,10
  255=8,0|230=8,10
  255=10,0
End
 
Object Brown // Brown Gems
  124=0,0|97=0,10
  151=10,0|99=10,10
End
 
Object Green 
  190=0,0|190=0,2|191=0,4
  174=0,6|173=0,8|170=0,10
  158=16,0|154=16,2
End
 
Object Purple
  174=0,0|173=0,2
  152=0,4|145=0,6
  214=14,0|198=16,12
  206=16,14
End
 
Object Red
  239=0,0|239=0,2|236=0,4
  234=10,0|239=10,2|239=10,4
  210=18,0|239=18,2|236=18,4
End
 
Object Blue
  239=0,0|239=0,2|160=0,4
  161=2,2|156=4,0
End
 
 
//--------PROCEDURES--------
 
(*All Possible Matches*)
 
procedure b1 // Spots 2 horizontal same color gems next to eachother and searches for the 3 possibilities to the RIGHT
   Isobject $Color at $C, $D // C and D are originally set to the first gem in the Left/Top corner
      compute C = $C + 82 // 82 pixels is both the width and height of a gem box
         Isobject $Color at $C, $D
            compute C = $C + 82 * 2 // Skips one box to check if there is a possible gem match in the form of: X X O X in which X are same color gems
         Else
            compute C = $C - 82
            exit // Have a question about exit, cause it forced me to make an extra empty procedure later on
         end
         Isobject $Color at $C, $D // If the form is: X X O X it swaps O and X to match 3
            Mousepos $C, $D
            call c
            compute C = $C - 82
            Mousepos $C, $D
            call c
            compute C = $C - 82 * 2
         Else
            compute C = $C - 82
            compute D = $D - 82
               Isobject $Color at $C, $D // Checks to see if there is a same gem above O in the form: X X O
                  Mousepos $C, $D
                  call c
                  compute D = $D + 82
                  Mousepos $C, $D
                  call c
                  compute C = $C - 82 * 3
               Else
                  compute D = $D + 82 * 2
                     Isobject $Color at $C, $D // Checks to see if there is a same gem below O in the form: X X O
                        Mousepos $C, $D
                        call c
                        compute D = $D - 82
                        Mousepos $C, $D
                        call c
                        compute C = $C - 82 * 3
                     Else
                        compute C = $C - 82 * 3
                        compute D = $D - 82
                     end
               end
         end
      end
timestamp $C and $D
end
 
procedure b2 // Spots 2 horizontal same color gems next to eachother and searches for the 3 possibilities to the LEFT
Isobject $Color at $C, $D
compute C = $C + 82
Isobject $Color at $C, $D
compute C = $C - 82 * 3
Else
compute C = $C - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute C = $C + 82
compute D = $D - 82
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute D = $D + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute C = $C + 82
compute D = $D - 82
end
end
end
 
end
timestamp $C and $D
end
 
procedure b3 // Spots 2 vertical same color gems next to eachother and searches for the 3 possibilities to the Bottom
Isobject $Color at $C, $D
compute D = $D + 82
Isobject $Color at $C, $D
compute D = $D + 82 * 2
Else
compute D = $D - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
compute D = $D - 82 * 2
Else
compute D = $D - 82
compute C = $C - 82
delay 50
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D - 82 * 3
Else
compute C = $C + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
compute D = $D - 82 * 3
Else
compute D = $D - 82 * 3
compute C = $C - 82
end
 
end
end
end
timestamp $C and $D
end
 
procedure b4 // Spots 2 vertical same color gems next to eachother and searches for the 3 possibilities to the TOP
Isobject $Color at $C, $D
compute D = $D + 82
Isobject $Color at $C, $D
compute D = $D - 82 * 3
Else
compute D = $D - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute D = $D + 82
compute C = $C - 82
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute C = $C + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute D = $D + 82
compute C = $C - 82
end
end
 
end
end
timestamp $C and $D
end
 
procedure b5 // Spots if the are 2 same color gems sperated by one different in the middle, horizontally, with the form: X O X
Isobject $Color at $C, $D
compute C = $C + 82 * 2
Isobject $Color at $C, $D
compute C = $C - 82
compute D = $D + 82
Else
compute C = $C - 82 * 2
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
Else
compute D = $D - 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute C = $C - 82
Else
compute C = $C - 82
compute D = $D + 82
end
end
end
timestamp $C and $D
end
 
procedure b6 // Spots if the are 2 same color gems sperated by one different in the middle, vertically, with the form: X O X
Isobject $Color at $C, $D
compute D = $D + 82 * 2
Isobject $Color at $C, $D
compute D = $D - 82
compute C = $C + 82
Else
compute D = $D - 82 * 2
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
Else
compute C = $C - 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D - 82
Else
compute D = $D - 82
compute C = $C + 82
end
end
end
timestamp $C and $D
end
 
(*Empty procedures for "exit" to exit without stopping the main procedure*)
 
procedure b6exit // because exit stops the procedure it is defined in, as well as 1 other procedure it is running in
call b6
end
 
procedure b5exit
call b5
end
 
procedure b4exit 
call b4
end
 
procedure b3exit
call b3
end
 
procedure b2exit
call b2
end
 
procedure b1exit
call b1
end
 
(*Checks Row*)
 
procedure BH1 // Applies possibility 1 (b1) in the first row
loop 3
call b1exit
compute C = $C + 82
end
Compute C = $C - 1 // needed to implement this because the game randomly inserts a white pixel column in the grid each battle 
loop 5 // and it always appears somewhere after the 3rd Column
call b1exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH2 
loop 3
call b2exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b2exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH3 
loop 3
call b3exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b3exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH4 
loop 3
call b4exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b4exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH5
loop 3
call b5exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b5exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH6 
loop 3
call b6exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b6exit
compute C = $C + 82
end
setconst C = 429
end
 
(*Searches Rows and then Columns*)
 
procedure B1e // Whole Grid
loop 8
call BH1
compute D = $D + 82
call spellz // Checks to see if the spells are ready to cast
end
setconst D = 113
end
 
procedure B2e 
loop 8
call BH2
compute D = $D + 82
end
setconst D = 113
end
 
procedure B3e
loop 8
call BH3
compute D = $D + 82
call spellz
end
setconst D = 113
end
 
procedure B4e 
loop 8
call BH4
compute D = $D + 82
end
setconst D = 113
end
 
procedure B5e
loop 8
call BH5
compute D = $D + 82
end
setconst D = 113
end
 
procedure B6e 
loop 8
call BH6
compute D = $D + 82
call spellz
end
setconst D = 113
end
 
procedure Grid // Every possibility of a specific color on the grid
call B1e
call B2e
call B3e
call B4e
call B5e
call B6e
end
 
procedure Script // Searches every possibility of every color chronologically
Setconst Color = Green
call grid
Setconst Color = Brown
call grid
Setconst Color = Red
call grid
Setconst Color = Yellow
call grid
Setconst Color = Purple
call grid
Setconst Color = Blue
call grid
end

Share this post


Link to post
Share on other sites

Is there code missing?, seems incomplete

 

When the code is run all it does is objvar 20

 

gems.zip

Share this post


Link to post
Share on other sites

This is the script in its entirety:

 

// Gems of War
//--------CONSTANTS--------
Constants // Coords of the first Gem in the grid
C = 429 // Needed for accurate Object values
D = 113
end
 
Constants
Color = blue
end
 
procedure c // leftclick
delay 55 // minimal time needed for two gems matches in row
leftclick
delay 45
end
 
//--------OBJECTS--------
 
ObjVar 20 // Can't go lower due to a randomized extra white pixel column in the game
 
(*COLORS*)
     
Object Yellow // Yellow Gems
  255=0,0|228=0,10
  255=8,0|230=8,10
  255=10,0
End
 
Object Brown // Brown Gems
  124=0,0|97=0,10
  151=10,0|99=10,10
End
 
Object Green 
  190=0,0|190=0,2|191=0,4
  174=0,6|173=0,8|170=0,10
  158=16,0|154=16,2
End
 
Object Purple
  174=0,0|173=0,2
  152=0,4|145=0,6
  214=14,0|198=16,12
  206=16,14
End
 
Object Red
  239=0,0|239=0,2|236=0,4
  234=10,0|239=10,2|239=10,4
  210=18,0|239=18,2|236=18,4
End
 
Object Blue
  239=0,0|239=0,2|160=0,4
  161=2,2|156=4,0
End
 
 
//--------PROCEDURES--------
 
(*All Possible Matches*)
 
procedure b1 // Spots 2 horizontal same color gems next to eachother and searches for the 3 possibilities to the RIGHT
Isobject $Color at $C, $D // C and D are originally set to the first gem in the Left/Top corner
compute C = $C + 82 // 82 pixels is both the width and height of a gem box
Isobject $Color at $C, $D
compute C = $C + 82 * 2 // Skips one box to check if there is a possible gem match in the form of: X X O X in which X are same color gems
Else
compute C = $C - 82
exit // Have a question about exit, cause it forced me to make an extra empty procedure later on
end
Isobject $Color at $C, $D // If the form is: X X O X it swaps O and X to match 3
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
compute C = $C - 82 * 2
Else
compute C = $C - 82
compute D = $D - 82
Isobject $Color at $C, $D // Checks to see if there is a same gem above O in the form: X X O
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute C = $C - 82 * 3
Else
compute D = $D + 82 * 2
Isobject $Color at $C, $D // Checks to see if there is a same gem below O in the form: X X O
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
compute C = $C - 82 * 3
Else
compute C = $C - 82 * 3
compute D = $D - 82
end
end
 
end
end
timestamp $C and $D
end
 
procedure b2 // Spots 2 horizontal same color gems next to eachother and searches for the 3 possibilities to the LEFT
Isobject $Color at $C, $D
compute C = $C + 82
Isobject $Color at $C, $D
compute C = $C - 82 * 3
Else
compute C = $C - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute C = $C + 82
compute D = $D - 82
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute D = $D + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
compute C = $C + 82
Else
compute C = $C + 82
compute D = $D - 82
end
end
end
 
end
timestamp $C and $D
end
 
procedure b3 // Spots 2 vertical same color gems next to eachother and searches for the 3 possibilities to the Bottom
Isobject $Color at $C, $D
compute D = $D + 82
Isobject $Color at $C, $D
compute D = $D + 82 * 2
Else
compute D = $D - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
compute D = $D - 82 * 2
Else
compute D = $D - 82
compute C = $C - 82
delay 50
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D - 82 * 3
Else
compute C = $C + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
compute D = $D - 82 * 3
Else
compute D = $D - 82 * 3
compute C = $C - 82
end
 
end
end
end
timestamp $C and $D
end
 
procedure b4 // Spots 2 vertical same color gems next to eachother and searches for the 3 possibilities to the TOP
Isobject $Color at $C, $D
compute D = $D + 82
Isobject $Color at $C, $D
compute D = $D - 82 * 3
Else
compute D = $D - 82
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute D = $D + 82
compute C = $C - 82
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute C = $C + 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
compute D = $D + 82
Else
compute D = $D + 82
compute C = $C - 82
end
end
 
end
end
timestamp $C and $D
end
 
procedure b5 // Spots if the are 2 same color gems sperated by one different in the middle, horizontally, with the form: X O X
Isobject $Color at $C, $D
compute C = $C + 82 * 2
Isobject $Color at $C, $D
compute C = $C - 82
compute D = $D + 82
Else
compute C = $C - 82 * 2
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D - 82
Mousepos $C, $D
call c
Else
compute D = $D - 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute D = $D + 82
Mousepos $C, $D
call c
compute C = $C - 82
Else
compute C = $C - 82
compute D = $D + 82
end
end
end
timestamp $C and $D
end
 
procedure b6 // Spots if the are 2 same color gems sperated by one different in the middle, vertically, with the form: X O X
Isobject $Color at $C, $D
compute D = $D + 82 * 2
Isobject $Color at $C, $D
compute D = $D - 82
compute C = $C + 82
Else
compute D = $D - 82 * 2
exit
end
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C - 82
Mousepos $C, $D
call c
Else
compute C = $C - 82 * 2
Isobject $Color at $C, $D
Mousepos $C, $D
call c
compute C = $C + 82
Mousepos $C, $D
call c
compute D = $D - 82
Else
compute D = $D - 82
compute C = $C + 82
end
end
end
timestamp $C and $D
end
 
(*Empty procedures for "exit" to exit without stopping the main procedure*)
 
procedure b6exit // because exit stops the procedure it is defined in, as well as 1 other procedure it is running in
call b6
call done1
end
 
procedure b5exit
call b5
call done1
end
 
procedure b4exit 
call b4
call done1
end
 
procedure b3exit
call b3
call done1
end
 
procedure b2exit
call b2
call done1
end
 
procedure b1exit
call b1
call done1
end
 
(*Checks Row*)
 
procedure BH1 // Applies possibility 1 (b1) in the first row
loop 3
call b1exit
compute C = $C + 82
end
Compute C = $C - 1 // needed to implement this because the game randomly inserts a white pixel column in the grid each battle 
loop 5 // and it always appears somewhere after the 3rd Column
call b1exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH2 
loop 3
call b2exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b2exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH3 
loop 3
call b3exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b3exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH4 
loop 3
call b4exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b4exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH5
loop 3
call b5exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b5exit
compute C = $C + 82
end
setconst C = 429
end
 
procedure BH6 
loop 3
call b6exit
compute C = $C + 82
end
Compute C = $C - 1
loop 5
call b6exit
compute C = $C + 82
end
setconst C = 429
end
 
(*Searches Rows and then Columns*)
 
procedure B1e // Whole Grid
loop 8
call BH1
compute D = $D + 82
call spellz // Checks to see if the spells are ready to cast
end
setconst D = 113
end
 
procedure B2e 
loop 8
call BH2
compute D = $D + 82
end
setconst D = 113
end
 
procedure B3e
loop 8
call BH3
compute D = $D + 82
call spellz
end
setconst D = 113
end
 
procedure B4e 
loop 8
call BH4
compute D = $D + 82
end
setconst D = 113
end
 
procedure B5e
loop 8
call BH5
compute D = $D + 82
end
setconst D = 113
end
 
procedure B6e 
loop 8
call BH6
compute D = $D + 82
call spellz
end
setconst D = 113
end
 
procedure Grid // Every possibility of a specific color on the grid
call B1e
call B2e
call B3e
call B4e
call B5e
call B6e
end
 
procedure Script // Searches every possibility of every color chronologically
Setconst Color = Green
call grid
Setconst Color = Brown
call grid
Setconst Color = Red
call grid
Setconst Color = Yellow
call grid
Setconst Color = Purple
call grid
Setconst Color = Blue
call grid
end
 
procedure cc // leftclick
delay 45
leftclick
delay 60 // 40 normaal
leftclick
delay 45
end
 
//-----------------------------------------
 
procedure s // spell
MousePos 705, 671 // Cast
delay 100
leftclick
delay 50
MousePos 426, 119 // 1st gem (for Convert)
call c
MousePos 508, 115 // 2nd gem 
call c
MousePos 586, 116 // 3rd gem
call c
MousePos 1154, 151 // 1st enemy (for TARGET)
call c
MousePos 1151, 324 // 2e
call c
MousePos 1153, 504 // 3e
call c
MousePos 1149, 680 // 4e
call c
delay 100
MousePos 1301, 727 // side failsafe
call c
end
 
procedure splash // spell
MousePos 705, 671 // Cast
delay 100
leftclick
delay 100
MousePos 1153, 504 // 3rd
call c
MousePos 1154, 151 // 1st enemy (for TARGET)
call c
MousePos 1151, 324 // 2nd
call c
MousePos 1149, 680 // 4th
call c
MousePos 1301, 727 // side failsafe
call c
end
 
procedure reverse // spell
MousePos 705, 671 // Cast
delay 100
leftclick
delay 100
MousePos 1149, 680 // 4th
call c
MousePos 1153, 504 // 3rd
call c
MousePos 1151, 324 // 2nd
call c
MousePos 1154, 151 // 1st enemy (for TARGET)
call c
MousePos 1301, 727 // side failsafe
call c
end
 
procedure S1 // spell 1
MousePos 271, 147 // 1st picture
delay 50
leftclick
delay 100
call s
end
 
procedure splash1
MousePos 271, 147 // 1st picture
delay 50
leftclick
delay 100
call splash
end
 
procedure S2
MousePos 264, 328 // 2nd pic
delay 50
leftclick
delay 100
call s
end
 
procedure s2- 
MousePos 264, 328 // 2nd pic
delay 50
leftclick
delay 100
call reverse
end
 
procedure splash2
MousePos 264, 328 // 2nd pic
delay 50
leftclick
delay 100
call splash
end
 
procedure S3 
MousePos 262, 500 
delay 50
leftclick
delay 100
call s
end
 
procedure S4
MousePos 269, 664 
delay 50
leftclick
delay 100
call s
end
 
procedure splash4
MousePos 269, 664
delay 50
leftclick
delay 100
call splash
end
 
//-------------------------------------
 
Constants
X = 423
Y = 85
end
 
Constants
  Red   = 0
  Green = 0
  Blue  = 0
End
 
Procedure GetColor using X, Y
  LoadRGB $X, $Y
  SetConst Red   = {RGBRed}
  SetConst Green = {RGBGreen}
  SetConst Blue  = {RGBBlue}
End
 
 
Procedure ShowColor using A, B
  LoadRGB $A, $B
  SetConst Red   = {RGBRed}
  SetConst Green = {RGBGreen}
  SetConst Blue  = {RGBBlue}
  saypaste $Red and $Green and $Blue op $A $B
End
 
Procedure colourtest
  if $Red > -1 and $Red
    timestamp $red $green $blue Is Red
  end
End
 
procedure newacc
  call getcolor 263, 160 // Weapon op 1
  if $Red > 220 and $Green > 230 and $Blue
  delay 2500
  call s1
  else
  call getcolor 295, 313 // Kerberos op 2
  if $Red 140 and $Blue > 150
  delay 2500
  call s2-
  else
  call getcolor 298, 478 // Dimetraxia op 3
  if $Red
  delay 2500
  call s3
  MousePos 1104, 733 // bug op victory screen
  call c  
  else
  call getcolor 239, 637 // weapon op 4
  if $Red 220 and $Blue > 230
  delay 2500
  call splash4
  end
  end
  end
  end
end
 
//call showcolor 147, 72
 
(*
 
---------------------
 
*)
 
procedure cblue
call newacc
end
 
procedure cred
end
 
procedure horizontal // explorer
loop 7
Mousepos $X, $Y
call c
Compute X = $X + 81
Mousepos $X, $Y
call cc
call done1
call cblue
end
Compute X = $X - (81 * 7)
end
 
//--------EXPLORER----------
 
procedure r1
call horizontal
end
 
procedure r2
Compute Y = $Y + 82 * 1
call horizontal
SetConst Y = 82
end
 
procedure r3
Compute Y = $Y + 82 * 2
call horizontal
SetConst Y = 82
end
 
procedure r4
Compute Y = $Y + 82 * 3
call horizontal
SetConst Y = 82
end
 
procedure r5
Compute Y = $Y + 82 * 4
call horizontal
SetConst Y = 82
end
 
procedure r6
Compute Y = $Y + 82 * 5
call horizontal
SetConst Y = 85
end
 
procedure r7
SetConst Y = 614
call horizontal
SetConst Y = 85
end
 
procedure r8
Compute Y = $Y + 82 * 7
call horizontal
SetConst Y = 85
end
 
procedure vertical
loop 5
Mousepos $X, $Y
call c
Compute Y = $Y + 82
Mousepos $X, $Y
call cc
call done1
call cblue
end
call c
SetConst Y = 614
Mousepos $X, $Y
call c
delay 50
call cc
SetConst Y = 657
Mousepos $X, $Y
call c
SetConst Y = 85
delay 80
end
 
//------EXPLORE-----------
procedure v1
call vertical
end
 
procedure v2
Compute X = $X + 81 * 1
call vertical
SetConst X = 423
end
 
procedure v3
Compute X = $X + 81 * 2
call vertical
SetConst X = 423
end
 
procedure v4
Compute X = $X + 81 * 3
call vertical
SetConst X = 423
end
 
procedure v5
Compute X = $X + 81 * 4
call vertical
SetConst X = 423
end
 
procedure v6
Compute X = $X + 81 * 5
call vertical
SetConst X = 423
end
 
procedure v7
Compute X = $X + 81 * 6
call vertical
SetConst X = 423
end
 
procedure v8
Compute X = $X + 81 * 7
call vertical
SetConst X = 423
end
 
procedure multicolor
loop 10
call showcolor $A, $B
delay 10
keys {up}
Compute A = $A + 1
end
Compute A = $A - 10
Compute B = $B + 10
loop 10
call showcolor $A, $B
delay 10
keys {up}
Compute A = $A + 1
end
Compute A = $A - 10
Compute B = $B - 10
end
 
procedure multicolor200 // invullen https://www.diffchecker.com/diff
loop 200
call showcolor $A, $B
delay 10
keys {up}
Compute A = $A + 1
end
Compute A = $A - 200
//Compute B = $B + 10
loop 80
call showcolor $A, $B
delay 10
keys {up}
Compute A = $A + 1
Compute B = $B + 1
end
Compute A = $A - 200
//Compute B = $B - 10
end
 
constants
A = 265
B = 729
end
 
procedure explore
delay 1500
MousePos 1043, 722 // play again
call c
delay 50
call c
delay 50
call c
delay 50
call c
delay 50
end
 
procedure done1 // to check when the battle is over and start a new one
call getcolor 112, 66
if $Red
loop 10
call getcolor 112, 66
if $Red
call explore
MousePos 909, 622 // failsafe mastery level up
call c
timestamp
end
end
end
end
 
(*SPELLS*)
 
Object Kerb // 236, 309 op 2
  158=0,0|112=2,0
  68=6,0|145=10,10
End
 
Object Dime // 234, 490 oN 3
  251=0,0|255=0,2
  242=2,0|255=2,2
  
Object Evil // 265, 161 oN 1
  243=0,0|168=0,10
  182=8,0|119=8,10
End
 
Object Hynd // 202, 675 oN 4
  70=2,0|58=2,10
  239=6,0|240=6,2
End
 
procedure dime
IsObject Dime at 234, 490
delay 2000
call s3
end
end
 
procedure Evil
IsObject Evil at 265, 161
delay 2000
call s1
end
end
 
procedure Kerb
IsObject Kerb at 236, 309
delay 2000
call s2-
end
end
 
procedure Hynd
IsObject Hynd at 202, 675
delay 2000
call splash4
end
end
 
procedure spellz
call Evil
call Kerb
call Dime
call Hynd
end
 
procedure script1 //Explorer
loop 1000
setconst Color = Green
call grid
call cred
call r1
call cred
call r2
call cred
call r3
call cred
call r4
call cred
call r5
call cred
call r6
call cred
call r7
call cred
call r8
call cred
call v1
call cred
call v2
call cred
call v3
call cred
call v4
call cred
call v5
call cred
call v6
call cred
call v7
call cred
call v8
end
end
 
call script1

 
I'm now using "call script1" to use a mix of my static script which matches all possibilities without checking colors and "procedure grid" with color set to green to check for green gems once in a while as they are the most important gems to me.
 
"procedure script" is the one in which it looks for specific colors.

Share this post


Link to post
Share on other sites

Thanks for that. I'll have a look tomorrow seeing as it is 10:48pm here :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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