Let me start by saying I have read the manual (twice) and I've looked at various finished scripts. I'm completely new to this particular type of programming so I've been trying to reverse engineer existing scripts without a full grasp of the basics.
As a result: Problems.
What this part (pasted below) is meant to do:
Decide which shot is best for your class
Decide which DB drink is best for your class
Replace bartender if it is missing
Create drinks
Drink drinks
Summon cocktail garnishes (x3)
Summon additional 2 if you have the skill
When I try to run it I am told that there are "Illegal amount of parameters for function drink at line 49".
If I add } } after the line "drink ( 19, booze2 );" I am then told that booze2 is an unknown variable. But I thought that would have been taken care of by "item booze2;" near the start.
Also: Is there perhaps a tutorial on how to use booleans, etc which would be suitable for their uses in ASH?
Any help would be greatly appreciated.
As a result: Problems.
What this part (pasted below) is meant to do:
Decide which shot is best for your class
Decide which DB drink is best for your class
Replace bartender if it is missing
Create drinks
Drink drinks
Summon cocktail garnishes (x3)
Summon additional 2 if you have the skill
When I try to run it I am told that there are "Illegal amount of parameters for function drink at line 49".
If I add } } after the line "drink ( 19, booze2 );" I am then told that booze2 is an unknown variable. But I thought that would have been taken care of by "item booze2;" near the start.
Also: Is there perhaps a tutorial on how to use booleans, etc which would be suitable for their uses in ASH?
Any help would be greatly appreciated.
Code:
void drink()
{
item booze2;
item booze3;
stat MainStat;
if( my_class() == $class[turtle tamer] || my_class() == $class[seal clubber]) { MainStat = $stat[muscle]; }
if( my_class() == $class[pastamancer] || my_class() == $class[sauceror]) { MainStat = $stat[mysticality]; }
if( my_class() == $class[Disco Bandit] || my_class() == $class[accordion thief]) { MainStat = $stat[moxie]; }
if (MainStat == $stat[moxie] )
{
booze2=$item[fine wine];
}
if (MainStat == $stat[muscle] )
{
booze2=$item[shot of orange schnapps];
}
if (MainStat == $stat[mysticality] )
{
booze2=$item[shot of grapefruit schnapps];
}
if (MainStat == $stat[moxie] )
{
booze3=$item[perpendicular hula];
}
if (MainStat == $stat[muscle] )
{
booze3=$item[slip 'n' slide];
}
if (MainStat == $stat[mysticality] )
{
booze3=$item[horizontal tango];
}
//boolean have_bartender;
//have_bartender = false;
if( have_bartender() == true)
{
create ( 19, booze2 );
drink ( 19, booze2 );
}
else
{
buy (1, $item[bartender-in-the-box]);
use(1, $item[bartender-in-the-box]);
create( 19, booze2 );
drink ( 19, booze2 );
}
{
if(have_skill($skill[Advanced Cocktailcrafting]))
{
cli_execute("outfit MP");
cast_buff($skill[Advanced Cocktailcrafting], 3);
}
{
if(have_skill($skill[Superhuman Cocktailcrafting]))
{
cli_execute("outfit MP");
cast_buff($skill[Advanced Cocktailcrafting], 2);
}
if(have_skill($skill[Advanced Cocktailcrafting]))
{
cli_execute("outfit MP");
create( 1, booze3 );
}
}