Why do you have the health to Cast % at 100%?
Seems unnecessary, but if you wanted to have it so you only shoot at over 80%hp or something you should change that "<" sign to ">" otherwise you will only shoot the rune when you are below that HP%.
local healthToCast = 80
local player = g_game.getLocalPlayer()
if g_game.isAttacking() and player:getHealthPercent() >= healthToCast then
g_game.useInventoryItemOnCreature(3198, g_game.getAttackingCreature())
sleep(900, 1100)
end
auto(100)