Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.89 KB | None | 0 0
  1. ;Color script by tank59
  2. ;Color codes provided by the good folks on Hawkee.com
  3. ;Enjoy!
  4. alias csc { dialog -md typec typec }
  5. #color on
  6. dialog typec {
  7. title "Color by tank59"
  8. size -1 -1 140 140
  9. option dbu
  10. box "Color 1", 1, 70 90 30 25
  11. box "Color 2", 2, 105 90 30 25
  12. check "Single Color", 3, 5 90 41 7
  13. check "Color w/ BG", 4, 5 100 40 7
  14. check "Random Color", 5, 5 110 45 7
  15. check "Alternating Color w/ BG", 6, 5 130 65 7
  16. check "Alternating Color", 7, 5 120 50 7
  17. combo 8, 74 99 23 50, size drop
  18. combo 9, 109 99 23 50, size drop
  19. button "Set", 10, 90 130 20 9, ok
  20. button "Cancel", 11, 115 130 20 9, cancel
  21. check "Bold", 12, 74 118 20 7
  22. text "This is a color script by tank59. Select the type of color you would like to use and then choose the appropriate color for your use, using the chart below. Click set to enable it. Enjoy!" 13, 5 1 130 27
  23. text "0 white 8 yellow", 16, 5 31 50 7
  24. text "1 black 9 lightgreen", 17, 5 38 60 7
  25. text "2 blue 10 cyan", 18, 5 45 50 7
  26. text "3 green 11 lightcyan", 19, 5 52 60 7
  27. text "4 lightred 12 lightblue", 20, 5 59 60 7
  28. text "5 brown 13 pink", 21, 5 66 50 7
  29. text "6 purple 14 grey", 22, 5 73 50 7
  30. text "7 orange 15 lightgrey", 23, 5 80 60 7
  31. link "http://www.hawkee.com/", 24, 66 55 60 7
  32. link "jalopenobologna@gmail.com", 25, 66 80 69 7
  33. text "Email me with any comments, questions, or suggestions.", 26, 66 65 70 15
  34. text "Thanks to folks on Hawkee.com with coding the majority of color codes.", 27, 66 33 70 20
  35. text "���������������������������������������������", 28, 3 27 135 4
  36. }
  37. on *:dialog:typec:init:0:{
  38. var %f 0
  39. while (%f <= 15) {
  40. if ($len(%f) < 2) {
  41. did -a typec 8,9 $+(0,%f)
  42. inc %f
  43. }
  44. else {
  45. did -a typec 8,9 %f
  46. inc %f
  47. }
  48. }
  49. }
  50. on *:dialog:typec:sclick:3:{
  51. if ($did(typec,3).state == 1) {
  52. did -b typec 4,5,6,7,9
  53. }
  54. else {
  55. did -eu typec 3,4,5,6,7,8,9
  56. }
  57. }
  58. on *:dialog:typec:sclick:4:{
  59. if ($did(typec,4).state == 1) {
  60. did -b typec 3,5,6,7
  61. }
  62. else {
  63. did -eu typec 3,4,5,6,7,8,9
  64. }
  65. }
  66. on *:dialog:typec:sclick:5:{
  67. if ($did(typec,5).state == 1) {
  68. did -b typec 3,4,6,7,8,9
  69. }
  70. else {
  71. did -eu typec 3,4,5,6,7,8,9
  72. }
  73. }
  74. on *:dialog:typec:sclick:6:{
  75. if ($did(typec,6).state == 1) {
  76. did -b typec 3,4,5,7
  77. }
  78. else {
  79. did -eu typec 3,4,5,6,7,8,9
  80. }
  81. }
  82. on *:dialog:typec:sclick:7:{
  83. if ($did(typec,7).state == 1) {
  84. did -b typec 3,4,5,6
  85. }
  86. else {
  87. did -eu typec 3,4,5,6,7,8,9
  88. }
  89. }
  90. on *:dialog:typec:sclick:11:{
  91. .disable #color
  92. }
  93. on *:dialog:typec:sclick:10:{
  94. unset %sc | unset %bg1 | unset %bg2 | unset %ab1 | unset %ab2 | unset %a1 | unset %a2 | unset %bold
  95. set %bold $did(12).state
  96. if ($did(3).state == 1) && ($did(12).state == 0) {
  97. .enable #single
  98. set %sc $did(8).seltext
  99. }
  100. if ($did(3).state == 1) && ($did(12).state == 1) {
  101. .enable #bs
  102. set %sc $did(8).seltext
  103. }
  104. if ($did(4).state == 1) && ($did(12).state == 0) {
  105. .enable #cwb
  106. set %bg1 $did(8).seltext
  107. set %bg2 $did(9).seltext
  108. }
  109. if ($did(4).state == 1) && ($did(12).state == 1) {
  110. .enable #withbb
  111. set %bg1 $did(8).seltext
  112. set %bg2 $did(9).seltext
  113. }
  114. if ($did(5).state == 1) && ($did(12).state == 0) {
  115. .enable #r
  116. }
  117. if ($did(5).state == 1) && ($did(12).state == 1) {
  118. .enable #randomb
  119. }
  120. if ($did(6).state == 1) && ($did(12).state == 0) {
  121. .enable #acb
  122. set %ab1 $did(8).seltext
  123. set %ab2 $did(9).seltext
  124. }
  125. if ($did(6).state == 1) && ($did(12).state == 1) {
  126. .enable #backaltb
  127. set %ab1 $did(8).seltext
  128. set %ab2 $did(9).seltext
  129. }
  130. if ($did(7).state == 1) && ($did(12).state == 0) {
  131. .enable #ac
  132. set %a1 $did(8).seltext
  133. set %a2 $did(9).seltext
  134. }
  135. if ($did(7).state == 1) && ($did(12).state == 1) {
  136. .enable #altb
  137. set %a1 $did(8).seltext
  138. set %a2 $did(9).seltext
  139. }
  140. }
  141. #color end
  142. #cwb off
  143. ;color w/ background
  144. on *:input:*:{
  145. if (/* !iswm $1) && (!$ctrlenter) {
  146. var %x =  $+ %bg1
  147. var %z = %bg2
  148. say %x $+ , $+ %z $+ $1-
  149. halt
  150. }
  151. }
  152. #cwb end
  153. #r off
  154. ;random color
  155. on *:input:*: {
  156. var %r = $r(1,15)
  157. if (/* !iswm $1) && (!$ctrlenter) && ($len(%r) < 2) {
  158. var %c = $+(0,,,%r)
  159. say $+($chr(3),%c,$1-)
  160. halt
  161. }
  162. elseif (/* !iswm $1) && (!$ctrlenter) {
  163. say $+($chr(3),%r,$1-)
  164. halt
  165. }
  166. }
  167. #r end
  168. #single on
  169. ;single color
  170. on *:input:*:{
  171. if (/* !iswm $1) && (!$ctrlenter) {
  172. say $+(,%sc,$1-,)
  173. halt
  174. }
  175. }
  176. #single end
  177. #ac on
  178. ;alternating color
  179. alias ctalker {
  180. var %x
  181. .echo -q $regsub($1,/(.)(.?)/g, $+ %a1 $+ \1 $+ %a2 $+ \2,%x)
  182. return %x
  183. }
  184. on *:input:*:{
  185. if (/* !iswm $1) && (!$ctrlenter) && (!$inpaste) {
  186. say $$ctalker($1-)
  187. halt
  188. }
  189. }
  190. #ac end
  191. #acb off
  192. ;alternating color w/ background
  193. alias ctalker {
  194. var %x =  $+ %ab1 $+ , $+ %ab2 $+ \1 $+ %ab2 $+ , $+ %ab1 $+ \2
  195. .echo -q $regsub($1,/(.)(.?)/g,%x,%x)
  196. return %x
  197. }
  198. on *:input:*:{
  199. if (/* !iswm $1) && (!$ctrlenter) && (!$inpaste) {
  200. say $$ctalker($1-)
  201. halt
  202. }
  203. }
  204. #acb end
  205. #withbb off
  206. ;Bold color w/ background
  207. on *:input:*:{
  208. if (/* !iswm $1) && (!$ctrlenter) {
  209. var %x =  $+ %bg1
  210. var %z = %bg2
  211. say %x $+ , $+ %z $+ $1-
  212. halt
  213. }
  214. }
  215. #withbb end
  216. #randomb off
  217. ;Bold random color
  218. on *:input:*: {
  219. var %r = $r(1,15)
  220. if (/* !iswm $1) && (!$ctrlenter) && ($len(%r) < 2) {
  221. var %c = $+(0,,,%r)
  222. say  $+ %c $+ $1-
  223. halt
  224. }
  225. elseif (/* !iswm $1) && (!$ctrlenter) {
  226. say  $+ %r $+ $1-
  227. halt
  228. }
  229. }
  230. #randomb end
  231. #bs on
  232. ;Bold single color
  233. on *:input:*:{
  234. if (/* !iswm $1) && (!$ctrlenter) {
  235. say $+(,%sc,$1-,)
  236. halt
  237. }
  238. }
  239. #bs end
  240. #altb off
  241. ;Bold alternating color
  242. alias ctalker {
  243. var %x
  244. .echo -q $regsub($1,/(.)(.?)/g, $+ %a1 $+ \1 $+ %a2 $+ \2,%x)
  245. return %x
  246. }
  247. on *:input:*:{
  248. if (/* !iswm $1) && (!$ctrlenter) && (!$inpaste) {
  249. say $$ctalker($1-)
  250. halt
  251. }
  252. }
  253. #altb end
  254. #backaltb off
  255. ;Bold alternating color w/ background
  256. alias ctalker {
  257. var %x =  $+ %ab1 $+ , $+ %ab2 $+ \1 $+ %ab2 $+ , $+ %ab1 $+ \2
  258. .echo -q $regsub($1,/(.)(.?)/g,%x,%x)
  259. return %x
  260. }
  261. on *:input:*:{
  262. if (/* !iswm $1) && (!$ctrlenter) && (!$inpaste) {
  263. say $$ctalker($1-)
  264. halt
  265. }
  266. }
  267. #backaltb end
  268.  
  269. menu * {
  270. Color Talker
  271. .Change Options: .enable #color | csc
  272. $iif($group(#color) == on,$style(1)) Talker On: .enable #color
  273. $iif($group(#color) == off,$style(1)) Talker Off: .disable #color #single #cwb #r #acb #ac #bs #withbb #randomb #backaltb #altb | echo -a *Color Script Disabled | unset %sc | unset %bg1 | unset %bg2 | unset %ab1 | unset %ab2 | unset %a1 | unset %a2 | unset %bold
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement