Advertisement
SaNCaK

mIRC Input chr/decode

Feb 3rd, 2014
749
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.72 KB | None | 0 0
  1. on *:LOAD: {
  2.   echo -a _____________________________________________________
  3.   echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Loading Add-On... 
  4.   echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Add-on: 15chr/decode Add-On 
  5.   echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Coder: 15SaNCaK 
  6.   echo -a 4,1[15,1 IrCQnet 4,1] 0,1 E-Mail: 15SaNCaK@ChanOps.org 
  7.   echo -a ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  8. }
  9.  
  10. menu menubar,status,channel,query {
  11.   Encoder
  12.   .$iif(%style = normal,$style(1)) Close:.set %style normal | .disable #decode54
  13.   .-
  14.   .$iif(%style = sym,$style(1)) chr:.set %style sym  | .enable #decode54
  15.   .-
  16.   .$iif(%style = decode,$style(1)) seperate decode:.set %style decode | .enable #decode54
  17.   .-
  18.   .$iif(%style = fullcode,$style(1)) Full decode:.set %style fullcode | .enable #decode54
  19.   .-
  20.   .Dialog:dmn.enc
  21.   .Set encryption key $+([,%enc.key,]):dmn.setkey $$?="Insert Number"
  22. }
  23.  
  24. #decode54 off
  25. On *:input:*: {
  26.   if ($Left($1-,1) != /) && (!$ctrlenter) { msg $active $iif(%style = normal,$1-,$symx($1-)) | halt }
  27. }
  28. alias symx {
  29.   var %t = 1
  30.   if (%style = fullcode) { return $+($!decode,$chr(40),$encode($1-,m),$chr(44),m,$chr(41)) | halt }
  31.   while ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32))) || ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32)) != $null) {
  32.     var %out = $iif(%style = sym,$+(%out,$+($!chr,$chr(40),$asc($mid($1-,%t,1)),$chr(41),$chr(44))),%out $+($!decode,$chr(40),$encode($gettok($1-,%t,32),m),$chr(44),m,$chr(41)))
  33.     inc %t
  34.   }
  35.   return $iif(%style = sym,$+($,+,$chr(40),$left(%out,$calc($len(%out) - 1)),$chr(41)),%out)
  36. }
  37. #decode54 end
  38. alias dmn.enc { if ($dialog(encoding)) { dialog -x encoding } | dialog -m encoding encoding }
  39. alias code { msg $active DmN` $dmn.code(%enc.key,$1-) }
  40. alias -l dmn.code {
  41.   if (!%enc.key) { set %enc.key 5 }
  42.   if ($isid) { var %iz = $1 | return $regsubex($2-,/(.)/g,$chr($xor($asc(\t),%iz))) }
  43.   else { var %iz = $2 | echo $1 $+(,$color(info),* Decode:,$color(normal)) $regsubex($3-,/(.)/g,$chr($xor($asc(\t),%iz))) }
  44. }
  45. alias -l dmn.setkey { if ($1 isnum) { set %enc.key $1 } }
  46. #autodecode on
  47. on *:TEXT:*:#: { if ($1 === DmN`) { dmn.code $chan %enc.key $2- } }
  48. on *:TEXT:*:?: { if ($1 === DmN`) { dmn.code $nick %enc.key $2- } }
  49. #autodecode end
  50. dialog encoding {
  51.   title "Encoder [/dmn.enc]"
  52.   size -1 -1 220 155
  53.   check "Enable Auto-Decoding" 111, 5 5 180 15
  54.   text "Encryption key:" 7, 5 27 89 15
  55.   edit "" 8,95 25 20 20
  56.   box "Encode/Decode" 112, 5 45 210 80
  57.   edit "TEXT" 1, 10 60 200 20,autohs center
  58.   button "Clear" 2, 20 80 50 20
  59.   button "Encode/Decode" 3, 80 80 120 20
  60.   edit "....." 4, 10 100 200 20,autohs center read
  61.   button "+ Info" 5, 5 130 60 20
  62.   button "ok" 6, 165 130 50 20, ok
  63.   text "- To encode a text type '/code TEXT'" 113, 5 165 210 30
  64.   text "- The Encryption key is a secret number for encoding\decoding text." 115, 5 195 210 30
  65. }
  66. on *:dialog:encoding:*:*:{
  67.   if ($devent == init) {
  68.     if ($group(#autodecode) = on) { did -cf encoding 111 }
  69.     did -ar $dname 8 %enc.key
  70.   }
  71.   if ($devent == sclick) {
  72.     if ($did = 2) { did -r encoding 1,4 }
  73.     if ($did = 3) { did -ar encoding 4 $dmn.code(%enc.key,$did(1)) }
  74.     if ($did = 111) { if ($group(#autodecode) = off) { .enable #autodecode } | else { .disable #autodecode } }
  75.     if ($did = 5) { if ($did(5).text = - Info) { did -ra encoding 5 + Info | dialog -s encoding $dialog(encoding).x $dialog(encoding).y 220 155 } | elseif ($did(5).text = + Info) { did -ra encoding 5 - Info | dialog -s encoding $dialog(encoding).x $dialog(encoding).y 220 225 } }
  76.   }
  77.   if ($devent == edit) && ($did = 8) { dmn.setkey $did(8).text  }
  78. }
  79. on *:load:{ set %enc.key 5 }
  80. on *:unload:{ unset %enc.key }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement