commit b502964c9ade11c08e0dff988144069170550764 Author: nitrogenoliquido <203537016+nitrogenoliquido@users.noreply.github.com> Date: Wed Dec 2 22:32:23 2026 -0500 added files diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..66ccd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vs/ +bin/ +obj/ +*.user diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 0000000..df0d377 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,7 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.Net.Component.4.8.1.TargetingPack" + ] +} diff --git a/Ctl.cs b/Ctl.cs new file mode 100644 index 0000000..53ca847 --- /dev/null +++ b/Ctl.cs @@ -0,0 +1,20 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; + +internal class Ctl : Control +{ + public Ctl() + { + SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, value: true); + BackColor = G.Card; + Cursor = Cursors.Hand; + } + + protected void Prep(Graphics g) + { + g.SmoothingMode = SmoothingMode.AntiAlias; + g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + } +} diff --git a/FloppaClicker.csproj b/FloppaClicker.csproj new file mode 100644 index 0000000..58e128b --- /dev/null +++ b/FloppaClicker.csproj @@ -0,0 +1,33 @@ + + + + + Debug + AnyCPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60} + FloppaClicker + FloppaClicker + WinExe + v4.8.1 + bin\$(Configuration)\net481\ + 8.0 + false + app.manifest + portable + true + + + + + + + + + + + + + + + + diff --git a/FloppaClicker.sln b/FloppaClicker.sln new file mode 100644 index 0000000..7fd0f76 --- /dev/null +++ b/FloppaClicker.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FloppaClicker", "FloppaClicker.csproj", "{191EC69A-5F65-43E9-BC2F-ED656EE5FA60}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|Any CPU.Build.0 = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|x64.ActiveCfg = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|x64.Build.0 = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|x86.ActiveCfg = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Debug|x86.Build.0 = Debug|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|Any CPU.ActiveCfg = Release|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|Any CPU.Build.0 = Release|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|x64.ActiveCfg = Release|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|x64.Build.0 = Release|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|x86.ActiveCfg = Release|Any CPU + {191EC69A-5F65-43E9-BC2F-ED656EE5FA60}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/G.cs b/G.cs new file mode 100644 index 0000000..8197ff3 --- /dev/null +++ b/G.cs @@ -0,0 +1,87 @@ +using System.Drawing; +using System.Drawing.Drawing2D; + +internal static class G +{ + public static readonly Color Bg = Color.FromArgb(12, 13, 17); + + public static readonly Color Card = Color.FromArgb(21, 22, 29); + + public static readonly Color Line = Color.FromArgb(40, 43, 58); + + public static readonly Color Acc = Color.FromArgb(90, 140, 255); + + public static readonly Color Txt = Color.FromArgb(232, 234, 240); + + public static readonly Color Dim = Color.FromArgb(124, 129, 150); + + public static readonly Color Ok = Color.FromArgb(72, 207, 142); + + public static readonly Font Big = new Font("Segoe UI", 26f, FontStyle.Bold); + + public static readonly Font H = new Font("Segoe UI", 11f, FontStyle.Bold); + + public static readonly Font Title = new Font("Segoe UI", 15f, FontStyle.Bold); + + public static readonly Font N = new Font("Segoe UI", 9.5f); + + public static readonly Font S = new Font("Segoe UI", 8.5f); + + public static readonly Image Logo = LoadLogo(); + + private static Image LoadLogo() + { + try + { + return Image.FromStream(typeof(G).Assembly.GetManifestResourceStream("FloppaClicker.Assets.Logo.png")); + } + catch + { + return null; + } + } + + public static void Circle(Graphics g, Image img, RectangleF r) + { + if (img == null) + { + return; + } + using GraphicsPath path = RR(r, r.Width); + Region clip = g.Clip; + g.SetClip(path, CombineMode.Intersect); + g.DrawImage(img, r.X, r.Y, r.Width, r.Height); + g.Clip = clip; + } + + public static GraphicsPath RR(RectangleF r, float d) + { + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddArc(r.X, r.Y, d, d, 180f, 90f); + graphicsPath.AddArc(r.Right - d, r.Y, d, d, 270f, 90f); + graphicsPath.AddArc(r.Right - d, r.Bottom - d, d, d, 0f, 90f); + graphicsPath.AddArc(r.X, r.Bottom - d, d, d, 90f, 90f); + graphicsPath.CloseFigure(); + return graphicsPath; + } + + public static void Fill(Graphics g, RectangleF r, float d, Color c) + { + using GraphicsPath path = RR(r, d); + using SolidBrush brush = new SolidBrush(c); + g.FillPath(brush, path); + } + + public static void T(Graphics g, string s, Font f, Color c, float x, float y, StringAlignment a) + { + using SolidBrush brush = new SolidBrush(c); + StringFormat stringFormat = new StringFormat(); + stringFormat.Alignment = a; + g.DrawString(s, f, brush, x, y, stringFormat); + } + + public static Color Mix(Color a, Color b, float t) + { + return Color.FromArgb((int)((float)(int)a.R + (float)(b.R - a.R) * t), (int)((float)(int)a.G + (float)(b.G - a.G) * t), (int)((float)(int)a.B + (float)(b.B - a.B) * t)); + } +} diff --git a/Graph.cs b/Graph.cs new file mode 100644 index 0000000..d560a19 --- /dev/null +++ b/Graph.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +internal class Graph : Ctl +{ + private List d = new List(); + + public Graph() + { + Size = new Size(368, 60); + Cursor = Cursors.Default; + } + + public void Add(double v) + { + lock (d) + { + d.Add(v); + if (d.Count > 60) + { + d.RemoveAt(0); + } + } + } + + public double[] Snap() + { + lock (d) + { + return d.ToArray(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + Prep(graphics); + graphics.Clear(BackColor); + G.Fill(graphics, new RectangleF(0f, 0f, Width - 1, Height - 1), 10f, G.Bg); + double[] array = Snap(); + float num = (float)Width / 60f; + for (int i = 0; i < array.Length; i++) + { + float num2 = (float)Math.Min(1.0, array[i] / 200.0) * (float)(Height - 8); + using SolidBrush brush = new SolidBrush(Color.FromArgb(200, G.Acc)); + graphics.FillRectangle(brush, (float)(60 - array.Length + i) * num + 1f, (float)(Height - 4) - num2, num - 2f, num2); + } + float num3 = (float)(Height - 4) - 0.5f * (float)(Height - 8); + Pen pen = new Pen(G.Dim, 1f); + pen.DashStyle = DashStyle.Dot; + using Pen pen2 = pen; + graphics.DrawLine(pen2, 0f, num3, Width, num3); + } +} diff --git a/MainForm.cs b/MainForm.cs new file mode 100644 index 0000000..28ac087 --- /dev/null +++ b/MainForm.cs @@ -0,0 +1,800 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Globalization; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +internal class MainForm : Form +{ + private delegate IntPtr HookProc(int n, IntPtr w, IntPtr l); + + private const int W = 780; + + private const int H = 500; + + private Slider sMin; + + private Slider sMax; + + private Seg sMode; + + private Seg sBtn; + + private Toggle tMc; + + private Graph gr; + + private System.Windows.Forms.Timer tick = new System.Windows.Forms.Timer(); + + private System.Windows.Forms.Timer fade = new System.Windows.Forms.Timer(); + + private volatile bool armed; + + private volatile bool clicking; + + private volatile bool ld; + + private volatile bool rd; + + private volatile bool run = true; + + private volatile bool breakMode; + + private double mn = 8.0; + + private double mx = 12.0; + + private double drift; + + private int mode = 2; + + private int btn; + + private int key = 117; + + private int breakKey = 118; + + private int hover; + + private int bindTarget; + + private int burstLeft; + + private bool onlyMc = true; + + private bool binding; + + private bool prevKey; + + private bool prevBreakKey; + + private long totalClicks; + + private double armStart = -1.0; + + private float fadeT; + + private float pulse; + + private IntPtr hook; + + private HookProc hp; + + private Random rnd = new Random(); + + private Stopwatch sw = Stopwatch.StartNew(); + + private List stamps = new List(); + + private Rectangle armR = new Rectangle(212, 86, 28, 28); + + private Rectangle keyR = new Rectangle(630, 164, 110, 28); + + private Rectangle keyR2 = new Rectangle(630, 276, 110, 28); + + private Rectangle minR = new Rectangle(704, 14, 24, 24); + + private Rectangle clsR = new Rectangle(736, 14, 24, 24); + + private int tab; + + private List[] tabs = new List[3] + { + new List(), + new List(), + new List() + }; + + private string[] navs = new string[3] { "Clicker", "Settings", "Stats" }; + + private string ini = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FloppaClicker\\settings.ini"); + + private Bitmap bgCache; + + [DllImport("user32")] + private static extern IntPtr SetWindowsHookEx(int id, HookProc p, IntPtr m, uint t); + + [DllImport("user32")] + private static extern bool UnhookWindowsHookEx(IntPtr h); + + [DllImport("user32")] + private static extern IntPtr CallNextHookEx(IntPtr h, int n, IntPtr w, IntPtr l); + + [DllImport("kernel32")] + private static extern IntPtr GetModuleHandle(string n); + + [DllImport("user32")] + private static extern short GetAsyncKeyState(int k); + + [DllImport("user32")] + private static extern void mouse_event(uint f, int x, int y, uint d, IntPtr e); + + [DllImport("user32")] + private static extern IntPtr GetForegroundWindow(); + + [DllImport("user32", CharSet = CharSet.Unicode)] + private static extern int GetWindowText(IntPtr h, StringBuilder s, int n); + + [DllImport("gdi32")] + private static extern IntPtr CreateRoundRectRgn(int a, int b, int c, int d, int e, int f); + + [DllImport("user32")] + private static extern bool ReleaseCapture(); + + [DllImport("user32")] + private static extern IntPtr SendMessage(IntPtr h, int m, int w, int l); + + [DllImport("winmm")] + private static extern uint timeBeginPeriod(uint p); + + public MainForm() + { + Text = "Floppa Clicker"; + FormBorderStyle = FormBorderStyle.None; + StartPosition = FormStartPosition.CenterScreen; + ClientSize = new Size(780, 500); + BackColor = G.Bg; + DoubleBuffered = true; + KeyPreview = true; + Opacity = 0.0; + Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, 781, 501, 24, 24)); + LoadCfg(); + sMin = new Slider(1.0, 20.0); + sMax = new Slider(1.0, 20.0); + sMin.Value = mn; + sMax.Value = mx; + Slider slider = sMin; + Action value = () => + { + if (sMin.Value > sMax.Value) + { + sMax.Value = sMin.Value; + sMax.Invalidate(); + } + mn = sMin.Value; + mx = sMax.Value; + }; + slider.Changed += value; + sMax.Changed += () => + { + if (sMax.Value < sMin.Value) + { + sMin.Value = sMax.Value; + sMin.Invalidate(); + } + mn = sMin.Value; + mx = sMax.Value; + }; + sMode = new Seg("Constant", "Random", "Human"); + sMode.Set(mode); + sMode.Changed += () => + { + mode = sMode.Index; + }; + sBtn = new Seg("Left", "Right"); + sBtn.Set(btn); + sBtn.Changed += () => + { + btn = sBtn.Index; + }; + tMc = new Toggle(); + tMc.Set(onlyMc); + tMc.Changed += () => + { + onlyMc = tMc.On; + }; + gr = new Graph(); + Put(sMode, 500, 220, 240, 28, 0); + Put(sMin, 420, 275, 320, 30, 0); + Put(sMax, 420, 331, 320, 30, 0); + Put(sBtn, 570, 164, 170, 28, 1); + Put(tMc, 696, 222, 44, 24, 1); + Put(gr, 192, 112, 552, 170, 2); + SetTab(0); + hp = (int n, IntPtr w, IntPtr l) => + { + if (n >= 0 && (Marshal.ReadInt32(l, 12) & 1) == 0) + { + switch (w.ToInt32()) + { + case 513: + ld = true; + break; + case 514: + ld = false; + break; + case 516: + rd = true; + break; + case 517: + rd = false; + break; + } + } + return CallNextHookEx(hook, n, w, l); + }; + hook = SetWindowsHookEx(14, hp, GetModuleHandle(null), 0u); + timeBeginPeriod(1u); + tick.Interval = 60; + tick.Tick += Tick; + tick.Start(); + fade.Interval = 15; + fade.Tick += (object param0, EventArgs param1) => + { + fadeT += 3f / 76f; + float num = Math.Min(1f, fadeT); + Opacity = 1.0 - Math.Pow(1f - num, 3.0); + if (num >= 1f) + { + Opacity = 1.0; + fade.Stop(); + } + }; + Thread thread = new Thread(Loop); + thread.IsBackground = true; + thread.Priority = ThreadPriority.AboveNormal; + thread.Start(); + BuildBg(); + } + + private void BuildBg() + { + Bitmap image = new Bitmap(780, 500); + using (Graphics graphics = Graphics.FromImage(image)) + { + graphics.SmoothingMode = SmoothingMode.AntiAlias; + using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, 780, 500), Color.FromArgb(255, 18, 20, 28), Color.FromArgb(255, 9, 10, 14), 105f)) + { + graphics.FillRectangle(brush, 0, 0, 780, 500); + } + Glow(graphics, new PointF(655.19995f, 50f), 270f, Color.FromArgb(70, G.Acc)); + Glow(graphics, new PointF(78f, 475f), 230f, Color.FromArgb(55, 255, 140, 195)); + Glow(graphics, new PointF(390f, 240f), 360f, Color.FromArgb(22, G.Acc)); + } + bgCache = image; + } + + private void Glow(Graphics g, PointF c, float r, Color col) + { + using GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddEllipse(c.X - r, c.Y - r, r * 2f, r * 2f); + using PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath); + pathGradientBrush.CenterColor = col; + pathGradientBrush.SurroundColors = new Color[1] { Color.FromArgb(0, col) }; + pathGradientBrush.CenterPoint = c; + g.FillPath(pathGradientBrush, graphicsPath); + } + + private void Put(Control c, int x, int y, int w, int h, int t) + { + c.SetBounds(x, y, w, h); + Controls.Add(c); + tabs[t].Add(c); + } + + private void SetTab(int t) + { + tab = t; + for (int i = 0; i < 3; i++) + { + foreach (Control item in tabs[i]) + { + item.Visible = i == t; + } + } + Invalidate(); + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + fade.Start(); + } + + protected override void OnFormClosed(FormClosedEventArgs e) + { + run = false; + if (hook != IntPtr.Zero) + { + UnhookWindowsHookEx(hook); + } + SaveCfg(); + base.OnFormClosed(e); + } + + private void LoadCfg() + { + try + { + string[] array = File.ReadAllLines(ini); + foreach (string text in array) + { + string[] array2 = text.Split('='); + if (array2.Length == 2) + { + string text2 = array2[1].Trim(); + switch (array2[0].Trim()) + { + case "min": + mn = double.Parse(text2, CultureInfo.InvariantCulture); + break; + case "max": + mx = double.Parse(text2, CultureInfo.InvariantCulture); + break; + case "mode": + mode = int.Parse(text2); + break; + case "btn": + btn = int.Parse(text2); + break; + case "mc": + onlyMc = text2 == "1"; + break; + case "key": + key = int.Parse(text2); + break; + case "bkey": + breakKey = int.Parse(text2); + break; + } + } + } + } + catch + { + } + } + + private void SaveCfg() + { + try + { + Directory.CreateDirectory(Path.GetDirectoryName(ini)); + File.WriteAllText(ini, string.Format(CultureInfo.InvariantCulture, "min={0}\r\nmax={1}\r\nmode={2}\r\nbtn={3}\r\nmc={4}\r\nkey={5}\r\nbkey={6}\r\n", mn, mx, mode, btn, onlyMc ? 1 : 0, key, breakKey)); + } + catch + { + } + } + + private bool Mc() + { + StringBuilder stringBuilder = new StringBuilder(256); + GetWindowText(GetForegroundWindow(), stringBuilder, 256); + string text = stringBuilder.ToString().ToLower(); + if (!text.Contains("minecraft") && !text.Contains("lunar client") && !text.Contains("badlion")) + { + return text.Contains("labymod"); + } + return true; + } + + private double Gauss() + { + double d = 1.0 - rnd.NextDouble(); + double num = rnd.NextDouble(); + return Math.Sqrt(-2.0 * Math.Log(d)) * Math.Cos(Math.PI * 2.0 * num); + } + + private double NextMs() + { + double num = Math.Min(mn, mx); + double num2 = Math.Max(mn, mx); + double num3 = (num + num2) / 2.0; + if (mode == 0) + { + return 1000.0 / Math.Max(0.5, num3); + } + double val; + if (mode == 1) + { + val = num + rnd.NextDouble() * (num2 - num); + return 1000.0 / Math.Max(0.5, val); + } + drift = Math.Max(-1.0, Math.Min(1.0, drift * 0.97 + Gauss() * 0.15)); + val = num3 + drift * (num2 - num) / 2.0 + Gauss() * (num2 - num) * 0.12; + val = Math.Max(num * 0.85, Math.Min(num2 * 1.15, val)); + double num4 = 1000.0 / Math.Max(0.5, val); + if (burstLeft > 0) + { + num4 *= 0.82; + burstLeft--; + } + else if (rnd.NextDouble() < 0.025) + { + burstLeft = 2 + rnd.Next(3); + } + if (rnd.NextDouble() < 0.018) + { + num4 += 45.0 + rnd.NextDouble() * 90.0; + } + return num4; + } + + private void Wait(double ms) + { + double num = sw.Elapsed.TotalMilliseconds + ms; + while (sw.Elapsed.TotalMilliseconds < num) + { + Thread.Sleep(0); + } + } + + private void DoClick() + { + bool flag = btn == 0; + mouse_event(flag ? 2u : 8u, 0, 0, 0u, IntPtr.Zero); + Wait(4.0 + rnd.NextDouble() * 8.0); + mouse_event(flag ? 4u : 16u, 0, 0, 0u, IntPtr.Zero); + } + + private void Loop() + { + double num = -1.0; + while (run) + { + bool flag = ((btn == 0) ? ld : rd); + if (armed && !breakMode && flag && (!onlyMc || Mc())) + { + clicking = true; + double totalMilliseconds = sw.Elapsed.TotalMilliseconds; + DoClick(); + totalClicks++; + if (num > 0.0 && totalMilliseconds - num < 500.0) + { + gr.Add(totalMilliseconds - num); + } + num = totalMilliseconds; + lock (stamps) + { + stamps.Add(totalMilliseconds); + } + double num2 = totalMilliseconds + NextMs(); + while (run && sw.Elapsed.TotalMilliseconds < num2 && ((btn == 0) ? ld : rd)) + { + if (num2 - sw.Elapsed.TotalMilliseconds > 2.0) + { + Thread.Sleep(1); + } + else + { + Thread.SpinWait(30); + } + } + } + else + { + clicking = false; + num = -1.0; + Thread.Sleep(3); + } + } + } + + private void Tick(object s, EventArgs e) + { + bool flag = (GetAsyncKeyState(key) & 0x8000) != 0; + if (flag && !prevKey && !binding) + { + armed = !armed; + if (armed) + { + totalClicks = 0L; + armStart = sw.Elapsed.TotalMilliseconds; + } + else + { + armStart = -1.0; + } + } + prevKey = flag; + bool flag2 = (GetAsyncKeyState(breakKey) & 0x8000) != 0; + if (flag2 && !prevBreakKey && !binding) + { + breakMode = !breakMode; + } + prevBreakKey = flag2; + pulse = (pulse + 0.12f) % 6.2832f; + lock (stamps) + { + double now = sw.Elapsed.TotalMilliseconds; + stamps.RemoveAll((double x) => now - x > 1000.0); + } + if (tab == 2) + { + gr.Invalidate(); + } + Invalidate(); + } + + protected override void OnKeyDown(KeyEventArgs e) + { + if (binding) + { + if (e.KeyCode != Keys.Escape) + { + if (bindTarget == 0) + { + key = (int)e.KeyCode; + } + else + { + breakKey = (int)e.KeyCode; + } + } + binding = false; + e.Handled = true; + Invalidate(); + } + base.OnKeyDown(e); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + int num = (minR.Contains(e.Location) ? 1 : (clsR.Contains(e.Location) ? 2 : 0)); + if (num != hover) + { + hover = num; + Invalidate(new Rectangle(690, 8, 80, 40)); + } + Cursor = ((num > 0 || (tab == 0 && (armR.Contains(e.Location) || keyR.Contains(e.Location))) || (tab == 1 && keyR2.Contains(e.Location)) || (e.X < 160 && e.Y >= 76 && e.Y < 196)) ? Cursors.Hand : Cursors.Default); + base.OnMouseMove(e); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + if (clsR.Contains(e.Location)) + { + Close(); + } + else if (minR.Contains(e.Location)) + { + WindowState = FormWindowState.Minimized; + } + else if (tab == 0 && armR.Contains(e.Location)) + { + armed = !armed; + } + else if (e.X < 160 && e.Y >= 76 && e.Y < 196) + { + SetTab((e.Y - 76) / 40); + } + else if (tab == 0 && keyR.Contains(e.Location)) + { + binding = true; + bindTarget = 0; + Invalidate(keyR); + } + else if (tab == 1 && keyR2.Contains(e.Location)) + { + binding = true; + bindTarget = 1; + Invalidate(keyR2); + } + else if (e.Y < 60 && e.Button == MouseButtons.Left) + { + ReleaseCapture(); + SendMessage(Handle, 161, 2, 0); + } + base.OnMouseDown(e); + } + + private void Row(Graphics g, int y, string t, string d) + { + G.T(g, t, G.H, G.Txt, 192f, y + 6, StringAlignment.Near); + G.T(g, d, G.S, G.Dim, 192f, y + 28, StringAlignment.Near); + using Pen pen = new Pen(G.Line); + g.DrawLine(pen, 192, y + 54, 740, y + 54); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + if (bgCache != null) + { + graphics.DrawImageUnscaled(bgCache, 0, 0); + } + else + { + graphics.Clear(G.Bg); + } + using (SolidBrush brush = new SolidBrush(Color.FromArgb(90, 8, 9, 13))) + { + graphics.FillRectangle(brush, new Rectangle(0, 0, 168, 500)); + } + RectangleF r = new RectangleF(168f, 52f, 600f, 436f); + using (GraphicsPath path = G.RR(r, 16f)) + { + using (SolidBrush brush2 = new SolidBrush(Color.FromArgb(160, G.Card.R, G.Card.G, G.Card.B))) + { + graphics.FillPath(brush2, path); + } + using Pen pen = new Pen(Color.FromArgb(50, 255, 255, 255), 1f); + graphics.DrawPath(pen, path); + } + G.Fill(graphics, new RectangleF(20f, 16f, 30f, 30f), 15f, G.Acc); + G.Circle(graphics, G.Logo, new RectangleF(21f, 17f, 28f, 28f)); + G.T(graphics, "Floppa", G.H, G.Txt, 60f, 15f, StringAlignment.Near); + G.T(graphics, "dev-local", G.S, G.Dim, 60f, 32f, StringAlignment.Near); + for (int i = 0; i < 3; i++) + { + RectangleF r2 = new RectangleF(12f, 76 + i * 40, 136f, 34f); + if (i == tab) + { + G.Fill(graphics, r2, 10f, G.Mix(G.Bg, G.Acc, 0.22f)); + using SolidBrush brush3 = new SolidBrush(G.Acc); + graphics.FillEllipse(brush3, 24, 88 + i * 40, 8, 8); + } + else + { + using SolidBrush brush4 = new SolidBrush(G.Dim); + graphics.FillEllipse(brush4, 25, 89 + i * 40, 6, 6); + } + G.T(graphics, navs[i], G.N, (i == tab) ? G.Txt : G.Dim, 44f, 83 + i * 40, StringAlignment.Near); + } + G.T(graphics, "Armar: " + (Keys)key, G.S, G.Dim, 20f, 466f, StringAlignment.Near); + if (hover == 1) + { + G.Fill(graphics, minR, 8f, G.Line); + } + if (hover == 2) + { + G.Fill(graphics, clsR, 8f, Color.FromArgb(200, 70, 70)); + } + using (Pen pen2 = new Pen(G.Txt, 1.6f)) + { + graphics.DrawLine(pen2, minR.X + 7, minR.Y + 12, minR.Right - 7, minR.Y + 12); + graphics.DrawLine(pen2, clsR.X + 7, clsR.Y + 7, clsR.Right - 7, clsR.Bottom - 7); + graphics.DrawLine(pen2, clsR.Right - 7, clsR.Y + 7, clsR.X + 7, clsR.Bottom - 7); + } + bool flag = !onlyMc || Mc(); + string text; + Color c; + if (!armed) + { + text = string.Concat("Disarmed · press ", (Keys)key, " to arm"); + c = G.Dim; + } + else if (breakMode) + { + text = "Mining mode · autoclick is paused"; + c = G.Acc; + } + else if (!flag) + { + text = "Waiting for game · open Minecraft or Lunar Client"; + c = G.Acc; + } + else if (clicking) + { + text = "Clicking · release to stop"; + c = G.Ok; + } + else + { + text = "Ready · hold " + ((btn == 0) ? "left" : "right") + " click"; + c = G.Ok; + } + int count; + lock (stamps) + { + count = stamps.Count; + } + if (tab == 0) + { + G.Fill(graphics, new RectangleF(192f, 64f, 548f, 72f), 14f, Color.FromArgb(30, 32, 42)); + if (armed) + { + using (SolidBrush brush5 = new SolidBrush(G.Acc)) + { + graphics.FillEllipse(brush5, armR); + } + using Pen pen3 = new Pen(Color.White, 2.4f); + graphics.DrawLines(pen3, new PointF[3] + { + new PointF(219f, 100f), + new PointF(224f, 105f), + new PointF(233f, 95f) + }); + } + else + { + using Pen pen4 = new Pen(G.Dim, 2f); + graphics.DrawEllipse(pen4, armR); + } + G.T(graphics, "AutoClicker", G.H, G.Txt, 258f, 78f, StringAlignment.Near); + G.T(graphics, text, G.S, c, 258f, 102f, StringAlignment.Near); + G.T(graphics, count.ToString(), G.Big, clicking ? G.Acc : G.Dim, 720f, 70f, StringAlignment.Far); + G.T(graphics, "Live CPS", G.S, G.Dim, 720f, 114f, StringAlignment.Far); + Row(graphics, 150, "Arm key", "Key that arms and disarms the clicker."); + Row(graphics, 206, "Mode", "Constant, random or human (with drift and micro-pauses)."); + Row(graphics, 262, "Minimum CPS", "Minimum clicks per second."); + Row(graphics, 318, "Maximum CPS", "Maximum clicks per second."); + G.Fill(graphics, keyR, 10f, G.Bg); + G.T(graphics, binding ? "Press a key…" : ((Keys)key).ToString(), G.S, binding ? G.Acc : G.Txt, keyR.X + keyR.Width / 2, keyR.Y + 5, StringAlignment.Center); + return; + } + if (tab == 1) + { + G.T(graphics, "Settings", G.H, G.Txt, 192f, 66f, StringAlignment.Near); + Row(graphics, 150, "Mouse button", "Button you need to hold down to click."); + Row(graphics, 206, "Only inside Minecraft", "Only clicks while Minecraft, Lunar, Badlion or Labymod is focused."); + Row(graphics, 262, "Break blocks", "Pauses the autoclick so you can mine without losing block progress."); + G.Fill(graphics, keyR2, 10f, G.Bg); + G.T(graphics, (binding && bindTarget == 1) ? "Press a key…" : ((Keys)breakKey).ToString(), G.S, (binding && bindTarget == 1) ? G.Acc : G.Txt, keyR2.X + keyR2.Width / 2, keyR2.Y + 5, StringAlignment.Center); + G.T(graphics, breakMode ? "Active now" : "Inactive", G.S, breakMode ? G.Acc : G.Dim, 192f, 290f, StringAlignment.Near); + return; + } + G.T(graphics, "Stats", G.H, G.Txt, 192f, 66f, StringAlignment.Near); + G.T(graphics, "Click intervals", G.S, G.Dim, 192f, 90f, StringAlignment.Near); + double[] array = gr.Snap(); + double num = 0.0; + double num2 = 0.0; + if (array.Length > 2) + { + double[] array2 = array; + foreach (double num3 in array2) + { + num += num3; + } + num /= (double)array.Length; + double[] array3 = array; + foreach (double num4 in array3) + { + num2 += (num4 - num) * (num4 - num); + } + num2 = Math.Sqrt(num2 / (double)array.Length); + } + G.T(graphics, (array.Length > 2) ? string.Format(CultureInfo.InvariantCulture, "Avg {0:0.0} CPS · Dev. {1:0} ms", 1000.0 / num, num2) : "Avg -- · Dev. --", G.N, G.Txt, 192f, 294f, StringAlignment.Near); + G.T(graphics, "dotted line: 100 ms", G.S, G.Dim, 740f, 296f, StringAlignment.Far); + G.T(graphics, count.ToString(), G.Big, clicking ? G.Acc : G.Dim, 192f, 330f, StringAlignment.Near); + G.T(graphics, "Live CPS right now · " + text, G.S, G.Dim, 192f, 376f, StringAlignment.Near); + double num5 = ((armed && armStart >= 0.0) ? ((double)totalClicks / Math.Max(0.5, (sw.Elapsed.TotalMilliseconds - armStart) / 1000.0)) : 0.0); + G.T(graphics, armed ? (totalClicks + " clicks this session · " + num5.ToString("0.0", CultureInfo.InvariantCulture) + " avg CPS") : "No active session", G.S, G.Dim, 192f, 402f, StringAlignment.Near); + } + + [STAThread] + private static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(defaultValue: false); + using (PasswordGate passwordGate = new PasswordGate()) + { + Application.Run(passwordGate); + if (!passwordGate.Ok) + { + return; + } + } + Application.Run(new Splash()); + } +} diff --git a/PBtn.cs b/PBtn.cs new file mode 100644 index 0000000..c3a9ac8 --- /dev/null +++ b/PBtn.cs @@ -0,0 +1,53 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +internal class PBtn : Panel +{ + public string Text2 = ""; + + private bool hov; + + public event Action Click2; + + public PBtn() + { + SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, value: true); + BackColor = G.Card; + Cursor = Cursors.Hand; + } + + protected override void OnMouseEnter(EventArgs e) + { + hov = true; + Invalidate(); + base.OnMouseEnter(e); + } + + protected override void OnMouseLeave(EventArgs e) + { + hov = false; + Invalidate(); + base.OnMouseLeave(e); + } + + protected override void OnClick(EventArgs e) + { + if (Click2 != null) + { + Click2(); + } + base.OnClick(e); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.Clear(G.Card); + RectangleF r = new RectangleF(0f, 0f, Width - 1, Height - 1); + G.Fill(graphics, r, 12f, hov ? G.Mix(G.Acc, Color.White, 0.12f) : G.Acc); + G.T(graphics, Text2, G.H, Color.White, Width / 2, Height / 2 - 9, StringAlignment.Center); + } +} diff --git a/PField.cs b/PField.cs new file mode 100644 index 0000000..9e454c7 --- /dev/null +++ b/PField.cs @@ -0,0 +1,57 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +internal class PField : Panel +{ + public TextBox Box; + + private bool foc; + + public PField() + { + SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, value: true); + BackColor = G.Card; + Box = new TextBox(); + Box.BorderStyle = BorderStyle.None; + Box.BackColor = G.Bg; + Box.ForeColor = G.Txt; + Box.Font = G.N; + Box.TextAlign = HorizontalAlignment.Center; + Box.UseSystemPasswordChar = true; + TextBox box = Box; + EventHandler value = (object param0, EventArgs param1) => + { + foc = true; + Invalidate(); + }; + box.GotFocus += value; + Box.LostFocus += (object param0, EventArgs param1) => + { + foc = false; + Invalidate(); + }; + Controls.Add(Box); + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + if (Box != null) + { + Box.SetBounds(16, (Height - 22) / 2, Width - 32, 22); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.Clear(G.Card); + RectangleF r = new RectangleF(0f, 0f, Width - 1, Height - 1); + G.Fill(graphics, r, 12f, G.Bg); + using Pen pen = new Pen(foc ? G.Acc : G.Line, 1.4f); + graphics.DrawPath(pen, G.RR(r, 12f)); + } +} diff --git a/PasswordGate.cs b/PasswordGate.cs new file mode 100644 index 0000000..5369236 --- /dev/null +++ b/PasswordGate.cs @@ -0,0 +1,187 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +internal class PasswordGate : Form +{ + private const int W = 380; + + private const int H = 320; + + private const string Pass = "FloppaClient"; + + private PField field; + + private Label err; + + private Rectangle clsR = new Rectangle(340, 14, 22, 22); + + private int hover; + + private Timer fade = new Timer(); + + private float fadeT; + + public bool Ok; + + [DllImport("gdi32")] + private static extern IntPtr CreateRoundRectRgn(int a, int b, int c, int d, int e, int f); + + [DllImport("user32")] + private static extern bool ReleaseCapture(); + + [DllImport("user32")] + private static extern IntPtr SendMessage(IntPtr h, int m, int w, int l); + + public PasswordGate() + { + Text = "Floppa Clicker"; + FormBorderStyle = FormBorderStyle.None; + StartPosition = FormStartPosition.CenterScreen; + ClientSize = new Size(380, 320); + BackColor = G.Bg; + DoubleBuffered = true; + Opacity = 0.0; + Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, 381, 321, 24, 24)); + field = new PField(); + field.SetBounds(40, 172, 300, 40); + Controls.Add(field); + err = new Label(); + err.Text = ""; + err.Font = G.S; + err.ForeColor = Color.FromArgb(235, 100, 100); + err.AutoSize = false; + err.TextAlign = ContentAlignment.MiddleCenter; + err.SetBounds(0, 216, 380, 18); + Controls.Add(err); + PBtn pBtn = new PBtn(); + pBtn.Text2 = "Unlock"; + pBtn.SetBounds(40, 248, 300, 42); + Controls.Add(pBtn); + pBtn.Click2 += Check; + TextBox box = field.Box; + KeyEventHandler value = (object s, KeyEventArgs e) => + { + if (e.KeyCode == Keys.Return) + { + Check(); + e.SuppressKeyPress = true; + } + }; + box.KeyDown += value; + MouseDown += (object s, MouseEventArgs e) => + { + if (e.Y < 40 && e.Button == MouseButtons.Left) + { + ReleaseCapture(); + SendMessage(Handle, 161, 2, 0); + } + }; + MouseMove += (object s, MouseEventArgs e) => + { + int num = (clsR.Contains(e.Location) ? 1 : 0); + if (num != hover) + { + hover = num; + Invalidate(new Rectangle(324, 8, 56, 40)); + } + Cursor = ((num > 0) ? Cursors.Hand : Cursors.Default); + }; + MouseDown += (object s, MouseEventArgs e) => + { + if (clsR.Contains(e.Location)) + { + Close(); + } + }; + fade.Interval = 15; + fade.Tick += (object param0, EventArgs param1) => + { + fadeT += 3f / 52f; + float num = Math.Min(1f, fadeT); + Opacity = 1.0 - Math.Pow(1f - num, 3.0); + if (num >= 1f) + { + Opacity = 1.0; + fade.Stop(); + } + }; + Shown += (object param0, EventArgs param1) => + { + fade.Start(); + field.Box.Focus(); + }; + } + + private void Check() + { + if (field.Box.Text == Pass) + { + Ok = true; + Close(); + return; + } + err.Text = "Incorrect password"; + field.Box.Clear(); + field.Box.Focus(); + Shake(); + } + + private void Shake() + { + int baseX = Left; + Timer t = new Timer(); + t.Interval = 18; + int n = 0; + int[] off = new int[7] { 6, -6, 5, -5, 3, -3, 0 }; + t.Tick += (object param0, EventArgs param1) => + { + if (n >= off.Length) + { + t.Stop(); + Left = baseX; + } + else + { + Left = baseX + off[n]; + n++; + } + }; + t.Start(); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, 380, 320), Color.FromArgb(255, 18, 20, 28), Color.FromArgb(255, 9, 10, 14), 105f)) + { + graphics.FillRectangle(brush, 0, 0, 380, 320); + } + using (GraphicsPath graphicsPath = new GraphicsPath()) + { + graphicsPath.AddEllipse(-30f, -120f, 440f, 440f); + using PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath); + pathGradientBrush.CenterColor = Color.FromArgb(70, G.Acc); + pathGradientBrush.SurroundColors = new Color[1] { Color.FromArgb(0, G.Acc) }; + pathGradientBrush.CenterPoint = new PointF(190f, -20f); + graphics.FillPath(pathGradientBrush, graphicsPath); + } + G.Fill(graphics, new RectangleF(164f, 34f, 52f, 52f), 26f, G.Acc); + G.Circle(graphics, G.Logo, new RectangleF(166f, 36f, 48f, 48f)); + G.T(graphics, "Floppa Clicker", G.H, G.Txt, 190f, 100f, StringAlignment.Center); + G.T(graphics, "Enter the password to continue", G.N, G.Dim, 190f, 126f, StringAlignment.Center); + G.T(graphics, "Password", G.S, G.Dim, 40f, 156f, StringAlignment.Near); + if (hover == 1) + { + G.Fill(graphics, clsR, 8f, Color.FromArgb(200, 70, 70)); + } + using Pen pen = new Pen(G.Txt, 1.6f); + graphics.DrawLine(pen, clsR.X + 6, clsR.Y + 6, clsR.Right - 6, clsR.Bottom - 6); + graphics.DrawLine(pen, clsR.Right - 6, clsR.Y + 6, clsR.X + 6, clsR.Bottom - 6); + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d70db6c --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,4 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("0.0.0.0")] diff --git a/README.md b/README.md new file mode 100644 index 0000000..67d0784 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +

+ Skid Solutions Banner +

+ + Discord + + .NET Framework 4.8.1 +

+ +

+ https://discord.gg/skidsolutions +

+ +

+ +

+ +

OpenFloppaClicker

+ +

+ It was a challenge.
+ sourced in 5min with 26s +

+ +

+ Portrait with a DEOBF? caption + Painted portrait with a DEOBF? caption + Webcam portrait with a DEOBF? caption + Bird with a Deobf? caption +

+ +

+ +

+ +## How to build + +### Prerequisites + +Use Visual Studio on Windows with the **.NET desktop development** workload and the **.NET Framework 4.8.1 targeting pack**. The included `.vsconfig` lists both. + +### Building OpenFloppaClicker + +Open `FloppaClicker.sln` and press **F5**. For a command-line build, use a Visual Studio Developer Command Prompt. + +```bat +msbuild FloppaClicker.sln /p:Configuration=Release +``` + +### Running + +Run `bin\Release\net481\FloppaClicker.exe`. Settings are stored in `%APPDATA%\FloppaClicker\settings.ini`. diff --git a/Seg.cs b/Seg.cs new file mode 100644 index 0000000..a216c3c --- /dev/null +++ b/Seg.cs @@ -0,0 +1,69 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +internal class Seg : Ctl +{ + public string[] Items; + + public int Index; + + private float pos; + + private Timer tm = new Timer(); + + public event Action Changed; + + public Seg(params string[] items) + { + Items = items; + tm.Interval = 15; + Timer timer = tm; + EventHandler value = (object param0, EventArgs param1) => + { + pos += ((float)Index - pos) * 0.35f; + if (Math.Abs((float)Index - pos) < 0.02f) + { + pos = Index; + tm.Stop(); + } + Invalidate(); + }; + timer.Tick += value; + } + + public void Set(int i) + { + Index = i; + pos = i; + Invalidate(); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + int num = Math.Min(Items.Length - 1, e.X * Items.Length / Width); + if (num != Index) + { + Index = num; + tm.Start(); + if (Changed != null) + { + Changed(); + } + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + Prep(graphics); + graphics.Clear(BackColor); + float num = (float)Width / (float)Items.Length; + G.Fill(graphics, new RectangleF(0f, 0f, Width - 1, Height - 1), 12f, G.Bg); + G.Fill(graphics, new RectangleF(pos * num + 2f, 2f, num - 4f, Height - 5), 10f, G.Acc); + for (int i = 0; i < Items.Length; i++) + { + G.T(graphics, Items[i], G.S, (i == Index) ? Color.FromArgb(10, 14, 28) : G.Dim, (float)i * num + num / 2f, Height / 2 - 9, StringAlignment.Center); + } + } +} diff --git a/Slider.cs b/Slider.cs new file mode 100644 index 0000000..1e2a6ae --- /dev/null +++ b/Slider.cs @@ -0,0 +1,64 @@ +using System; +using System.Drawing; +using System.Globalization; +using System.Windows.Forms; + +internal class Slider : Ctl +{ + public double Value; + + public double Lo; + + public double Hi; + + public event Action Changed; + + public Slider(double lo, double hi) + { + Lo = lo; + Hi = hi; + Size = new Size(320, 30); + } + + private void Pick(int x) + { + double num = Lo + (Hi - Lo) * Math.Max(0.0, Math.Min(1.0, ((double)x - 8.0) / (double)(Width - 64))); + Value = Math.Round(num * 2.0) / 2.0; + Invalidate(); + if (Changed != null) + { + Changed(); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + Pick(e.X); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + Pick(e.X); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + Prep(graphics); + graphics.Clear(BackColor); + float num = Width - 64; + float num2 = 8f + (float)((Value - Lo) / (Hi - Lo)) * num; + float num3 = (float)Height / 2f; + G.Fill(graphics, new RectangleF(8f, num3 - 2f, num, 4f), 2f, G.Line); + G.Fill(graphics, new RectangleF(8f, num3 - 2f, num2 - 8f, 4f), 2f, G.Acc); + using (SolidBrush brush = new SolidBrush(Color.White)) + { + graphics.FillEllipse(brush, num2 - 7f, num3 - 7f, 14f, 14f); + } + G.Fill(graphics, new RectangleF(Width - 48, num3 - 12f, 48f, 24f), 8f, G.Bg); + G.T(graphics, Value.ToString("0.0", CultureInfo.InvariantCulture), G.S, G.Txt, Width - 24, num3 - 9f, StringAlignment.Center); + } +} diff --git a/Splash.cs b/Splash.cs new file mode 100644 index 0000000..cc91e3b --- /dev/null +++ b/Splash.cs @@ -0,0 +1,144 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +internal class Splash : Form +{ + private const int W = 640; + + private const int H = 360; + + private Timer t = new Timer(); + + private Stopwatch sw = Stopwatch.StartNew(); + + private MainForm main; + + private bool shown; + + private string status = "Starting Floppa.."; + + private float prog; + + private string[] art = new string[7]; + + private static string[][] L = new string[6][] + { + new string[7] { "#####", "# ", "# ", "#### ", "# ", "# ", "# " }, + new string[7] { "# ", "# ", "# ", "# ", "# ", "# ", "#####" }, + new string[7] { " ### ", "# #", "# #", "# #", "# #", "# #", " ### " }, + new string[7] { "#### ", "# #", "# #", "#### ", "# ", "# ", "# " }, + new string[7] { "#### ", "# #", "# #", "#### ", "# ", "# ", "# " }, + new string[7] { " ### ", "# #", "# #", "#####", "# #", "# #", "# #" } + }; + + [DllImport("gdi32")] + private static extern IntPtr CreateRoundRectRgn(int a, int b, int c, int d, int e, int f); + + public Splash() + { + FormBorderStyle = FormBorderStyle.None; + StartPosition = FormStartPosition.CenterScreen; + ClientSize = new Size(640, 360); + Opacity = 0.0; + DoubleBuffered = true; + ShowInTaskbar = false; + BackColor = G.Acc; + Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, 641, 361, 24, 24)); + for (int i = 0; i < 7; i++) + { + StringBuilder stringBuilder = new StringBuilder(); + string[][] l = L; + foreach (string[] array in l) + { + stringBuilder.Append(array[i]).Append(" "); + } + art[i] = stringBuilder.ToString().TrimEnd(); + } + t.Interval = 15; + t.Tick += Step; + t.Start(); + } + + private void Step(object s, EventArgs e) + { + double totalMilliseconds = sw.Elapsed.TotalMilliseconds; + prog = (float)Math.Min(1.0, totalMilliseconds / 2700.0); + ref string reference = ref status; + string text; + if (totalMilliseconds < 700.0) + { + text = "Starting Floppa.."; + } + else if (totalMilliseconds < 1400.0) + { + text = "Loading settings.."; + } + else + { + text = ((totalMilliseconds < 2100.0) ? "Searching for Minecraft.." : "Ready"); + } + reference = text; + if (totalMilliseconds >= 1500.0 && main == null) + { + main = new MainForm(); + main.FormClosed += (object param0, FormClosedEventArgs param1) => + { + Close(); + }; + } + if (totalMilliseconds < 350.0) + { + Opacity = totalMilliseconds / 350.0; + } + else if (totalMilliseconds < 2800.0) + { + Opacity = 1.0; + } + else + { + if (!shown && main != null) + { + shown = true; + main.Show(); + } + Opacity = Math.Max(0.0, 1.0 - (totalMilliseconds - 2800.0) / 350.0); + if (totalMilliseconds >= 3200.0) + { + t.Stop(); + Hide(); + } + } + Invalidate(); + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + graphics.Clear(G.Acc); + using Font font = new Font("Consolas", 17f, FontStyle.Bold); + using Font font2 = new Font("Consolas", 11f, FontStyle.Bold); + using SolidBrush brush = new SolidBrush(Color.FromArgb(10, 10, 10)); + StringFormat genericTypographic = StringFormat.GenericTypographic; + float num = graphics.MeasureString("#", font, 0, genericTypographic).Width; + float num2 = (float)font.Height * 0.95f; + float num3 = 70f; + string[] array = art; + foreach (string text in array) + { + graphics.DrawString(text, font, brush, (640f - num * (float)text.Length) / 2f, num3, genericTypographic); + num3 += num2; + } + SizeF sizeF = graphics.MeasureString(status, font2, 0, genericTypographic); + graphics.DrawString(status, font2, brush, (640f - sizeF.Width) / 2f, num3 + 34f, genericTypographic); + G.Fill(graphics, new RectangleF(210f, num3 + 68f, 220f, 5f), 2f, G.Mix(G.Acc, Color.Black, 0.2f)); + G.Fill(graphics, new RectangleF(210f, num3 + 68f, Math.Max(5f, 220f * prog), 5f), 2f, Color.FromArgb(10, 10, 10)); + } +} diff --git a/Toggle.cs b/Toggle.cs new file mode 100644 index 0000000..0fbd96e --- /dev/null +++ b/Toggle.cs @@ -0,0 +1,60 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +internal class Toggle : Ctl +{ + public bool On; + + private float t; + + private Timer tm = new Timer(); + + public event Action Changed; + + public Toggle() + { + Size = new Size(44, 24); + tm.Interval = 15; + Timer timer = tm; + EventHandler value = (object param0, EventArgs param1) => + { + float num = (On ? 1f : 0f); + t += (num - t) * 0.35f; + if (Math.Abs(num - t) < 0.02f) + { + t = num; + tm.Stop(); + } + Invalidate(); + }; + timer.Tick += value; + } + + public void Set(bool v) + { + On = v; + t = (v ? 1f : 0f); + Invalidate(); + } + + protected override void OnClick(EventArgs e) + { + On = !On; + tm.Start(); + if (Changed != null) + { + Changed(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Graphics graphics = e.Graphics; + Prep(graphics); + graphics.Clear(BackColor); + G.Fill(graphics, new RectangleF(0f, 0f, Width - 1, Height - 1), Height, G.Mix(G.Line, G.Acc, t)); + using SolidBrush brush = new SolidBrush(Color.White); + graphics.FillEllipse(brush, 3f + t * (float)(Width - Height), 3f, Height - 7, Height - 7); + } +} diff --git a/app.manifest b/app.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/app.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/Logo.png b/assets/Logo.png new file mode 100644 index 0000000..1c6c91c Binary files /dev/null and b/assets/Logo.png differ diff --git a/assets/deobf.jpg b/assets/deobf.jpg new file mode 100644 index 0000000..fa8dbde Binary files /dev/null and b/assets/deobf.jpg differ diff --git a/assets/deobf2.png b/assets/deobf2.png new file mode 100644 index 0000000..1d4014d Binary files /dev/null and b/assets/deobf2.png differ diff --git a/assets/divider.svg b/assets/divider.svg new file mode 100644 index 0000000..f473231 --- /dev/null +++ b/assets/divider.svg @@ -0,0 +1,26 @@ + diff --git a/assets/hack.jpg b/assets/hack.jpg new file mode 100644 index 0000000..c4252ef Binary files /dev/null and b/assets/hack.jpg differ diff --git a/assets/jak.jpg b/assets/jak.jpg new file mode 100644 index 0000000..162bfe5 Binary files /dev/null and b/assets/jak.jpg differ diff --git a/assets/ss.png b/assets/ss.png new file mode 100644 index 0000000..041b33a Binary files /dev/null and b/assets/ss.png differ