I'm trying to figure out what I'm doing wrong here. Instead of moving on to each section, it's just running through the entire sequence top to bottom then looping back around to popping my Snackbar back up so I can start over? You guys notice anything wrong with the way my if statements are? Or maybe my variables?
CheckMobs (10)
A1: Variable Set [ Name:%attacking To:0 Do Maths:Off Append:Off ]
<beginloop>
A2: AutoInput Root [ Configuration:Capture Screen: /sdcard/scr.png Timeout (Seconds):100 ]
<tell where to start>
A3: If [ %attacking ~ 0 ]
A4: Goto [ Type:Action Label Number:1 Label:start topmob ]
<still attacking the top mob>
A5: Else If [ %attacking ~ 1 ]
A6: Goto [ Type:Action Label Number:1 Label:top still attacking ]
<start attacking right mob>
A7: Else If [ %attacking ~ 2 ]
A8: Goto [ Type:Action Label Number:1 Label:start right mob ]
<still attacking right mob>
A9: Else If [ %attacking ~ 3 ]
A10: Goto [ Type:Action Label Number:1 Label:right still attacking ]
<start attacking bot mob>
A11: Else If [ %attacking ~ 4 ]
A12: Goto [ Type:Action Label Number:1 Label:start bot mob ]
<still attacking bot mob>
A13: Else If [ %attacking ~ 5 ]
A14: Goto [ Type:Action Label Number:1 Label:bot still attacking ]
<start attacking left mob>
A15: Else If [ %attacking ~ 6 ]
A16: Goto [ Type:Action Label Number:1 Label:start left mob ]
<still attacking left mob>
A17: Else If [ %attacking ~ 7 ]
A18: Goto [ Type:Action Label Number:1 Label:left still attacking ]
A19: Else If [ %attacking ~ 8 ]
A20: Return [ Value:1 Stop:On ]
A21: End If
<start topmob>
A22: AutoPhoto Metadata [ Configuration
ath: %capturepath
Get Pixel Color: 730,915 Timeout (Seconds):5 ]
<top green or yellow>
A23: If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 0 ]
<click top mob>
A24: Run Shell [ Command:input tap 960 400 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A25: Variable Set [ Name:%attacking To:1 Do Maths:Off Append:Off ]
<top still attacking>
A26: Else If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 1 ]
A27: Goto [ Type:Action Label Number:1 Label:beginloop ]
<stop attacking red mob>
A28: Else If [ %appixelcolor ~ #ffce3131 | %appixelcolor ~ #ffce3531 | %appixelcolor ~ ##ffd6353a ]
A29: Variable Set [ Name:%attacking To:2 Do Maths:Off Append:Off ]
A30: Goto [ Type:Action Label Number:% Label:start right mob ]
A31: End If
<start right mob>
A32: AutoPhoto Metadata [ Configuration
ath: %capturepath
Get Pixel Color: 610,1030 Timeout (Seconds):5 ]
<rightmob>
A33: If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 2 ]
A34: Run Shell [ Command:input tap 1080 540 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A35: Variable Set [ Name:%attacking To:3 Do Maths:Off Append:Off ]
<right still attacking>
A36: Else If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 3 ]
A37: Goto [ Type:Action Label Number:1 Label:beginloop ]
<stop attacking red mob>
A38: Else If [ %appixelcolor ~ #ffce3131 | %appixelcolor ~ #ffce3531 | %appixelcolor ~ ##ffd6353a ]
A39: Variable Set [ Name:%attacking To:4 Do Maths:Off Append:Off ]
A40: Goto [ Type:Action Label Number:1 Label:start bot mob ]
A41: End If
<start bot mob>
A42: AutoPhoto Metadata [ Configuration
ath: %capturepath
Get Pixel Color: 490,910 Timeout (Seconds):5 ]
<botmob>
A43: If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 4 ]
A44: Run Shell [ Command:input tap 960 650 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A45: Variable Set [ Name:%attacking To:5 Do Maths:Off Append:Off ]
<bot still attacking>
A46: Else If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 5 ]
A47: Goto [ Type:Action Label Number:1 Label:beginloop ]
<stop attacking red mob>
A48: Else If [ %appixelcolor ~ #ffce3131 | %appixelcolor ~ #ffce3531 | %appixelcolor ~ ##ffd6353a ]
A49: Variable Set [ Name:%attacking To:6 Do Maths:Off Append:Off ]
A50: Goto [ Type:Action Label Number:1 Label:start left mob ]
A51: End If
<start left mob>
A52: AutoPhoto Metadata [ Configuration
ath: %capturepath
Get Pixel Color: 610,790 Timeout (Seconds):5 ]
A53: If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 6 ]
A54: Run Shell [ Command:input tap 840 530 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A55: Variable Set [ Name:%attacking To:7 Do Maths:Off Append:Off ]
<left still attacking>
A56: Else If [ %appixelcolor ~ #ff21ba4a | %appixelcolor ~ #ff19ba4a | %appixelcolor ~ #ffe6ff00 | %appixelcolor ~ #ffeeff00 & %attacking ~ 7 ]
A57: Goto [ Type:Action Label Number:1 Label:beginloop ]
A58: Else If [ %appixelcolor ~ #ffce3131 | %appixelcolor ~ #ffce3531 | %appixelcolor ~ ##ffd6353a ]
A59: Variable Set [ Name:%attacking To:8 Do Maths:Off Append:Off ]
A60: Goto [ Type:Action Label Number:1 Label:beginloop ]
A61: End If