Advertisement
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.Xna.Framework.Input;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- int timeleft = 3600;
- int clicksleft = 21600;
- int labeltime = 10;
- public Form1()
- {
- InitializeComponent();
- timer1.Start();
- timer2.Start();
- lblCheat.Hide();
- }
- private void Form1_MouseLeave(object sender, EventArgs e)
- {
- goback();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- goback();
- if (cheating == true)
- {
- timer3.Start();
- lblCheat.Show();
- }
- }
- private void goback()
- {
- Point zurück = yesBtn.Location;
- zurück.Offset(68, 16);
- Cursor.Position = PointToScreen(zurück);
- this.BringToFront();
- this.Activate();
- if (Keyboard.GetState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Enter))
- {
- clicksleft = clicksleft + 21600;
- timeleft = timeleft + 3600;
- }
- }
- private void timer2_Tick(object sender, EventArgs e)
- {
- timeleft -= 1;
- timeWait.Text = timeleft.ToString() + " seconds";
- if (timeleft <= 0)
- {
- timer1.Stop();
- timer2.Stop();
- MessageBox.Show(" Hope you learned something!", "Lesson 4 the life", MessageBoxButtons.OK,
- MessageBoxIcon.Warning);
- this.Close();
- }
- }
- private void yesBtn_KeyUp(object sender, KeyEventArgs e)
- {
- clicksleft = clicksleft + 21600;
- timeleft = timeleft + 3600;
- cheating = true;
- }
- private void yesBtn_Click(object sender, EventArgs e)
- {
- clicksleft = clicksleft - 1;
- clicksübrig.Text = clicksleft.ToString() + " clicks left";
- if (clicksleft <= 0)
- {
- timer1.Stop();
- timer2.Stop();
- MessageBox.Show(" Hope you learned something!", "Lesson 4 the life", MessageBoxButtons.OK,
- MessageBoxIcon.Warning);
- this.Close();
- }
- }
- bool cheating = false;
- private void timer3_Tick(object sender, EventArgs e)
- {
- labeltime = labeltime - 1;
- if (labeltime <= 0)
- {
- lblCheat.Hide();
- timer3.Stop();
- cheating = false;
- }
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- e.Cancel = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement