okay, here's how you do this cleanly
right click opens a gui client side, with buttons with pictures and stuff that you click on to select spells, perhaps by submenus
right click > offensive, defensive, utility > left click > list of spells in grid maybe? > left click again
bam done
three clicks and you've selected your spell. fast, easy, intuitive