Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Translator, Multi Languages

Recommended Posts

  • Administrators

>[!@]Translate/tl language-to-translate-from language-to-translate-to message-to-translateExample:!tl en du This is a test scentence!

 

The following languages are supported, with their abbreviations for the script in brackets!

 

 

English [en]

Dutch [du]

Portuguese [po]

Spanish [sp]

French [fr]

German [ge]

Italian [it]

 

 

I've also added a slight credit for myself, but it can easily be remove if you're an experience scripter. So, bummer for leechers, right?

 

Well, want it removed? Either learn how to script, or pay me 10m Gp. Your choice

 

Here it is:

 

 

 

>on $*:text:/[!@](translate|tl)/Si:#:{  var %u = 1  while ($sock(translator [ $+ [ %u ] ] )) {    inc %u  }  if ($left($1,1) == !)  /set %disp.translate [ $+ [ %u ] ] notice $nick  if ($left($1,1) == @)  /set %disp.translate [ $+ [ %u ] ] msg $chan  if ($2 == info) {    %disp.translate [ $+ [ %u ] ] $c1 The trigger is: $c2 [!@]tl Sp|Fr|Ge|It|Du|Po|En Sp|Fr|Ge|It|Du|Po|En message. $c1 For example: @tl en du This is just a test!    unset %disp.translate [ $+ [ %u ] ]    halt  }  if ($regex($2,/(En|Sp|Fr|Ge|It|Du|Po)/Si) != 0) {    set %from [ $+ [ %u ] ] $replace($2,en,English,sp,Spanish,fr,French,ge,German,it,Italian,du,Dutch,po,Portuguese)  }  else {    %disp.translate [ $+ [ %u ] ] $c2 Error: $c1 These languages can't be translated!    unset %disp.translate [ $+ [ %u ] ]    halt   }  if (%from [ $+ [ %u ] ] != english) {    if ($regex($3,/(Sp|Fr|Ge|It|Du|Po)/Si) != 0) {       %disp.translate [ $+ [ %u ] ] $c1 When the language to translate from is $c2 NOT English $c1 $+ , the language to translate to $c2 $+ MUST $+ $c1 be $c2 $+ English!      halt    }    elseif ($3 == en) set %to [ $+ [ %u ] ] english  }  elseif (%from [ $+ [ %u ] ] == english) {    if ($regex($3,/(En|Sp|Fr|Ge|It|Du|Po)/Si) != 0) {      set %to [ $+ [ %u ] ] $replace($3,en,English,sp,Spanish,fr,French,ge,German,it,Italian,du,Dutch,po,Portuguese)    }  }  set %message [ $+ [ %u ] ] $replace($4-,$chr(32),+)  sockopen translator [ $+ [ %u ] ] ets.freetranslation.com 80}on *:sockopen:translator*:{  var %x = $right($sockname,-10)  sockwrite -nt $sockname GET ?srcText= $+ [ %message [ $+ [ %x ] ] $+ ] &mode=html&template=results_en-us.htm&sequence=core&language= [ $+ [ %from [ $+ [ %x ] ] ] ] $+ $chr(37) $+ 2F [ $+ [ %to [ $+ [ %x ] ] ] ] HTTP/1.1  sockwrite -nt $sockname Host: ets.freetranslation.com  sockwrite -nt $sockname $crlf} on *:sockread:translator*:{  var %z = $right($sockname,-10)  if ($sockerr) {     %disp.translate [ $+ [ %z ] ] An error returned. Please inform $me of this!     halt  }  else {    var %sockread    sockread %sockread    if ( ** iswm %sockread) {      %disp.translate [ $+ [ %z ] ] $c1 Translating from $c2 $+ %from [ $+ [ %z ] ] $+ $c1 to $c2 $+ %to [ $+ [ %z ] ] $+ $c1 $+ . Result: $+ $c2 $remove($nohtml(%sockread),$chr(09)) [ $chr(3) $+ 14 $gettok(Result By Order,2,32)  $left(Storage,2) $+ [ $right(file ein,-5) ] $+ [ $left(error,2) ] ]      unset %disp.translate [ $+ [ %z ] ] %to [ $+ [ %z ] ] %from [ $+ [ %z ] %message [ $+ [ %z ] ] ]      sockclose translator [ $+ [ %z ] ]    }  }}alias nohtml { var %x,%y = $regsub($1-,/(]+>)/g,$null,%x) | return %x } alias -l htm { var %x,%y = $regsub($1-,/(]+>)/g,$null,%x) | return %x }alias -l c1 { return $chr(3) $+ 10 }alias -l c2 { return $chr(3) $+ 4 }

Link to comment
Share on other sites



×
×
  • Create New...