Pre-Hobo Boss Item Buffs (Alpha)

Kli1195

New member
I have:
Code:
void bagT(){
	int BoT = my_adventures();
	while((item_amount($item[Bag o' Tricks]) > 0)){
		while(BoT == my_adventures()){
			equip($item[Bag o' Tricks]);
			adventure(my_adventures(), $location[McMillicancuddy's Farm]);
			use_skill($skill[Entangling Noodles]);
			use_skill($skill[Lasagna Bandages]);
			use_skill($skill[Open the Bag o' Tricks]);
		}
	}
}
But I'm having some trouble.
How can I make it so that it automatically checks to see if you have any mysticality-based skills and uses them twice in combat?
And if the player has none, how to make it so that it aborts?
 

slyz

Developer
I have:
Code:
void bagT(){
    int BoT = my_adventures();
    while((item_amount($item[Bag o' Tricks]) > 0)){
        while(BoT == my_adventures()){
            equip($item[Bag o' Tricks]);
            adventure(my_adventures(), $location[McMillicancuddy's Farm]);
            use_skill($skill[Entangling Noodles]);
            use_skill($skill[Lasagna Bandages]);
            use_skill($skill[Open the Bag o' Tricks]);
        }
    }
}

Instead of adventure(my_adventures(), $location[McMillicancuddy's Farm]); (which will use ALL of your adventures at the Farm - thankfully you would loose 15 at most), you could adventure there ONCE, with the right CCS.

Or you can do this:
Code:
void bagT(){
    while( equip($item[Bag o' Tricks]) && have_effect($effect[Weasels Underfoot]) == 0 ) {
        string page_text = visit_url( to_url($location[McMillicancuddy's Farm]) );
        page_text = use_skill($skill[Entangling Noodles]);
        while ( !contains_text(page_text, "begins to wriggle around in your hand") ) {
            page_text = use_skill($skill[Lasagna Bandages]);
            if ( contains_text(page_text, "begins squirming around more urgently") )
                break;
        }
        page_text = use_skill($skill[Open the Bag o' Tricks]);
        // You probably want to use one last skill for the kill here.
    }
}

This is untested, but from what I gather about the Bag'o'Tricks on the wiki, it should work.
 

Kli1195

New member
Instead of adventure(my_adventures(), $location[McMillicancuddy's Farm]); (which will use ALL of your adventures at the Farm - thankfully you would loose 15 at most), you could adventure there ONCE, with the right CCS.
Shoot, keep forgetting that.
/slap
 
Last edited:

Kli1195

New member
Code:
get_property("sideDefeated");
	get_property("warProgress");
	get_property("sidequestArenaCompleted");
	visit_url("postwarisland.php?action=concert&option=2&pwd");
The above is in the script.

Code:
get_property("sideDefeated");
	get_property("warProgress");
	get_property("sidequestArenaCompleted");
Works, but...
Code:
	visit_url("postwarisland.php?action=concert&option=2&pwd");
...returns a blank page.

It also wouldn't work for anyone who defeated both sides or those who killed the other side.
How would you go around this?
 

Bale

Minion
For cryin' out! I wasn't giving you a script, I was giving you the tools to make a script.

If sideDefeated is the the opposite of sidequestArenaCompleted and warProgress is finished, only then can the arena be used. Think about it.
 
Last edited:

heeheehee

Developer
Staff member
Wait. If, say, you fight for the Frats, wouldn't sideDefeated give you the hippies? So sideDefeated would have to be different from sidequestArenaCompleted. warProgress would still have to be finished.

If it doesn't work that way (the logical way), then the way Bale suggested would be right.
 

Bale

Minion
No, you're right Heeheehee. I accidentally reversed that. I'll correct my post to prevent Kli1195 from getting even more confused.
 

Kli1195

New member
Code:
if((Frat_sideDefeated) && (sidequestArenaCompleted))
    visit_url("postwarisland.php?action=concert&option=2&pwd")
Is this the right pseudo code? I'm almost certain it's not.
 

slyz

Developer
Code:
boolean FratSideDefeated = ( get_property("sideDefeated") == "Frat");
boolean ArenaDone = get_property("sidequestArenaCompleted").to_boolean();

if( FratSideDefeated && ArenaDone )
    visit_url("postwarisland.php?action=concert&option=2&pwd")
 

heeheehee

Developer
Staff member
There's a missing semi-colon at the end of line 179.

Food like honey-dew must be eaten, not used. If you want to use a universal consume(boolean) function, here it is:
Code:
boolean consume(int qty,item it) { 
	if(item_type(it)=="food") eat(qty,it);
	else if(item_type(it)=="booze") drink(qty,it);
	else use(qty,it);
}

(I found it much more useful when iterating over keys in a map... that is, in my slime-buffing script.)

I'd also suggest only getting effects if you don't already have them active.

Edit: I'm also not really sure why you're calling seaside() in your main function, when useagua() already calls it.
 
Last edited:

heeheehee

Developer
Staff member
Erm, yeah. I totally had that in my universal consume function at some point.
Code:
// The following snippet was lifted (then modified) from EatDrink.ash. Mostly because I am too lazy to write this from scratch.
record fullness_file_entry // holds the map found in fullness.txt
{
	int drunk;
    	int level;	 
	string adv; 
	string muscle; 
	string mysticality;
	string moxie; 
};
fullness_file_entry [item] it_stats;
file_to_map("inebriety.txt", it_stats)
fullness_file_entry [item] it_stats;
file_to_map("inebriety.txt", it_stats);
// We didn't need to check spleen/fullness use, as you can't go over those limits. We could, but it's just not as necessary right away.

// And here's the new and improved universal consume function!
boolean consume(int qty,item it) { 
	if(item_type(it)=="food") eat(qty,it);
	else if(item_type(it)=="booze") {
		if(inebriety_limit() - (my_inebriety() + it_stats[it].drunk)) drink(qty,it);
		else return false;
	}
	else use(qty,it);
}

Also, isn't love song of icy revenge worse than love song of disturbing obsession when maxing out item drops?
 
Last edited:

Bazaaretw

Member
Not sure if this has been brought up, I got stuck in a loop. No idea why.

[6270] Mt. Molehill
Encounter: digital underground dweller
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw attacks!
You gain 125 Meat
You gain 14 Muscleboundness
You gain 37 Mysteriousness
You gain 10 Chutzpah

[6271] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw attacks!
You gain 115 Meat
You gain 19 Strengthliness
You gain 32 Enchantedness
You gain 9 Cheek

[6272] Mt. Molehill
Encounter: Here She Come Now Singin' Molé Molé
You acquire an item: mole molé

[6273] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!

[6273] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw loses initiative!
 

Bazaaretw

Member
Not sure if this has been brought up, I got stuck in a loop. No idea why.

[6270] Mt. Molehill
Encounter: digital underground dweller
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw attacks!
You gain 125 Meat
You gain 14 Muscleboundness
You gain 37 Mysteriousness
You gain 10 Chutzpah

[6271] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw attacks!
You gain 115 Meat
You gain 19 Strengthliness
You gain 32 Enchantedness
You gain 9 Cheek

[6272] Mt. Molehill
Encounter: Here She Come Now Singin' Molé Molé
You acquire an item: mole molé

[6273] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!

[6273] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw loses initiative!

Searching for "llama lama gong"...
Purchasing llama lama gong (1 @ 3,995)...
You acquire an item: llama lama gong
Purchases complete.
Gong path: mole
Using 1 llama lama gong...
You're still under a gong effect.

Any it should probably have something to allow it to restart where it left off in mid gong.
 

Kli1195

New member
Oh that's weird.
I'll try to test and fix that today.

Were you already under gong effect?

EDIT: I tested this on a multi and my main, and both work, are you sure you didn't already have a gong effect/dance interpreter?
 
Last edited:

heeheehee

Developer
Staff member
I checked out the script again -- for future reference, once Mafia has ID'd the ! potions, you can call the potion that gives Object Detection with $item[potion of detection], as Mafia appends "of detection" to the item name for your character.

Edit: Also, your documentation has a small error -- the second gong should get Extra-sensory Perception, not Perceptive Pressure. Heh.
 
Last edited:

Bazaaretw

Member
Oh that's weird.
I'll try to test and fix that today.

Were you already under gong effect?

EDIT: I tested this on a multi and my main, and both work, are you sure you didn't already have a gong effect/dance interpreter?

My first post, it was looping infinitely when it already had enough skill uses to get the buff on mole form.

The second post was because I was under gong effect and stopped the script because it was looping, and trying to restart it gave me that.
 

Kli1195

New member
I'm trying to make it so that it asks if you are killing Zombo (eventually adding in Scratch) and if you have funkslinging, and if you do, then if you know that Zombos drops aren't profitable.
Unfortunately kolmafia isn't exactly like regular java, and so I have no idea how to do this.
An attempt I made that didn't work:
Code:
void main( boolean killing_Zombo )
{
	if( killing_Zombo ){
		print( "Do you have Ambidextrious Funkslinging skill?" );
		boolean funk;
		if( funk ){
			print( "Awesome! And you do know that Zombo's drops are not profitable, right?" );
			boolean profit;
			if( profit )
				print( "Great! Continuing script..." );
			else
				print( "Oh noes! Aborting script! Error 404! Division by Zero!" );
			}
		else
			print( "Then you do realize that your shirt, hat, and pants will be rendered ineffective, right?" );
	}
}
 
Top