Custom combat

Doc

New member
Is there anyway to get the custom combat to use an item/multiple items if they are there, but revert to a regular attack if they are not? I would like to get my divine favours consumed without having to manually adventure.
 

zarqon

Well-known member
Best way would be a consult script. Save this as throwdivine.ash

Code:
void main(int round, monster foe, string url) {
   while (round < 27 && item_amount($item[divine favor]) > 0) {
      url = throw_item($item[divine favor]);
      round = round + 1;
   }
}

Then in your CCS, do something like this:

Code:
[ default ]
1: consult FirstThingsFirst.ash
2: consult throwdivine.ash
3: attack

Of course, you can leave out the first line if you don't use FTF.
 

Bale

Minion
That script won't work. You know that, right? You should have made it clear that he needs to substitute the correct divine favor for the place where you said $item[divine favor]

Code:
[COLOR="Olive"]> ash print($item[divine favor])[/COLOR]

Libram of Divine Favors
Heh. I don't think you want to throw that.
 

Bale

Minion
My mind couldn't quite let go of this script. How does this look to you:

Code:
item [int] select_favors() {
	item [int] answer;
	item [3] divine_favors;
	switch(my_primestat()) {
	case $stat[muscle]:
		divine_favors[0] = $item[divine noisemaker];
		divine_favors[1] = $item[can of silly string];
		divine_favors[2] = $item[divine blowout];
		break;
	case $stat[mysticality]:
		divine_favors[0] = $item[can of silly string];
		divine_favors[1] = $item[divine noisemaker];
		divine_favors[2] = $item[divine blowout];
		break;
	case $stat[moxie]:
		divine_favors[0] = $item[divine blowout];
		divine_favors[1] = $item[can of silly string];
		divine_favors[2] = $item[divine noisemaker];
	}
	foreach key, value in divine_favors
		switch(count(answer)) {
		case 0:
			if(item_amount(value) > 1) {
				answer[1] = value;
				answer[2] = value;
			} else if(item_amount(value) == 1)
				answer[1] = value;
			break;
		case 1:
			if(item_amount(value) > 0)
				answer[2] = value;
		default:
			if(count(answer) >= to_int(have_skill($skill[ambidextrous funkslinging])) + 1)
				return answer;
		}
	return answer;
}

void main(int round, monster foe, string url) {
	boolean still_got_it = true;
	item [int] favor;
	while(round < 27 && still_got_it) {
		favor = select_favors();
		if(favor[1] != $item[none]) {
			if(have_skill($skill[ambidextrous funkslinging]))
				url= throw_items(favor[1], favor[2]);
			else
				url = throw_item(favor[1]);
			round = round + 1;
		} else still_got_it = false;
	}
}
 
Last edited:

zarqon

Well-known member
Do the second two options need to be prioritized? It's only mainstat that needs to be selected above the others right? Seems like a simpler implementation is possible, something like

Code:
item select_favor(item firstfunk) {  // firstfunk = first item chosen for mainhand
   item preferred() {
      switch (my_primestat()) {
         case $stat[muscle]: return $item[divine noisemaker];
         case $stat[mysticality]: return $item[can of silly string];
         case $stat[moxie]: return $item[divine blowout];
      } return $stat[none];
   }
   if (item_amount(preferred()) > to_int(firstfunk == preferred())) return preferred();
   for i from 3118 to 3120
      if (item_amount(to_item(i)) > to_int(firstfunk == to_item(i))) return to_item(i);
   return $item[none];
}

void main(int round, monster foe, string url) {
   while (round < 27 && select_favor(item[none]) != item[none]) {
      item mainhand = select_favor($item[none]);
      if (have_skill($skill[funkslinging]) && select_favor(mainhand) != item[none])
         throw_items(mainhand,select_favor(mainhand));
       else throw_item(mainhand);
      round = round + 1;
   }
}
 
Last edited:

Bale

Minion
I's dotted; T's crossed:

Code:
item select_favor(item firstfunk) {  // firstfunk = first item chosen for mainhand
	item[stat] pref;
		pref[$stat[muscle]] = $item[divine noisemaker];
		pref[$stat[mysticality]] = $item[can of silly string];
		pref[$stat[moxie]] = $item[divine blowout];
	if(item_amount(pref[my_primestat()]) > to_int(firstfunk == pref[my_primestat()]))
		return pref[my_primestat()];
	for i from 3118 to 3120     // item numbers of favors
		if (item_amount(to_item(i)) > to_int(firstfunk == to_item(i))) return to_item(i);
	return $item[none];
}

void main(int round, monster foe, string url) {
	while(round < 27 && select_favor($item[none]) != $item[none]) {
		item mainhand = select_favor($item[none]);
		if(have_skill($skill[ambidextrous funkslinging]) && select_favor(mainhand) != $item[none])
			throw_items(mainhand,select_favor(mainhand));
		else throw_item(mainhand);
		round = round + 1;
	}
}
And that's why I'm the lackey. You deserve every batbit I send you.
 

zarqon

Well-known member
Ha, came back and fixed it before I saw your post. First time I've been ninja'd by someone who posted after I did, ha.
 

Doc

New member
Thanks for the help guys, but I dont have funkslinging quite yet I'm afraid. Which of the scripts should I be using in this case?
 

zarqon

Well-known member
Either of the last two will work, throwing every single divine favor you have, both now without funkslinging and later when you get it.
 

Bale

Minion
Thanks for the help guys, but I dont have funkslinging quite yet I'm afraid. Which of the scripts should I be using in this case?

The script is too full of awesome to care if you have funkslinging. It checks that for you. It will start off using all your mainstat favor and them using all the other favors you have. When zarqon and I play off each other like that you can count on the outcome being perfect.

Well, to continue it occurs to me that I can make it a little more perfect by choosing the divine favor to match highest buffed stat, rather than primestat. Here's the next version:

Code:
item select_favor(item firstfunk) {  // firstfunk = first item chosen for mainhand
	item preferred() {
		if(my_buffedstat($stat[muscle]) > my_buffedstat($stat[mysticality]) && my_buffedstat($stat[muscle]) > my_buffedstat($stat[moxie]))
			 return $item[divine noisemaker];
		if(my_buffedstat($stat[mysticality]) > my_buffedstat($stat[moxie]))
			 return $item[divine can of silly string];
		return $item[divine blowout];
	}
	if (item_amount(preferred()) > to_int(firstfunk == preferred())) return preferred();
	for i from 3118 to 3120
		if (item_amount(to_item(i)) > to_int(firstfunk == to_item(i))) return to_item(i);
	return $item[none];
}

void main(int round, monster foe, string url) {
	while (round < 27 && select_favor($item[none]) != $item[none]) {
		item mainhand = select_favor($item[none]);
		if (have_skill($skill[funkslinging]) && select_favor(mainhand) != $item[none])
			throw_items(mainhand,select_favor(mainhand));
		else throw_item(mainhand);
		round = round + 1;
	}
}

I'll make this version an attachment for the convenience of anyone who wants to use it.
 

Attachments

  • throwdivine.ash
    1,008 bytes · Views: 71
Top