Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:LOAD: {
- echo -a _____________________________________________________
- echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Loading Add-On...
- echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Add-on: 15chr/decode Add-On
- echo -a 4,1[15,1 IrCQnet 4,1] 0,1 Coder: 15SaNCaK
- echo -a 4,1[15,1 IrCQnet 4,1] 0,1 E-Mail: 15SaNCaK@ChanOps.org
- echo -a ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- }
- menu menubar,status,channel,query {
- Encoder
- .$iif(%style = normal,$style(1)) Close:.set %style normal | .disable #decode54
- .-
- .$iif(%style = sym,$style(1)) chr:.set %style sym | .enable #decode54
- .-
- .$iif(%style = decode,$style(1)) seperate decode:.set %style decode | .enable #decode54
- .-
- .$iif(%style = fullcode,$style(1)) Full decode:.set %style fullcode | .enable #decode54
- .-
- .Dialog:dmn.enc
- .Set encryption key $+([,%enc.key,]):dmn.setkey $$?="Insert Number"
- }
- #decode54 off
- On *:input:*: {
- if ($Left($1-,1) != /) && (!$ctrlenter) { msg $active $iif(%style = normal,$1-,$symx($1-)) | halt }
- }
- alias symx {
- var %t = 1
- if (%style = fullcode) { return $+($!decode,$chr(40),$encode($1-,m),$chr(44),m,$chr(41)) | halt }
- while ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32))) || ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32)) != $null) {
- 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)))
- inc %t
- }
- return $iif(%style = sym,$+($,+,$chr(40),$left(%out,$calc($len(%out) - 1)),$chr(41)),%out)
- }
- #decode54 end
- alias dmn.enc { if ($dialog(encoding)) { dialog -x encoding } | dialog -m encoding encoding }
- alias code { msg $active DmN` $dmn.code(%enc.key,$1-) }
- alias -l dmn.code {
- if (!%enc.key) { set %enc.key 5 }
- if ($isid) { var %iz = $1 | return $regsubex($2-,/(.)/g,$chr($xor($asc(\t),%iz))) }
- else { var %iz = $2 | echo $1 $+(,$color(info),* Decode:,$color(normal)) $regsubex($3-,/(.)/g,$chr($xor($asc(\t),%iz))) }
- }
- alias -l dmn.setkey { if ($1 isnum) { set %enc.key $1 } }
- #autodecode on
- on *:TEXT:*:#: { if ($1 === DmN`) { dmn.code $chan %enc.key $2- } }
- on *:TEXT:*:?: { if ($1 === DmN`) { dmn.code $nick %enc.key $2- } }
- #autodecode end
- dialog encoding {
- title "Encoder [/dmn.enc]"
- size -1 -1 220 155
- check "Enable Auto-Decoding" 111, 5 5 180 15
- text "Encryption key:" 7, 5 27 89 15
- edit "" 8,95 25 20 20
- box "Encode/Decode" 112, 5 45 210 80
- edit "TEXT" 1, 10 60 200 20,autohs center
- button "Clear" 2, 20 80 50 20
- button "Encode/Decode" 3, 80 80 120 20
- edit "....." 4, 10 100 200 20,autohs center read
- button "+ Info" 5, 5 130 60 20
- button "ok" 6, 165 130 50 20, ok
- text "- To encode a text type '/code TEXT'" 113, 5 165 210 30
- text "- The Encryption key is a secret number for encoding\decoding text." 115, 5 195 210 30
- }
- on *:dialog:encoding:*:*:{
- if ($devent == init) {
- if ($group(#autodecode) = on) { did -cf encoding 111 }
- did -ar $dname 8 %enc.key
- }
- if ($devent == sclick) {
- if ($did = 2) { did -r encoding 1,4 }
- if ($did = 3) { did -ar encoding 4 $dmn.code(%enc.key,$did(1)) }
- if ($did = 111) { if ($group(#autodecode) = off) { .enable #autodecode } | else { .disable #autodecode } }
- 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 } }
- }
- if ($devent == edit) && ($did = 8) { dmn.setkey $did(8).text }
- }
- on *:load:{ set %enc.key 5 }
- on *:unload:{ unset %enc.key }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement