January 16, 20179 yr So, I wrote this looting script for bounty hunter worlds that I run on my pures whilst I'm sleeping or at class. However, I get killed by targets frequently. My proposed solution is to run to the line when in combat then relog. But anybody in my bot's bracket can just hit me over and over to make me relog. This leads me to the question is there a way to check if you have a target? If so, how?
January 16, 20179 yr you check if you are underattack by: myPlayer().isUnderAttack(); if you want to check if your player is fighting check by: getCombat().isFighting(); if you want to check whether you are interacting with someone: myPlayer().isInteracting(); These were written without an IDE and may have some errors, if you want to find out more methods check the api: http://osbot.org/api Edited January 16, 20179 yr by Precise
January 16, 20179 yr Author you check if you are underattack by: myPlayer().isUnderAttack(); if you want to check if your player is fighting check by: getCombat().isFighting(); if you want to check whether you are interacting with someone: myPlayer().isInteracting(); These were written without an IDE and may have some errors, if you want to find out more methods check the api: http://osbot.org/api Thanks for the response! My original idea was to check if my player was in combat. However, if someone wants to hit me over and over issues can arise. I rather something more consistent, someone in the shoutbox mentioned I could use widgets to check my target. I will be doing so when I am back at my room.