namespace firstMacro
{
class Program
{
static DateTime lastBandage;
static DateTime nextBandage;
static double bandageDelay;
static void Main(string[] args)
{
lastBandage = DateTime.Now;
while (true)
{
int hp = Stealth.Script_GetSelfLife();
int maxHp = Stealth.Script_GetSelfMaxLife();
if (hp < maxHp)
{
BandageSelf();
}
}
}
public static void BandageSelf()
{
bandageDelay = 5.0 + (0.5 * ((double)(120 - Stealth.Script_GetSelfDex()) / 10));
nextBandage = lastBandage.AddSeconds(bandageDelay + 0.2); // + 0.2s is just for testing.
if (nextBandage <= DateTime.Now)
{
Stealth.Script_SendTextToUO("[band"); // [band is a server command for bandaging.
lastBandage = DateTime.Now;
}
}
}
}
The problems are;
1- Stealth does'nt get hitpoints and any other stats instantly. (because of this, the script can't start to aid instantly)
2- After aiding successfuly, if hitpoints equals to maxhits, the script starts to wait the delay even if the character gets wounded in that time. (this could be related to script)
Stealth version : 6.0.0
Client version : 6.0.1.10
(if i want to update my stealth version, there becomes lots of problems, its the most stable version for me right now)