Advertisement
lengend

Untitled

Nov 23rd, 2012
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.25 KB | None | 0 0
  1. alias -l box_size { var %opt = $1, %target = paste, %cid = 6, %x = 1, %n = $did(%target,%cid).lines, %size = 0 | while %x <= %n { var %line = $did(%target,%cid,%x).text | if (%opt == 1) { if (%line == $null) { %size = $calc(%size + $len(% $+ 0A)) } | else { %size = $calc(%size + $len($urlencode(%line) $+ % $+ 0A)) } } | else { %size = $calc(%size + $len(%line)) } | inc %x } | return %size }
  2. alias -l urlencode { var %r = $regsubex($$1-,/([!#$%&'()*+,/:;=?@rn[] ])/g,% $+ $($base($asc(t),10,16))) | $iif($isid,return,echo -a) %r }
  3. alias -l write_combobox { var %syntax = $wsstr(67) | var %x = 1 | while (%x <= $numtok(%syntax,32)) { did -o paste 14 %x $gettok(%syntax,%x,32) | inc %x } }
  4. dialog -l paste {
  5.   title $wsstr(49)
  6.   size $readini($wsconfig,position,pasteX) $readini($wsconfig,position,pasteY) 250 117
  7.   icon $mircdirscript\images\pastebin.ico, 0
  8.   option dbu
  9.   text "Name:", 21, 3 3 15 8
  10.   edit $mnick, 4, 19 1 40 10, read
  11.   edit "", 19, 137 110 30 8, hide disable
  12.   text $wsstr(54), 17, 65 3 23 8, right
  13.   combo 14, 89 1 36 10, drop
  14.   check $wsstr(52), 25, 128 3 46 8
  15.   edit "", 6, 0 12 250 81, multi return autohs autovs vsbar
  16.   text $wsstr(53), 10, 188 3 58 8, right
  17.   text $wsstr(57), 13, 171 109 75 8, right
  18.   text $wsstr(58), 12, 3 94 13 8
  19.   link $wsstr(59), 11, 17 94 117 8
  20.   button $wsstr(60), 7, 147 94 38 14, default
  21.   button $wsstr(61), 8, 186 95 30 11
  22.   button $wsstr(65), 22, 217 95 30 11
  23.   text $wsstr(50), 15, 3 102 130 8
  24.   text $wsstr(51), 16, 3 109 130 8
  25. }
  26. on *:dialog:paste:*:*: { if ($devent == init) { did -h paste 19 | did -f paste 6 | write_combobox | did -b paste 7, 4 | did -f paste 6 | did -ck paste 14 1 | if ($wscfgget(cfg20)) { did -c paste 25 } }
  27.   if ($devent == close) { noop $wssavepos(paste) } | if ($devent == edit) { if ($did == 6) { if ($box_size == 0) { did -b paste 7 1 } | else { did -e paste 7 1 } | did -o paste 10 1 $box_size chars ( $+ $did(paste,6).lines $iif($did(paste,6).lines == 1,line,lines)) $+ ) } }
  28.   if ($devent == rclick) { if ($did == 11) { clipboard $did(paste,11).text } }
  29.   if ($devent == sclick) { if ($did == 11) { if ($server) { /msg $active $did(paste,11).text } }
  30.     if ($did == 14) { if ($did(paste,14).seltext !== none) || ($did($paste,14).seltext == $null) { set %pst.frmt $replace($did(paste,14).seltext,-,$chr(32)) } | else { unset %pst.frmt } }
  31.     if ($did == 22) { noop $wssavepos(paste) | dialog -x paste }
  32.     if ($did == 25) { if ($did(paste,25).state == 0) { dialog -n paste paste } | else { dialog -o paste paste } | wscfgset cfg20 $iif(($did(paste,25).state == 1),$true,$false) }
  33.     if ($did == 7) { if ($did(6) !== $null) { %paste.user = $mnick | sockclose paste | did -o paste 13 1 $chr(91) uploading $chr(93) | did -b paste 4,6,7,14,19 1 | sockopen Paste %privatepst $+ pastebin.com 80 } }
  34.     if ($did == 8) { did -b paste 7 1 | did -re paste 6,19 1 | did -ec paste 14 1 | unset %privatepst | unset %pst.frmt | did -o paste 10 1 $wsstr(53) | did -o paste 11 1 http://pastebin.com | did -o paste 13 1 $chr(91) idle $chr(93) }
  35.   }
  36. }
  37. on *:sockopen:Paste:{
  38.   var %a = $+(parent_id=&format= $+ $iif(%pst.frmt,$lower(%pst.frmt),text) $+ &paste=Send&poster=,%Paste.User,&code2=,)
  39.   unset %pst.frmt | %paste_lc = 0 | %paste_found302 = 0 | sockwrite -n $sockname POST /pastebin.php HTTP/1.0 | sockwrite -n $sockname Host: %privatepst $+ pastebin.com
  40.   sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded | sockwrite -n $sockname Content-length: $calc($len(%a) + $box_size(1)) | sockwrite $sockname $crlf | sockwrite $sockname %a | unset %privatepst
  41.   var %cnt = 1, %ttl = $did(paste,6).lines | while %cnt <= %ttl { var %line = $did(paste,6,%cnt).text | if (%line == $null) { %line = % $+ 0A | sockwrite $sockname %line } | else { var %encd = $urlencode(%line) | sockwrite $sockname %encd $+ % $+ 0A } | inc %cnt }
  42. }
  43. on *:sockread:Paste:{
  44.   var %a | sockread %a | if (%paste_lc == 0 && 200 isin %a) { did -o paste 13 1 $chr(91) error $chr(93) | sockclose $sockname | unset %paste_lc, %paste_found302 | halt }
  45.   if (%paste_lc == 0 && 302 isin %a) { did -o paste 13 1 $chr(91) done $chr(93) | %paste_found302 = 1 | inc %paste_lc } | else if (%paste_found302 == 1 && Location: isin %a) { var %t = $regex(%a,/Location: (.*)$/g) | did -o paste 11 1 $regml(1) | unset %paste_lc | unset %paste_found302 | halt }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement