The Trapzor Quest simplified

codster62

Member
Here is some script I created and also need help with. I am a newbie at this, and I am using basic Cli Commands... Please help me finish this so we can have a good working Trapzor script. :)

// The Trapzor Quest simplified
// By Cody Hawken

Cli_execute( "conditions add 1 7-Foot Dwarven Mattock" );
Cli_execute( "conditions add 1 Miner's Helmet" );
Cli_execute( "conditions add 1 Miner's Pants" );
Cli_execute( "adventure 100 Itznotyerzitz Mine" );

Cli_execute( "Equip 7-Foot Dwarven Mattock" );
Cli_execute( "Equip Miner's Helmet" );
Cli_execute( "Equip Miner's Pants" );

Cli_execute( "conditions add 3 chrome ore" ); // Once you visit the Trapper, change chrome ore to whatever is needed.
Cli_execute( "adventure 100 Itznotyerzitz Mine" );


adventure( 1 , $location[ I don't know the location ] ); // I was wanting it to be the tr4pz0rz cabin, but I cannot find the location name

Cli_execute( "conditions add 6 goat cheese" );
Cli_execute( "adventure 100 goatlet" );

adventure( 1 , $location[ I don't know the location ] ); // I have the same problem here as above, I need to check the L33t Trapzor

cli_execute( "conditions add 1 extreme scarf" );
cli_execute( "buy 1 phial of coldness" );
cli_execute( "use 1 phial of coldness" );

adventure( 1 , $location[ I don't know the location ] ); // And return to him to finish the quest...


// Save this text using notepad, not worpad because of some known issues, and save as a .ash file. Then run with kolmafia.
 

Grotfang

Developer
I think you may be biting off a little more than you can chew here, codster. The Trapzor quest has a few complicated aspects to it.

The first bit is fine, and you have correctly identified that setting goals is the way to approach the adventures. The ASH way of expressing that instead of:

Code:
Cli_execute( "conditions add 1 Miner's Helmet" );

Is:

Code:
add_item_condition( int quantity, item it );

Therefore, for getting the outfit and equipping it, you could use:

Code:
add_item_condition( 1 , $item[Miner's Pants] );
add_item_condition( 1 , $item[Miner's Helmet] );
add_item_condition( 1 , $item[7-Foot Dwarven Mattock] );
adventure( 100 , $location[Itznotyerzitz Mine] );

equip( $slot[weapon] , $item[7-Foot Dwarven Mattock] );
equip( $slot[hat] , $item[Miner's Helmet] );
equip( $slot[pants] , $item[Miner's Pants] );

Unfortunately, the elements required to do the mining aspect of this script is a little trickier. Firstly, you will need to learn how to parse pages in order to work out which ore the Trapzor is after. You will then need to include a lot of direct URL visits in order to actually mine.

Let me explain. Telling mafia to "adventure( 100 , $location[Itznotyerzitz Mine] );" when in disguise will not do anything. Mafia does not automatically mine for you, and it won't recognise the location. I'm not going to discuss string handling and parsing to you, as it goes well beyond what you are currently doing and, to be honest, will probably confuse more than assist. Suffice to say, it wouldn't do any harm for the time being to either try scripting simpler quests, or simply accept that this particular aspect of the trapzor quest will have to be done by hand.

The rest of the script is easy enough and simply repetitive. To get to the trapper, you will have to visit that URL directly, I think:

Code:
visit_url( "trapper.php" );

should do that. Using the add_item_condition() and equip() and adventure() functions I alluded to earlier, you should be able to complete your script. Remember, use the wikis!

The kolmafia wiki is found here.

And the kol wiki is found here.

If you use a combination of these, you shouldn't need to use cli_execute, or not know a location name. If you can't find a location (it isn't listed on either wiki) then consider using visit_url(). To find a url, just hover over the link (picture or text) in your browser and it should appear in the bottom corner. Worst comes to the worst, view the source code of the page to find what the links are.
 

codster62

Member
Wow! To tell you the truth, I know the mining thing was way off because of what Bale said about adventuring in a specific square in my last script. Once again, thanks for taking the time to point out errors in my script. I will try and work on them and redo this script in ash. Thanks! And also, thanks for the Url thing, I will be using it more often. I appreciate you putting your effort into the script.
 

Grotfang

Developer
Not a problem. If you have any questions you want to ask before posting something on the forum, please feel free to send me a private message, either through the forum or in-game.

Happy scripting!
 
Top