PDA

View Full Version : Ballroom Dancing



StrawberryLetter23
01-09-2007, 04:38 PM
I would like to ballroom dance with Rotting Matilda, so I've written a short script to check for dance cards and use them and adventure x dance card + 4 in the Spookyraven Ballroom.

I'd like some comments from experienced ASH coders on the script. Here it is:

void main()
{
int cards = item_amount( $item[dance card] );
if (cards > 0) {
if ( my_adventures() >= (cards+4)){
while (cards > 0)
{
use(1, $item[dance card]);
adventure(1, $location[Haunted Ballroom]);
cards --;
}
} else {
print ("You do not have enough adventures to use all the dance cards in your inventory.");
}
} else {
print ("You do not have any dance cards to use, silly rabbit.");
}
}
It does compile. I'm too drunk to see if it works. I'm hoping to use it tomorrow. Should I use a different control structure to iterate through the cards?

Thanks in advance.
SL23

Metraxis
01-09-2007, 05:32 PM
The biggest problem with it is that it won't work. When you use a dance card, it sets a timer. The 4th adventure after using the card will be Matilda, if it is in the Ballroom. As written, your script will never trigger Matilda, since the timer is reset every time you use a card. Here's a slightly stripped-down version of my own dancing script (Less the buff-maintainence stuff)



void main (int level) {
while(my_adventures() >= 4 && my_level() < level) {
use(1,$item[dance card]);
adventure(3,$location[Haunted Gallery]);
adventure(1,$location[Haunted Ballroom]);
}
}


Since the use() is not trapped, the script will abort if the character has no dance cards and is unable to acquire one from the mall for whatever reason (such as being in Ronin/Hardcore)

StrawberryLetter23
01-10-2007, 02:32 PM
Triple posts merged
Topics merged
Post in second topic merged-efilnikufecin

So you can't use dance cards to stack Rotting Matilda so it occurs back to back. >:(

I tested on another account and indeed that happened.[br]Posted on: January 09, 2007, 12:07:25 PM[hr]Well this is now a very specific goal to powerlevel on stat day with clovers and dance cards.


void main()
{
int cards = item_amount( $item[dance card] );
if (cards > 0)
{
if ( my_adventures() >= (cards*4)){
while (cards > 0)
{ use(1, $item[dance card]);
if (item_amount($item[disassembled clover]) >= 3) { use(3, $item[disassembled clover]); }
else { int clover = item_amount($item[disassembled clover]);
use (clover, $item[disassembled clover]); }
adventure(4, $location[Haunted Ballroom]);
cards = cards - 1;
}
}
else { print ("You do not have enough adventures to use all the dance cards in your inventory."); }
}
else { print ("You do not have any dance cards to use, silly rabbit."); }
}

cards --; did not work. Is this kind of operation not allowed in ASH?[br]Posted on: January 09, 2007, 12:12:46 PM[hr]I guess it's finished until tomorrow at which point I'll test it.



void main()
{ /*purpose: maximizing Moxie stat day with clovers and dance cards while adventuring in The Haunted Ballroom of Spookyraven's Manor.*/
int cards = item_amount( $item[dance card] );//get number of dance cards in inventory
if (cards > 0)
{
if ( my_adventures() >= (cards*4)){//each dance card requires 4 adventures to get to the Rotting Matilda adventure.
while (cards > 0) //Loop through cards
{ use(1, $item[dance card]);
if (item_amount($item[disassembled clover]) >= 3) { //use clovers to trigger Forward to the Past adventure
use(3, $item[disassembled clover]);
}
else { //if there aren't 3 clovers use the rest
int clover = item_amount($item[disassembled clover]);
use (clover, $item[disassembled clover]);
}
//Adventure 4 times to trigger Rotting Matilda

adventure(4, $location[Haunted Ballroom]);
//decrement cards variable.
cards = cards - 1;
}
} //error handling for not enough adventures.
else { print ("You do not have enough adventures to use all the dance cards in your inventory."); }
} //error handling for no dance cards.
else { print ("You do not have any dance cards to use, silly rabbit."); }
}
[br]Posted on: January 09, 2007, 03:05:44 PM[hr]Success! Went from 22nd to 23rd level in no time flat. I'll move this script to Turn-Burning.[br]Posted on: January 10, 2007, 08:27:10 AM[hr]I present a very specific script to Moxie power-level at the Haunted Ballroom. The script finds the number of dance cards in your inventory and if there are 3 or fewer disassembled clovers, it uses them. Adventure 4 times (3 Forward to the Past and 1 Rotting Matilda) rinse and repeat. Used it today and it works great.

nsnicole
03-31-2007, 12:07 AM
I hope you'll forgive a complete noob question. But whenever I try to load one of thsese scripts, I get an error message which says "no available namespace with function: void main". I tried selecting "custom combat script" from the "in combat" pulldown anyway, and the turns do burn, but it doesn't use dance cards.

The way I try to load them is that I copy and paste the script onto a notepad document, save it in the "scripts" folder, open the "scripts" menu, select "load script", click the file, then selsct "custom combat script" from the "in combat" pulldown. Is there something I'm missing in this process? I've tried it with several of these scripts, and each one has brought the same result - including the ones for which other people have had success.

I tried to find a sticky topic dealing with this, or some sort of help in the wiki, but no luck.

StrawberryLetter23
04-16-2007, 02:52 PM
Update: My luckiness (from a Moon sign and a Lucky holiday item) was not being properly captured. Ballroom Dancing is now updated to use any ten-leaf clovers before dancing with Rotting Matilda. No more wasted dance cards.

grazepoop
04-17-2007, 03:57 PM
Great script.

I'm learning how to script for this, and this script brought me forwards leaps and bounds.

I tried to see if I could make my own, simpler version (without the clovers) and I did. I'm so proud of myself.

If anyone's interested, here's a simpler version (all credit must go to original script.)

MsNicole
05-19-2007, 07:53 PM
Hi everybody. Ms Nweb Non-scriptwriter back again to report on progress.

Of the several scripts posted to this thread, the only one I've been able to get to work was this one:


void main()
{
int cards = item_amount( $item[dance card] );
if (cards > 0)
{
if ( my_adventures() >= (cards*4)){
while (cards > 0)
{ use(1, $item[dance card]);
if (item_amount($item[disassembled clover]) >= 3) { use(3, $item[disassembled clover]); }
else { int clover = item_amount($item[disassembled clover]);
use (clover, $item[disassembled clover]); }
adventure(4, $location[Haunted Ballroom]);
cards = cards - 1;
}
}
else { print ("You do not have enough adventures to use all the dance cards in your inventory."); }
}
else { print ("You do not have any dance cards to use, silly rabbit."); }
}
This script uses both clovers and cards, but it also works if I closet my clovers.


I haven't been able to get any of the others to work.

This one might well work as written, but it asks you to "input a value for int lvl", and I have no idea what that's supposed to mean:



void main (int level) {
while(my_adventures() >= 4 && my_level() < level) {
use(1,$item[dance card]);
adventure(3,$location[Haunted Gallery]);
adventure(1,$location[Haunted Ballroom]);
}
}

Which was a bit of a disappointment, because its shortness and simplicity sort of appeals to me.

When I attempt to load this one, I get "UNEXPECTED ERROR. debug log printed." Guess there's nothing to do about that if you're not an expert code writer, eh?


void main()
{ /*purpose: maximizing Moxie stat day with clovers and dance cards while adventuring in The Haunted Ballroom of Spookyraven's Manor.*/
int cards = item_amount( $item[dance card] );//get number of dance cards in inventory
if (cards > 0)
{
if ( my_adventures() >= (cards*4)){//each dance card requires 4 adventures to get to the Rotting Matilda adventure.
while (cards > 0) //Loop through cards
{ use(1, $item[dance card]);
if (item_amount($item[disassembled clover]) >= 3) { //use clovers to trigger Forward to the Past adventure
use(3, $item[disassembled clover]);
}
else { //if there aren't 3 clovers use the rest
int clover = item_amount($item[disassembled clover]);
use (clover, $item[disassembled clover]);
}
//Adventure 4 times to trigger Rotting Matilda

adventure(4, $location[Haunted Ballroom]);
//decrement cards variable.
cards = cards - 1;
}
} //error handling for not enough adventures.
else { print ("You do not have enough adventures to use all the dance cards in your inventory."); }
} //error handling for no dance cards.
else { print ("You do not have any dance cards to use, silly rabbit."); }
}

Anyhow, thanks for the efforts all. :)

holatuwol
05-20-2007, 04:54 AM
This one might well work as written, but it asks you to *"input a value for int lvl", and I have no idea what that's supposed to mean:


Looks like it's asking what level it should stop using clovers at. If you enter 30, it will stop using clovers at level 30, if you enter 15, it will stop using clovers at level 15.

gemelli
05-21-2007, 03:08 AM
A clannie of mine asked me for a script similar to this one, so I slapped my own version together. This one lets you decide whether to use clovers and scraps of paper, and whether you want to hit the mall in case you run out of dancing supplies. I haven't tested it myself, but the requestor seemed happy with it :)

macman104
05-21-2007, 06:11 AM
I haven't been able to get any of the others to work.

This one might well work as written, but it asks you to "input a value for int lvl", and I have no idea what that's supposed to mean:
void main (int level) {
while(my_adventures() >= 4 && my_level() < level) {
use(1,$item[dance card]);
adventure(3,$location[Haunted Gallery]);
adventure(1,$location[Haunted Ballroom]);
}
}

Which was a bit of a disappointment, because its shortness and simplicity sort of appeals to me.When you have the main function that takes parameters that makes it so you get prompted to fill those values. I've attached a script where I use this action. This actually makes your script even better because you haven't hardcoded a value that the user has to go in and change. Instead, you've given it the flexibility as Hola pointed out, that allows the user to define the level at which they'd like the script to stop at.
When I attempt to load this one, I get "UNEXPECTED ERROR. debug log printed." Guess there's nothing to do about that if you're not an expert code writer, eh?Not at all, that's what this forum is here for, to ask questions, and learn more about scripting. One thing that you can do is find the debug printout (all of the printouts in the debug log are timestamped), and either follow the directions in the printout or post them here, and we may be able to help. I went ahead and tested out your script to look at the debug log. It appears that the error is happening because in a script, no text is allowed to be on the same line following a /*. Likewise, for future reference, no text can follow a */ on the same line. If you simply add a newline before your /*, it should work.

The script I've attached is the script I use to put all the things I collect in my display case after a run. However, one of the sections I only want to run once. The way I've decided to do that is through the use of a prompt. It's not an integer like your script, but...yea.

dornbeast
06-20-2007, 04:56 AM
I'm using the ballroom dancing script to work my Moxie days on a level 30 run, and it works wonders. However, I've grown frustrated with the "too many dance cards" message, so I bashed together a script to fix that. The problem is, I can't integrate it with the ballroom dancing script. Can anybody help me add



if ( my_adventures() < (cards*4)){
int overflow = ceil (cards - my_adventures()/4);
put_closet (overflow, $item[dance card]);
}


to the script?

(I'm just running it separately right now, but where's the fun in that?)[hr]
Can anybody help me add (my changes) to the script?


Never mind; I figured out what I'd done wrong. Missing a closing bracket, of all things. I've attached the altered version.

Tarko
08-25-2009, 10:54 AM
GRRrr! found the problem to my script. (Reason for first edit)

Sorry for the Necro all, but I modified a script and Im proud, so I share!
Will acquire a dance card and then adv 4 adv @Ballroom. Will keep on doing it aslong as you have over 3adv.
I know most of the script is un0needed after the changes I made, but it works, so I didnt see any reason to fumble around more


import <zlib.ash>
void main()

while (my_adventures() > 3)
{

obtain(1,"dance card",$location[Haunted Ballroom]);


@ the begining of the script



I guess those extra lines are for those even less script-savy than me (they MIGHT exist,,).
As I pick more of ASH, it will get better, I swear.