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 


I guess string.format

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Sun Jul 26, 2020 10:37 am    Post subject: I guess string.format Reply with quote

I have in a CEMEMO line 1 a string.
This string is "value, value".
Like this "1664, 544".
I am trying to set the value "1664" equal to x and the second value to y.
But how can I achieve that??
I have no idea what string.format does, all that I have found on google was not useful (for me) and didn't really understand how is it useful in their examples not cuz they explained it badly... (cuz I am dumb Embarassed )
I hope you can help me. : )

_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
Back to top
View user's profile Send private message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Sun Jul 26, 2020 10:52 am    Post subject: Reply with quote

assuming you are trying to make the mouse position recorder and you want to assign x,y from getMousePos()
you can do this:
Code:

local x,y = getMousePos()

or if you are trying to store the mouse positions use a table instead of a memo

_________________
hi
Back to top
View user's profile Send private message
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Sun Jul 26, 2020 11:02 am    Post subject: Reply with quote

srr, I thought you mean by "table" a "form" 🤦‍♂️
_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun Jul 26, 2020 11:19 am    Post subject: Reply with quote

If you must use CEMemo1 lines text for your mouse coordinate, as you wish:

Code:
txt = UDF1.CEMemo1.Lines.Text --- say  "1664,544"
x, y = txt:match("([^,]+),([^,]+)")
setMousePos(x, y)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4704

PostPosted: Sun Jul 26, 2020 11:31 am    Post subject: Reply with quote

https://www.lua.org/pil/20.3.html

This was written for Lua 5.0 (CE uses 5.3), but most of the information is still relevant.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Sun Jul 26, 2020 2:36 pm    Post subject: Reply with quote

Thank Ya All Very Happy
_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
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