knugi

Untitled

Mar 7th, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. command /czas [<text>]:
  2. trigger:
  3. if arg 1 is not set:
  4. send "&cPodaj liczbe."
  5. stop
  6. set {_poczatek} to arg 1
  7. set {_poczatek} to {_poczatek} parsed as integer
  8. if {_poczatek} is integer:
  9. if {_poczatek} is smaller than 60:
  10. send "&c%{_poczatek}% sekund."
  11. stop
  12. if {_poczatek} is larger than 59:
  13. set {_w} to "%{_poczatek} / 60%"
  14. loop length of {_w} times:
  15. if subtext of {_w} from characters loop-number to loop-number is ".":
  16. set {_ll} to loop-number - 1
  17. exit loop
  18. set {_w} to first {_ll} characters of {_w}
  19. set {_w} to {_w} parsed as integer
  20. set {_s} to "%60 * {_w}%"
  21. set {_s} to {_s} parsed as integer
  22. set {_s} to "%{_poczatek} - {_s}%"
  23. set {_s} to {_s} parsed as integer
  24. set {_wk} to ""
  25. if {_w} is 1:
  26. set {_wk} to "a"
  27. if {_w} is 2 or 3 or 4:
  28. set {_wk} to "y"
  29. if {_s} is 0:
  30. set {_ss} to ""
  31. if {_s} is larger than 0:
  32. set {_sk} to ""
  33. if {_s} is 1:
  34. set {_sk} to "a"
  35. if {_s} is 2 or 3 or 4:
  36. set {_sk} to "y"
  37. set {_ss} to ", %{_s}% sekund%{_sk}%"
  38. set {_koniec} to "%{_w}% minut%{_wk}%%{_ss}%"
  39. send "&6%{_poczatek}% &7sekund to &c%{_koniec}%"
  40. stop
  41. send "&cPoczatkowa liczba musi byc liczba calkowita!"
Advertisement
Add Comment
Please, Sign In to add comment