Advertisement
NickAc

Código Patenteado!

May 22nd, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. n script unload:
  2. loop {nickchat.registedhooks::*}:
  3. set {_s} to the last 7 characters of loop-value
  4. set {_a} to loop-value
  5. set {_al} to length of {_a}
  6. subtract 7 from {_al}
  7. set {_a} to the first {_al} characters of {_a}
  8. df "plugins/Skript/scripts/nchook-%{_a}%.sk"
  9. df "plugins/Skript/scripts/-nchook-%{_a}%.sk"
  10.  
  11. on script load:
  12. set {nickchat.registedhooks::*} to files in "plugins/NickChat/Hooks"
  13. loop {nickchat.registedhooks::*}:
  14. set {_s} to the last 7 characters of loop-value
  15. if {_s} is ".nchook":
  16. set {_a} to loop-value
  17. set {_al} to length of {_a}
  18. subtract 7 from {_al}
  19. set {_a} to the first {_al} characters of {_a}
  20.  
  21. make console execute command "sk disable nchook-%{_a}%.sk"
  22. df "plugins/Skript/scripts/-nchook-%{_a}%.sk"
  23.  
  24. #Isto vai processar o hook e vai corrigir coisas daoras!
  25. set {_tempfile} to content of file "plugins/NickChat/Hooks/%{_a}%.nchook"
  26.  
  27. $ thread # Registar o hook do nickchat
  28. regex replace "(R|r)egist(a|e)r(?: (N|n)ick( |)(C|c)hat|) hook(?: named|) ""((\s|\S)+?)""(?: made|) by ""((\s|\S)+?)""(?: with|) version ""((\s|\S)+?)""" with "nickchat_registerHook(""$6"", ""$8"", ""$10"")" in {_tempfile}
  29.  
  30. $ thread # Setar Tags
  31. regex replace "set (?:nick(?: |)|)chat tag of ((?:\s|\S)+?) to ""((?:\s|\S)+?)"" replacer of ""((?:\s|\S)+?)""" with "nickapi_settag($1, ""$3"", ""$2"")" in {_tempfile}
  32.  
  33. $ thread # Des-Registar o hook do nickchat
  34. regex replace "(u|U)n(R|r)egist(a|e)r(?: (N|n)ick( |)(C|c)hat|) hook(?: named|) ""((\s|\S)+?)""(?:(?: made|) by ""((\s|\S)+?)""(?: with|) version ""((\s|\S)+?)""|)" with "nickchat_unregisterHook(""$7"")" in {_tempfile}
  35.  
  36. # Evento On Global
  37. set {_aaaaa} to nickutils_configValue("Hooks.UsarTABS", "NickChat", "config")
  38. if {_aaaaa} is "true":
  39. $ thread
  40. regex replace "on (G|g)lobal(?: (send|message)):" with "on command ""/g"":%nl% arguments is set%nl% set {_msg} to ""%%arguments%%""%nl% wait 1 tick" in {_tempfile}
  41. else:
  42. $ thread
  43. regex replace "on (G|g)lobal(?: (send|message)):" with "on command ""/g"":%nl% arguments is set%nl% set {_msg} to ""%%arguments%%""%nl% wait 1 tick" in {_tempfile}
  44.  
  45. # Evento On Local
  46. if {_aaaaa} is "true":
  47. $ thread
  48. regex replace "on (L|l)ocal(?: (send|message)):" with "on chat:%nl% wait 1 tick" in {_tempfile}
  49. else:
  50. $ thread
  51. regex replace "on (L|l)ocal(?: (send|message)):" with "on chat:%nl% wait 1 tick" in {_tempfile}
  52.  
  53. $ thread # Enviar Chat customizado
  54. regex replace "send custom(?: (?:(N|n)ick|)(?: |)(C|c)hat|) to ((\s|\S)+?) sent by ((\s|\S)+?)(?: with|) prefix(?:ed|) ""((\s|\S)+?)""(?: with|) text ""((\s|\S)+?)""" with "nickchat_sendcustomChat($3, ""$7"", $5, ""$9"")" in {_tempfile}
  55.  
  56. # $ thread
  57. regex replace "on(?: hook|) (|un)load:" with "on script $1load:" in {_tempfile}
  58.  
  59. create file "plugins/Skript/scripts/nchook-%{_a}%.sk"
  60.  
  61. wf "%{_tempfile}%" to "plugins/Skript/scripts/nchook-%{_a}%.sk"
  62.  
  63. load script from file "plugins/Skript/scripts/nchook-%{_a}%.sk"
  64.  
  65. send "[NickChat Lite] Carregado Hook do Ficheiro %{_a}%.nchook" to console
  66. else:
  67. remove loop-value from {nickchat.registedhooks::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement