Results 1 to 6 of 6

Thread: Items

  1. #1
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    465

    Default Items

    Code:
    	foreach it in $items[]
    	{
            int nt = to_int(numeric_modifier(it,"Adventures"));
            if ( nt > 0 && can_equip(it) && is_unrestricted(it) )
    		{
                if (available_amount(it)>0)
    My standard rollover bonus uses that code. The script looks at ALL items, and spits out ALL items you can equip, or pull and equip for bonus turns.

    Is there a way I can break it down into slots? IE: spit out hats only first, then weapons / offhand next, etc.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,342

    Default

    I don't see an easy way.

    The lazy way would be to check item_type() for each of the ~100 item types that are of interest. That would take more time than optimal since you would be traversing the entire item list once for each type you were interested in.

    A slightly more efficient way could be to record the item name and type in a map (rather than printing) during one pass, sort the map and iterate over the map printing things in the order you want.

    Potentially complicated if one item can have more than one type and by the fact that item types can have spaces in them.

  3. #3
    Developer
    Join Date
    Aug 2009
    Posts
    2,919

    Default

    to_slot(item) is probably useful here. Something like...

    Code:
    boolean [slot, item] map;
    foreach it in $items[] {
      slot s = it.to_slot();
      if (s != $slot[none] && to_int(numeric_modifier(it,"Adventures") > 0 && ...) {
        map[s, it] = true;
      }
    }
    foreach s, it, _ in map {
      print(it);
    }
    (you could also hardcode the order in which you want to iterate over the slots, I guess... e.g. by using $slots[hat, pants, shirt, hat, weapon, off-hand, acc1, hat] or whatever)

  4. #4
    Developer
    Join Date
    Apr 2010
    Posts
    5,107

    Default

    I just use maximize("adv, 0.1 pvp fights +switch trick-or-treating tot", false); but then I am not considering pulls. I have it in my logout script, so I wouldn't want it using pulls, just in case I was planning to log in again later to carry on playing.

  5. #5
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    465

    Default

    I just use maximize("adv, 0.1 pvp fights +switch trick-or-treating tot", false); but then I am not considering pulls. I have it in my logout script, so I wouldn't want it using pulls, just in case I was planning to log in again later to carry on playing.
    Originally Posted by Darzil View Post
    I have that in mine too. I only use the script in question when I'm in ronin, and have extra pulls. I haven't personally used it in some time, and happened to use it yesterday. I wasn't happy with the results, as it was rather confusing.
    Code:
    Checking Gear
    You have 2 dead guy's watch (Good for 1 turns) in storage, with 20 pulls remaining
    You have 1 stainless steel solitaire (Good for 2 turns) in storage, with 20 pulls remaining
    You can equip your plexiglass pocketwatch for 3 extra turns
    You have 1 gold wedding ring (Good for 1 turns) in storage, with 20 pulls remaining
    You can equip your aerogel ascot for 3 extra turns
    You can equip your tiny plastic golden gundam for 1 extra turns
    You can equip your novelty monorail ticket for 3 extra turns
    You have 4 genie's turbane (Good for 2 turns) in storage, with 20 pulls remaining
    You can equip your psychic's circlet for 3 extra turns
    You have 1 scepter of the Skeleton Lord (Good for 3 turns) in storage, with 20 pulls remaining
    You have 7 shoe ad T-shirt (Good for 3 turns) in storage, with 20 pulls remaining
    You have 1 chalk chlamys (Good for 2 turns) in storage, with 20 pulls remaining
    Here's the output I get. Mind you, I just logged in, and haven't run any turns, that's why there's 20 pulls remaining. I will work on this today. Thanks everyone for the feedback. I'll post my results later.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  6. #6
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    465

    Default

    Here's what I came up with, and it seems to work as I would expect.
    Code:
    boolean [slot, item] map;
    foreach it in $items[] 
    	{
    	  slot s = it.to_slot();
    	  int nt = to_int(numeric_modifier(it,"Adventures"));
    	  if (nt > 0 && can_equip(it) && is_unrestricted(it) )
    		{
    		if (s == $slot[hat])
    			{
    			map[s, it] = true;
    
    		if (available_amount(it)>0)
     			{
    	                print_html("<b>You can equip your </b><font color=7900a7>"+it+"</font> for "+nt+" extra turns");
    		        }
    		else if (pulls_remaining()>0 && storage_amount(it)>0) 
    			{
            	        print_html("You have "+storage_amount(it)+" <font color=7900a7><b>"+it+"</b></font> (Good for "+nt+" turns) <b><font color=008000>in storage</b></font>, with "+pulls_remaining()+" pulls remaining");
    		        }
         		}
    
    			}
    		}
    which spits out this (for me):
    Code:
    You have 4 genie's turbane (Good for 2 turns) in storage, with 2 pulls remaining
    You can equip your psychic's circlet for 3 extra turns
    Now I will go about making the script look a little easier to read.
    Last edited by Pazleysox; 03-13-2019 at 02:50 PM. Reason: figured it out
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

Posting Permissions

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