On the Subject of Yellow Levers

8 decisions, and only one can be your last.
Is that different enough?

This module has 8 small levers on it.
If the first lever is not yellow, you are looking at a different module.

To disarm the module, determine which lever gives a strike, and flip all other levers except that one.

First, take the number of all solvable modules on the bomb, count the amount of levers starting from the first, looping back to the beginning if you reach the 8th, and the lever you land on will be your Key Lever. Remember it. The first Yellow lever is lever 1.

Then, calculate the sum of all characters in the Serial Number, converting letters into numbers via A1Z26, but ignore all vowels, then multiply it by the number of batteries on the bomb, add the number of indicators, modulo 30, and that is the row you want to start on.

If the condition is true, flip all levers except the one stated by the row.
Otherwise, move down the table by the number specified.
If you go beyond Row 29, loop back to the top of the table.
If you land on a condition already visited, move down one row at a time until you land on an unvisited condition.
Keep doing this until you find a true condition.

Note: If the word "Levers" is capitalized, that means the condition is referring to a different module. Otherwise, it's referring to the levers on the module.

Row Avoid/If... Otherwise, move down by...
0 Third/It's Yellow # of batteries + 2
1 First/Key Lever is Red (# of lit indicators + 1) × 2
2 Key Lever/It's Blue # of ports + 1
3 Sixth/No ports on bomb Key Lever's position
4 Second/It's not Green # battery holders + 7
5 Last/Key Lever is the Second The first letter of the Key lever's colour, converted to a number.
6 Fifth/No Blue levers (# of Blue levers × 3) - 1
7 Third/>3 batteries # of batteries + 3
8 Fourth/Key Lever is not Green Key Lever's position
Row Avoid/If... Otherwise, move down by...
9 Seventh/No Red Levers on bomb # of all Levers modules on bomb (including itself)
10 Key Lever/It's Red # of Red levers on module + 2
11 Second/Its colour matches the Key Lever Key Lever's position
12 Fifth/Key Lever's position matches the last digit of the Serial # Last digit of Serial #
13 Sixth/It's not Yellow # of port plates + 2
14 Seventh/There's a Needy on bomb # of solvable modules - 1
15 First/Key Lever is not Blue # of all Lever modules on bomb + 1 (including itself)
16 Third/It's not the Key Lever Distance from the third and the Key Lever
17 Fourth/No batteries # of batteries × 2
18 Last/Its colour is different from the Key Lever # of levers matching with matching colour with the Key Lever (including itself)
19 Key Lever/Last lever is Red The last letter of the Key lever's colour, converted to a number.
20 Second/Its colour matches the third lever Key Lever's position + 1
21 Key Lever/It's Red # of Red levers on module + 2
22 Seventh/It's not Green # of Green levers on module + 7
23 Fourth/Serial ports on bomb # of non-Serial ports + 1
24 First/Third lever is Blue Yellow levers + 5
25 Key Lever/Red Levers on bomb Key Lever's position × 2
26 Sixth/Last digit of Serial # is 6 Last digit of Serial # + 3
27 Key Lever/You are currently on this rule. No Exception
28 Third/Its colour matches the last lever First letter of Serial #, converted to a number (A1Z26)
29 Key Lever/It's Green # of non-Green levers on module