yojimbos_law icon

some desc_item.php hammering CLI commands

yojimbos_law | PRO | 05/16/19 04:14:37 PM UTC | 0 ⭐ | 495 👁️ | Never ⏰ | []
text |

1.48 KB

|

None

|

0 👍

/

0 👎

These CLI commands are exclusively intended for spading. They will each hit desc_item.php thousands of times, so don't be running them regularly.
  all equipment:
 ash string butt; foreach i in $items[]{if(i.to_slot() != $slot[none] ){ butt = visit_url("desc_item.php?whichitem="+i.descid).group_string("<center><b><font[^<>]*color\\=\"blue\">(.+)<\\/font>")[0][1]; butt = replace_all(create_matcher("(<[^<>]*>|Last Available.*$|NOTE:.*)",butt), "     "); print(i+"   ("+butt+")");}}
 all potions and a few nonsense items that aren't worth excluding:
 ash string effid; foreach i in $items[]{ if(i.usable && i.string_modifier("effect") != "" && i.spleen == 0){ effid = visit_url("desc_item.php?whichitem="+i.descid).group_string("whicheffect\\=(\\w+)\"")[0][1]; print(i+" gives "+effid.desc_to_effect()+" ("+effid.desc_to_effect().string_modifier("modifiers")+")"); }}
 all non-potion consumables:
ash string effid; string boop; string quality; string size; foreach i in $items[]{ 
	if( i.fullness > 0 || i.spleen > 0 || i.inebriety > 0){ boop = visit_url("desc_item.php?whichitem="+i.descid);	quality = boop.group_string("Type: <b>(?:booze|spleen item|food|beverage) (?:<font[^<>]*color\\=[^>]*>)?\\(([^\\)]*)\\)")[0][1]; size = boop.group_string("(Potency|Size|Toxicity): <b>(\\d+)")[0][2]; effid = boop.group_string("whicheffect\\=(\\w+)\"")[0][1]; print(i+" is "+quality+" with size "+size+" and effect "+effid.desc_to_effect()+" ("+effid.desc_to_effect().string_modifier("modifiers")+")"); } }

Comments