Advertisement
yojimbos_law

some desc_item.php hammering CLI commands

May 16th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. 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.
  2.  
  3.  
  4. all equipment:
  5.  
  6. 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+")");}}
  7.  
  8. all potions and a few nonsense items that aren't worth excluding:
  9.  
  10. 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")+")"); }}
  11.  
  12. all non-potion consumables:
  13. ash string effid; string boop; string quality; string size; foreach i in $items[]{
  14. 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")+")"); } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement