StealthBot.net: Language Translation Script - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Language Translation Script

#1 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted December 14, 2009 - 04:10 AM

Language Translation Script

Author: FiftyToo
Version: 1.0 Revision 0
Description: Translates the specified string from one language to another.

Installation Notes:
Unzip the file and place the vbs file in the scripts folder.
http://fiftytoo.no-i...Translation.zip


Commands:
trans [initial language] [distination language] [word or phrase] = Translates the specified word or phrase to a specified language. A list of languages is in the command manager for this command under Special Notes.[/indent]

Example Usages:
.trans en fr This message will be translated from English to French

#2 User is offline   gustav Icon

  • new-bie
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: November-27 09

Posted December 31, 2009 - 03:31 PM

i tried but its not working i instaled and reconect and reload the scripts to and it dont work ( i dont get it)
Mr_hotwire

#3 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted December 31, 2009 - 10:04 PM

Works fine for me, try the example given by T-B-N?

Oh and you must of forgotten to replace "& # 3 9 ;" with " ' ".

Example:

[11:02:10] <Gwypaas> .trans en fr This message will be translated from English to French
[11:02:10] <Northwind> Translation in progress (English/French)...
[11:02:10] <Northwind Ce message sera traduit de l& # 3 9 ;anglais à français>

NOTE: "& # 3 9 ;" means without spaces but the forum automatically makes it into a " ' "

This post has been edited by Neco: December 31, 2009 - 10:05 PM


#4 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted January 01, 2010 - 11:32 AM

I tried adapting this script to work with Google's translation service, because of the massive list but it half works..
It can translate anything to english, but if you try to translate anything to anything but english, it fails!
(eg es->en works, but en->es is interpreted as en->en, es->fr is interpreted as es->en)

For some reason, the language your translating to is stuck on English!

I've tried many things.. and I've even resorted to sniffing the request header of various browsers (and using those) but that didn't work.

It parses the command correctly, and I have confirmed this.

Sub Translate(strText, sl, tl)

	On Error Resume Next

	strData = "hl=&ie=UTF-8&text=" & strText & "&sl=" & sl & "&tl=" & tl &"#"
	'// Send the POST request
	
	Call oHTTP.Open("POST", "http://translate.google.com.au/translate_t?", False)
	
	Call oHTTP.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7")
	Call oHTTP.SetRequestHeader("Content-type", "application/x-www-form-urlencoded")
	Call oHTTP.Send(strData)
	'AddChat vbCyan, "hl=&ie=UTF-8&text=" & strText & "&sl=" & sl & "&tl=" & tl &"#"&sl & "|" & tl & "|" & strText
	
	
	strHTML = oHTTP.ResponseText
	'AddChat vbYellow, oHTTP.status
    astrHTML = Split(strHTML, "title=" & Chr(34) & strText & Chr(34) )
	AddChat vbYellow, strHTML
	
	pos1 = InStr(astrHTML(1), ">")
	pos2 = InStr(astrHTML(1), "<")
	'// Parse the results
	'pos1 = InStr(strHTML, "dsttext")
	'pos1 = InStr(pos1 + 1, strHTML, "dsttext")
	'pos1 = InStr(pos1, strHTML, ">")
	'pos2 = InStr(pos1, strHTML, "<")
	
	strTrans = Mid(astrHTML(1), pos1+1, pos2-pos1-1)
	
	If strTrans = "" Then
		AddQ "/me Error Translating... sorry!!"
		
	Else
		'AddQ "/me " & strTrans
		AddChat vbCyan, strTrans
	End If
	
End Sub


Also, how do you edit a command? I've made it so it downloads google's entire list of languages (that it can translate to and from) this works 99.9%.. and this list is inserted into the command when it is created.. but how would I update this list?

UpdateLanguages is called before CreateCommands the objects are global.
Spoiler

This post has been edited by oblivious: January 01, 2010 - 11:35 AM


#5 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted January 02, 2010 - 03:24 PM

I fixed the issue, it was because of a question mark in the wrong place. I also fixed other issues which arose (such as needing to convert spaces to + and ? to it's hex rep. %3F

#6 User is offline   Name Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: May-17 10

Posted May 17, 2010 - 04:08 PM

Can't seem to stop the script. I deleted the translation script, rebooted, reloaded, deleted all file. It seems the script is still running. I even reconnected/disconnected. Is there a backdoor or am I doing something wrong.

#7 User is offline   smkyros Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 39
  • Joined: December-13 09

Posted May 18, 2010 - 04:25 PM

I have already taken the emote out but how would I add something to this, that if the command is whispered to the bot it returns the response as a whisper? If you whisper the bot now it just puts it in the channel like normal. I'd like it to whisper me back so I can use it in game etc. Thanks.

#8 User is offline   Dead_Cold Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: October-25 10

Posted March 15, 2011 - 10:22 PM

Hi
I have search the forums and cannot seem to find a fix for this issue, If there is a fix I am sorry to have double posted. I keep getting this error on the translation script
[04:16:20 PM] Scripting parsing error '1032' in bcp_translations_6.txt: (line 1; column 7)
 [04:16:20 PM] Invalid character
 [04:16:20 PM] Offending line: >> Spanish|Tu amigo * ha entrado en una partida * llamada *.|Tu amigo * ha salido de Battle.net

if someone knows the fix could you please tell me. I don't like red messages and its driving me nuts. :blink:

This post has been edited by Dead_Cold: March 15, 2011 - 10:24 PM


#9 User is offline   Dragon_Legion Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 423
  • Joined: October-08 09

Posted March 16, 2011 - 12:21 AM

View Postsmkyros, on May 18, 2010 - 09:25 AM, said:

I have already taken the emote out but how would I add something to this, that if the command is whispered to the bot it returns the response as a whisper? If you whisper the bot now it just puts it in the channel like normal. I'd like it to whisper me back so I can use it in game etc. Thanks.


you can use the .Source variable if you use a command or you can try cmd_variable.Respond "response" instead as well


View PostDead_Cold, on March 15, 2011 - 03:22 PM, said:

Hi I have search the forums and cannot seem to find a fix for this issue, If there is a fix I am sorry to have double posted. I keep getting this error on the translation script
[04:16:20 PM] Scripting parsing error '1032' in bcp_translations_6.txt: (line 1; column 7) [04:16:20 PM] Invalid character [04:16:20 PM] Offending line: >> Spanish|Tu amigo * ha entrado en una partida * llamada *.|Tu amigo * ha salido de Battle.net
if someone knows the fix could you please tell me. I don't like red messages and its driving me nuts. :blink:

that file shouldnt be in your scripts folder, if it is either you saved it wrong or you changed the bcp script. Download a fresh copy and use that

#10 User is offline   Dead_Cold Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: October-25 10

Posted March 16, 2011 - 10:54 AM

View PostDragon_Legion, on March 15, 2011 - 06:21 PM, said:

that file shouldnt be in your scripts folder, if it is either you saved it wrong or you changed the bcp script. Download a fresh copy and use that

Thanks, removed it and no more red messages B)

#11 User is offline   Simard Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 17
  • Joined: March-20 11

Posted March 23, 2011 - 07:41 AM

anybody can help me before i go sucide myself...

say i dont got translation folder i put the folder in all folder i got about stealhbot [03:39:09 AM] [BCP] You do not have a translations file. The translations file allows your channel patrons to use other Diablo non-english clients. Place it in your bot folder.


i dont understand this error
[03:23:29 AM] Scripting parsing error '1033' in Translation.vbs: (line 53; column 90)
[03:23:29 AM] Unterminated string constant
[03:23:29 AM] Offending line: >> .Description = "Votre ami est entré dans une partie Diablo II Lord of Destruction nommée .

trans [initial language] [distination language] [word or phrase] = Translates the specified word or phrase to a specified language. A list of languages is in the command manager for this command under Special Notes.[/indent]

what i type if i want to translate this --> Votre ami party_boy2 est entré dans une partie Diablo II Lord of Destruction nommée Clanqc Baal-58. to this Your friend party_boy2 entered a Diablo II Lord of Destruction game called Clanqc Baal-58.

thx for your help appreciate

This post has been edited by Simard: March 23, 2011 - 07:42 AM


#12 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted March 23, 2011 - 12:48 PM

Sorry guys, can't help you. I didn't write this script.

#13 User is offline   Dragon_Legion Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 423
  • Joined: October-08 09

Posted March 23, 2011 - 06:19 PM

View PostSimard, on March 23, 2011 - 12:41 AM, said:

anybody can help me before i go sucide myself...

say i dont got translation folder i put the folder in all folder i got about stealhbot [03:39:09 AM] [BCP] You do not have a translations file. The translations file allows your channel patrons to use other Diablo non-english clients. Place it in your bot folder.


i dont understand this error
[03:23:29 AM] Scripting parsing error '1033' in Translation.vbs: (line 53; column 90)
[03:23:29 AM] Unterminated string constant
[03:23:29 AM] Offending line: >> .Description = "Votre ami est entré dans une partie Diablo II Lord of Destruction nommée .

trans [initial language] [distination language] [word or phrase] = Translates the specified word or phrase to a specified language. A list of languages is in the command manager for this command under Special Notes.[/indent]

what i type if i want to translate this --> Votre ami party_boy2 est entré dans une partie Diablo II Lord of Destruction nommée Clanqc Baal-58. to this Your friend party_boy2 entered a Diablo II Lord of Destruction game called Clanqc Baal-58.

thx for your help appreciate


you want to delete the plugin version of bcp and update to the Script Version. That automatically downloads the translations file you need

#14 User is offline   Simard Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 17
  • Joined: March-20 11

Posted March 24, 2011 - 02:45 AM

View PostDragon_Legion, on March 23, 2011 - 06:19 PM, said:

you want to delete the plugin version of bcp and update to the Script Version. That automatically downloads the translations file you need


i dit and still got this error

[10:44:23 PM] [BCP] You do not have a translations file. The translations file allows your channel patrons to use other Diablo non-english clients. Place it in your bot folder.
[10:44:23 PM] [BCP] You can consult /phelp bcp for more information.

Posted Image

i got everything right i got the translation folder in all my folder

This post has been edited by Simard: March 24, 2011 - 02:58 AM


#15 User is offline   Dragon_Legion Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 423
  • Joined: October-08 09

Posted March 24, 2011 - 04:50 AM

ok, first off that is NOT the bcp_translations file that you have. Second, you didnt DELETE the bcp plugin, thats why you're getting the errors. Use "/delplugin bcp" in the bot and in your scripts folder of your bot put the file in the topic I linked you to. Thirdly, the bcp_translations file you put up isnt even a valid script format, should try deleting the file and re-saving it using The information in this topic

BCP from version 1.x has translated messages itself. 2.0.6 (the current version) will download the LATEST translations file (and has a hotfix for the french? issue) and use that in the bcp and spam the games correctly

#16 User is offline   Gaius Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: April-22 11

Posted May 25, 2011 - 11:29 PM

Hi all,
the translation seems to work between English and German for me only; between English and any other language, it just gets stuck at 'Translation in Progress', between English and Russian, I get runtime error 13.
Does this have anything to do with me logging in from Germany (only German translation works), or is it some other mistake?
Thanks for your help.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users