Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 48

Thread: ForkČ~ UberPvPOptimizer - an updated PVPBestGear

  1. #21
    Senior Member
    Join Date
    Dec 2013
    Posts
    389

    Default

    Chefstaff fix was surprisingly simple. The real trick was realizing that you'll only equip an offhand if
    • You can't dual wield, or
    • Equipping an off-hand is the worse option

    Oops. That's been fixed.

  2. #22
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Great work. Just one more thing because I'm hoping to drive you completely insane. The familiar slot matters for things like letter of the moment. This script doesn't handle that. Fortunately I think it can be fixed by adding it in only three lines like this...

    Code:
    Index: UberPvPOptimizer.ash
    ===================================================================
    --- UberPvPOptimizer.ash	(revision 55)
    +++ UberPvPOptimizer.ash	(working copy)
    @@ -759,7 +759,7 @@
     	print_html("</ul>");
     	
     /*** unequip all slots ***/
    -	foreach i in $slots[hat, back, shirt, weapon, off-hand, pants, acc1, acc2, acc3] 
    +	foreach i in $slots[hat, back, shirt, weapon, off-hand, pants, acc1, acc2, acc3, familiar] 
     		equip(i,$item[none]);
     	print_html("<br/>");	
     /*******
    @@ -792,7 +792,7 @@
     	}
     
     /*** Top Gear display lists ***/
    -	foreach i in $slots[hat, back, shirt, weapon, off-hand, pants, acc1] {
    +	foreach i in $slots[hat, back, shirt, weapon, off-hand, pants, acc1, familiar] {
     		int itemCount = count(gear[to_string(i)]); 
     		print_html("<b>Slot <i>" + i + "</i> items considered: " + itemCount + " printing top items in slot:</b>");
     
    @@ -894,6 +894,7 @@
     	bestGear("acc1", $slot[acc1]);
     	bestGear("acc1", $slot[acc2]);
     	bestGear("acc1", $slot[acc3]);
    +	bestGear("familiar", $slot[familiar]);
     	
     /*******
     	Snipped familiars

  3. #23
    Senior Member
    Join Date
    Dec 2013
    Posts
    389

    Default

    Familiars are a little more complicated if you want it to consider equipment for every familiar you own. Your fix, while useful, will only consider items that can be equipped to your current familiar.

  4. #24
    Senior Member
    Join Date
    Dec 2013
    Posts
    389

    Default

    I've added full familiar support. It takes a little while longer to run, as a result. I'm debating putting the list-preparation in a static block to save time if you have to run it multiple times in a day.

  5. #25
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    I started this, so I regret not liking your implementation, but I noticed the "full familiar support" requires equipping every single familiar I own, one after another. Why is that necessary? Couldn't you just check all generic familiar equipment and familiar_equipment(() for each familiar without needing to equip every single familiar?

    Code:
    boolean [item] familiar_gear;
    foreach it in $items[]
    	if(it.item_type() == "familiar equipment" && string_modifier(it, "Modifiers").contains_text("Generic"))
    		familiar_gear[it] = true;
    foreach f in $familiars
    	if(have_familiar(f) && be_good(f))
    		familiar_gear[ familiar_equipment(f) ] = true;
    Your actual process might be a bit different, but adaptating would be an enormous time-saver.
    Last edited by Bale; 09-07-2016 at 05:16 AM.

  6. #26
    Senior Member
    Join Date
    Jun 2016
    Posts
    190

    Default

    Also, currently it seems to go through the full familiar list twice, once before it prints out the top 10 per slot, and then once more after.
    Oh, and my top 10 for familiar equipment for today [d], was simply 10 listings of the toddler sized dragon costume, which wasn't particularly helpful, even if it then (after going through the list for a second time), ended up going with my spelunker's stenbridge sidearm (which I think is correct in that I don't have any 3 or 4 'd' familiar equips available).

  7. #27

    Default

    Or you could use:

    Code:
    		if (char_at(output,i)≈letter) lettersCounted+=1;
    Although I'm probably the only one who thinks that is cool.

    Code:
    > ash ( "a" == "A" )
    
    Returned: false
    
    > ash ( "a" ≈ "A" )
    
    Returned: true
    On my Mac, ≈ is option-x.
    Originally Posted by Veracity View Post

    This is really, really cool.

  8. #28
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Being a little tired of the endless familiar switching in the current version of the script I decided to fix it. The following patch takes care of the problem.

    Code:
    Index: UberPvPOptimizer.ash
    ===================================================================
    --- UberPvPOptimizer.ash	(revision 57)
    +++ UberPvPOptimizer.ash	(working copy)
    @@ -545,7 +545,7 @@
     			break;			
     		}
     		//this simultaneously checks if a piece can be equipped and tries to do so
    -		if ((canEquip(g) && gearup(s, g)) || (s == $slot[familiar] && fams[j].use_familiar() && canEquip(g) && gearup(s, g))) {	
    +		if ((canEquip(g) && gearup(s, g)) || (s == $slot[familiar] && canAcquire(g) && fams[j].use_familiar() && canEquip(g) && gearup(s, g))) {	
     			print_html("<b>Best Available " + s + ":</b> " + gearString(g));
     			print_html(string_modifier(g,"Modifiers"));
     			break;		
    @@ -793,22 +793,23 @@
     		}
     	}
     
    -	familiar CurrentFam = my_familiar();
    -	foreach f in $familiars[] {
    -		string s = $slot[familiar].to_string();
    -		if (f.have_familiar() && f.use_familiar()){
    -			foreach it in $items[] {
    -				int price = npc_price(it);
    -				if (price == 0) 
    -					price = historical_price(it);
    -				if ((it.to_slot().to_string() == s && can_equip(it)) && (showAllItems || canAcquire(it))) {
    -					gear[s][count(gear[s])] = it;
    -					fams[count(fams)] = f;
    -				}
    -			}
    +	familiar [item] famItems;
    +	foreach f in $familiars[]
    +		if(f.have_familiar())
    +			famItems[familiar_equipment(f)] = f;
    +	string s = $slot[familiar].to_string();
    +	foreach it in $items[] {
    +		int price = npc_price(it);
    +		if (price == 0)
    +			price = historical_price(it);
    +		if (famItems contains it || (it.to_slot().to_string() == s && string_modifier(it, "Modifiers").contains_text("Generic"))&& (showAllItems || canAcquire(it))) {
    +			gear[s][count(gear[s])] = it;
    +			if(famItems contains it)
    +				fams[count(fams)] = famItems[it];
    +			else
    +				fams[count(fams)] = my_familiar();
     		}
     	}
    -	CurrentFam.use_familiar();
     
     /*** Top Gear display lists ***/
     	sort fams by -valuation(gear["familiar"][index]);

  9. #29
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    For people who have trouble with patch files and want to edit it themselves, here's an explanation of my previous post. If you understood that, then feel free to ignore this.

    Find the following code at line 796:
    Code:
    	familiar CurrentFam = my_familiar();
    	foreach f in $familiars[] {
    		string s = $slot[familiar].to_string();
    		if (f.have_familiar() && f.use_familiar()){
    			foreach it in $items[] {
    				int price = npc_price(it);
    				if (price == 0) 
    					price = historical_price(it);
    				if ((it.to_slot().to_string() == s && can_equip(it)) && (showAllItems || canAcquire(it))) {
    					gear[s][count(gear[s])] = it;
    					fams[count(fams)] = f;
    				}
    			}
    		}
    	}
    	CurrentFam.use_familiar();
    Replace that with
    Code:
    	familiar [item] famItems;
    	foreach f in $familiars[]
    		if(f.have_familiar())
    			famItems[familiar_equipment(f)] = f;
    	string s = $slot[familiar].to_string();
    	foreach it in $items[] {
    		int price = npc_price(it);
    		if (price == 0)
    			price = historical_price(it);
    		if (famItems contains it || (it.to_slot().to_string() == s && string_modifier(it, "Modifiers").contains_text("Generic"))&& (showAllItems || canAcquire(it))) {
    			gear[s][count(gear[s])] = it;
    			if(famItems contains it)
    				fams[count(fams)] = famItems[it];
    			else
    				fams[count(fams)] = my_familiar();
    		}
    	}
    Now find the following code at line 548:
    Code:
    		if ((canEquip(g) && gearup(s, g)) || (s == $slot[familiar] && fams[j].use_familiar() && canEquip(g) && gearup(s, g))) {
    and replace it with:
    Code:
    		if ((canEquip(g) && gearup(s, g)) || (s == $slot[familiar] && canAcquire(g) && fams[j].use_familiar() && canEquip(g) && gearup(s, g))) {

  10. #30
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,377

    Default

    I did get the patch to work, but I had to convert it to DOS style and patch with --binary.

    /me grumbles about it being the 21st century and how people are still using two characters for line breaks.

Similar Threads

  1. bUMRATS FORK
    By Arakasi in forum Relay Override Scripts
    Replies: 9
    Last Post: 04-19-2013, 06:38 AM
  2. Bug - Fixed Failing to reprice silver shrimp fork
    By adeyke in forum Bug Reports
    Replies: 3
    Last Post: 01-02-2013, 09:08 PM
  3. Replies: 0
    Last Post: 08-07-2012, 12:40 AM
  4. Replies: 0
    Last Post: 07-28-2009, 10:40 AM
  5. Using the Frosty Mug and Fork
    By Des80 in forum Scripting Discussion
    Replies: 4
    Last Post: 03-07-2009, 07:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •