Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l colorquotes {
- ;; Colorize Dialog
- var %num = 1
- var %out = $2-
- var %txtDialog = $hget($1, txtDialog)
- var %txtColorD = $hget($1, colDialog)
- $iif(%txtColorD < 10, %txtColorD = $chr(48) $+ %txtColorD)
- :loop
- if ($pos(%out,%txtDialog,%num) != $null) {
- if ($calc(%num % 2) == 1) {
- set %txtColorD2 $get_end_cc($left(%out,$calc($pos(%out,%txtDialog,%num) + 1)))
- %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+ $+ %txtColorD $+ %txtDialog $+ $right(%out,$calc($pos(%out,%txtDialog,%num) * -1))
- }
- else {
- if ($right(%out,$calc($pos(%out,%txtDialog,%num) * -1))) {
- %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+ %txtDialog $+ $+ %txtColorD2 $+ $right(%out,$calc($pos(%out,%txtDialog,%num) * -1))
- }
- else {
- %out = $left(%out,$calc($pos(%out,%txtDialog,%num) - 1)) $+ %txtDialog
- }
- }
- inc %num 1
- goto loop
- }
- return %out
- }
- alias -l colortele {
- ;; Colorize Telepathy
- var %numt = 1
- var %outt = $2-
- var %txtTele = $hget($1, txtTelepathy)
- var %txtColorT = $hget($1, colTelepathy)
- $iif(%txtColorT < 10, %txtColorT = $chr(48) $+ %txtColorT)
- :loop
- if ($pos(%outt,%txtTele,%numt) != $null) {
- if ($calc(%numt % 2) == 1) {
- set %txtColorT2 $get_end_cc($left(%outt,$calc($pos(%outt,%txtTele,%numt) - 3)))
- %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+ $+ %txtColorT $+ %txtTele $+ $right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))
- }
- else {
- if ($right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))) {
- %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+ %txtTele $+ $+ %txtColorT2 $+ $right(%outt,$calc($pos(%outt,%txtTele,%numt) * -1))
- }
- else {
- %outt = $left(%outt,$calc($pos(%outt,%txtTele,%numt) - 1)) $+ %txtTele
- }
- }
- inc %numt 1
- goto loop
- }
- return %outt
- }
- alias -l colorfor {
- ;; Colorize Foreign Language
- var %numf = 1
- var %outf = $2-
- var %txtForeign = $hget($1, txtForeign)
- var %txtColorF = $hget($1, colForeign)
- $iif(%txtColorF < 10, %txtColorF = $chr(48) $+ %txtColorF)
- :loop
- if ($pos(%outf,%txtForeign,%numf) != $null) {
- if ($calc(%numf % 2) == 1) {
- set %txtColorf2 $get_end_cc($left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 3)))
- %outf = $left(%outf,$calc($pos(%outf, %txtForeign,%numf) - 1)) $+ $+ %txtColorf $+ %txtForeign $+ $right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))
- }
- else {
- if ($right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))) {
- %outf = $left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 1)) $+ %txtForeign $+ $+ %txtColorf2 $+ $right(%outf,$calc($pos(%outf,%txtForeign,%numf) * -1))
- }
- else {
- %outf = $left(%outf,$calc($pos(%outf,%txtForeign,%numf) - 1)) $+ %txtForeign
- }
- }
- inc %numf 1
- goto loop
- }
- return %outf
- }
- alias -l get_end_cc {
- ;; Get last color code in saytext chunk
- if ($prop == bold) return $iif($calc($count($$1,) % 2),$true,$null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement