<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/5990" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-11-02T15:16:41-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/5990</id>

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-11-02T15:16:41-04:00</updated>

		<published>2003-11-02T15:16:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29361#p29361</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29361#p29361"/>
		<title type="html"><![CDATA[help to !translate script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29361#p29361"><![CDATA[
its not a TCL error, the error is from the script (incase of translation failure).. which means it couldnt translate<blockquote class="uncited"><div>regsub -all "\n" $answer " " answer <br>    if {![string length $answer]} { <br>      set answer "Translation failed of unknown reason, you could try to use\ <br>     http://$translate(server):$translate(port)$translate(script)\ <br>     directly instead." <br>    }</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Nov 02, 2003 3:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-02T14:13:04-04:00</updated>

		<published>2003-11-02T14:13:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29357#p29357</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29357#p29357"/>
		<title type="html"><![CDATA[help to !translate script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29357#p29357"><![CDATA[
&lt;asdf&gt; translate eng fin script<br>&lt;foo&gt; asdf(6) Translating 'script' from 'eng' to 'fin'  wait..<br>&lt;foo&gt; asdf(6) Translation failed of unknown reason, you could try to use <a href="http://www.tranexp.com:2000/InterTran" class="postlink">http://www.tranexp.com:2000/InterTran</a> directly instead.<br><br>There is the error.<p>Statistics: Posted by Guest — Sun Nov 02, 2003 2:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-11-01T18:33:16-04:00</updated>

		<published>2003-11-01T18:33:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29305#p29305</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29305#p29305"/>
		<title type="html"><![CDATA[help to !translate script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29305#p29305"><![CDATA[
What's wrong in it? Any errors or something?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Nov 01, 2003 6:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-01T17:16:02-04:00</updated>

		<published>2003-11-01T17:16:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29302#p29302</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29302#p29302"/>
		<title type="html"><![CDATA[help to !translate script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29302#p29302"><![CDATA[
Can someone fix that script.. Actually i mean, that this script must to work via <a href="http://www.tranexp.com" class="postlink">www.tranexp.com</a><br><div class="codebox"><p>Code: </p><pre><code>#### Translator 3 © 1999, 2000 Per Johansson (dw@eggheads.org)## For eggdrop1.3/1.4/1.5# (might work in 1.1.5 also but I dont really care that bot version suck#  and only clueless morons use them still)## v1.0 (19/12-98) -- first release# v1.1 (21/12-98) -- added some user settings#                    added bindings for msg and dcc#                    made it friendly with multichanbots# v1.2 (20/9-99)  -- fixed security bug..wonder how many tcls that has it.#--# v2.0 (01/12-99) -- Totally recoded it should work with older tcl versions#                    take less resourses, be more simple to get working#                    and be more secure.#                    It's now async(non blocking) and requests are stacked.# v2.1 (03/12-99) -- Added check/fix for possible infinite loop#                    Better error handling (host is unreachable etc.)#                    Some code optimisation# v2.2 (06/12-99) -- Improved the url-x-encoder so it wont puke on some#                    chars.#--# v3.0 (10/01-00) -- Happy new year, and welcome to the year 2000!#                    Another lang db, so you have a choise which to use#                    the new one supports more languages.#                    Some new settings on how it should behave to querys#                    and sock# aint used as ID anymore since I reuse them#                    to damn fast :P#                    It now uses language codes in the commandline,#                    type !translate langs get the codes.## Installation:  gunzip translator3.0.tcl.gz#                mv translator3.0.tcl ~/botdir/scripts/#                echo source scripts/translator3.0.tcl &gt;&gt; ~/botdir/&lt;bot&gt;.conf#                .rehash## Upgrading: Same as above but first remove the old source line for#            translator in the conf file.## Usage: pub: !translate &lt;fromlang&gt; &lt;tolang&gt; &lt;text&gt;#        msg: /msg &lt;botnick&gt; translate &lt;fromlang&gt; &lt;tolang&gt; &lt;text&gt;#        dcc: .translate &lt;fromlang&gt; &lt;tolang&gt; &lt;text&gt;#        To get help use the same commands but without any args.#        To get language codes : /msg bot tr.. langs or !tr.. langs#        or .tra.. langs######## Note: I code all my stuff from scratch, I rip no other persons code#       If you seen some part of this somewhere else it has been copyed#       from me. Per "dw" Johansson and to hell with then and whoo DCU!######## PS: This script uses either altavista or tranexp so if they#     change anything it might stop working.#     When you use altavista one of the language must be english#     ie you must always translate to or from english.#     tranexp can translate between anylang.#     IMHO altavista does better translations then tranexp#     but tranexp has alot more languages to use.#     If someone knows of a better translator database on the net#     please let me know.#########&gt; SETTINGS &lt;### Set channels that !translate should work inset translate(chans) "#somechannel"# Userflag needed to use pub and msg translation#  default "o" (global or channel op)#  type "-" if the user don't need to have a botflagset translate(flag) "o"# altavista = english, french, german, italian, portuguese, spanish# tranexp   = brazilian portuguese, bulgarian, croatian, czech, danish#             dutch, english, european spanish, finnish, french, german#             greek, hungarian, icelandic,  italian, japanese,#             latin american spanish, norwegian, polish, portuguese,#             romanian, russian, serbian, slovenian, spanish,#             swedish, welsh# Set translate db 0 == altavista, 1 == tranexpset translate(db) 1# Show status/msgid/help in channel or in priv notice#  when issuing public command. 0 == in channel, 1 == in noticeset translate(target) 0## End of settings no need for edit below this point #########################################################if {![info exist translate(id)]} {  set translate(id) 0}set translate(help) "Usage: \002MSG:\002 /msg &lt;botnick&gt; translate &lt;args&gt;\    \002PUB:\002 !translate &lt;args&gt; \002DCC:\002 .translate &lt;args&gt;\    \002Args is:\002 &lt;fromlang&gt; &lt;tolang&gt; &lt;text to translate&gt; \002:\002\    type langs as a single arg after the command\    to get a list of valid language codes \    \002(\002dw@eggheads.org\002)\002"if {$translate(db)} {  set translate(server) "www.tranexp.com"  set translate(script) "/InterTran"  set translate(port) 2000  set translate(langs) "{Valid langcodes: pob(Brazilian Pourugese)\      bul(Bulgarian CP1251) cro(Croatian CP1250) che(Czech CP1250)\      dan(Danish) dut(Dutch) eng(English) spe(European Spanish)\      fin(Finnish) fre(French) ger(German) grk(Greek) hun(Hungarian CP1250)}  {ice(Icelandic) ita(Italian) jpn(Japanese ShiftJIS)\      spl(LatinAmericanSpanish) nor(Norwegian) pol(Polish ISO8859-2)\      poe(Portuguese) rom(Romanian CP1250) rus(Russian CP1251)\      sel(Serbian Latin) slo(Slovenian CP1250) spa(Spanish)\      swe(Swedish) wel(Welsh)}"  set translate(codes) "pob bul cro che dan dut eng spe fin fre ger grk\      hun ice ita jpn spl nor pol poe rom rus sel slo spa swe wel"} else {  set translate(server) "babelfish.altavista.com"  set translate(script) "/cgi-bin/translate"  set translate(port) 80  set translate(langs) "eng(English) fre(French) ger(German)\      ita(Italian) poe(Portuguese) spa(Spanish)"}set translate(chans) [string tolower $translate(chans)]proc tr_lang {froml tol} {  if {$froml == "eng"} {    switch $tol {      "fre" { return "en_fr" }      "ger" { return "en_de" }      "ita" { return "en_it" }      "por" { return "en_pt" }      "spa" { return "en_es" }      default { return "ERROR" }    }  } else {    if {$tol != "eng"} { return "ERROR" }    switch $froml {      "fre" { return "fr_en" }      "ger" { return "de_en" }      "ita" { return "it_en" }      "por" { return "pt_en" }      "spa" { return "es_en" }      default { return "ERROR" }    }  }}proc xploit {text} {  return [regexp {[\[\{\|\\]} $text]}if {$translate(target)} {  proc tranout {text} {    return "puthelp \"NOTICE \$ni :$text\""  }} else {  proc tranout {text} {    return "puthelp \"PRIVMSG \$ch :$text\""  }}proc urlencode {text} {  regsub -all {\%} $text "%25" text  set i [string length $text]  while {([regexp -nocase {[^a-z0-9%]} $text toh])&amp;&amp;!($i &lt; 0 )} {    scan "$toh" %c dec    regsub -all "\\${toh}" $text "%[format %X $dec]" text    incr i -1  }  if {$i &lt; 0} {putlog "Infinite loop something is very wrong: $text"}  return $text}proc incoming_translation {sid query where who id} {  global translate  if {![info exist translate($sid)]} {    set ind [gets $sid]    switch $ind {      "HTTP/1.1 100 Continue" {puts $sid "$query"lappend translate($sid) $indfconfigure $sid -blocking no -buffering full -buffersize 4096      }      "HTTP/1.0 200 OK" {lappend translate($sid) $indfconfigure $sid -blocking no -buffering full -buffersize 4096      }      default {putlog "Translator: Getting garbage on $sid ($ind) closing it"close $sidunset translate($sid)      }    }  } else {    lappend translate($sid) [read $sid 4096]  }  if {[eof $sid]} {    close $sid    set answer [join $translate($sid) \n]    if {0} {      #debug::dump returning file      set did [open debug.tran w+];      puts $did $answer;      close $did;      putlog "debug.tran written";    }    if {!$translate(db)} {      set answer [string range $answer\  [expr [string first {&lt;td align="left"&gt;&lt;br&gt;} $answer]+53]\  [expr [string first "&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" $answer]-1]]    } else {      set answer [string range $answer\  [expr [string first "&lt;TEXTAREA NAME=none COLS=73 ROWS" $answer]+36]\  [expr [string first "&lt;/TEXTAREA&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/FORM&gt;" $answer]-1]]    }    regsub -all "\n" $answer " " answer    if {![string length $answer]} {      set answer "Translation failed of unknown reason, you could try to use\  http://$translate(server):$translate(port)$translate(script)\  directly instead."    }    switch $where {      "server" { puthelp "PRIVMSG $who :${id} ${answer}" }      "dcc" { putdcc $who "${id} ${answer}" }    }    unset translate($sid)  }}proc pub_transl {ni uh ha ch text} {  global translate  if {![string match "*[string tolower "$ch"]*" "$translate(chans)"]} {    return 0  }  if {[xploit $text]} {    eval [tranout "\${ni}: This request will not be processed\any further, The attempt has been logged as abuse."]    putlog "$ha ${ni}!${uh}/$ch abused translate.tcl (${text})"    return 1  }  if {[llength $text] &lt; 3} {    if {[lindex $text 0] == "langs"} {      foreach part $translate(langs) {eval [tranout $part]      }    } else {      eval [tranout $translate(help)]    }    return 1  }  set froml [string tolower [lindex $text 0]]  set tol [string tolower [lindex $text 1]]  set text [lreplace $text 0 1]  if {!$translate(db)} {    set lp [tr_lang $froml $tol]    if {$lp == "ERROR"} {      eval [tranout "Error in language codes use !translate langs for help"]      return 1    }    set query "doit=done&amp;lp=${lp}&amp;urltext=[urlencode $text]"  } else {    if {([lsearch $translate(codes) $froml] == -1) ||\([lsearch $translate(codes) $tol] == -1)} {      eval [tranout "Error in language codes use !translate langs for help"]      return 1    }    set query "url=&amp;topframe=yes&amp;type=text&amp;text=[urlencode\$text]&amp;from=${froml}&amp;to=${tol}"  }  if {[catch {set sid [socket -async $translate(server) $translate(port)]}\      emsg]} {    putlog "Translator: Error($emsg)"    eval [tranout "\${ni}: Error($emsg)"]    return 1  }  set id ${ni}([incr translate(id)])  eval [tranout "\${id} Translating '${text}' from '${froml}'\      to '${tol}'  wait.."]  fconfigure $sid -blocking 0 -buffering line  fileevent $sid readable "incoming_translation $sid $query server $ch\      [split $id]"  if {$translate(db)} {    puts $sid "POST $translate(script)/ HTTP/1.0\\nReferer: http://www.tranexp.com:2000/InterTran\\nConnection: Keep-Alive\\nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\\nPragma: no-cache\\nHost: $translate(server)\\nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\\nAccept-Encoding: gzip\\nAccept-Language: en\\nAccept-Charset: iso-8859-1,*,utf-8\\nContent-type: application/x-www-form-urlencoded\\nContent-Length: [expr [string length $query] +2]\n"    puts $sid "\n$query"  } else {    puts $sid "POST $translate(script)/ HTTP/1.1\\nReferer: http://babelfish.altavista.com/cgi-bin/translate?\\nConnection: Keep-Alive\\nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\\nPragma: no-cache\\nHost: $translate(server)\\nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\\nAccept-Encoding: gzip\\nAccept-Language: en\\nAccept-Charset: iso-8859-1,*,utf-8\\nContent-type: application/x-www-form-urlencoded\\nContent-Length: [expr [string length $query] +2]\n"  }    flush $sid  return 1}proc msg_transl {ni uh ha text} {  global translate  if {[xploit $text]} {    puthelp "PRIVMSG $ni :This request will not be processed any further,\The attempt has been logged as abuse."    putlog "$ha ${ni}!${uh}/MSG abused translate.tcl (${text})"    return 1  }  if {[llength $text] &lt; 3} {    if {[lindex $text 0] == "langs"} {      foreach part $translate(langs) {        puthelp "PRIVMSG $ni :$part"      }    } else {      puthelp "PRIVMSG $ni :$translate(help)"    }    return 1  }  set froml [string tolower [lindex $text 0]]  set tol [string tolower [lindex $text 1]]  set text [lreplace $text 0 1]  if {!$translate(db)} {    set lp [tr_lang $froml $tol]    if {$lp == "ERROR"} {      puthelp  "PRIVMSG $ni :Error in language codes use\  !translate langs for help"      return 1    }    set query "doit=done&amp;lp=${lp}&amp;urltext=[urlencode $text]"  } else {    if {([lsearch $translate(codes) $froml] == -1) ||\        ([lsearch $translate(codes) $tol] == -1)} {      puthelp  "PRIVMSG $ni :Error in language codes use\  !translate langs for help"      return 1    }    set query "url=&amp;topframe=yes&amp;type=text&amp;text=[urlencode\        $text]&amp;from=${froml}&amp;to=${tol}"  }  if {[catch {set sid [socket -async $translate(server) $translate(port)]}\      emsg]} {    putlog "Translator: Error($emsg)"    puthelp "PRIVMSG $ni :Error($emsg)"    return 1  }  set id ${ni}([incr translate(id)])  puthelp "PRIVMSG $ni :${id} Translating '${text}' from '${froml}'\      to '${tol}'  wait.."  fconfigure $sid -blocking 0 -buffering line  fileevent $sid readable "incoming_translation $sid $query server $ni\      [split $id]"  if {$translate(db)} {    puts $sid "POST $translate(script)/ HTTP/1.0\        \nReferer: http://www.tranexp.com:2000/InterTran\        \nConnection: Keep-Alive\        \nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\        \nPragma: no-cache\        \nHost: $translate(server)\        \nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\        \nAccept-Encoding: gzip\        \nAccept-Language: en\        \nAccept-Charset: iso-8859-1,*,utf-8\        \nContent-type: application/x-www-form-urlencoded\        \nContent-Length: [expr [string length $query] +2]\n"    puts $sid "\n$query"  } else {    puts $sid "POST $translate(script)/ HTTP/1.1\        \nReferer: http://babelfish.altavista.com/cgi-bin/translate?\        \nConnection: Keep-Alive\        \nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\        \nPragma: no-cache\        \nHost: $translate(server)\        \nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\        \nAccept-Encoding: gzip\        \nAccept-Language: en\        \nAccept-Charset: iso-8859-1,*,utf-8\        \nContent-type: application/x-www-form-urlencoded\        \nContent-Length: [expr [string length $query] +2]\n"  }  flush $sid  return 1}proc dcc_transl {ha idx text} {  global translate  if {[xploit $text]} {    putdcc $idx "This request will not be processed any further,\The attempt has been logged as abuse."    putlog "${ha}!DCC abused translate.tcl (${text})"    return 1  }  if {[llength $text] &lt; 3} {    if {[lindex $text 0] == "langs"} {      foreach part $translate(langs) {        putdcc $idx $part      }    } else {      putdcc $idx $translate(help)    }    return 1  }  set froml [string tolower [lindex $text 0]]  set tol [string tolower [lindex $text 1]]  set text [lreplace $text 0 1]  if {!$translate(db)} {    set lp [tr_lang $froml $tol]    if {$lp == "ERROR"} {      putdcc $idx "Error in language codes use !translate langs for help"      return 1    }    set query "doit=done&amp;lp=${lp}&amp;urltext=[urlencode $text]"  } else {    if {([lsearch $translate(codes) $froml] == -1) ||\        ([lsearch $translate(codes) $tol] == -1)} {      putdcc $idx "Error in language codes use !translate langs for help"      return 1    }    set query "url=&amp;topframe=yes&amp;type=text&amp;text=[urlencode\        $text]&amp;from=${froml}&amp;to=${tol}"  }  if {[catch {set sid [socket -async $translate(server) $translate(port)]}\      emsg]} {    putlog "Translator: Error($emsg)"    putdcc $idx "Translator: Error($emsg)"    return 1  }  set id ${ha}([incr translate(id)])  putdcc $idx "${id} Translating '${text}' from '${froml}' to '${tol}'\      wait.."  fconfigure $sid -blocking 0 -buffering line  fileevent $sid readable "incoming_translation $sid $query dcc $idx\      [split $id]"  if {$translate(db)} {    puts $sid "POST $translate(script)/ HTTP/1.0\        \nReferer: http://www.tranexp.com:2000/InterTran\        \nConnection: Keep-Alive\        \nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\        \nPragma: no-cache\        \nHost: $translate(server)\        \nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\        \nAccept-Encoding: gzip\        \nAccept-Language: en\        \nAccept-Charset: iso-8859-1,*,utf-8\        \nContent-type: application/x-www-form-urlencoded\        \nContent-Length: [expr [string length $query] +2]\n"    puts $sid "\n$query"  } else {    puts $sid "POST $translate(script)/ HTTP/1.1\        \nReferer: http://babelfish.altavista.com/cgi-bin/translate?\        \nConnection: Keep-Alive\        \nUser-Agent: Mozilla/4.61 \[en\] (X11; I; Linux 2.2.13 i586; Nav)\        \nPragma: no-cache\        \nHost: $translate(server)\        \nAccept: image/gif, iimage/jpeg, image/pjpeg, image/png, */*\        \nAccept-Encoding: gzip\        \nAccept-Language: en\        \nAccept-Charset: iso-8859-1,*,utf-8\        \nContent-type: application/x-www-form-urlencoded\        \nContent-Length: [expr [string length $query] +2]\n"  }  flush $sid  return 1}bind pub $translate(flag)|$translate(flag) !translate pub_translbind msg $translate(flag)|$translate(flag) translate msg_translbind dcc -|- translate dcc_translputlog "Translator 3.0 by dw loaded.."</code></pre></div><p>Statistics: Posted by Guest — Sat Nov 01, 2003 5:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
