 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Dec 29, 2013 4:20 am Post subject: |
|
|
faizangmc wrote: | mgr.inz.player when i run the script it gives this error :-
Code: | Error:[string "Nationality = "[[[Cricket2013.exe+005D4D20]..."]:47: attempt to call field 'Add' (a nil value) |
the script at line 47 is this :-
Code: | -- fill CEComboBox1
MyForm.CEComboBox1.Items.clear()
for _,v in pairs(Nationalities) do
MyForm.CEComboBox1.Items.Add(v)
end |
|
Hmm. I'm using CE6.3+ (many bugs were fixed) and few useful "forgivable" methods are implemented. Just change it to "add" (from "Add" to "add").
_________________
|
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Sun Dec 29, 2013 4:24 am Post subject: |
|
|
6.3+ where did you get that from? I downloaded the the current version on home page.
this one : (from homepage)
Quote: | June 13 2013:Cheat Engine 6.3 Released: |
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Dec 29, 2013 4:27 am Post subject: |
|
|
You have to compile it yourself (CE source is available on code.google.com), or download "custom builds" from CheatEngine Beta sub-forum.
Just change "Add" to "add". It will be fine.
_________________
Last edited by mgr.inz.Player on Sun Dec 29, 2013 4:29 am; edited 1 time in total |
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Sun Dec 29, 2013 4:29 am Post subject: |
|
|
Okies! thanks did you read about the dob thing? its not possible right?
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Dec 29, 2013 4:53 am Post subject: |
|
|
I think you can rewrite that C# code to Lua.
To calculate differences:
- you can convert Gregorian calendar date to Julian Day Number. http://en.wikipedia.org/wiki/Julian_day
JDN1 = converttoJDN(date1)
JDN2 = converttoJDN(date2)
difference = JDN2 - JDN1
- or this: http://www.lua.org/pil/22.1.html
( diffdays = os.difftime(t2, t1) / 86400 )
_________________
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Sun Dec 29, 2013 9:18 am Post subject: |
|
|
Ya from the first look of it I understood its gna be real pain.
Thnx for looking into it.
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Sun Dec 29, 2013 9:42 am Post subject: |
|
|
Well.
The only hard part is to get difference between those dates.
If anyone wants to give hand, here's my start
Code: | DoB = {
get = {
days = {
day = function (day1, day2)
return (day2-day1);
end;
week = function (week1, week2)
return ((week2-week1) * 7);
end;
month = function (month, year)
year = year or os.date('%Y');
-- Source http://lua-users.org/wiki/DayOfWeekAndDaysInMonthExample
local days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
local d = days_in_month[month];
if (month == 2) then
if (math.mod(year,4) == 0) then
if (math.mod(year,100) == 0)then
if (math.mod(year,400) == 0) then
d = 29;
end
else
d = 29;
end
end
end
return d;
end;
year = function (year)
local days = 0
for i=1,12 do
local _days = DoB.get.days.month(i, year);
days = days + _days;
end
return days;
end;
}
}
} |
Example:
Code: | DoB.get.days.year(2013) |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Sun Dec 29, 2013 9:59 am Post subject: |
|
|
Ya from the first look of it I understood its gna be real pain.
Thnx for looking into it.
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Dec 29, 2013 5:41 pm Post subject: |
|
|
Code: | function returnJDN(year,month,day)
local a=math.floor((14-month)/12)
local y=year+4800-a
local m=month+12*a-3
return day+math.floor((153*m+2)/5)+365*y+math.floor(y/4)+
-math.floor(y/100)+math.floor(y/400)-32045
end
function diffDays(date1,date2)
local jdn1=returnJDN(date1.year, date1.month, date1.day)
local jdn2=returnJDN(date2.year, date2.month, date2.day)
return math.abs(jdn1-jdn2)
end
function dateOfBirthToCode(date)
local epoch1 = {year=1944,month=11,day=8}
local epoch2 = {year=1989,month=9,day=17}
local diff = diffDays(epoch1,date)
local mult=1
local startZ=208
if diff>16384 then
diff = diffDays(epoch2,date)
mult=2
startZ=224
end
local b0 = (diff%(4*mult))*math.floor(64/mult)
local b1 = math.floor(diff/(4*mult)) % 256
local b2 = math.floor(diff/(1024*mult)) + startZ
return b0,b1,b2
end
date = {year=1989,month=2,day=22}
print('b0 b1 b2 ') --debug info
print(dateOfBirthToCode(date)) --debug info
print('') --debug info
date = {year=1989,month=2,day=25}
print('b0 b1 b2 ') --debug info
print(dateOfBirthToCode(date)) --debug info
print('') --debug info
b0,b1,b2 = dateOfBirthToCode(date)
|
Above script will convert from date to this weird code.
_________________
|
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Sun Dec 29, 2013 11:52 pm Post subject: |
|
|
mgr.inz.Player
this is working perfect. The calculation part. This will work for writing the dob. Now what about the reverse thing. 'weird' code to dob? because il need it for reading from players profile.
Also is this possible to incorporate in the edit boxes?
See the editors screenshot on first page. that dob1, dob2, dob3 columns.
'weird' lol. you are using my language. hehe
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Dec 30, 2013 4:30 pm Post subject: |
|
|
reverse routine is easy too, there are JDN to date algorithms.
"Also is this possible to incorporate in the edit boxes?
See the editors screenshot on first page. that dob1, dob2, dob3 columns. "
Of course.
Too bad, CE doesn't provide TCalendar object. It would be much better solution. I can build custom CE version for you with Calendar. (current CE revision patched with http://pastebin.com/viKYVQ5h)
TCalendar already provides (indirectly) dateToNumber routine (useful for diff calculations).
So, you don't need "Julian Day Number" anymore.
_________________
|
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Tue Dec 31, 2013 12:48 am Post subject: |
|
|
Unbelievable! you made a new object itself!
Im doing this for the first time. How do install this? I downloaded the .txt file from pastebin. where to place this. and what is the script to add it in my form. I made all my form through form designer not through lua script. so this wud also be a new thing for me.
You should make a new post with calender object and make it stickied. Because its such an important object. The calender. Many people will need it.
Description: |
what change i need to make here? |
|
 Download |
Filename: |
final script (latest).CT |
Filesize: |
169.93 KB |
Downloaded: |
1092 Time(s) |
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Jan 01, 2014 1:09 pm Post subject: |
|
|
faizangmc wrote: | How do install this? I downloaded the .txt file from pastebin |
It is not txt file, it is a diff file. You have to save it as TCalendarPatch.diff.
You need:
1. Lazarus downloaded link
2. Lazarus installed like this (if you have 64bit OS) - link
3. You need TortoiseSVN or other SVN client, then you have to download (SVN Checkout) current CheatEngine source files from
Code: | http://cheat-engine.googlecode.com/svn/trunk/Cheat Engine |
4. then, TortoiseSVN->Apply patch, and choose TCalendarPatch.diff
5. open cheatengine.lpi file with 32bit Lazarus and compile 32bit CheatEngine
6. open cheatengine.lpi file with 64bit Lazarus and compile 64bit CheatEngine
As I said, I can compile it for you. I already have it.
Download this
http://www.mediafire.com/?in27mxybaf7pkwr
Move it to CheatEngine installation directory (make backup of original file)
launch it, and try this demo code
Code: | UDF1=createForm()
UDF1.Caption='UDF1'
UDF1.show()
calendar = createCalendar(UDF1)
calendar.Top = 10
calendar.Left = 10
|
_________________
|
|
Back to top |
|
 |
faizangmc Expert Cheater
Reputation: 0
Joined: 12 Nov 2013 Posts: 167
|
Posted: Wed Jan 01, 2014 2:40 pm Post subject: |
|
|
First of all HAPPY NEW YEAR mgr.inzPlayer
Second, ur patched cheat engine is freaking Aeeweeesome! thankx brother.
How do i readByte and writeByte on this? My script attached
Also, i dont know why the team balance and coach, physio section is showing what this means error in others pc. (people asking me to fix that error on game's forum). But it works perfectly on mine!
They player editing works well for them. Only the right section of the form. (one with balance and coach and physio is showing that error). I tried v much to find where the problem is in the script, but everything seems to be fine. I asked them whether they are going in the right in screen, in the game, they replied yes. if you have time, just scan through the script of the right side of form and see if you find anything wrong. (Not that important though)
But the calender stuff is main, that will add so much to the editor.
Description: |
|
 Download |
Filename: |
final script (latest).CT |
Filesize: |
169.9 KB |
Downloaded: |
1102 Time(s) |
|
|
Back to top |
|
 |
|
|
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
|
|