Code Master Version 1.1

By supergeo on Aug 24, 2005

This is probably the best code snippet submitted to Hawkee.com for 2 reasons. You can set it to automatically encode everything you type in like normal text, making it much easier to type full paragraphs in code. The second reason is that it automatically decodes all code sent by someone with this same code! In the next version, I plan on making it so that you can have an @ window with encodings and decodings, and possibly double encode the text.
Note: This document is COMMENTED by me to help you understand what does what. Hopefully Code Master helps with your text coding. Also look for special codes in the future, with a way to make it better for simple person to person codes.
Special thanks to xDaeMoN, for helping clean-up and bug-check my code!

;Code Master Version 1.0
;Scripted by supergeo
;Revised by xDaeMoN
;Special thanks to xDaeMoN for his help in fixing & cleaning up
;This script!

;Type /encode to encode text. You don't have to use this if you turned on automatic encoding by using /eall.
alias encode { 
  /* Messages the active window with a code and the encoded text.
  The code is sent so that other users using this code will automatically decode the text.
  Note: Anything witj 7eK8 in front of it will be decoded.
  So this could lead to some accidental decoding.
  This should never happen, but you never know.
  But don't worry, you will still see the correct version 
  in this situation.
  */
  msg $active 7eK8 $+ $encode($$?="Text to encode:",m) 
  echo -a Translation: $! 
} 
/* I've added this alias for if you want to decode some text. Your friend doesn't use this snippet? No problem. You can manually decode all text. Simply copy the text to decode, and type /decode. Then, paste the text into the popup box.
Note: It decodes using mime. */

alias decode { echo -a $decode($$?="Text to decode:",m) } 

;Decoding trigger.
on *:Text:*:#: { 
  ;Checks to see if code is in front
  ;Note: It will only automatically decode if the person that encoded the text sent this to you using this snippet. So have your friends use it too! 
  if ($left($1,4) = 7eK8) { 
    echo # Translation: $decode($right($1,-4),m) 
  } 
} 
;Use this to set it to automatically encode all of the text you send
;If you want to disable it's use, just use the command again.
alias eall { 
  if (%eall == on) unset %eall 
  else set %eall on 
} 
;This part of the script is for the auto-coding.
;If you have the option set for it, you can just type text and it will be encoded.
on *:Input:*: { 
  ;Checks to see if you have auto-encode set to on
  ;Makes sure it isn't a command.
  if (%eall == on) && ( /* !iswm $1 ) { 
   ;Encodes and messages the text.
    msg $active 7eK8 $+ $encode($1-,m) 
   ;Gives the translation of it also.
    echo -a Translation: $1- 
    halt 
  } 
} 

menu * {
 Code Master
 .Encode text: encode
 .Decode text: decode
 .Auto-Encode $iif(%eall == on, -Enabled-,-Disabled-): eall
 .Credits: echo -a Made by supergeo. Thanks to xDaeMoN
 }

Comments

Sign in to comment.
xDaeMoN   -  Aug 26, 2005

In your menu, you can change the 2 $iif\'s to \".Auto-Encode $iif(%eall == on, -Enabled-,-Disabled-): eall\"

 Respond  
xDaeMoN   -  Aug 25, 2005

Not really, it gives more details on how the snippet works.

 Respond  
supergeo   -  Aug 25, 2005

Err.... does it look too messy now with the comments?

 Respond  
F*U*R*B*Y*   -  Aug 25, 2005

well done

oh and btw while i remember nice dp xDaeMoN

 Respond  
xDaeMoN   -  Aug 24, 2005

I just noticed something. Change \"echo -a ...\" in your On Text event to \"echo # ...\"

 Respond  
anthalus   -  Aug 24, 2005

LOL Yoinx, I did do something like this with blowfish...

http://www.hawkee.com/view.php?file_id=1112

 Respond  
Ace99   -  Aug 24, 2005

Reminds me of my Code Talk...Good job. :D

 Respond  
Yoinx   -  Aug 24, 2005

I was thinking of doing something kinda like this, but with blowfish and shared keys.

 Respond  
supergeo   -  Aug 24, 2005

Oops I forgot that lol. I KNEW I forgot something!

 Respond  
xDaeMoN   -  Aug 24, 2005

hmm I thought that you said that you commented the code?

 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.