·:·:· 1. Clear the Mind Stone ·:·:·
Select all the text that comes by default in your Mind Stone and delete it. If you'd like, you could keep the header by Bezerra, the Sage , as any text preceeded by // has no effect and is ignored by the AI.
Hint: The shortcut to select all is Ctrl + A.
_.,·─·──·────┬───────────────────────·──·─·.,_
.:´ | `-.
.:' └--------┐ Power `.
/:' | ____,---╓───┐ `\
,:' ◘ │ '---╙───┘ \
:' | `.
:.' ╔══════════════════════════════════╧═══════════════╕ |
:.| ║ │ '/
:.! ║ │ ´!
:. ║ │ |
:.' ║ │ '|
:. ║ │ |
:.' ║ │ '|
:. ║ │ |
!.' ║ │ '|
:. ║ │ |
:.' ║ │ '|
:.| ║ │ |
:.' ║ │ '|
:. ║ │ .(
:.' ║ │ '|
:. ║ │ |
:.' ║ │ '|
:.| ║ │ |
:.' ╙────────────────────────┬─────────────────────────┘ ';
':.\ . | . ./
'::.`- | ° | .'
'':.:.:.:.:.|.:.:.:.:.:.:.:.:.:.:.:.:.:.:.|.:.:.:.:.:·`
·:·:· 2. Healing ·:·:·
)(
(~≈)
¯¯
Instructions are all about converting common sense into something the game's AI can understand. For example, if you're about to die it would make sense to use a Healing Potion, right?
There's a command to do that. Type the following into the Mind Stone:
activate potion
This tells the AI what to do. When you visit a location it will continuously try to activate the potion, every frame. As soon as you lose some health it will then successfully activate. In case you have a non-healing potion such as Lucky Potion, then it will activate immediately when you visit a location. Probably not the outcome we're looking for, so let's improve it.
We can think of a more complete instruction like this:
"IF my hitpoints are low THEN activate potion"
Translating that into Stonescript, modify the Mind Stone to the following:
?hp < 7
activate potion
The first line ?hp < 7 is asking a question, "Are my hitpoints less-than 7?" As opposed to human language, the game requires the question mark as the first thing in the line, this way it knows right away that it's a question and knows how to read the rest (¿kinda like Spanish?).
Notice the space added in front of activate potion . The space is important because it groups that line as dependant to the line above it. This way, it will only activate if the question above equals "yes" .
·:·:· 3. Play ·:·:·
\|' /´,
`| / ,
/\ / `-´-
\ò ó` /´
| , (
'¡'!| |
|-'´ _'-.
¯'_/`´·\ `
With your Mind Stone powered up and a potion freshly brewed, head over to any dangerous location and watch as you take damage from foes. When your hitpoints go below 7 it should automatically activate the potion.
Hint: To re-open the Mind Stone in the middle of a location press 'M'. There's no need to head back to the Workstation. When you close the Mind Stone and resume the location your script will be reloaded and the new instructions you've written will take effect.
·:·:· 4. Weapons ·:·:·
│ O__
┼/|)_)
/ \
Our goal in this tutorial is to auto-farm Deadwood Canyon. A basic Sword + Shield combo is enough to complete the location on some difficulties and a good starting point.
Add the following to the bottom of your Mind Stone:
equipL sword
equipR shield
The equip command is exactly what you'd expect. It finds a weapon from your inventory and equips it. All text to the right of the command are additional details for the instruction. The L and R indicate which hand to place the weapon, left or right respectively. You could add more details to specify which weapon to equip, as you probably have many swords in your inventory. For example you can add *7 to specify it's a 7-star weapon: equipL sword *7 . Without any additional details the AI will find your best weapon and equip that, which is probably ok.
|/)
o.-._
´ /|`-`
`'
This will do fine in general, but when you are against Mosquitos it could be better to equip a Crossbow and avoid all damage, as they are very weak but can swarm you and deal lots of damage:
?foe = mosquito
equip crossbow
The keyword foe allows us to inspect the enemy currently targeted by the AI and then make decisions based on what kind of foe it is.
You may notice there's no L or R on this equip command. For the Crossbow we'll leave it without any details and let the AI decide what's best. Keep things simple for now.
Your entire script should look like this:
?hp < 7
activate potion
equipL sword
equipR shield
?foe = mosquito
equip crossbow
At this point it's worth clarifying that your script executes from top to bottom. It will first check the potion, then equip the sword and shield, and finally, if you are facing a mosquito it will equip the crossbow. The whole script runs 30 times per second.
Go to Deadwood Canyon to see if everything is working. If your script is a success and you didn't choose a location that's too hard for your current weapons, then you should be able to keep looping the location with the Ouroboros and farm it many times. That is, until you run out of Tar for potions or your inventory becomes full with treasure.
·:·:· 5. Wood ·:·:·
\|
|, |/
\| | /-'
`-─\ | /_/─,
\'//
'\} {
{ }
} {
//\`\
As you approach trees in Deadwood Canyon, perhaps you'd like to take the opportunity to harvest wood.
Add the following to the bottom of your script:
?harvest.distance < 10
equip hatchet
In this case L and R are also not needed because the Hatchet can only be equipped on the right side anyway.
Visit Deadwood to try out your latest changes!
·:·:· 6. More Healing ·:·:·
____,
_.-·´ o/`___
,´ _.-._\¯¯`-.`.
/ ,´ `.`.
| : | :
| :. .' ;
\ `':.,,,,,..·´ ,´
`-._ _,-´
¯¯¯¯¯
At this point the script works, but depending on the star level of your gear or the chosen difficulty of the location you may still be taking too much damage from foes. Let's improve the script by equipping the Ouroboros, which heals over time while equipped.
Add the following:
?foe ! boss & foe.distance > 8
equipL ouroboros
The question asked here is more complex, so let's break it down. On line 1, the first part asks foe ! boss which translates to "Foe is not a boss" . The exclamation mark is the opposite of the equals symbol.
The second part of line 1 is foe.distance > 8 which means "Is the foe's distance to the player greater than 8?" . The two questions in line 1 are combined into a single question with the & symbol, which means "AND" .
The whole instruction means:
"If the next foe is not a boss and it's distance to the player is greater than 8, equip the Ouroboros on the left hand."
Hint: With a foe distance of 8 the Ouroboros will be used in combat. This is useful if your gear level is low. However, if 17 is used instead of 8 then the Ouroboros is excluded from combat, resulting in faster loop times. This is because the Ouroboros has an attack range of 17 . The value of 8 allows the Sword to be prioritized in melee situations.
·:·:· 7. Pickups ·:·:·
,
_/-'
You may notice that one thing slowing us down are things on the ground that must be picked up. In Deadwood Canyon that would be bits of wood. Lucky for us, the Star Stone (when equipped) sucks up all pickups and speeds up movement by a lot.
Add the following:
?pickup.distance < 10
equipL star
Similar to foe.distance this instruction is asking if the next pickup is less than 10 units away from the player. If that's the case then we equip the Star Stone on the left hand. We can say only star and that's enough to identify the relic because there aren't any other items with star in their name.
·:·:· 8. All Together ·:·:·
Our script for Deadwood is complete! However, these instructions will currently run in all locations. We probably want to do a specific set of instructions for each location, so we need to group these and only run them if we are exploring Deadwood Canyon.
To check in what location we are, we can use the keyword loc .
At the TOP of the script, add the following:
?loc = deadwood
But also, add space to the front of all the lines thereafter, so they become dependant on the location question. The entire script should look like this:
?loc = deadwood
?hp < 7
activate potion
equipL sword
equipR shield
?foe = mosquito
equip crossbow
?harvest.distance < 10
equip hatchet
?foe ! boss & foe.distance > 8
equipL ouroboros
?pickup.distance < 10
equipL star
Hint: You can copy/paste scripts from here or from other players into the Mind Stone with the Ctrl+C / Ctrl+V shortcuts.
·:·:· What's next? ·:·:·
.-.
\ ´ .-.
,-. ) \ ´
'- `-/¯\-´
.· /`°´\ ·.
`-´ `-´
External resources and mini-tutorials below.
Links
Trouble with this tutorial? Need help with other locations? Visit our Discord.
Discover fun cosmetics and mini-games created by the Stone Story community.
Ready to dive deeper? Learn everything from the Stonescript manual.
Lifesteal
If you have a good Lifesteal sword (dL) you may want to use that to manage your hitpoints, instead of relying only on potions. This will vastly improve your survivability (and save Tar):
?hp < maxhp & foe.distance < 7
equipL sword dL
Poison
With a good Poison weapon (dP) you can mitigate most of the damage from the boss. Again, greatly improving your survival and need for potions. This allows you to reach higher difficulty locations with minimal gear:
?foe = boss & foe.debuffs.count = 0
equipR dp
In this idea, we check the number of debuffs to avoid re-applying the Poison before its time runs out.
Mobility
Players often employ the Dashing Shield, Triskelion and even the Quarterstaff abilities to greatly improve their loop times. E.g.:
?foe.distance >= 11 & foe.distance <= 16
equipR dashing
Ability Activation
Here things start getting more complex. A common question from players is how to activate abilities. While some items like the Hatchet and Blade of the Fallen God are easier, an important one that gives players lots of trouble is the Bardiche:
?foe = boss & foe.distance <= 10 &
^item.GetCooldown("bardiche") <= 0 |
^item.GetCooldown("bardiche") > 870
equip bardiche
activate R
A few new symbols you will notice here are the ^ which is a way of continuing the previous line, as well as the | which means "OR" .
In this example we are using the Bardiche's special ability against the boss (?foe = boss ) when it's in range (foe.distance <= 10 ) by calling equip bardiche then activate R . We are also using item.GetCooldown() to check the cooldown on the Bardiche's super attack.
We use the cooldown information to keep it equipped only during the activation. Unlike some ability activations that are instantaneous, the Bardiche has a "cast" time, during which we need to keep it equipped. The game allows you to equip something else during the cast, but that cancels the ability and it goes on cooldown anyway. That's where the 870 comes from: Cooldown values are represented in frames. Each second equals 30 frames. The Bardiche has a 30 second cooldown which translates to 900 frames. Minus the cast time which is roughly one second, equals 870 frames.
To better visualize what's happening with the Bardiche, try adding this:
var cd
cd = item.GetCooldown("bardiche")
>`0,0,Bardiche cooldown = @cd@
The above snippet will print the cooldown in the upper-left corner. Activate the Bardiche's ability to see it go up to 900 then count down back to zero.
Copyright Martian Rex, Inc. 2020