rendered paste body private void AlarmTimer_Tick(object sender, EventArgs e)
{
alarmstarttime--;
UpdateTitle(alarmstarttime, totallooted, fishingtime);
if (alarmstarttime == 0)
{
AlarmTimer.Stop();
UpdateTitle(alarmstarttime, totallooted, fishingtime);
this.btnAlarmStart.Enabled = true;
this.btnAlarmStop.Enabled = false;
// stop the fisher
btnStop_Click(sender, e);
// hearthstone to INN then logout
if (cbAlarmHearthstone.Checked)
{
bool foundhearthstone = false;
foreach (WoW_Object item in wow.Inventory.GetAllItems())
{
if (item == null)
continue;
if (item.Name == "Hearthstone")
{
foundhearthstone = true;
wow.Inventory.UseItem(item.Name);
// casting delay
Thread.Sleep(10000 + rnd.Next(500));
wow.SendScript("Logout()");
return;
}
}
if (!foundhearthstone)
{
// unable to find hearthstone, just logout
cbAlarmHearthstone.Checked = false;
wow.SendScript("Logout()");
}
}
// we shouldn't get here if the above was checked
wow.SendScript("Logout()");
}
}