Complex sentence: When Jestro first allied with the Book of Monsters, Merlok used his magic to drive them out of the capital city but was absorbed into the castle's computers as a result.
Split into simpler sentences: When Jestro first allied with the Book of Monsters, Merlok used his magic to drive them out of the capital city. The side effect of this magic caused Merlok to be absorbed into the castle's computers as a result.