^ Why does that matter...
This will disable cabebot, cast "Exana pox" if you are poisoned and stand still until your skull leaves then start botting again.
local yourName = "Your Char name"
if getcreature(yourName).skull ~= 0 then
if poisoned and cancast("exana pox") then
You do not need to disable looting, because it only loots if cavebot is on
You shouldn't disable targeting because if you're going to just stand there, people can lure things on you very easy, by not turning it off, it will kill/finish killing anything on screen.
If you have actions that use AoE attacks, add another line before "setcavebot("off")" to disable the action and another line after "else" to turn them back on.