Scripting is one of the major features of BlueStacks and it allows you to automate a certain sequence of in-game actions (i.e., keystrokes, mouse clicks, delays). The script is activated by pressing the key that you assigned to it. Knowing how to use scripts is a very useful skill to have as it can dramatically enhance your gameplay features and give you advantages that you never thought you would be able to have!

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense
How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

One of the most repetitive actions in Archer Forest: Idle Defense is summoning lightning bolts to strike enemies. Summoning requires you to repeatedly left-click the screen, which can not only be physically exhausting but can also be taxing on your mouse. Fortunately, you can automate this entire process of summoning lightning bolts and even make it way better than manual clicking via scripting.

In this guide, we’ll show you how to create an automatic lightning bolt striker in Archer Forest: Idle Defense using BlueStacks scripting feature. We will provide the code for you so all you need to do is copy and paste. If you have not done so already, install and play Archer Forest: Idle Defense now on PC or Mac with BlueStacks.

How to Create a Script

Creating a script is very easy in BlueStacks and you only need to make a few clicks to get started.

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

Firstly, launch Archer Forest: Idle Defense from your BlueStacks menu. After launching the game, click on the “Game Controls” icon (a keyboard icon) from the side toolbar and then select “Controls editor” from the dropdown menu.

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

In the controls editor, find the script button and drag-and-drop it to the game screen. You can place it anywhere on the screen. A good area to place it would be the lower corners of the screen. After dragging and dropping, press the key that you want to assign to the script. For this instance, we’ll assign the Enter key but you can use any other key. If you accidentally pressed the wrong key, you can hover over the script button and click the small “X” button on the top-right corner.

After assigning the key, click on the “>” icon to open the scripts editor and start adding scripts.

Automated Lightning Bolt Scripts

The scripts editor acts like a typical notepad application where you can enter specific code. If you want to know in-depth about the commands you can write, you can check out this dedicated scripting guide.

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

For this guide, we’ve already written the script for you so you need only to copy-paste this code into the script editor. After copy-pasting, just click on the “Save” button and exit the editor.

Script Code
#Archer Forest: Idle Defense

# Auto-lightning script

loop

# Change coordinates if needed.

mouseDown 72.2615 20.6759

wait 100

mouseUp

loopEnd

onRelease

abort

What this script does is initiate an infinite loop in which a mouse click is registered on the specified screen coordinates every 100 milliseconds. The loop starts when you press the assigned key and stops when you let go of it. In other words, you will need to keep holding the assigned key to run the script.

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

When activated, this script summons lightning bolts at an inhumanly fast rate. You can lower the delay time from 100 milliseconds to 50 milliseconds or 25 milliseconds to get an even faster summoning rate. You can also remove the “wait 100” code entirely to get the fastest rate possible. When this is done, the script can legitimately slow down the game and even cause it to crash when it runs for too long.

How to Automate Lightning Bolts with BlueStacks Scripting in Archer Forest: Idle Defense

If you find that the script is not working properly, you may need to edit the mouse click coordinates. To do this, go back to the script editor, remove all the numbers in the “mouseDown” command and then click beside the command. To get new coordinates, simply click on the game screen, hover over the part of the screen you want to get the coordinates to, and then right-click. This should automatically copy-paste the new coordinates into the scripts editor.

To make this script more powerful, you can increase the damage of the lightning strikes. You can either spend gold or diamonds to increase lightning DMG incrementally.

You can create more than one script to suit your needs. The given script works only while holding the assigned key. However, you can have a new script that only strikes lightning for a certain amount of times. You can do this by simply modifying the loop command to specify the amount of times lightning will strike enemies. An example script is found below.

Script Code
#Archer Forest: Idle Defense

# Auto-lightning script

loop 999

# Change coordinates if needed.

mouseDown 72.2615 20.6759

wait 100

mouseUp

loopEnd

In the above script, the loop runs only 999 times which means that lightning is summoned 999 times before you must activate the script key again.

Conclusion

Scripting is a powerful tool and it can give you a huge advantage in Archer Forest: Idle Defense. By copy-pasting a simple script, you can unleash lightning upon enemies at an inhumanly fast rate and can help you progress levels faster. Install and play Archer Forest: Idle Defense on PC or Mac with BlueStacks now to take advantage of scripting and also other useful features like macros.  Check out other strategy games here.