How to incorporate Daylight Shavings Helmet into a script?

Hison

New member
Hi, I am very new to this whole thing but I am slightly familiar with programming script.

What would be the easiet method to automate putting on the Daylight Shaving Helmet every 11th adventure to upkeep the various buffs?

Thanks all.
 

Rax

New member
There are more elegant ways, but something like this will work if you want to switch hats if you already have an active Shavings effect.

Code:
while (my_adventures() > 0)    {
    if (have_effect($effect[barbell moustache]) == 0 && have_effect($effect[cowboy stache]) == 0) {
        equip($slot[hat],$item[daylight shavings helmet]);
        adv1($location[WHEREVER], -1, "");                                                        }
    else {
        equip($slot[hat],$item[SOMETHING ELSE]);
        adv1($location[WHEREVER], -1, "");
           }
                               }

Note that you need to add the remaining 9 effects into the if condition (using &&).
 

Hison

New member
Thank you a million times for your advice, this is sparking an old joy of mine.

So my current script is bust, I am trying to find a way to:
1. Spend one adventure in the previous/current place. OR Just stay idle for a single adventure allowing for user to choose whatever adventure they want next.
2. Re-equip the previously equipped hat after the script is done.

Here is what I got.
Code:
//I want to have daylight shavings effects at all times and dont want to micromanage
// The goal is to have one adventure spent in the previous/current location. Then to re-equip the previous equipment.
print("Shave time.");



while (my_adventures() > 0)    {
    if (have_effect($effect[barbell moustache]) == 0 && have_effect($effect[cowboy stache]) == 0 && have_effect($effect[friendly chops]) == 0 && have_effect($effect[grizzly beard]) == 0 && have_effect($effect[gull-wing moustache]) == 0 && have_effect($effect[musician's musician's moustache]) == 0 && have_effect($effect[pointy wizard beard]) == 0 && have_effect($effect[space warlord's beard]) == 0 && have_effect($effect[spectacle moustache]) == 0 && have_effect($effect[surrealist's moustache]) == 0 && have_effect($effect[toiletbrush moustache]) == 0) {
        equip($slot[hat],$item[daylight shavings helmet]);
        adv1($location[lastAdventure], -1, "");                                                        }
    else {
        equip($slot[hat],$item[previous]);
        adv1($location[lastAdventure], -1, "");
           }
                               }


print("The barber shoves a mirror in your face, 'Lookin' mighty fine!'");


Any advice?
 

Pazleysox

Member
So my current script is bust, I am trying to find a way to:
1. Spend one adventure in the previous/current place. OR Just stay idle for a single adventure allowing for user to choose whatever adventure they want next.
2. Re-equip the previously equipped hat after the script is done.

Is your script equipping specific hat each time, or is the script using the modifier maximizer to find a hat?

If you're using a specific hat all the time, just do

equip($slot[hat],$item[SPECIFIC HAT]);

If you're using the maximizer to choose your outfit, then just run that again.
 

Pazleysox

Member
Not sure why I didn't think of this before, but there is a simple solution.

just add the code in red.

cli_execute("outfit save current");

while (my_adventures() > 0) {
if (have_effect($effect[barbell moustache]) == 0 && have_effect($effect[cowboy stache]) == 0 && have_effect($effect[friendly chops]) == 0 && have_effect($effect[grizzly beard]) == 0 && have_effect($effect[gull-wing moustache]) == 0 && have_effect($effect[musician's musician's moustache]) == 0 && have_effect($effect[pointy wizard beard]) == 0 && have_effect($effect[space warlord's beard]) == 0 && have_effect($effect[spectacle moustache]) == 0 && have_effect($effect[surrealist's moustache]) == 0 && have_effect($effect[toiletbrush moustache]) == 0) {
equip($slot[hat],$item[daylight shavings helmet]);
adv1($location[lastAdventure], -1, ""); }
else {
cli_execute("outfit current");
adv1($location[lastAdventure], -1, "");
}
}
 
Two quick tips:
1. You can get an effect if you have 1 turn of any of the effects, not just if you have 0. So I would check to see if the sum of durations is >=1, and equip when that's the case
2. the lastBeardBuff property may be helpful to you
 
Top