Im not familiar with ibot yet, dunno many functions but i need something like following

IF player atack me then turn cavebot off, kill all monsters around and force exit?

Also just in case if i stay longer than 50 sec and im not in pz zone then exit

Is it possible? Any help ll be appreciated