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 


Separating numbers with a ","?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Psiho_c
Newbie cheater
Reputation: 0

Joined: 11 Feb 2016
Posts: 16

PostPosted: Tue Sep 14, 2021 9:55 am    Post subject: Separating numbers with a ","? Reply with quote

Non-main English and dyslectic

Is there, or can someone create, an extension that will show numbers separately when writing or otherwise?

Like if I type 390423523 (random number btw) that is how it will show. What I want, is when I type it, to add a "," whenever there are 3 numbers. So as I start typing the 1st 4 numbers, it will appear 3,904. As I carry on, the end number to show (including after I press ok):

390,423,523

As this makes a life difference.

Or even when after pressing ok it shows if it's too much.

If you have windows 10, or just try your phones' calculator. You will have exactly the same, as your time, the , will be added automatically making life easier.

and yes, if there is or someone adds, please provide simples guide for me as I never used an extension and have no clue how to add it.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 179

Joined: 25 Jan 2006
Posts: 8284
Location: 127.0.0.1

PostPosted: Tue Sep 14, 2021 2:30 pm    Post subject: Reply with quote

You can find stuff like this on Google pretty easily.
https://stackoverflow.com/a/10992898

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Psiho_c
Newbie cheater
Reputation: 0

Joined: 11 Feb 2016
Posts: 16

PostPosted: Tue Sep 14, 2021 3:38 pm    Post subject: Reply with quote

atom0s wrote:
You can find stuff like this on Google pretty easily.


Please elaborate.

As I said, I have 0 knowledge of what is shown. There are codes I don't understand, as in which is the one I need. I copy-pasted one but one but none worked. Unless its not Table -> Luna scrip where I need to add them as like I said, I don't know where to add them
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 412

Joined: 09 May 2003
Posts: 23748
Location: The netherlands

PostPosted: Wed Sep 15, 2021 1:36 am    Post subject: Reply with quote

you can overide the addresslist display value event and add some ,'s
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Psiho_c
Newbie cheater
Reputation: 0

Joined: 11 Feb 2016
Posts: 16

PostPosted: Thu Sep 16, 2021 3:54 am    Post subject: Reply with quote

Dark Byte wrote:
you can override the address list display value event and add some ,'s


Sorry, I really have no clue. I don't understand anything. The link the previous person gave, again, I have no clue which is the one I need to use and where to add it. I copy-pasted one by one in the Luna scrip but none worked. That's all my knowledge using them goes
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 412

Joined: 09 May 2003
Posts: 23748
Location: The netherlands

PostPosted: Thu Sep 16, 2021 4:50 am    Post subject: Reply with quote

ok, it's not really for each address but you can do it per address

e.g:
Code:

function comma_value(amount)
  local formatted = amount
  while true do
    formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
    if (k==0) then
      break
    end
  end
  return formatted
end

AddressList[0].OnGetDisplayValue=function(mr, valuestring)
  local v=tonumber(valuestring)
  if v then
    return true, comma_value(v)
  else
    return false
  end
end

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ByTransient
Expert Cheater
Reputation: 1

Joined: 05 Sep 2020
Posts: 201

PostPosted: Thu Sep 16, 2021 5:24 am    Post subject: Reply with quote

Psiho_c wrote:
atom0s wrote:
You can find stuff like this on Google pretty easily.


Please elaborate.

As I said, I have 0 knowledge of what is shown. There are codes I don't understand, as in which is the one I need. I copy-pasted one but one but none worked. Unless its not Table -> Luna scrip where I need to add them as like I said, I don't know where to add them


Code:

if frm then frm.Destroy () end
frm=createForm()
edt1=createEdit(frm)
lbl1=createLabel(frm)
lbl1.top=50

function format_int(number)

  local i, j, minus, int, fraction = tostring(number):find('([-]?)(%d+)([.]?%d*)')

  -- reverse the int-string and append a comma to all blocks of 3 digits
  int = int:reverse():gsub("(%d%d%d)", "%1,")

  -- reverse the int-string back remove an optional comma and put the
  -- optional minus and fractional part back
  return minus .. int:reverse():gsub("^,", "") .. fraction
end

edt1.OnChange=function()
lbl1.caption=assert(format_int(edt1.text)
end

--assert(format_int(1234567)           == '1,234,567')
--assert(format_int(123456789)         == '123,456,789')
--assert(format_int(123456789.1234)    == '123,456,789.1234')
---assert(format_int(-123456789.)


like..
Back to top
View user's profile Send private message
LeFiXER
Master Cheater
Reputation: 0

Joined: 02 Sep 2011
Posts: 279
Location: 0x90

PostPosted: Thu Sep 16, 2021 6:07 am    Post subject: Reply with quote

I have made a small extension for you to view the values with the thousandth separator for each of the values held within the table.

Place the file in:
Quote:

C:\Program Files\Cheat Engine 7.3\autorun


Restart Cheat Engine and it will automatically load. This will add a new menu item to the main form of Cheat Engine, once clicked, it will display the Lua Engine window with all the formatted values of each table entry and its appropriate number representative of the entry.



Thousandify.lua
 Description:

Download
 Filename:  Thousandify.lua
 Filesize:  1.12 KB
 Downloaded:  29 Time(s)

Back to top
View user's profile Send private message
Psiho_c
Newbie cheater
Reputation: 0

Joined: 11 Feb 2016
Posts: 16

PostPosted: Fri Sep 17, 2021 4:37 am    Post subject: Reply with quote

LeFiXER wrote:
I have made a small extension for you to view the values with the thousandth separator for each of the values held within the table.

Place the file in:
Quote:

C:\Program Files\Cheat Engine 7.3\autorun


Restart Cheat Engine and it will automatically load. This will add a new menu item to the main form of Cheat Engine, once clicked, it will display the Lua Engine window with all the formatted values of each table entry and its appropriate number representative of the entry.


Because of my dyslecsia, I reinstalled CE. It says clearly 7.3. I opened the path and added the file you added as it its. as I still had no luck

I opened cheat ending. Thousandify Values shows up cleary. I click on it.

Click on execute.

I get this:

Error:C:\Program Files\Cheat Engine 7.3\autorun\Thousandify.lua:18: attempt to index a nil value (local 'mr')

No changes to values.


I tried all the other codes that were posted Table - Luna script - execute. None worked. Again, I have no clue what I'm doing and just do whatever look what I need to do.

And again. I reinstaled CE 7.3 and copy pasted the file is said folder without doing anything to it.

I see it was downloaded 10 times, but no thanks or its not working. Anyone else who downloads the file, can they give a feedback so I know at least if its on my part that it's not working
Back to top
View user's profile Send private message
LeFiXER
Master Cheater
Reputation: 0

Joined: 02 Sep 2011
Posts: 279
Location: 0x90

PostPosted: Fri Sep 17, 2021 10:49 am    Post subject: Reply with quote

It doesn't change values, only displays the current values available with the thousands separator. Of course, there have to be actual entries in the table for that. I should mention that it is a very crude implementation of what you want to achieve.
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 Extensions 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