That FN Ninja
Member
Miner 2.5 - Automated ore farming
Requires Zlib.
I made this script mostly for help in acquiring the ore necessary for the Dwarvish War Uniform, but also as a quick way to get the ore for the trapper.
Here is an alias to get the ore that the trapper is asking for:
alias tore => ash import <miner.ash> get_tore=true; mine_stuff();
And here is one to utilize the free mining that you get from Unaccompanied Miner:
alias fmine => ashq import <miner.ash> free_mine();
User Preferences
boolean get_tore
If true the script will just get the ore the Trapper is asking for.
boolean mine_all
If true will mine all walls in cavern instead of just the top 3 rows. By default the script only mines the top 3 rows of evey cavern because almost all ore is found in the top 3 rows.
WARNING: Mining all walls consumes 36 adv. per cavern as opposed to 21 for just the top 3 rows.
boolean open_mine2
If true and you've selected to mine ore that can only be mined in the Knob Shaft this will gain access to The Knob Shaft. It opens Cobb's Knob Laboratory if it's not already open.
boolean asked
Set this to true if you plan on mining in the anemone mine and have already asked grandpa about it.
int asbestos, chrome, linoleum, diamond, bubblewrap, cardboard, styrofoam, teflon, velcro, vinyl, aquamarine, stonepower, meatstack
These set the amount of the specified item to mine for. These numbers take into account items already in inventory. (i.e. If you set int chrome = 3; and you already have 3 or more chunks of chrome ore in inventory the script won't farm for more chrome ore.) You can set as many of these as you want.
For instance:
The script will mine the Itznotyerzitz Mine until you have 3 chunks of chrome ore and 3 lumps of diamond in inventory and will then mine the Knob Shaft until you have 10 chunks of bubblewrap ore in inventory.
Notable Functions:
boolean free_mine()
This uses the 5 free mine attempts granted by the skill Unaccompanied Miner. It will try to get the trapper ore if you still need it and can access Itznotyerzitz Mine. Then it will try to mine for the most profitable ore based on mine access and mall prices (or autosell value if in Ronin/HC).
boolean mine(int amount, item ore)
This tries to retrieve amount ore and if it is unsuccessful it mines for the remaining amount needed.
boolean mine(int[item] ore)
This repeatedly tries to retrieve 3 of the ore you need the most of in the map until you can't retrieve anymore and then mines for the remaining amounts needed.
The following code for example:
The script will try to retrieve 3 chrome ore and if successful
will try to retrieve 3 more chrome ore and if successful
will try to retrieve 3 linoleum ore and if successful
will try to retrieve 3 asbestos ore and so forth until an unsuccessful retrieval attempt.
This ensures that you have the lowest amount of each ore if you end up having to mine. Witch means fewer caverns to mine through and a lot of saved turns.
Thanks goes to Zarqon, Jason Harper, mredge73, & Bale for helping me fix my n00bish scripting errors.
If you find this script useful donations in the form of in-game ninja paraphernalia are always appreciated! Thanks and enjoy the script!
Change log:
11.05.09 - Added mine() function. Changed counter_change() to switch.
09.24.10 - Added support for Anemone mine. Re-factored code. Overloaded the mine function to take a map. Converted prints to vprints and aborts to exits. Now restores your outfit to whatever it was before mining.
09.29.10 - Added the free_mine() function to utilize the Unaccompanied Miner skill.
09.30.10 - Fixed mine one access detection bug.
10.01.10 - Re-factored code to reduce some server hits.
10.04.10 - Last update to reduce server hits caused an infinite loop when finding a new cavern. Fixed that bug.
02.20.11 - Changed Harem location name.
05.29.11 - Fixed sea/mine3 detection error.
Requires Zlib.
I made this script mostly for help in acquiring the ore necessary for the Dwarvish War Uniform, but also as a quick way to get the ore for the trapper.
Here is an alias to get the ore that the trapper is asking for:
alias tore => ash import <miner.ash> get_tore=true; mine_stuff();
And here is one to utilize the free mining that you get from Unaccompanied Miner:
alias fmine => ashq import <miner.ash> free_mine();
User Preferences
boolean get_tore
If true the script will just get the ore the Trapper is asking for.
boolean mine_all
If true will mine all walls in cavern instead of just the top 3 rows. By default the script only mines the top 3 rows of evey cavern because almost all ore is found in the top 3 rows.
WARNING: Mining all walls consumes 36 adv. per cavern as opposed to 21 for just the top 3 rows.
boolean open_mine2
If true and you've selected to mine ore that can only be mined in the Knob Shaft this will gain access to The Knob Shaft. It opens Cobb's Knob Laboratory if it's not already open.
boolean asked
Set this to true if you plan on mining in the anemone mine and have already asked grandpa about it.
int asbestos, chrome, linoleum, diamond, bubblewrap, cardboard, styrofoam, teflon, velcro, vinyl, aquamarine, stonepower, meatstack
These set the amount of the specified item to mine for. These numbers take into account items already in inventory. (i.e. If you set int chrome = 3; and you already have 3 or more chunks of chrome ore in inventory the script won't farm for more chrome ore.) You can set as many of these as you want.
For instance:
Code:
int chrome = 3;
int diamond = 3;
int bubblewrap = 10;
Notable Functions:
boolean free_mine()
This uses the 5 free mine attempts granted by the skill Unaccompanied Miner. It will try to get the trapper ore if you still need it and can access Itznotyerzitz Mine. Then it will try to mine for the most profitable ore based on mine access and mall prices (or autosell value if in Ronin/HC).
boolean mine(int amount, item ore)
This tries to retrieve amount ore and if it is unsuccessful it mines for the remaining amount needed.
boolean mine(int[item] ore)
This repeatedly tries to retrieve 3 of the ore you need the most of in the map until you can't retrieve anymore and then mines for the remaining amounts needed.
The following code for example:
Code:
import <miner.ash>
int[item] to_mine;
to_mine[$item[chrome ore]] = 16;
to_mine[$item[asbestos ore]] = 11;
to_mine[$item[linoleum ore]] = 12;
mine(to_mine);
will try to retrieve 3 more chrome ore and if successful
will try to retrieve 3 linoleum ore and if successful
will try to retrieve 3 asbestos ore and so forth until an unsuccessful retrieval attempt.
This ensures that you have the lowest amount of each ore if you end up having to mine. Witch means fewer caverns to mine through and a lot of saved turns.
Thanks goes to Zarqon, Jason Harper, mredge73, & Bale for helping me fix my n00bish scripting errors.
If you find this script useful donations in the form of in-game ninja paraphernalia are always appreciated! Thanks and enjoy the script!
Change log:
11.05.09 - Added mine() function. Changed counter_change() to switch.
09.24.10 - Added support for Anemone mine. Re-factored code. Overloaded the mine function to take a map. Converted prints to vprints and aborts to exits. Now restores your outfit to whatever it was before mining.
09.29.10 - Added the free_mine() function to utilize the Unaccompanied Miner skill.
09.30.10 - Fixed mine one access detection bug.
10.01.10 - Re-factored code to reduce some server hits.
10.04.10 - Last update to reduce server hits caused an infinite loop when finding a new cavern. Fixed that bug.
02.20.11 - Changed Harem location name.
05.29.11 - Fixed sea/mine3 detection error.
Attachments
Last edited: