How to write "mathematical function" in script in CE 6.8.1?
Posted: Mon Jun 25, 2018 10:27 am
Hello guys!
First of all - thank you so much [B][USER=12587] SunBeam[/USER][/B],[B][USER=91]ShyTwig16[/USER] [/B]and other people who helped me - thanks to your help I learnt a lot new things and I want still learning.
But I have new problem in my script.
And I don't have any idea how to solve this problem :)
The main problem is: I don't know how to write a "mathematical function" in my script.
But let me explain first.
I made a script:
[code]code:
push eax
mov eax,[VALUE]
movd xmm4,eax
movaps xmm1,xmm4
movss [ebp-08],xmm4
mulss xmm1,xmm2
pop eax
ret
code1:
push eax
mov eax,[VALUE]
movd xmm4,eax
movaps xmm1,xmm4
movss [ebp-18],xmm4
mulss xmm1,xmm2
pop eax
ret[/code]
This is a part of my script but script is working 100%.
Like you can see in my script, I am moving global allocating value into EAX - this is good BUT - I checked in game that: if I want to have a 10 value in a game I must write: 3.3333 in FLOAT or 40555555 in HEX or 1079334229 in 4-BYTES - these all values mean 10 VALUE in game!
So, going further, I checked that:
- If you want to have a 100 value in a game you must write in the script:
float: 100
hex: 42C80000
4 bytes: 1120403456
- If you want to have a 50 value in a game you must write in the script:
float: 16.6666
hex: 41855532
4 bytes: 1099257138
- If you want to have a 20 value in a game you must write in the script:
float: 6.6666
hex: 40d55554
4 bytes: 1087722836
and etc. etc.
So my question is: IS IT POSSIBLE to add to my script a MATHEMATICAL FUNCTION which will convert these strange values to normal values - that If I wanted to have a 50 value in game, I will write a 50 value and If I wanted to have a 20 value in game, I will write a 20 value and etc. etc. ??? Is it possible to add something like that? It is very hard to remember all that type of values to put them all the time.
I have a hope that you will understand me :)
I am waiting for your advices.
Original code where I am injecting my script is:
[code]movaps xmm1,xmm4
movss [ebp-08],xmm4
mulss xmm1,xmm2[/code]
First of all - thank you so much [B][USER=12587] SunBeam[/USER][/B],[B][USER=91]ShyTwig16[/USER] [/B]and other people who helped me - thanks to your help I learnt a lot new things and I want still learning.
But I have new problem in my script.
And I don't have any idea how to solve this problem :)
The main problem is: I don't know how to write a "mathematical function" in my script.
But let me explain first.
I made a script:
[code]code:
push eax
mov eax,[VALUE]
movd xmm4,eax
movaps xmm1,xmm4
movss [ebp-08],xmm4
mulss xmm1,xmm2
pop eax
ret
code1:
push eax
mov eax,[VALUE]
movd xmm4,eax
movaps xmm1,xmm4
movss [ebp-18],xmm4
mulss xmm1,xmm2
pop eax
ret[/code]
This is a part of my script but script is working 100%.
Like you can see in my script, I am moving global allocating value into EAX - this is good BUT - I checked in game that: if I want to have a 10 value in a game I must write: 3.3333 in FLOAT or 40555555 in HEX or 1079334229 in 4-BYTES - these all values mean 10 VALUE in game!
So, going further, I checked that:
- If you want to have a 100 value in a game you must write in the script:
float: 100
hex: 42C80000
4 bytes: 1120403456
- If you want to have a 50 value in a game you must write in the script:
float: 16.6666
hex: 41855532
4 bytes: 1099257138
- If you want to have a 20 value in a game you must write in the script:
float: 6.6666
hex: 40d55554
4 bytes: 1087722836
and etc. etc.
So my question is: IS IT POSSIBLE to add to my script a MATHEMATICAL FUNCTION which will convert these strange values to normal values - that If I wanted to have a 50 value in game, I will write a 50 value and If I wanted to have a 20 value in game, I will write a 20 value and etc. etc. ??? Is it possible to add something like that? It is very hard to remember all that type of values to put them all the time.
I have a hope that you will understand me :)
I am waiting for your advices.
Original code where I am injecting my script is:
[code]movaps xmm1,xmm4
movss [ebp-08],xmm4
mulss xmm1,xmm2[/code]