Hacking an Angular.JS game for Fun and (fake) Profit
Last night I came across an interesting game called Giant Shaft Enterprises. In this game you play the role of a CEO of a fictitious company and the goal is to maximize your profits and reduce costs. You do this by performing business opportunities such as “Network with business leaders”, “Push the envelope”, and “Streamline workforce”. You also can hire employees, purchase buildings, establish various departments, and motivate your workforce with seasoned upper managers. The last thing that you can do in the game is purchase upgrades such as health benefits, electric car charging ports or allow upper managers to hold useless meetings. These upgrades maximize the performance of your workforce. All of these things make more money for your company and allow you to get achievements.
This is pretty much like any other point, click, and wait game that you would find in the “Top 10 Free Games” section in an App store, but the difference is that this game does not take any real money from you. The game is very entertaining and kind of trolls the world. For example, buying more cubicles for your company provides a higher ROI than hiring additional upper managers. The game is also strangely addictive, I found myself clicking on the same button thousands of times to get more money and increase the profitability of my company.
I must have played for a few hours before I began filling a bit silly for wasting my time clicking on a button. A few hours later not only was I feeling silly I was also beginning to get an repetitive stress injury in my wrist. That is when I realized that clicking on the button to watch my company sore to greatness was not providing me with the highest ROI. Then I decided to streamline my efforts and opened up the Chrome Javascript Console to see if I could outsource me clicking this button to a simple Javascript program.
Luckily, this was pretty straightforward. The app is written in Angluar.JS and all of the various buttons that you click to do things are exposed in the DOM. Using JQuery you can access these buttons a simulate a click through the Javascript console that can be found in the Developer Tools of most browsers. For example, the button that lets you take advantage of business opportunities (and instantly raise more money) calls a function called doBusiness. You can select it, and send it a click() like this:
$('div[ng-click="doBusiness(opportunity, $event)"]').click();
for ( i=0; i < 100; i++ ) { $('div[ng-click="doBusiness(opportunity, $event)"]').click(); }
buyStoreItem, but the individual items (such as employees, cubicles, and harware) are referenced by index. Using the similar method you can purchase things in various multiples by wrapping the function in a for loop like so:
# Buy Cubicle for ( i=0; i < 100; i++ ) { $('div[ng-click="buyStoreItem($event, item)"]')[1].click(); }
# Giant Shaft Cheats The lines below simulate clicks, to run then open up the Javascript Console (in Chrome this is Ctrl+Shift+i) and enter them. To change the amount of simulated clicks change the second value in the for loop ( i < 100 ) to something other than 100. Going above 1,000 will probably crash the app :)Do Business Opportunities
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“doBusiness(opportunity, $event)”]’).click(); }
Buy Minium Wage Worker
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[0].click(); }
Buy Cubicle
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[1].click(); }
Buy Salary Employee
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[2].click(); }
Buy Hardware
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[3].click(); }
Buy HR Department
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[4].click(); }
Buy Accounting Department
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[5].click(); }
Buy Benefits Package
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[6].click(); }
Buy (Useless) Upper Management
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[7].click(); }
Buy Executive
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[8].click(); }
Buy Office Building
for ( i=0; i < 100; i++ ) { $(‘div[ng-click=“buyStoreItem($event, item)”]’)[9].click(); }
UPDATE 1: I was curious to see what the max number of clicks I could pass through was. I enabled logging to show me when the loop made the 100th click.
for ( i=0; i < 1000; i++ ) { $('div[ng-click="doBusiness(opportunity, $event)"]').click(); if (i % 100 == 0 ) {console.log('Click #' + i)}}
UPDATE 2: The final step of this was obviously to automate the automated clicks. Using Javascripts setInterval method, we can have the script run indefinitely. For example the following code, does 100 business opportunities every 3 seconds, forever.
setInterval(function() {for ( i=0; i < 100; i++ ) { $('div[ng-click="doBusiness(opportunity, $event)"]').click(); if (i % 10 == 0 ) {console.log('Click #' + i)}}}, 3000);
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- 2024
- Setting up ANTLR4 on Windows
- My Custom Miniflux CSS Theme
- SQLite DB Migrations with PRAGMA user_version
- Ten Years of Dreaming of San Francisco
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Fedora Magazine: Contribute to Fedora 44 KDE and GNOME Test Days from Fedora People
- Pluralistic: bunnie's piggyback hack (09 Jan 2026) from Pluralistic: Daily links from Cory Doctorow
- Clicks Communicator from Chris Hannah
- A Year Of Vibes from Armin Ronacher's Thoughts and Writings
- Pluralistic: A perfect distillation of the social uselessness of finance (18 Dec 2025) from Pluralistic: Daily links from Cory Doctorow
- Moving from WordPress to Substack from charity.wtf
- Grow, Like a Tree Not a Cancer from Jim Nielsen’s Blog
- Pluralistic: All the books I reviewed in 2025 (02 Dec 2025) from Pluralistic: Daily links from Cory Doctorow
Articles from blogs I follow around the net
Announcing Live AI & Design Systems Jam Sessions!
Ian, TJ, and I are excited to announce live AI & Design Systems Jam Sessions with our AI & Design Systems course community! Our first jam session will be Thursday, February 26 at 10AM ET. In these recurring biweekly Zoom […]
via Blog – Brad Frost February 16, 2026I Sold Out for $20 a Month and All I Got Was This Perfectly Generated Terraform
Until recently the LLM tools I’ve tried have been, to be frank, worthless. Copilot was best at writing extremely verbose comments. Gemini would turn a 200 line script into a 700 line collection of gibberish. It was easy for me to, more or less, ignore LLM…
via matduggan.com February 16, 2026Pluralistic: The online community trilemma (16 Feb 2026)
Today's links The online community trilemma: Reach, community and information, pick two. Hey look at this: Delights to delectate. Object permanence: Bruces x Sony DRM; Eniac tell-all; HBO v PVRs; Fucking damselflies; Gil Scout Cookie wine-pairings; Bi…
via Pluralistic: Daily links from Cory Doctorow February 16, 2026Generated by openring