Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Microsoft.Xna.Framework.Input;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class Form1 : Form
  14. {
  15. int timeleft = 3600;
  16. int clicksleft = 21600;
  17. int labeltime = 10;
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. timer1.Start();
  22. timer2.Start();
  23. lblCheat.Hide();
  24.  
  25. }
  26.  
  27. private void Form1_MouseLeave(object sender, EventArgs e)
  28. {
  29. goback();
  30.  
  31. }
  32.  
  33. private void timer1_Tick(object sender, EventArgs e)
  34. {
  35. goback();
  36. if (cheating == true)
  37. {
  38. timer3.Start();
  39. lblCheat.Show();
  40.  
  41. }
  42.  
  43.  
  44.  
  45. }
  46. private void goback()
  47. {
  48. Point zurück = yesBtn.Location;
  49. zurück.Offset(68, 16);
  50. Cursor.Position = PointToScreen(zurück);
  51.  
  52. this.BringToFront();
  53. this.Activate();
  54.  
  55. if (Keyboard.GetState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Enter))
  56. {
  57. clicksleft = clicksleft + 21600;
  58. timeleft = timeleft + 3600;
  59. }
  60. }
  61.  
  62. private void timer2_Tick(object sender, EventArgs e)
  63. {
  64. timeleft -= 1;
  65. timeWait.Text = timeleft.ToString() + " seconds";
  66. if (timeleft <= 0)
  67. {
  68. timer1.Stop();
  69. timer2.Stop();
  70.  
  71. MessageBox.Show(" Hope you learned something!", "Lesson 4 the life", MessageBoxButtons.OK,
  72. MessageBoxIcon.Warning);
  73. this.Close();
  74. }
  75. }
  76. private void yesBtn_KeyUp(object sender, KeyEventArgs e)
  77. {
  78. clicksleft = clicksleft + 21600;
  79. timeleft = timeleft + 3600;
  80. cheating = true;
  81. }
  82. private void yesBtn_Click(object sender, EventArgs e)
  83. {
  84. clicksleft = clicksleft - 1;
  85. clicksübrig.Text = clicksleft.ToString() + " clicks left";
  86. if (clicksleft <= 0)
  87. {
  88. timer1.Stop();
  89. timer2.Stop();
  90. MessageBox.Show(" Hope you learned something!", "Lesson 4 the life", MessageBoxButtons.OK,
  91. MessageBoxIcon.Warning);
  92. this.Close();
  93. }
  94. }
  95. bool cheating = false;
  96.  
  97. private void timer3_Tick(object sender, EventArgs e)
  98. {
  99. labeltime = labeltime - 1;
  100. if (labeltime <= 0)
  101. {
  102. lblCheat.Hide();
  103. timer3.Stop();
  104. cheating = false;
  105. }
  106. }
  107.  
  108. private void Form1_FormClosing(object sender, FormClosingEventArgs e)
  109. {
  110. e.Cancel = true;
  111. }
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121. }
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement