Request: Ballroom leveling script

CheezyBob

New member
It would be really awesome if I could get a script that would automatically use a dance card after every Rotting Matilda adventure.
 

icon315

Member
This is what i came up with in a few min. do what you wish with it
PHP:
item card = $[dance card]
repeat
{
adventure(1 ,$location[haunted ballroom] )

if(item_amount(card) > 1)
use( item_amount(card), card )

}until (my_adventures() < 1)
 

Theraze

Active member
It will reuse a dance card if one is available and the counter runs out, but it won't use one if it's newly acquired and there's no counter currently active.

Edit: Above code fails. Try this:
Code:
item card = $item[dance card];
repeat
{
adventure(1 ,$location[haunted ballroom] );

if(item_amount(card) > 1) use( item_amount(card), card );

}until (my_adventures() < 1);
Several semicolons added, and $[dance card] became $item[dance card], which should fix it...
 
Last edited:

heeheehee

Developer
Staff member
Was under the impression that was what the OP was asking. But okay, set that to be your counterScript, then just use a while loop:
PHP:
while(my_adventures()>0 && adventure(1,$location[Haunted Ballroom])) retrieve_item(1,$item[dance card]);
/em is practicing zarqon-style solutions. Single-line, and concise!

(edit: edited to be even more concise!)

And, uh, double edit: uh. Forgot to account for that case, yeah. You'd need something slightly more complicated, I guess.
PHP:
if(get_counters("Dance Card",0,3)=="") use(1,$item[Dance card]);
while(my_adventures()>0 && adventure(1,$location[Haunted Ballroom])) retrieve_item(1,$item[dance card]);

Hmm... I could probably get that into a single-line statement, but it'd be messy.
 
Last edited:

Theraze

Active member
Here's another version, that I think should run more like requested...
Code:
item card = $item[dance card];
while (my_adventures() > 0 && have_effect($effect[beaten up]) == 0)
{
    if(get_counters("dance card", 0, 4) == "" && item_amount(card) > 0) use( item_amount(card), card );
    adventure(1 ,$location[haunted ballroom] );
}

This one should start by checking if there's a current dance card counter, and if not and there's a card available, use it. Otherwise, keep adventuring until you get one, then use the card, keep adventuring, repeat until done...

Edit: Yes, strictly speaking, what he asked for is exactly what Bale's script does. But what he actually wants is more like what we've posted following, for optimal ballroom moxie training. :D

Edit2: And yes, this is a script I've considered writing/updating for myself several times, despite using the counter checker, for precisely this reason... newly acquired dance cards, when the counter isn't active, don't get used, but if you set the goal and get one before the counter expires, you have to disable the goal, run 3 adventures manually, reapply the dance card, and re-set the goal, if you didn't manage to get a card in those 4 (since Bale's script automatically runs an extra adventure over what you set) adventures, otherwise you run another 3 adventures, and repeat the process...
 
Last edited:

Xenthes

Member
Here is what I use which also allows you to choose how many adventure you want to use also.

Code:
void main(int advs) {
if(advs>0) advs=advs-my_adventures();

cli_execute("conditions clear;");


while(my_adventures()+advs>0) {

if(item_amount($item[dance card])==0) cli_execute("conditions add dance card; adv "+advs+" ballroom;");
if(my_adventures()+advs>3 && item_amount($item[dance card])>0) cli_execute("use 1 dance card; adv 4 ballroom;");
	else {
		if(advs<0) cli_execute("adv "+advs+" ballroom;");
	}
}


cli_execute("conditions clear;");
}
 

Bale

Minion
In run I do this:

Code:
void hunt_dances(){
	if(item_amount($item[dance card]) <1) {
		add_item_condition(1, $item[dance card]);
		adventure(my_adventures(), $location[Haunted Ballroom]);
	} else {
		use (1, $item[dance card]);
		adventure(4, $location[Haunted Ballroom]);
	}
}

void main() {
	while(my_adventures() >= 4) {
		hunt_dances();
	}
}

When I have mall access, this does the job nicely from the CLI:

Code:
ash while(my_adventures() >= 4) {retrieve_item(1, $item[dance card]); use(1, $item[dance card]); adventure(4, $location[Haunted Ballroom]);}
 

Theraze

Active member
Well, I just used my new script to earn 5227 moxie today in the ballroom with my 100% black cat bad moon... Worked exactly as I wanted, no mucking with conditions, no stopping, just adventuring, using dance cards when there's no counter. :) Though I'll probably need to add a beaten up check to it as well... think I'll update it above. Heh.

Edit: And next day, 121 adventures, 7226 moxie. eatdrink, ballroom, eatdrinkod. Happy.
 
Last edited:

Alden

New member
Can someone post that as a finished script, for the people that are compeltely unable to write anything and are affraid of making some weird mistake that will somehow break things? XD I know it's a silly request.
 

Theraze

Active member
If you end up with two, is that smart enough to know that the counter is still active, and not try to use another dance card between every fight until you manage to fail to have it still active? That was the main issue I ran into with trying to do it normally...
 
Top