All pastes #21600 Raw Edit

Miscellany

public text v1 · immutable
#21600 ·published 2005-08-30 14:45 UTC
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()");
			}
		}