Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Copy to Clipboard JIS encoding?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
nilum
How do I cheat?
Reputation: 0

Joined: 21 Dec 2014
Posts: 2

PostPosted: Sun Dec 21, 2014 1:21 am    Post subject: Copy to Clipboard JIS encoding? Reply with quote

I've given up on trying to use automatic text hookers like Chiitrans to translate Japanese games because it's too complicated to create custom hooks.

I can find the memory location where text is written with Cheat Engine and so I tried to make a script that would copy text to the clipboard (to be translated).

The text displays fine in address list, but when I use the script it seems to copy garbage to the clipboard.

Code:
al=getAddressList()
mr=addresslist_getMemoryRecord(al,0) --get the first entry in the list
lastValue=memoryrecord_getValue(mr)

writeToClipboard(lastValue)

function readValueTimer(t)
  local currentValue=memoryrecord_getValue(mr)
  if currentValue ~= lastValue then --value changed
    writeToClipboard(currentValue)
    lastValue=currentValue
  end
end

t1=createTimer(nil)
timer_setInterval(t1,100) --check every 1/100th second if the value has changed
timer_onTimer(t1,readValueTimer)


This is what should be copied:

「盗人は罪の重さを知る」

But instead I get this:

?u?l?͍߂̏d??m??v

Suggestions?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Dec 21, 2014 5:23 am    Post subject: Re: Copy to Clipboard JIS encoding? Reply with quote

Code:
al=getAddressList()
mr=addresslist_getMemoryRecord(al,0) --get the first entry in the list
lastValue=memoryrecord_getValue(mr)

writeToClipboard(  ansiToUtf8(lastValue)   )

function readValueTimer(t)
  local currentValue=memoryrecord_getValue(mr)
  if currentValue ~= lastValue then --value changed
    writeToClipboard(  ansiToUtf8(currentValue)   )
    lastValue=currentValue
  end
end

t1=createTimer(nil)
timer_setInterval(t1,100) --check every 1/100th second if the value has changed
timer_onTimer(t1,readValueTimer)

_________________
Back to top
View user's profile Send private message MSN Messenger
nilum
How do I cheat?
Reputation: 0

Joined: 21 Dec 2014
Posts: 2

PostPosted: Sun Dec 21, 2014 1:27 pm    Post subject: Reply with quote

Thanks that worked perfectly!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites