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 


Print without newline?

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

Joined: 19 Aug 2014
Posts: 2

PostPosted: Tue Aug 19, 2014 3:25 am    Post subject: Print without newline? Reply with quote

Code:
offset = AOBScan("94 00 11 00 24 00 1C 00 00")
count=stringlist_getCount(offset) - 1
x = 0
for x = 0, count do
offset[x] = offset.getString(x)
newoffset = tonumber(offset[x], 16) + 0x45
print(string.format("%02X", newoffset))
AESKey = readBytes(string.format("%02X", newoffset), 16, true)
y = 1
for y = 1, 16 do
print(string.format("%02X", AESKey[y]))
end
end


Basically I want the AESKey printed like that, but since print always applies a \n, the data is a mess.
I tried googling around and found the io.write() function but nothing ever gets displayed in the lua engine (possibly has no stdout?).
So I'm hoping someone can point me in the right direction.

Thanks alot,
Kaine
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Tue Aug 19, 2014 4:08 am    Post subject: Reply with quote

Try this
Code:
local offset = AOBScan("94 00 11 00 24 00 1C 00 00");
if (not offset) then return print("Couldn't find it"); end
for x = 0, offset.Count-1 do
   local newoffset = ('0x' .. offset.getString(x)) + 0x45 ;
   print(string.format("%02X", newoffset))
   local AESKey = readBytes(string.format("%02X", newoffset), 16, true)
   for key,value in pairs(AESKey) do
      AESKey[key] = string.format("%02X",value);
   end
   print(table.concat(AESKey, " "));
end

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
DarkKaine
How do I cheat?
Reputation: 0

Joined: 19 Aug 2014
Posts: 2

PostPosted: Wed Aug 27, 2014 7:24 am    Post subject: Reply with quote

Could have sworn I replied to this O_O.
Thank you so much, this works perfectly!
*Back to RE*
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