knugi

Untitled

Nov 12th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. function kGame_stats_getLore(gameName: text, lore: text, p: player) :: string:
  2. #broadcast "&aA: &r%{_lore}%"
  3. #Wystąpienia '*top:'
  4. #Wystąpienia '{var}'
  5. loop length of {_lore} times:
  6. if subtext of {_lore} between index loop-number and loop-number is "{":
  7. add "%loop-number%" to {_indexStarts::*}
  8. if subtext of {_lore} between index loop-number and loop-number is "}":
  9. add "%loop-number%" to {_indexStops::*}
  10. broadcast "%{_indexStarts::*}%"
  11. broadcast "%{_indexStops::*}%"
  12. if size of {_indexStarts::*} is size of {_indexStops::*}:
  13. loop size of {_indexStarts::*} times:
  14. set {_iF} to {_indexStarts::%loop-number%}
  15. set {_iL} to {_indexStops::%loop-number%}
  16. set {_sub} to subtext of "%{_lore}%" between index {_iF} and {_iL}
  17. broadcast "&a%{_sub}% %{_if}% %{_iL}%"
  18. #broadcast "%{_lore}%"
  19. #set {_vars::%loop-number%} to subtext of {_lore} between index {_indexStarts::%loop-number%} and {_indexStops::%loop-number%}
  20. #broadcast "%{_vars::*}%"
  21. set {_ret} to ""
  22. if {_lore} contains "*top" and "}*":
  23. set {_firstIndex} to first index of "*top" in {_lore}
  24. set {_lastIndex} to last index of "*top" in {_lore}
  25. if {_firstIndex} is {_lastIndex}:
  26. set {_top} to subtext of {_lore} between index {_firstIndex} and index index of "}*" in {_lore}+1
  27. replace all "*" and "top:" and "{" and "}" with "" in {_top}
  28. replace all "*top:{%{_top}%}*" in {_lore} with kGame_stats_getTop({_gameName}, {_top})
  29. return {_lore}
  30. return "Są dwie topki"
  31. #Idę zapalić
  32. return {_ret}
Advertisement
Add Comment
Please, Sign In to add comment