Advertisement
Kooky

Untitled

Mar 26th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. alias -l colorquotes {
  2. ;; Colorize Dialog
  3. var %num = 1
  4. var %out = $2-
  5. var %txtDialog = $hget($1, txtDialog)
  6. var %txtColorD = $hget($1, colDialog)
  7.  
  8. $iif(%txtColorD < 10, %txtColorD = $chr(48) $+ %txtColorD)
  9.  
  10. :loop
  11. if ($pos(%out,%txtDialog,%num) != $null) {
  12. if ($calc(%num % 2) == 1) {
  13. set %txtColorD2 $get_end_cc($left(%out,$calc($pos(%out,%txtDialog,%num) + 1)))
  14. %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+  $+ %txtColorD $+ %txtDialog $+ $right(%out,$calc($pos(%out,%txtDialog,%num) * -1))
  15. }
  16. else {
  17. if ($right(%out,$calc($pos(%out,%txtDialog,%num) * -1))) {
  18. %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+ %txtDialog $+  $+ %txtColorD2 $+ $right(%out,$calc($pos(%out,%txtDialog,%num) * -1))
  19. }
  20. else {
  21. %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+ %txtDialog
  22. }
  23. }
  24. inc %num 1
  25. goto loop
  26. }
  27. return %out
  28. }
  29.  
  30. alias -l colortele {
  31. ;; Colorize Telepathy
  32. var %numt = 1
  33. var %outt = $2-
  34. var %txtTele = $hget($1, txtTelepathy)
  35. var %txtColorT = $hget($1, colTelepathy)
  36.  
  37. $iif(%txtColorT < 10, %txtColorT = $chr(48) $+ %txtColorT)
  38. :loop
  39. if ($pos(%outt,%txtTele,%numt) != $null) {
  40. if ($calc(%numt % 2) == 1) {
  41. set %txtColorT2 $get_end_cc($left(%outt,$calc($pos(%outt,%txtTele,%numt) - 3)))
  42. %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+  $+ %txtColorT $+ %txtTele $+ $right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))
  43. }
  44. else {
  45. if ($right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))) {
  46. %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+ %txtTele $+  $+ %txtColorT2 $+ $right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))
  47. }
  48. else {
  49. %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+ %txtTele
  50. }
  51. }
  52. inc %numt 1
  53. goto loop
  54. }
  55. return %outt
  56. }
  57.  
  58. alias -l colorfor {
  59. ;; Colorize Foreign Language
  60. var %numf = 1
  61. var %outf = $2-
  62. var %txtForeign = $hget($1, txtForeign)
  63. var %txtColorF = $hget($1, colForeign)
  64.  
  65. $iif(%txtColorF < 10, %txtColorF = $chr(48) $+ %txtColorF)
  66.  
  67. :loop
  68. if ($pos(%outf,%txtForeign,%numf) != $null) {
  69. if ($calc(%numf % 2) == 1) {
  70. set %txtColorf2 $get_end_cc($left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 3)))
  71. %outf = $left(%outf,$calc($pos(%outf, %txtForeign,%numf) - 1)) $+  $+ %txtColorf $+ %txtForeign $+ $right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))
  72. }
  73. else {
  74. if ($right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))) {
  75. %outf = $left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 1)) $+ %txtForeign $+  $+ %txtColorf2 $+ $right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))
  76. }
  77. else {
  78. %outf = $left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 1)) $+ %txtForeign
  79. }
  80. }
  81. inc %numf 1
  82. goto loop
  83. }
  84. return %outf
  85. }
  86.  
  87. alias -l get_end_cc {
  88. ;; Get last color code in saytext chunk
  89. if ($prop == bold) return $iif($calc($count($$1,) % 2),$true,$null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement