Elvish/Drow translator

By blackvenomm666 on Nov 23, 2010

drow elf/reg elf translator. translates text and names. with the drow translation you can translate more than one word at a time eg i love you make sure the drow check box is clicked. but with the elfish part you can only do one word at a time the best site i could find for it sucks make sure the elf check box is clicked. there isnt much to the elvish language.then for a name just click male/female and type in a male/female name in the upper text box then click trans name. thanks to napa and typo for teachin me. napa scripted the drow socket im not that good yet

Menu Menubar,Nicklist,Channel {
  ElvenTranslator
  .ElvenTranslator: dialog $iif($dialog(ElvenTranslator.System),-v,-md ElvenTranslator.System) ElvenTranslator.System 
}
dialog ElvenTranslator.System {
  title "Elven Translator"
  size -1 -1 164 56
  option dbu
  button "Translate", 1, 0 26 35 14
  edit , 4, 1 2 155 11, autohs
  edit , 5, 1 15 155 10, autohs
  Radio "Message chan on " 6, 113 27 50 10, flat 
  Radio "Message chan off" 7, 113 40 50 10, flat 
  check "Drow", 8, 40 27 20 9
  check "Elven", 9, 40 40 23 9
  check "Male name", 10, 70 27 35 9
  check "Girl name", 11, 70 40 35 9
  button "Trans Name", 12, 0 41 35 14

}
On *:dialog:ElvenTranslator.System:init:*: { 
  if (%msgchan == on ) {
    did -c ElvenTranslator.System 6
  }
  elseif (%msgchan == off ) { did -c ElvenTranslator.System 7
  }
  if ( %Language == Drow ) { did -c ElvenTranslator.System 8
  }
  if ( %Language == Elven ) { did -c ElvenTranslator.System 9
  }
  if ( %sex == male ) { did -c ElvenTranslator.System 10
  }
  if ( %sex == female ) { did -c ElvenTranslator.System 11
  }
}
On *:dialog:ElvenTranslator.System:sclick:1: { 
  if (%Language == Drow ) {
    set %trans $did(4) |  sockopen Drow www.eilistraee.com 80 
  }
  elseif (%Language == Elven ) && (%msgchan == off) {   
    did -r ElvenTranslator.System 5 
    set %elvish.msg did -a ElvenTranslator.System 5 
    set %elvish.word $did(4)
    sockopen elvish www.arwen-undomiel.com 80
  }
  else { set %elvish.msg msg $active 12,1[4,1Elvish12,1]
    set %elvish.word $did(4)
    sockopen elvish www.arwen-undomiel.com 80
  }
}
On *:dialog:ElvenTranslator.System:sclick:12: { 
  if (%sex == male ) && (%msgchan == off) {
    did -r ElvenTranslator.System 5 
    set %elvishname.msg did -a ElvenTranslator.System 5
    set %elvishname.word $did(4)
    sockopen elvishname www.arwen-undomiel.com 80
  }
  else { set %elvishname.msg msg $active 12,1[4,1Elvish Name12,1]
    set %elvishname.word $did(4)
    sockopen elvishname www.arwen-undomiel.com 80 
  }
  if (%sex == female ) && (%msgchan == off) {   
    did -r ElvenTranslator.System 5 
    set %elvishname2.msg did -a ElvenTranslator.System 5
    set %elvishname2.word $did(4)
    sockopen elvishname2 www.arwen-undomiel.com 80
  }
  elseif (%msgchan == on) { set %elvishname2.msg msg $active 12,1[4,1Elvish Name12,1]
    set %elvishname2.word $did(4)
    sockopen elvishname2 www.arwen-undomiel.com 80
  }
}

on *:sockopen:Drow:{ 
  var %Drow $+(page=result&words=,%trans,&direction=drow&plain=plain&submit=Translate)
  sockwrite -n Drow POST /chosen/language.php HTTP/1.1 
  sockwrite -n Drow Host: $sock(Drow).addr 
  sockwrite -n Drow Content-Type: application/x-www-form-urlencoded 
  sockwrite -n Drow Content-Length: $len(%Drow) 
  sockwrite -n Drow $+($crlf,%Drow)
}
on *:sockread:Drow: { 
  var %Drow | sockread %Drow
  if ($regex(%Drow,/<tr><td.+>(.+:)<\/b>&nbsp;<.+>(.+?)<\/td>/)) { 
    .set %reg1 $regml(1) $+ $regml(2)
    Did -r ElvenTranslator.System 5
    Did -a ElvenTranslator.System 5 %reg1
    if (%msgchan == on) { msg $active 4,1 $regml(1) $regml(2)
    }  
  }
}
On *:dialog:ElvenTranslator.System:sclick:6: { 
  set %msgchan on
}
On *:dialog:ElvenTranslator.System:sclick:7: { 
  set %msgchan off
}
On *:dialog:ElvenTranslator.System:sclick:8: { 
  set %Language Drow
  did -u ElvenTranslator.System 9
}
On *:dialog:ElvenTranslator.System:sclick:9: { 
  set %Language Elven
  did -u ElvenTranslator.System 8
}
On *:dialog:ElvenTranslator.System:sclick:10: { 
  set %sex male
  did -u ElvenTranslator.System 11
}
On *:dialog:ElvenTranslator.System:sclick:11: { 
  set %sex female
  did -u ElvenTranslator.System 10
}

on *:sockopen:elvish: {
  sockwrite -n $sockname GET /elvish/eng_to_elv.html HTTP/1.1
  sockwrite -n $sockname Host: $+($sock(elvish).addr,$str($crlf,2))
}
on *:sockread:elvish: {
  var %elvish.sock
  sockread %elvish.sock  
  if (<b> $+ %elvish.word isin %elvish.sock) {
    var %elvish.sock $htmlfree(%elvish.sock)
    %elvish.msg $mid(%elvish.sock,1,$calc($pos(%elvish.sock,$chr(40))-2)) 
  }
}
on *:sockopen:elvish: { unset %elvish.* }
alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}

on *:sockopen:elvishname: {
  sockwrite -n $sockname GET /elvish/boynames.html HTTP/1.1
  sockwrite -n $sockname Host: $+($sock(elvishname).addr,$str($crlf,2))
}
on *:sockread:elvishname: {
  var %elvishname.sock
  sockread %elvishname.sock  
  if (<b> $+ %elvishname.word isin %elvishname.sock) {
    var %elvishname.sock $htmlfree(%elvishname.sock)
    %elvishname.msg $mid(%elvishname.sock,1,$calc($pos(%elvishname.sock,$chr(40))-2)) 
  }
}
on *:sockopen:elvishname: { unset %elvishname.* }
alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}

on *:sockopen:elvishname2: {
  sockwrite -n $sockname GET /elvish/girlnames.html HTTP/1.1
  sockwrite -n $sockname Host: $+($sock(elvishname2).addr,$str($crlf,2))
}
on *:sockread:elvishname2: {
  var %elvishname2.sock
  sockread %elvishname2.sock  
  if (<b> $+ %elvishname2.word isin %elvishname2.sock) {
    var %elvishname2.sock $htmlfree(%elvishname2.sock)
    %elvishname2.msg $mid(%elvishname2.sock,1,$calc($pos(%elvishname2.sock,$chr(40))-2)) 
  }
}
on *:sockopen:elvishname2: { unset %elvishname2.* }
alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
Sign in to comment.
BigSteve   -  Dec 03, 2010

erm

 icon "whatever.ico"

sorry lol pressed a key and didnt mean to >.>

 Respond  
BigSteve   -  Dec 03, 2010

and REMEMBER TO MAKE sure the icon file is where the scripts are :D

 Respond  
blackvenomm666   -  Nov 30, 2010

there arent any good elvish translator sites so i just used a elvish dictionary to translate it

 Respond  
evilMonkey   -  Nov 30, 2010

if it only does one word at a time, it can't really be considered a translator. I'd look for another site to socket to.

 Respond  
blackvenomm666   -  Nov 26, 2010

with the elvish translator you can only translate one word at a time and not all of our language has been translated into elvish there is only certain words. granted there are a lot of em but not all. try opening it setting it to elvish then put love in the top text area and hit translate. and with the names same as with the words for elvish not all names are translated. type in ryan at the top then make sure elvish is clicked and then make sure male is clicked. i do not have a drow name translator in it yet

 Respond  
evilMonkey   -  Nov 26, 2010

The Drow translator seems to work pretty well, and names for Drows work, but nothing else seems to really work. Also, you don't have to keep re-defining the alias htmlfree. Just one definition is sufficient, and you also probably should use alias -l htmlfree { ... } so it won't be confused with another script.

 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.