KeiroD

Kaiorga - Text Cutter

Jul 22nd, 2010
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.78 KB | None | 0 0
  1. menu channel,query {
  2.   -
  3.   .Text Cutter { startct }
  4. }
  5.  
  6. alias startct {
  7.   dialog -md textcut textcut
  8.   did -a textcut 3 Message
  9.   did -a textcut 3 Action
  10. }
  11.  
  12. dialog textcut {
  13.   title "Text Cutter v1 "
  14.   size -1 -1 267 205
  15.   option dbu
  16.   edit "", 1, 10 20 150 156, multi return autovs vsbar
  17.   edit "", 2, 205 40 50 10
  18.   combo 3, 205 26 50 27, size drop
  19.   button "Send to active", 4, 168 53 48 12
  20.   box "Customization", 5, 164 17 96 55
  21.   text "Text Input:", 6, 11 10 33 8
  22.   text "Text Color:", 7, 169 41 32 8
  23.   text "Send as:", 8, 169 27 25 8
  24.   button "Close", 9, 219 53 36 12, ok
  25. }
  26.  
  27. on *:dialog:textcut:sclick:4:{ sendtxt }
  28.  
  29. alias sendtxt {
  30.   var %x = 0
  31.   var %new = 0
  32.   var %rline = 0
  33.   var %color = $did(textcut,2).text
  34.   var %msg = $did(textcut,3).text
  35.   if (%color && %color > 15) || (%color != $abs($int(%color))) { echo -a Invalid color code... | halt }
  36.   if (!%msg) { echo -a Must specify send format... | halt }
  37.   if ($did(textcut,1,1).text == $null) { echo -a No text to send... | halt }
  38.   if (%msg == Action) { var %msg = me }
  39.   else { var %msg = msg $active }
  40.   while ($did(textcut,1).lines != %x) {
  41.     inc %x
  42.     var %line = $did(textcut,1,%x).text
  43.     if (%line) && (%color) { var %line = $+(,%color,%line) }
  44.     if (!%line) {
  45.       %msg %line. [ $+ [ %rline ] ]
  46.       %msg -
  47.       inc %rline | var %new = 0
  48.     }
  49.     elseif ($len(%line. [ $+ [ %rline ] ]) >= 300) {
  50.       var %line. [ $+ [ %rline ] ] %line. [ $+ [ %rline ] ] %line $+ ...
  51.       %msg %line. [ $+ [ %rline ] ]
  52.       inc %rline
  53.     }
  54.     elseif (!%line. [ $+ [ %rline ] ]) { var %line. [ $+ [ %rline ] ] $iif(%new != 0,$+($+(,%color,...),%line),%line) | inc %new }
  55.     else { var %line. [ $+ [ %rline ] ] %line. [ $+ [ %rline ] ] %line }
  56.   }
  57.   if (%line. [ $+ [ %rline ] ]) { %msg $v1 }
  58. }
Add Comment
Please, Sign In to add comment