Leet Translator

By Kirby on Dec 18, 2008

Just a little dialog for talking and translating in "leet-speak".

To launch it, either type in /dleet or right-click a window and hit 'Leet Translator'.

Right click a window and hit 'Turn Leet-Speak ON/OFF' to talk normally in Leet-Speak.

Use /leet [words] to look up a translation from English to Leet-Speak and message the active channel/window.

Check the /ame or /amsg to replace messaging or describing into the active channel/window by messaging or describing to all channels/windows.

If you're using the dialog, make sure you translate your text into leet FIRST!.

Here's a picture:
Image

alias leet {
  if (!$sock(leet)) {
    if ($1-) { sockopen leet www.generator.name 80 | sockmark leet $replace($1-,$chr(32),$chr(43)) }
    else { if (!$dialog(leet)) { echo -a Syntax: /leet [text] } }
  }
}
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) | return %x }
dialog Leet {
  title "Leet Translator"
  size -1 -1 87 148
  option dbu
  box "Leet", 2, 9 3 67 23
  edit "", 1, 16 11 54 10, autohs
  edit "", 3, 15 37 54 41, read multi return vsbar
  box "1337 73X7", 4, 9 29 66 55
  button "Echo", 5, 14 102 27 12
  button "Describe", 6, 47 87 27 12
  button "Say", 7, 47 102 27 12
  check "/ame + /amsg", 8, 18 118 44 10
  button "Close", 9, 24 133 37 12, cancel
  button "Leetify!!!", 10, 14 87 27 12
}
alias dleet { dialog $iif($dialog(leet),-v,-m) leet leet }
menu * {
  $iif($group(#LeetText) == On,$style(1)) Leet Text - 1337 73X7
  .$iif($group(#LeetText) == On,$style(2)) On: .enable #LeetText
  .$iif($group(#LeetText) == Off,$style(2)) Off: .disable #LeetText
  Leet Translator : dleet
}
#LeetText off
on *:input:*: { if (!$ctrlenter) && (/ !isin $left($1-,1)) { leet $1- | haltdef } }
#LeetText end
on *:dialog:leet:*:*: {
  if ($devent == init) && ($did == 0) { did -b leet 5-7 }
  if ($devent == sclick) {
    if ($did == 5) { echo $active 4Translation: $+(",$replace($did(1),$chr(43),$chr(32)),") -> $did(3) }
    if ($did == 6) { $iif($did(8).state == 1,ame $did(3),describe $active $did(3)) }
    if ($did == 7) { $iif($did(8).state == 1,amsg $did(3),msg $active $did(3)) }
    if ($did == 9) { dialog -x leet leet | unset %leet }
    if ($did == 10) { did -b leet 10 | did -r leet 3 | leet $did(1) }
  }
  if ($devent == edit) {
    if ($did == 1) { did $iif($did(1),-e,-b) leet 10 | did -r leet 3 }
  }
}

on *:sockopen:leet: { sockwrite -n $sockname GET /leet?name= $+ $iif($dialog(leet),$did(leet,1),$sock($sockname).mark) HTTP/1.0 | sockwrite -n $sockname Host: www.generator.name $+ $crlf $+ $crlf | $iif($dialog(leet),did -b leet 5-7) }
on *:sockread:leet: {
  if ($sockerr) { echo -a * There was a problem retrieving data from the website. Please try again. }
  else {
    sockread %leet
    if (readonly isin %leet) {
      if ($dialog(leet)) { did -e leet 5-7,10 | did -b leet 10 | did -a leet 3 $gettok(%leet,8,34) }
      else { msg $active $gettok(%leet,8,34) }
      unset %leet | sockclose leet
    }
  }
}

Comments

Sign in to comment.
Ghost-writer   -  Mar 28, 2010

Fail: Translation: "wtf" -> |/7f|/7f

 Respond  
Kirby   -  Feb 03, 2009

Heavily compressed.

 Respond  
Kirby   -  Dec 20, 2008

@ Blitzjager:
Should I also make an identifier called $leet (really the same thing as 'leetifing' the text and messaging the window or channel with the alias)?

 Respond  
Blitzjager   -  Dec 18, 2008

You could make it so that if someone hasn't leetified the text but have something in the edit box it will still echo/say/w.e

Pretty sure you could just make an alias for the leetify button and have the other buttons call the alias if the text hasn't already been leetified.

 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.