Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu channel,query {
- -
- .Text Cutter { startct }
- }
- alias startct {
- dialog -md textcut textcut
- did -a textcut 3 Message
- did -a textcut 3 Action
- }
- dialog textcut {
- title "Text Cutter v1 "
- size -1 -1 267 205
- option dbu
- edit "", 1, 10 20 150 156, multi return autovs vsbar
- edit "", 2, 205 40 50 10
- combo 3, 205 26 50 27, size drop
- button "Send to active", 4, 168 53 48 12
- box "Customization", 5, 164 17 96 55
- text "Text Input:", 6, 11 10 33 8
- text "Text Color:", 7, 169 41 32 8
- text "Send as:", 8, 169 27 25 8
- button "Close", 9, 219 53 36 12, ok
- }
- on *:dialog:textcut:sclick:4:{ sendtxt }
- alias sendtxt {
- var %x = 0
- var %new = 0
- var %rline = 0
- var %color = $did(textcut,2).text
- var %msg = $did(textcut,3).text
- if (%color && %color > 15) || (%color != $abs($int(%color))) { echo -a Invalid color code... | halt }
- if (!%msg) { echo -a Must specify send format... | halt }
- if ($did(textcut,1,1).text == $null) { echo -a No text to send... | halt }
- if (%msg == Action) { var %msg = me }
- else { var %msg = msg $active }
- while ($did(textcut,1).lines != %x) {
- inc %x
- var %line = $did(textcut,1,%x).text
- if (%line) && (%color) { var %line = $+(,%color,%line) }
- if (!%line) {
- %msg %line. [ $+ [ %rline ] ]
- %msg -
- inc %rline | var %new = 0
- }
- elseif ($len(%line. [ $+ [ %rline ] ]) >= 300) {
- var %line. [ $+ [ %rline ] ] %line. [ $+ [ %rline ] ] %line $+ ...
- %msg %line. [ $+ [ %rline ] ]
- inc %rline
- }
- elseif (!%line. [ $+ [ %rline ] ]) { var %line. [ $+ [ %rline ] ] $iif(%new != 0,$+($+(,%color,...),%line),%line) | inc %new }
- else { var %line. [ $+ [ %rline ] ] %line. [ $+ [ %rline ] ] %line }
- }
- if (%line. [ $+ [ %rline ] ]) { %msg $v1 }
- }
Add Comment
Please, Sign In to add comment