priMELval

count macro

Apr 10th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $${
  2.  
  3. // Save as count.txt
  4. // Bind to onSendChatMessage
  5.  
  6. IF(%KEYNAME%="onSendChatMessage")
  7. IFMATCHES(%CHAT%,"^/count$")
  8. EXEC(count.txt)
  9. FILTER
  10. ENDIF
  11.  
  12.  
  13. ELSE
  14.  
  15. MATCH(%ITEMIDDMG%,"(.*):([0-9]+)",{&item,#dmg})
  16. UNSET(#totalamount)
  17.  
  18. UNSAFE(0)
  19. GUI(INVENTORY)
  20. FOR(#slotnum,9,45)
  21. GETSLOTITEM(%#slotnum%,&itema,#amount,#dmga)
  22. IF((%&itema%==%&item%) && ((%#dmga%==%&dmg%)
  23. INC(#totalamount,%#amount%)
  24. ENDIF
  25. NEXT
  26. GUI()
  27. LOG(&eYou have %#totalamount% %ITEMNAME%)
  28. ENDUNSAFE
  29. ENDIF
  30.  
  31. }$$
Advertisement
Add Comment
Please, Sign In to add comment