Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

ChestShopLogger

By: Sanwi on Mar 27th, 2014  |  syntax: None  |  size: 1.04 KB  |  views: 173  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $${
  2.  
  3. // Bind this script to the OnChat event
  4. // When you punch a chest shop, it will log the current exchange to a text file
  5. // If the shop has more than one exchange, just cycle it through each
  6. // Example:
  7. //               @ [0000,00,0000] input: 1 Diamond, output: 1 Diamond Sword, stock: 3
  8. // OUT OF STOCK: @ [0000,00,0000] input: 1 Iron Ingot, output: 2 XP Bottle, stock: 0
  9.  
  10.  
  11. ifmatches(%CHATCLEAN%,"(Input: (([0-9][0-9]?[0-9]?) ([a-z][a-z]+).?([a-z]*)))",@&exchangeinput,2);
  12. endif;
  13.  
  14. ifmatches(%CHATCLEAN%,"(Output: (([0-9][0-9]?[0-9]?) ([a-z][a-z]+).?([a-z]*)))",@&exchangeoutput,2);
  15. endif;
  16.  
  17. ifmatches(%CHATCLEAN%,"(([0-9][0-9]?[0-9]?) exchanges available)",@&exchangesleft,2);
  18.         time(&ctime);
  19.         if(%@&exchangesleft% = 0);
  20.                 logto(shoplog.txt,"OUT OF STOCK: @ [%HITX%,%HITY%,%HITZ%] input: %@&exchangeinput%, output: %@&exchangeoutput%, stock: %@&exchangesleft%");
  21.         else;
  22.                 logto(shoplog.txt,"              @ [%HITX%,%HITY%,%HITZ%] input: %@&exchangeinput%, output: %@&exchangeoutput%, stock: %@&exchangesleft%");
  23.         endif;
  24. endif;
  25.  
  26. }$$
clone this paste RAW Paste Data