More efficent way of doing this /Betterway of doing this /Getting hat buff

mottsy

Member
I have two issues in my script.

1. I think there my be a more efficent way to do this

I use a stocking mimic, so i get lots of mp, that i vent to clannies/self

The efficeny problem:

adventure 3 castle
outfit cast
cast 40 jingle bells
outfit meat

I am using this, copy pasted 100 times. Not knowing enough of ash to know how to do a function like this:
if mp greater than 10% then outfit cast, cast Jingle bells untill mp is at 10% or a little less

If that can be solved, then the second problem is not copy pasting this 100 times, possibly through some loop function.

Finally: getting the hat buff "Dances with Tweedles"
I cannot for the life of me figure out how to get this


I attatched the farming section and bounty section of the scripts


-------------------------------------------------------------------------

OO the wiki has been upgraded (i havent seen it since last year)
 

Attachments

  • Farm.txt
    11 KB · Views: 29
  • Bounty.txt
    359 bytes · Views: 27
Last edited:

Grotfang

Developer
This is untested, but I think behaves as you want. Instead of casting whenever you go above 10% MP, it casts when above 80%. Simply change the 0.8 to 0.x where x = x0%.

Code:
void cast_buff()
{
   outfit( "cast" );
   use_skill( ( ( my_mp() - ( my_maxmp() / 10 ) ) / mp_cost( $skill[Jingle Bells] ) ) , $skill[Jingle Bells] );
   outfit( "meat" );
}

void main()
{
   while( my_adventures() > 0 )
   {
      adventure( 1 , $location[giants castle] );
      if( my_mp() > (my_maxmp() * 0.8 ) )
         cast_buff();
   }
}
 

slyz

Developer
Finally: getting the hat buff "Dances with Tweedles"
I cannot for the life of me figure out how to get this

I guess you could equip the hat you want and use the DRINK ME potion in your script, then use visit_url() to get the buff. I don't know of any CLI command that get the Tea Party buff for you.

To find out the exact url to use, visit the mad hatter through the Mafia minibrowser, it will show the URL(s) that were visited. URL might be plural (thus needing two visit_url() in your script, because it's a choice adventure).

I'm not doing it for you because (a) it's a good exercise (that you can post in the visit_url() wiki page once it works :D) and (b) I'm in BM right now.
 

mottsy

Member
I guess you could equip the hat you want and use the DRINK ME potion in your script, then use visit_url() to get the buff. I don't know of any CLI command that get the Tea Party buff for you.

To find out the exact url to use, visit the mad hatter through the Mafia minibrowser, it will show the URL(s) that were visited. URL might be plural (thus needing two visit_url() in your script, because it's a choice adventure).


Hey, finally figuring out where to get that url is good enough for me, that was the part i was lacking, and never knew how to get it
I'm not doing it for you because (a) it's a good exercise (that you can post in the visit_url() wiki page once it works :D) and (b) I'm in BM right now.

Hey, the visit url was the part i was lacking

Now, to commit diabolical scripting with that knowlege
 

mottsy

Member
cli_execute("equip filthy knitted dread sack");
cli_execute("use "DRINK ME" potion");
visit_url("rabbithole.php?action=teaparty ");
visit_url("choice.php?pwd&whichchoice=441&option=1&choiceform1=Try+to+get+a+seat ");
print("Thanks Slyz", "black")



Win
 
Last edited:
You can always do stuff like this the easy way with loops:
All you need is:
a) some way to control how many loops to do. A user input is one easy way to do so thru the main(argument) method.
b) A loop counter that starts at 0.
c) A while loop.
d) be sure to increment the loop counter.


main (int numberOfLoops)
{
int loopCounter = 0;

while (loopCounter < numberOfLoops)
{
loopCounter = loopCounter + 1;
cli_execute("whatever cli command here");
cli_execute("more commands.");
}
}
 

mottsy

Member
After writing the script, i encountered a problem with my CLI selling part


mallsell * prismatic wad
mallsell * twinkly wad 800
mallsell * little paper umbrella
mallsell * magical ice cubes
mallsell * disassembled clover
mallsell 2 cocktail onion


autosell * thin black candle
autosell * heavy D
autosell * original G
autosell * procrastination potion
send * wolf mask to smashbot
send * Giant needle to smashbot
use * warm subject gift certificate
autosell * plot hole
autosell * probability potion
autosell * Awful poetry journal
wait 20
send * twinkly nuggets to smashbot
Undercut
call Nextstep.ash

exit

The error is

Unexpected error, debug log printed.
Unexpected error, debug log printed.
[*] has no matches.
 

mottsy

Member
I figured it out.

It is meant to be mallsell (item) (number)
E.g mallsell your-soul *

If anyone finds out how to mall-sell an item at a particular price, i would be incredibly grateful
 
Last edited:

slyz

Developer
Code:
> help mallsell

mallsell item [[@] price [[limit] num]] [, another]... - sell in Mall.
It's mallsell <amount> <item> @ <price> though. Maybe the problem was mallsell * twinkly wad 800, which was missing the @.
 
Top