Advertisement
cnl_cnl_cnl

alias #

Dec 31st, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. pattern: ^#\s*$|^#([0-9]+|g)(,([0-9]+))?\s+(.*)
  2.  
  3. code:
  4.  
  5. local arg1 = matches[2]
  6. local arg2 = matches[4]
  7. local cmd = matches[5]
  8.  
  9. if arg1 == nil then
  10.  
  11. cecho([[
  12. #iterators
  13.  
  14. #1 cmd @
  15. #1,3 cmd @
  16. #g cmd @
  17. ]])
  18.  
  19.  
  20. else
  21.  
  22. if tonumber(arg1) then
  23. local q1, q2
  24. if tonumber(arg2) then
  25. q1,q2 = arg1,arg2
  26. else
  27. q1,q2 = 1,arg1
  28. end
  29. for i=q1,q2 do
  30. local icmd = cmd:gsub("@",tostring(i))
  31. expandAlias(icmd)
  32. end
  33. elseif arg1 == "g" then
  34. for k,v in pairs(msdp.GROUP) do
  35. local icmd = cmd:gsub("@",v.NAME)
  36. expandAlias(icmd)
  37. end
  38. end
  39.  
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement