Pre-Hobo Boss Item Buffs (Alpha)

heeheehee

Developer
Staff member
Protip: have_skill($skill[ambidextrous funkslinging]) will return true if the player has Funkslinging.
 

heeheehee

Developer
Staff member
The documentation error isn't in the code itself; it's in the first post of this thread ("3. Then it uses another gong and gets the Perceptive Pressure effect.").

Functions that might come in handy when improving functionality and checking:
have_skill($skill[Entangling Noodles]) returns false if you don't have the skill.
have_effect($effect[Shape of...Mole!]) returns how many turns of Moleform you have remaining (0 if it is not currently active).
have_familiar( $familiar[Jack-in-the-Box] ) will return false if you don't have a Jack.

Of course, these can also take other skills/effects/familiars. And never forget -- ashref is your friend!
 
Last edited:

Bazaaretw

Member
So I'm still getting this error when it attempts to get the moleform buff, once it has the correct number of tunnels, it goes into an infinite loop when it comes to the next monster,

I have a feeling that if no one else is getting this error it may be because of my 2 other CCS scripts.

Also if the choice to eat food is True it should buff with Milk of Mag, instead of having mafia prompt me that I'm about to eat without it.

Code:
> call scripts\Hobo_Buffs_v0.9.ash

Sending kmail to Kli1195...
Searching for "llama lama gong"...
Purchasing llama lama gong (1 @ 3,000)...
You acquire an item: llama lama gong
Purchases complete.
Gong path: mole
Using 1 llama lama gong...
You acquire an effect: Shape of...Mole! (duration: 12 Adventures)
Finished using 1 llama lama gong.

[10858] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw casts TUNNEL UPWARDS!
You lose 10 hit points
Round 2: bazaaretw attacks!
You gain 122 Meat
You gain 14 Beefiness
You gain 25 Mysteriousness
You gain 11 Roguishness

[10859] Mt. Molehill
Encounter: digital underground dweller
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw casts TUNNEL UPWARDS!
Round 2: bazaaretw attacks!
You gain 112 Meat
You gain 12 Fortitude
You gain 28 Mysteriousness
You gain 13 Chutzpah

[10860] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw casts TUNNEL UPWARDS!
You lose 10 hit points
Round 2: bazaaretw attacks!
You gain 98 Meat
You gain 6 Fortitude
You gain 27 Enchantedness
You gain 19 Chutzpah

[10861] Mt. Molehill
Encounter: A Fairly Large Fairy
You gain 896 hit points

[10862] Mt. Molehill
Encounter: dwarvish gnome
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw casts TUNNEL UPWARDS!
Round 2: bazaaretw attacks!
You gain 14 Strongness
You gain 26 Enchantedness
You gain 13 Cheek

[10863] Mt. Molehill
Encounter: spelunking astronaut
Round 0: bazaaretw wins initiative!
Checking for updates (running First Things First ver. 3.6)...
_version_FTF => 3.6
You have a current version of First Things First.
Checking for updates (running SmartStasis ver. 2.3)...
_version_SS => 2.3
You have a current version of SmartStasis.
Round 1: bazaaretw attacks!
You gain 111 Meat
You gain 14 Fortitude
You gain 26 Wizardliness
You gain 10 Chutzpah

[10864] Mt. Molehill
Encounter: velvet underground dweller
Round 0: bazaaretw wins initiative!
Round 1: bazaaretw attacks!
You gain 127 Meat
You gain 7 Strengthliness
You gain 28 Magicalness
You gain 15 Sarcasm

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

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw wins initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!

[10866] Mt. Molehill
Encounter: weather underground dweller
Round 0: bazaaretw loses initiative!
KoLmafia declares world peace.
KoLmafia declares world peace.
KoLmafia declares world peace.
 
Last edited:

icon315

Member
Maybe you should add the Update checker...almost used V0.7

EDIT: Also you should fix it so that the script does not stop when this choice adv. happens

Code:
[24357] Seaside Megalopolis
Encounter: Bad Reception Down Here
Manual control requested for choice #353

EDIT: Also you should either make the Adv. using effects a True/False option, or make it so that the script check for the active effects
 
Last edited:

Kli1195

New member
How to add an Update checker?
Also, I tried to make it so it would overide the manual request the first time it goes to seaside:
Code:
set_property("choiceAdventure352","2");
set_property("choiceAdventure356","1");
And the second time:
Code:
set_property("choiceAdventure358","2");
but for some reason, it still doesn't work. I'm not sure if this is just a problem with mafia or something.

Also, yeah, good point, I'll make it so that it gives you the option of whether or not you want the script to use any adventures.
 

heeheehee

Developer
Staff member
The easiest way is to just use ZLib's check_version(). Also, are you doing the set_property() calls at the beginning of the script, or where...?
 

Kli1195

New member
Sorry haven't been on in a while.
@heeheehee
This is my code:
Code:
void seaside(){
	if (my_adventures() == 0){
		print("Out of adventures.");
		exit;
	}else{
		set_property("choiceAdventure352","2");
		set_property("choiceAdventure356","1");
		while((item_amount($item[blue milk club card]) < 1)){
			if (adventure(1, $location[Seaside Megalopolis])){
				adventure(1, $location[Seaside Megalopolis]);
			}else{
				use(1, $item[agua de vida]);
			}
		}
	}
}
And the second time:
Code:
void seaside2(){
	if (my_adventures() == 0){
		print("Out of adventures.");
		exit;}
	else{
		set_property("choiceAdventure358","2");
		while((item_amount($item[blue milk club card]) > 0)){
			if (adventure(1, $location[Seaside Megalopolis])){
				set_property("choiceAdventure358","2");
				adventure(1, $location[Seaside Megalopolis]);}
			else
				use(1, $item[agua de vida]);
		}
	}
}
It may work now, I haven't tested it yet and I'm out of turns. Is there a better way to set the property?
Also, thanks for the update help

@icon315
Good idea, I'll add that in asap.

@ Bazaaretw
I'll add in the Milk thingy, and I'm not entirely sure about your mole problem, is there anything else you can specify?
I don't use CCS so it may be a possibility that that's the problem.
 

slyz

Developer
Code:
if (adventure(1, $location[Seaside Megalopolis])){
     adventure(1, $location[Seaside Megalopolis]);
}

I have already pointed this out, but do you realize this will spend 2 advs in megalopolis?
 

Kli1195

New member
Does it?
When I tested the script, it just used how many adventures it needed until it got the Club Card. (Talking about the first Seaside)
 

icon315

Member
Almost every time i use the script it always gets stuck here
Code:
[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 wins initiative!
Round 1: icon315 tries to steal an item!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!

[24488] Mt. Molehill
Encounter: dwarvish gnome
Round 0: icon315 loses initiative!
 

Kli1195

New member
Oh I see. The script screws up if you lose initiative.
I'll try to work on this, but there are some cheap things that greatly boost your initiative:
Panty raider camouflage (100% init) goes for 700 meat currently.
upsy daisy (50% init) goes for 200 meat.
 

slyz

Developer
I don't see how initiative could have something to do with Icon's problem. Icon: how many turns of Mole do you have left when this happens ? I think this might be the problem. Also, how is Mafia setup to handle combats? You're not using free runaways, are you? If so, try setting mafia to simply attack.

If that wasn't the issue, try replacing molehill() with this :
Code:
void molehill(){
	if (my_adventures() == 0){
		print("Out of adventures.");
		exit;
	}else{
		while( have_effect($effect[Shape of...Mole!]) > 0 ) {
			visit_url("adventure.php?snarfblat=177") ;
			switch( have_effect($effect[Shape of...Mole!]) ) {
				case 12:
				case 11:
				case 10:
				case 8:
				case 7:
				case 6:
					use_skill($skill[tunnel upwards]) ;
					run_combat() ;
					break ;
				case 4:
				case 3:
				case 2:
					run_combat() ;
					break ;
				default:
			}
		}
	}
}
This should get you the MP non combat instead of the food, but food can be arranged.
 

slyz

Developer
Ah, well that makes sense.
Code:
if((have_effect($effect[Shape of...Mole!]) > 7)){
	visit_url("adventure.php?snarfblat=177");
	use_skill($skill[tunnel upwards]);
	run_combat();}
else if((have_effect($effect[Shape of...Mole!]) < 8 )){
	visit_url("adventure.php?snarfblat=177");
	run_combat();}
else if((have_effect($effect[Bureaucratized]) > 0)){
	exit;}
else{
	exit;
}
Since you have < 8 turns of Shape of...Mole! left when you hit the Bureaucratized noncombat, the script never gets to exit. I don't know why this parts works for Kli though... maybe he has a different local copy?
 

Kli1195

New member
Nah, I have the same version. Should I just switch it so it looks like this:
Code:
else if((have_effect($effect[Bureaucratized]) > 0)){
	exit;}
else if((have_effect($effect[Shape of...Mole!]) < 8 )){
	visit_url("adventure.php?snarfblat=177");

EDIT: I also know that this script works for 2 other people.
 
Last edited:
Looks useful.

After looking through the code I did notice some things however.

1. The arena buff is not being detected correctly. Unless I'm missing something lines 349 & 350 will always be false. I think the valid settings for the sideDefeated property are neither, both, hippies, fratboys. The valid settings for the side quest completed properties are fratboy and hippy. For your purposes (i.e getting Dilated Pupils) I think you'll want something like this:

Code:
if(get_property("sideDefeated") == "fratboys" && get_property("sidequestArenaCompleted") == "hippy")
2. Around lines 300 & 307 the mapPref keys for Thingfinder and Chorale are switched.

3. This has the potential to fall into an infinite loop:

Code:
while((item_amount($item[The Legendary Beat]) > 0) && (have_effect($effect[Clyde's Blessing])) == 0 ) {
        use( 1 , $item[The Legendary Beat] );}
This would be better:

Code:
if(!get_property("_legendaryBeat").to_boolean() && retrieve_item(1, $item[Legendary Beat])) 
        use(1, $item[Legendary Beat]);
4. The feast is not getting used all the time. This line:

Code:
if (item_amount($item[Moveable feast]) > 0){
should be:

Code:
if(retrieve_item(1, $item[Moveable feast])){
item_amount will not be greater than zero if you have the feast but it's equipped on your familiar or on a familiar in your terrarium, but retrieve_item will unequip it from whichever familiar might be wearing it.

5. bubblewrap turtleban, several things. There should probably be an option to buy it or at least use retrieve_item which will buy it in accordance with your mafia settings. Also

Code:
use( 1 , $item[Bubblewrap bottlecap turtleban] );
should be:

equip($item[Bubblewrap bottlecap turtleban] );

The use function will equip the item momentarily and then re-equip what you had on before. In my experience the only time use keeps the item equipped is if you were wearing nothing in the slot it gets equipped in. Best to utilize the equip function when working with equipment.

Also, as far as I know, it requires 2 visit_url() calls to get the hatter buff. So this:

Code:
visit_url("choice.php?whichchoice=441&option=1");
should be this:

Code:
    visit_url("rabbithole.php?action=teaparty");
    visit_url("choice.php?pwd&whichchoice=441&option=1");
6. I think you should consider using retrieve_item() instead of buy() and/or item_amount(). Obviously depending on the circumstance, but in many of the instances in your script, I think retrieve_item() is more appropriate.

The retrieve_item() function has numerous benefits. It will pull from storage if you have the item there. It will create the item if you have the ingredients and can. It will buy the item if mafia is set-up to do so. For example, this line:

Code:
 buy( 10 , $item[BRICKO ooze] );
If it was:

Code:
retrieve_item( 10 , $item[BRICKO ooze] );
and you had the bricks to make this item in inventory it would create the ooze.

7. Also, just curious, why three scripts? Why not move the item map and the other functions into the main script?

Those are just some thoughts and observations. Nice work.
 

Fluxxdog

Active member
Looks useful.

After looking through the code I did notice some things however.

1. The arena buff is not being detected correctly. Unless I'm missing something lines 349 & 350 will always be false. I think the valid settings for the sideDefeated property are neither, both, hippies, fratboys. The valid settings for the side quest completed properties are fratboy and hippy. For your purposes (i.e getting Dilated Pupils) I think you'll want something like this:

Code:
if(get_property("sideDefeated") == "fratboys" && get_property("sidequestArenaCompleted") == "hippy")
Actually, that should be
Code:
if((get_property("sideDefeated") == "fratboys" || get_property("sideDefeated")=="none") && get_property("sidequestArenaCompleted") == "hippy")
...because some people might not end the war and end up farming some rewards.
 

Fluxxdog

Active member
That would have to be
Code:
get_property("sideDefeated") != "hippies" || get_property("sideDefeated") != "both"
sideDefeated has 4 potential values:none, fratboys, hippies, and both. To make sure one side is or is not defeated, you need to check against 2 different values.
PHP:
boolean hippies_alive(){
	if(get_property("sideDefeated")=="none" || get_property("sideDefeated")=="fratboys") return true;
	return false;}

boolean fratboys_alive(){
	if(get_property("sideDefeated")=="none" || get_property("sideDefeated")=="hippies") return true;
	return false;}
That should make things a bit easier to read.
 
Top