Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto clicker for Starbound during the Steam summer sale. Works in the background, simply launch Starbound, spawn sodas and you're good to go.
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleClicker
class Program
public const int WM_LBUTTONDOWN = 0x201;
public const int WM_LBUTTONUP = 0x202;
public static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam);
static void Main(string[] args)
var starbound =
.Where(p => p.ProcessName == "starbound")
if (starbound == null)
Console.WriteLine("couldn't find starbound.exe, exiting");
var starboundWindowHandle = starbound.MainWindowHandle.ToInt32();
// 70ms seems to be the sweet spot on my machine
// you can try to go lower though
var msBetweenClicks = 70;
var msBetweenDownAndUp = 1;
while (true)
SendMessage(starboundWindowHandle, WM_LBUTTONDOWN, 1, 0);
SendMessage(starboundWindowHandle, WM_LBUTTONUP, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment