Advertisement
Sanwi

ChestShopLogger

Mar 27th, 2014
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  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. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement