Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Microsoft.Win32;
- using System.Diagnostics;
- using System.IO;
- using System.Net;
- namespace FarmingTimer
- {
- public partial class Form1 : Form
- {
- public int treeTime;
- public Form1()
- {
- InitializeComponent();
- checkUpdates();
- initTimers();
- progressTimers();
- }
- public void initTimers()
- {
- timer1.Interval = 1000;
- timer2.Interval = 1000;
- timer3.Interval = 1000;
- timer4.Interval = 1000;
- timer5.Interval = 1000;
- timer6.Interval = 1000;
- timer7.Interval = 1000;
- timer8.Interval = 1000;
- timer9.Interval = 1000;
- timer10.Interval = 1000;
- timer11.Interval = 1000;
- timer12.Interval = 1000;
- timer13.Interval = 1000;
- timer14.Interval = 1000;
- timer15.Interval = 1000;
- timer1.Tick += new EventHandler(timer1_Tick);
- timer2.Tick += new EventHandler(timer2_Tick);
- timer3.Tick += new EventHandler(timer3_Tick);
- timer4.Tick += new EventHandler(timer4_Tick);
- timer5.Tick += new EventHandler(timer5_Tick);
- timer6.Tick += new EventHandler(timer6_Tick);
- timer7.Tick += new EventHandler(timer7_Tick);
- timer8.Tick += new EventHandler(timer8_Tick);
- timer9.Tick += new EventHandler(timer9_Tick);
- timer10.Tick += new EventHandler(timer10_Tick);
- timer11.Tick += new EventHandler(timer11_Tick);
- timer12.Tick += new EventHandler(timer12_Tick);
- timer13.Tick += new EventHandler(timer13_Tick);
- timer14.Tick += new EventHandler(timer14_Tick);
- timer15.Tick += new EventHandler(timer15_Tick);
- }
- public void progressTimers()
- {
- progressBar1.Visible = true;
- progressBar2.Visible = true;
- progressBar3.Visible = true;
- progressBar4.Visible = true;
- progressBar5.Visible = true;
- progressBar6.Visible = true;
- progressBar7.Visible = true;
- progressBar8.Visible = true;
- progressBar9.Visible = true;
- progressBar10.Visible = true;
- progressBar11.Visible = true;
- progressBar12.Visible = true;
- progressBar13.Visible = true;
- progressBar14.Visible = true;
- progressBar15.Visible = true;
- progressBar1.Value = 0;
- progressBar2.Value = 0;
- progressBar3.Value = 0;
- progressBar4.Value = 0;
- progressBar5.Value = 0;
- progressBar6.Value = 0;
- progressBar7.Value = 0;
- progressBar8.Value = 0;
- progressBar9.Value = 0;
- progressBar10.Value = 0;
- progressBar11.Value = 0;
- progressBar12.Value = 0;
- progressBar13.Value = 0;
- progressBar14.Value = 0;
- progressBar15.Value = 0;
- progressBar1.Minimum = 0;
- progressBar2.Minimum = 0;
- progressBar3.Minimum = 0;
- progressBar4.Minimum = 0;
- progressBar5.Minimum = 0;
- progressBar6.Minimum = 0;
- progressBar7.Minimum = 0;
- progressBar8.Minimum = 0;
- progressBar9.Minimum = 0;
- progressBar10.Minimum = 0;
- progressBar11.Minimum = 0;
- progressBar12.Minimum = 0;
- progressBar13.Minimum = 0;
- progressBar14.Minimum = 0;
- progressBar15.Minimum = 0;
- progressBar1.Maximum = 4800;
- progressBar2.Maximum = 4800;
- progressBar3.Maximum = 4800;
- progressBar4.Maximum = 4800;
- progressBar10.Maximum = 52560;
- progressBar11.Maximum = 52560;
- progressBar12.Maximum = 52560;
- progressBar13.Maximum = 52560;
- progressBar14.Maximum = 52560;
- progressBar15.Maximum = 52560;
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (comboBox1.SelectedItem.ToString() == "Oak")
- treeTime = 8400;
- else if (comboBox1.SelectedItem.ToString() == "Willow")
- treeTime = 13200;
- else if (comboBox1.SelectedItem.ToString() == "Maple")
- treeTime = 18000;
- else if (comboBox1.SelectedItem.ToString() == "Yew")
- treeTime = 22800;
- else if (comboBox1.SelectedItem.ToString() == "Magic")
- treeTime = 27600;
- timer5.Stop();
- timer6.Stop();
- timer7.Stop();
- timer7.Stop();
- timer9.Stop();
- progressBar5.Value = 0;
- progressBar6.Value = 0;
- progressBar7.Value = 0;
- progressBar8.Value = 0;
- progressBar9.Value = 0;
- progressBar5.Maximum = treeTime;
- progressBar6.Maximum = treeTime;
- progressBar7.Maximum = treeTime;
- progressBar8.Maximum = treeTime;
- progressBar9.Maximum = treeTime;
- }
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- try
- {
- Process.Start("http://www.youtube.com/tcoygames");
- }
- catch (Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- public void checkUpdates()
- {
- string news;
- WebClient web = new WebClient();
- news = web.DownloadString("http://tcoy.netau.net/ftnews");
- label2.Text = news;
- if (web.DownloadString("http://tcoy.netau.net/ftupdate") == "true")
- MessageBox.Show("Farming Timer updated! Please visit tcoy.netau.net/farmingtimer to download the newest version!");
- }
- //###########################################################################\\
- public void timer1_Tick(object sender, EventArgs e) //S.Falador timer
- {
- if (progressBar1.Value != progressBar1.Maximum)
- {
- progressBar1.Value += 1;
- }
- else
- {
- timer1.Stop();
- MessageBox.Show("S.Falador Herb patch ready to harvest!");
- }
- }
- public void timer2_Tick(object sender, EventArgs e) // Phasmatys timer
- {
- if (progressBar2.Value != progressBar2.Maximum)
- {
- progressBar2.Value += 1;
- }
- else
- {
- timer2.Stop();
- MessageBox.Show("Port Phasmatys Herb patch ready to harvest!");
- }
- }
- public void timer3_Tick(object sender, EventArgs e) // N.Catherby timer
- {
- if (progressBar3.Value != progressBar3.Maximum)
- {
- progressBar3.Value += 1;
- }
- else
- {
- timer3.Stop();
- MessageBox.Show("N.Catherby Herb patch ready to harvest!");
- }
- }
- public void timer4_Tick(object sender, EventArgs e) // N.Ardougne timer
- {
- if (progressBar4.Value != progressBar4.Maximum)
- {
- progressBar4.Value += 1;
- }
- else
- {
- timer4.Stop();
- MessageBox.Show("N.Ardougne Herb patch ready to harvest!");
- }
- }
- public void timer5_Tick(object sender, EventArgs e) // Lumbridge tree timer
- {
- if (progressBar5.Value != progressBar5.Maximum)
- {
- progressBar5.Value += 1;
- }
- else
- {
- timer5.Stop();
- MessageBox.Show("Lumbridge tree patch ready to harvest!");
- }
- }
- public void timer6_Tick(object sender, EventArgs e) // Varrock tree timer
- {
- if (progressBar6.Value != progressBar6.Maximum)
- {
- progressBar6.Value += 1;
- }
- else
- {
- timer6.Stop();
- MessageBox.Show("Varrock tree patch ready to harvest!");
- }
- }
- public void timer7_Tick(object sender, EventArgs e) // Falador tree timer
- {
- if (progressBar7.Value != progressBar7.Maximum)
- {
- progressBar7.Value += 1;
- }
- else
- {
- timer7.Stop();
- MessageBox.Show("Falador tree patch ready to harvest!");
- }
- }
- public void timer8_Tick(object sender, EventArgs e) // Taverly tree timer
- {
- if (progressBar8.Value != progressBar8.Maximum)
- {
- progressBar8.Value += 1;
- }
- else
- {
- timer8.Stop();
- MessageBox.Show("Taverly tree patch ready to harvest!");
- }
- }
- public void timer9_Tick(object sender, EventArgs e) // Stronghold tree timer
- {
- if (progressBar9.Value != progressBar9.Maximum)
- {
- progressBar9.Value += 1;
- }
- else
- {
- timer9.Stop();
- MessageBox.Show("Gnome Stronghold tree patch ready to harvest!");
- }
- }
- public void timer10_Tick(object sender, EventArgs e) // Catherby Ftree timer
- {
- if (progressBar10.Value != progressBar10.Maximum)
- {
- progressBar10.Value += 1;
- }
- else
- {
- timer10.Stop();
- MessageBox.Show("Catherby fruit tree patch ready to harvest!");
- }
- }
- public void timer11_Tick(object sender, EventArgs e) // Gnome Maze Ftree timer
- {
- if (progressBar11.Value != progressBar11.Maximum)
- {
- progressBar11.Value += 1;
- }
- else
- {
- timer11.Stop();
- MessageBox.Show("Gnome maze fruit tree patch ready to harvest!");
- }
- }
- public void timer12_Tick(object sender, EventArgs e) // Brimhaven Ftree timer
- {
- if (progressBar12.Value != progressBar12.Maximum)
- {
- progressBar12.Value += 1;
- }
- else
- {
- timer12.Stop();
- MessageBox.Show("Brimhaven fruit tree patch ready to harvest!");
- }
- }
- public void timer13_Tick(object sender, EventArgs e) // Agility Course Ftree timer
- {
- if (progressBar13.Value != progressBar13.Maximum)
- {
- progressBar13.Value += 1;
- }
- else
- {
- timer13.Stop();
- MessageBox.Show("Brimhaven fruit tree patch ready to harvest!");
- }
- }
- public void timer14_Tick(object sender, EventArgs e) // Lletya Ftree timer
- {
- if (progressBar14.Value != progressBar14.Maximum)
- {
- progressBar14.Value += 1;
- }
- else
- {
- timer14.Stop();
- MessageBox.Show("Lletya fruit tree patch ready to harvest!");
- }
- }
- public void timer15_Tick(object sender, EventArgs e) // Herblore Habitat Ftree timer
- {
- if (progressBar15.Value != progressBar15.Maximum)
- {
- progressBar15.Value += 1;
- }
- else
- {
- timer15.Stop();
- MessageBox.Show("Herblore Habitat fruit tree patch ready to harvest!");
- }
- }
- //###########################################################################\\
- private void button1_Click(object sender, EventArgs e) // S.Falador button
- {
- if (button1.Text == "S.Falador")
- {
- timer1.Start();
- button1.Text = "Stop";
- }
- else
- {
- progressBar1.Value = 0;
- timer1.Stop();
- button1.Text = "S.Falador";
- }
- }
- private void button2_Click(object sender, EventArgs e) // Phasmatys button
- {
- if (button2.Text == "Phasmatys")
- {
- timer2.Start();
- button2.Text = "Stop";
- }
- else
- {
- progressBar2.Value = 0;
- timer2.Stop();
- button2.Text = "Phasmatys";
- }
- }
- private void button3_Click(object sender, EventArgs e) // N.Catherby button
- {
- if (button3.Text == "N.Catherby")
- {
- timer3.Start();
- button3.Text = "Stop";
- }
- else
- {
- progressBar3.Value = 0;
- timer3.Stop();
- button3.Text = "N.Catherby";
- }
- }
- private void button4_Click(object sender, EventArgs e) // N.Ardougne button
- {
- if (button4.Text == "N.Ardougne")
- {
- timer4.Start();
- button4.Text = "Stop";
- }
- else
- {
- progressBar4.Value = 0;
- timer4.Stop();
- button4.Text = "N.Ardougne";
- }
- }
- private void button5_Click(object sender, EventArgs e) // Donation button
- {
- try
- {
- Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=3YRSBENF7QDFN&lc=US&item_name=Donation%20to%20tcoy¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted");
- }
- catch (Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- private void button6_Click(object sender, EventArgs e) // Lumbridge tree button
- {
- if (button6.Text == "Lumbridge")
- {
- timer5.Start();
- button6.Text = "Stop";
- }
- else
- {
- progressBar5.Value = 0;
- timer5.Stop();
- button6.Text = "Lumbridge";
- }
- }
- private void button7_Click(object sender, EventArgs e) // Varrock tree button
- {
- if (button7.Text == "Varrock")
- {
- timer6.Start();
- button7.Text = "Stop";
- }
- else
- {
- progressBar6.Value = 0;
- timer6.Stop();
- button7.Text = "Varrock";
- }
- }
- private void button8_Click(object sender, EventArgs e) // Falador tree button
- {
- if (button8.Text == "Falador")
- {
- timer7.Start();
- button8.Text = "Stop";
- }
- else
- {
- progressBar7.Value = 0;
- timer7.Stop();
- button8.Text = "Falador";
- }
- }
- private void button9_Click(object sender, EventArgs e) // Taverley tree button
- {
- if (button9.Text == "Taverley")
- {
- timer8.Start();
- button9.Text = "Stop";
- }
- else
- {
- progressBar8.Value = 0;
- timer8.Stop();
- button9.Text = "Taverley";
- }
- }
- private void button10_Click(object sender, EventArgs e) // Stronghold tree button
- {
- if (button10.Text == "Stronghold")
- {
- timer9.Start();
- button10.Text = "Stop";
- }
- else
- {
- progressBar9.Value = 0;
- timer9.Stop();
- button10.Text = "Stronghold";
- }
- }
- private void button11_Click(object sender, EventArgs e)
- {
- if (button11.Text == "Catherby")
- {
- timer10.Start();
- button11.Text = "Stop";
- }
- else
- {
- progressBar10.Value = 0;
- timer10.Stop();
- button11.Text = "Catherby";
- }
- } // Catherby Ftree button
- private void button12_Click(object sender, EventArgs e)
- {
- if (button12.Text == "Gnome maze")
- {
- timer11.Start();
- button12.Text = "Stop";
- }
- else
- {
- progressBar11.Value = 0;
- timer11.Stop();
- button12.Text = "Gnome maze";
- }
- } // Gnome Maze Ftree button
- private void button13_Click(object sender, EventArgs e)
- {
- if (button13.Text == "Brimhaven")
- {
- timer12.Start();
- button13.Text = "Stop";
- }
- else
- {
- progressBar12.Value = 0;
- timer12.Stop();
- button13.Text = "Brimhaven";
- }
- } // Brimhaven Ftree button
- private void button14_Click(object sender, EventArgs e)
- {
- if (button14.Text == "Agility Course")
- {
- timer13.Start();
- button14.Text = "Stop";
- }
- else
- {
- progressBar13.Value = 0;
- timer13.Stop();
- button14.Text = "Agility Course";
- }
- } // Agility Course Ftree button
- private void button15_Click(object sender, EventArgs e)
- {
- if (button15.Text == "Lletya")
- {
- timer14.Start();
- button15.Text = "Stop";
- }
- else
- {
- progressBar14.Value = 0;
- timer14.Stop();
- button15.Text = "Lletya";
- }
- } // Lletya Ftree button
- private void button16_Click(object sender, EventArgs e)
- {
- if (button16.Text == "HerbHabitat")
- {
- timer15.Start();
- button16.Text = "Stop";
- }
- else
- {
- progressBar15.Value = 0;
- timer15.Stop();
- button16.Text = "HerbHabitat";
- }
- } // Herblore Habitat Ftree button
- //###########################################################################\\
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment