Encoding/decoding text

By ^Neptune on Oct 20, 2008

Image

Put in remotes and type /decode to open it. Note that the alias doesn't mess up the normal $decode!

VERY basic, but I figured that there wasn't one of these on Hawkee, so I quickly whipped one up in about 10mins.

This basically allows you to easily check what decoded text is, and encode your own messages. The output will automatically update as you type, so you don't have to press any buttons. The output options are Mime, Uucode and Text. Sorry, but I just couldn't find out how to use the b switch. :\

If you're wondering, that "Status" bit just shows if you have the decode setting locked in your mIRC options.

Clipboard will copy whatever is in the output box to your clipboard, and Message will show whatever text is in the output box to the active channel.

Enjoy!

dialog decode {
  title "Encoding/decoding text"
  size -1 -1 180 119
  option dbu
  edit "", 1, 25 3 42 10, read
  text "Status:", 2, 5 4 18 9
  box "", 3, -2 14 270 1
  radio "Encode:", 4, 5 19 30 8
  radio "Decode:", 5, 5 32 30 8
  edit "", 6, 38 18 140 10 autohs
  edit "", 7, 38 31 140 10 autohs
  combo 8, 64 53 60 35, drop
  box "Method", 9, 60 45 67 22
  edit "", 10, 6 75 168 25, read multi vsbar
  box "Output:", 11, 3 67 174 36
  button "OK", 12, 145 105 32 12, ok
  button "Message", 13, 111 105 32 12
  button "Clipboard", 14, 77 105 32 12
}
on *:dialog:decode:init:0: {
  did -b $dname 7
  did -c $dname 4
  did -a $dname 1 $iif($lock(decode),Off,On)
  did -a $dname 8 Mime
  did -a $dname 8 Uucode
  did -a $dname 8 Text
  did -c $dname 8 1
}
alias decode {
  if (!$isid) { dialog $iif($dialog(decode),-v,-m) decode decode }
  else { return $decode($1,$2) }
}
on *:dialog:decode:edit:*: {
  if ($did == 6) {
    var %txt = $did(6).text | did -ra $dname 10 $encode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t))
  }
  if ($did == 7) {
    var %txt = $did(7).text | did -ra $dname 10 $decode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t))
  }
}
on *:dialog:decode:sclick:*: {
  if ($did == 4) {
    did -e $dname 6 | did -b $dname 7
    var %txt = $did(6).text | did -ra $dname 10 $encode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t))
  }
  if ($did == 5) {
    did -e $dname 7 | did -b $dname 6 
    var %txt = $did(7).text | did -ra $dname 10 $decode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t))
  }
  if ($did == 8) {
    if ($did(6).enabled) { var %txt = $did(6).text | did -ra $dname 10 $encode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t)) }
    elseif ($did(7).enabled) { var %txt = $did(7).text | did -ra $dname 10 $decode(%txt,$replace($did(8).text,Mime,m,Uucode,u,Text,t))
    }
  }
  if ($did == 14) { 
    if (!$did(10).text) { noop $input(There is no text to copy!,uwo,Error!) }
    else { clipboard $did(10).text }
  }
  if ($did == 13) {
    if (!$did(10).text) { noop $input(There is no text to message!,uwo,Error!) }
    else {
      if (%decmsg) { unset %decmsg }
      var %x = 1
      while (%x <= $did($dname,10).lines) {
        set %decmsg %decmsg $+ $did($dname,10,%x)
        inc %x
      }
    $iif($window($active) == Status Window,echo -a,msg $active) %decmsg }
    unset %decmsg
  }
}
Sign in to comment.
JacK™   -  Oct 21, 2008

cool :D

 Respond  
irchainscriptz   -  Oct 21, 2008

Nice basic and simple nice work!!

 Respond  
rhasttaff   -  Oct 20, 2008

very good man :) simple basic and clean :) i often use encode :P

Jah Bless´´´

 Respond  
AHBARAR   -  Oct 20, 2008

/me find it useful way to chat >:D although me stopping here >:/

 Respond  
BrAndo   -  Oct 20, 2008

alias decode { if (!$isid) { dialog $iif($dialog(decode),-v,-m) decode decode } else { return $decode($1,$2) } }

If you use $decode() with parameters it automatically assumes your trying to use the built in identifier, so you dont really need to check $isid

 Respond  
^Neptune   -  Oct 20, 2008

Update:

-The edit fields are now autohs -Fixed small decode bug -Fixed messaging problem

 Respond  
^Neptune   -  Oct 20, 2008

Opinions and suggestions are welcome!

Edit: Just found another one on Hawkee. Although it's a bit basic. :|

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.