• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community Welcome Help & Support Tutorials & Tools Community Activity Guides Tutorial: Google Translate and Super Setmsg

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

Pages (2): 1 2 Next »
Tutorial: Google Translate and Super Setmsg
Offline darkwind
01-18-2020, 07:05 PM, (This post was last modified: 09-02-2020, 08:55 PM by darkwind.)
#1
Frontier Sheriff
Posts: 1,153
Threads: 138
Joined: Oct 2019
Staff roles:
Coding Developer

Inspired by this guide I wished to improve things, to make using Google Translator even easier
Plus having setmsg working across all characters, instead of binding every time phrases for every account.

As in the guide which me inspired, you need to install this program

Basically, you create notepad file named Something.ahk
you insert code there, slightly redacting it, Right Click at file and choose "Run Script", your program is running.



If you wish to have setmsg working across all characters, you make something like this. All those phrases are working, when I write .g1 or .w1 or .s1 in chat. They are automatically replaced with what is written there.
[+]Setmsg
Code:
Hotstring("EndChars", "")
:*:.g1::You phrase number 1
:*:.g2::You phrase number 2
:*:.g3::You phrase number 3

:*:.s1::You phrase number 4
:*:.s2::You phrase number 5

:*:.w1::You phrase number 6
:*:.w2::You phrase number 7
Due to being external, it works across all characters.
+You can have as much setmsg phrases as you wish. Feel free to use from .s1 to .s9, from .g1 to .g9, and e.t.c.



Next thing enables Ctrl+V also knows as Paste, copying text from buffer/clipboard to Freelancer chat (you can insert things into the clipboard by selecting something in Google Translate and pressing Ctrl+C or right-click and copy and e.t.c.)
[+]Working Ctrl V
Code:
#IfWinActive Freelancer
^v::
  Temp := StrReplace(clipboard, "`r`n", " ")
  SendInput, %Temp%
  return
Two differences from guide I used as inspiration. Mine works faster due to SendInput usage(1000 times faster), and if you have newlines, they are automatically replaced to whitespaces to not have auto pressing mistakes.



Also I made thing which copies six last phrases from chat. Which you can insert immediately into Google Translate! Without opening log file. Resolves problem of not having ability to copy from chat
[+]Copying and Pasting last six phrases from log file
Code:
Extractor()
{
Array := Array()
    Loop, read, %A_MyDocuments%\My Games\Freelancer\DSAce.log
    {
        last_line := A_LoopReadLine

        numberWhere := RegExMatch(last_line, "^.*\d{2}\].(?!(Death:))(?!(Tip:))[^\s]+.: .*$")
        if (numberWhere > 0)
        {    
            Array.InsertAt(0,last_line)
            RemovedValue := Array.RemoveAt(6)
        }
    }
    
    Counter:=5
    While(Counter >= 0)
    {
        Temp := Array[Counter]
        SendInput, %Temp%`r
        Counter--
    }
    return
}    

#IfWinNotActive Freelancer
!v::
  Extractor()
  return    

:*:.log::
  Extractor()
  return
It's activated by pressing Alt+V or by writing .log
to work correctly this C:\Users\User\Documents\My Games\Freelancer\DSAce.log address should be leading to your log file, correct it if it's wrong.



And the last thing I tried, to make an automated thing, what you write in chat to be translated into the English language on its own. It works slightly weird, but it works.

You write .gt in your ingame chat, which makes it dissapear(You can replace it to something different, to your language letters), then write in your language phrases, and press Esc canceling phrase(or pressing Enter) to send it, it will translate anyway.
It requires for you to have Freelancer working in window, and then it opens Google Chrome, automatically translates, copies from there, and returns to game to copy into chat. You remain ability to press Enter to send it or not to send it.
[+]Write while translating
Code:
:*:.gt::
  Input, Temp, V, {Esc}{Enter}.
  Run, Chrome.exe
  Sleep, 1000
  IfWinNotActive, Freelancer
  {
    Temp := StrReplace(Temp, A_Space, "%20")
    SendInput, {Raw}

https://translate.google.com/#view=home&op=translate&sl=auto&tl=en&text=%Temp%
    SendInput, {Enter}
    Sleep, 5000
    SendInput, ^+s
    Sleep, 500
    SendInput, {F6}
    Sleep, 500
    SendInput, ^c
    SendInput, ^{F4}
    Sleep, 500
    FoundPos := InStr(clipboard, "text=") + 5
    Temp := SubStr(clipboard,FoundPos)
    Temp := StrReplace(Temp, "%20", " ")
    Temp := StrReplace(Temp, "%2C", ",")
    Temp := StrReplace(Temp, "%3F", "?")
    SendInput, {Esc}{Enter}%Temp%
  }
  
  return



Anyway, all those things combined into one scripting file
[+]Full Code
Code:
#IfWinActive Freelancer
#MaxThreadsPerHotkey 255
Hotstring("EndChars", "")

Extractor()
{
Array := Array()
    Loop, read, C:\Users\User\Documents\My Games\Freelancer\DSAce.log
    {
        last_line := A_LoopReadLine

        numberWhere := RegExMatch(last_line, "^.*\d{2}\].(?!(Death:))(?!(Tip:))[^\s]+.: .*$")
        if (numberWhere > 0)
        {    
            Array.InsertAt(0,last_line)
            RemovedValue := Array.RemoveAt(6)
        }
    }
    
    Counter:=5
    While(Counter >= 0)
    {
        Temp := Array[Counter]
        SendInput, %Temp%`r
        Counter--
    }
    return
}    

:*:.g1::You phrase number 1
:*:.g2::You phrase number 2
:*:.g3::You phrase number 3

:*:.s1::You phrase number 4
:*:.s2::You phrase number 5

:*:.w1::You phrase number 6
:*:.w2::You phrase number 7

:*:btw::by the way
return

:*:.gt::
  Input, Temp, V, {Esc}{Enter}.
  Run, Chrome.exe
  Sleep, 1000
  IfWinNotActive, Freelancer
  {
    Temp := StrReplace(Temp, A_Space, "%20")
    SendInput, {Raw}

https://translate.google.com/#view=home&op=translate&sl=auto&tl=en&text=%Temp%
    SendInput, {Enter}
    Sleep, 5000
    SendInput, ^+s
    Sleep, 500
    SendInput, {F6}
    Sleep, 500
    SendInput, ^c
    SendInput, ^{F4}
    Sleep, 500
    FoundPos := InStr(clipboard, "text=") + 5
    Temp := SubStr(clipboard,FoundPos)
    Temp := StrReplace(Temp, "%20", " ")
    Temp := StrReplace(Temp, "%2C", ",")
    Temp := StrReplace(Temp, "%3F", "?")
    SendInput, {Esc}{Enter}%Temp%
  }
  
  return
  

^v::
  Temp := StrReplace(clipboard, "`r`n", " ")
  SendInput, %Temp%
  return

#IfWinNotActive Freelancer
!v::
  Extractor()
  return    

:*:.log::
  Extractor()
  return

All except for "Write while translating" works very well, last thing is working too, but it just... you know, slightly less certain thing to use due to windows switching.

Perhaps it is possible to improve the last thing, but I need to find free API which would be translating it for me.

P.S. For people who have a hard time to follow this guide. Configured exe to enable CtrlV only. You can download here.


Interstellar Autogit Ctrl-V Encryptor Discovery At Linux
Dark Tools DarkBot DarkLint DarkStat DarkMap
Reply  
Offline Liberty.In
01-18-2020, 07:32 PM,
#2
Banned
Posts: 224
Threads: 23
Joined: Jul 2019

Kodzima: I am genius!
darkwind: Hold my beer...

User was banned for: https://discoverygc.com/forums/showthrea...tid=177105
Time left: (Permanent)
Reply  
Offline Dom!no
07-12-2020, 05:33 PM,
#3
Member
Posts: 17
Threads: 3
Joined: Jul 2020

Isn't this program banned on the server? It seems like you can use it to configure macros for strafe
Reply  
Offline Groshyr
07-12-2020, 05:36 PM,
#4
Member
Posts: 3,805
Threads: 377
Joined: Mar 2018

this thing doesn't let you strafe, it only enables CRTL+V option
Reply  
Offline Dom!no
07-12-2020, 05:52 PM,
#5
Member
Posts: 17
Threads: 3
Joined: Jul 2020

Like no. You can also use autohotkey to record actions and when it starts, the script will perform actions related to the keyboard.
I do not think that you need to be a Superintelligent who form Nomads to study these programs length and breadth
Reply  
Offline Save My Soul
07-12-2020, 05:55 PM,
#6
Kittens & Hatred
Posts: 578
Threads: 40
Joined: Feb 2013

Then you'll be banned for cheating. But if you use this, not modified, script only for copy and paste, then everything will be fine.

[Image: sig-gitto-gudo-da-da.png]
  Reply  
Offline Shiki
07-12-2020, 05:57 PM, (This post was last modified: 07-12-2020, 05:57 PM by Shiki.)
#7
UwU
Posts: 2,754
Threads: 121
Joined: May 2015

i feel like this is illegal

i mean macro is not really modifying anything, just just press buttons for you

[Image: loyolabully.gif]
[Image: Q5rd5YU.png]
Reply  
Offline Dom!no
07-12-2020, 05:57 PM, (This post was last modified: 07-12-2020, 06:12 PM by Dom!no.)
#8
Member
Posts: 17
Threads: 3
Joined: Jul 2020

I want to hear the approval of the Game Master about this and not be accidentally banned for running the autohotkey anticheat process
Reply  
Offline Groshyr
07-12-2020, 06:03 PM,
#9
Member
Posts: 3,805
Threads: 377
Joined: Mar 2018

but the administration doesn't exist. they're GAME MASTERS now
Reply  
Offline Corile
07-12-2020, 08:15 PM,
#10
C::iemka pl
Posts: 3,248
Threads: 267
Joined: Apr 2014

Macros with AHK are difficult to catch unless the launcher/game is scanning running processes in which case you have much bigger problems. The thing about gameplay macros is that they tend to be very obvious - chainfire or boxing is simple to figure out. I don't know about caps cause I never flew them. There were macros for turret steering that nobody seemed to mind, I also had macros for typing /pingtarget and /showscan$ commands for a while and I never got sanctioned so you know.

It's all fine.




Reflections on the Revolution in Gallia
Custodi // High City of Heraklion // The Cult of Archangels
Log Filter // Post Creator // Manhattan
  Reply  
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2025 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode