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 


LUa - TRAINER

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

Joined: 19 Sep 2013
Posts: 27

PostPosted: Wed Apr 08, 2015 1:03 pm    Post subject: LUa - TRAINER Reply with quote

Hi, I have a LUa code:

Code:
UDF1.OnClose = function(sender) closeCE() return caFree end
mrMiny = getAddressList().getMemoryRecordByDescription('Miny')

function CEButton1Click(sender)
  mrMiny.Value  = mrMiny.Value + 10
  if not mrMiny.Active then mrMiny.Active = true end
end

form_show(UDF1)
strings_add(getAutoAttachList(), "MineSweeper")


I have problem


Code:
Error:[string "UDF1.OnClose = function(sender) closeCE() r..."]:5: attempt to perform arithmetic on field 'Value' (a string value)



someone help me convert it to make it so that I press my button and changes the value e. g. , for 9999? I would be very grateful
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Wed Apr 08, 2015 3:18 pm    Post subject: Reply with quote

Try this:
Code:
mrMiny.Value  = tostring(tonumber(mrMiny.Value) + 10);

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

Joined: 19 Sep 2013
Posts: 27

PostPosted: Mon Apr 13, 2015 1:54 pm    Post subject: Reply with quote

Error:[strin "UDF1.OnClose=function(sender) closeCE() r..."]:1:attempt to index global 'UDF1' ( a nil value)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Apr 13, 2015 3:21 pm    Post subject: Reply with quote

what name did you give your form? (Assuming you made one)
_________________
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
dadajszen
Cheater
Reputation: 0

Joined: 19 Sep 2013
Posts: 27

PostPosted: Tue Apr 14, 2015 9:48 am    Post subject: Reply with quote

Still the same Error: [string "UDF1. OnClose = function (sender) closeCE () r. . . "]: 5: attempt to perform arithmetic on field ' value ' (a string value)


My LUA:

Code:
UDF1.OnClose = function(sender) closeCE() return caFree end
mrMiny = getAddressList().getMemoryRecordByDescription('Miny')

function ButtonClick(sender)
  mrMiny.Value  = mrMiny.Value + 10
  if not mrMiny.Active then mrMiny.Active = true end
end

form_show(UDF1)
strings_add(getAutoAttachList(), "MineSweeper")




Miny - ITS MY POINTER
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Tue Apr 14, 2015 9:58 am    Post subject: Reply with quote

mrMiny.Value = tonumber(mrMiny.Value) + 10
_________________
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
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