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; // hearthstone to INN then logout if (cbAlarmHearthstone.Checked) { foreach (WoW_Object item in wow.Inventory.GetAllItems()) { if (item == null) continue; if (item.Name == "Hearthstone") { wow.Inventory.UseItem(item.Name); while (wow.Player.IsCasting) { } wow.SendScript("Logout()"); return; } } // we shouldn't get here if the above was checked wow.SendScript("Logout()"); } } }