 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jan 09, 2009 5:33 pm Post subject: |
|
|
oops
The pussy is right.
| Code: |
double getCombat(double att, double str, double def, double hp, double mage, double range, double pray) {
string combat_class;
double cmblvl = (0.32707 * att) + (0.249 * def) + (0.324 * str) + (0.25 * hp) + (0.124 * pray);
double rangelvl = (0.487 * range) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
double magelvl = (0.487 * mage) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
if ((cmblvl > magelvl) && (cmblvl > rangelvl)) {
combat_class = "Warrior";
}
else if ((rangelvl > magelvl) && (rangelvl > cmblvl)) {
combat_class = "Ranger";
cmblvl = rangelvl;
}
else if ((magelvl > cmblvl) && (magelvl > rangelvl)) {
combat_class = "Mage";
cmblvl = magelvl;
}
else {
combat_class = "Warrior";
}
return(cmblvl);
}
int main(){
}
|
|
|
| Back to top |
|
 |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Fri Jan 09, 2009 5:41 pm Post subject: |
|
|
yes and inside int main{ do something like,
| Code: |
int main()
{
double CombatLevel = getCombat(99, 99, 99, 99, 99, 99, 99);
cout << CombatLevel;
cin.get();
return 0;
} |
|
|
| Back to top |
|
 |
Cloud-Strife Master Cheater
Reputation: 0
Joined: 14 Mar 2008 Posts: 346 Location: MilkyWay
|
Posted: Fri Jan 09, 2009 8:20 pm Post subject: |
|
|
Okay, I am about to try editing the .cpp file again according to you. By the way I just installed Visual C++ 08 Express and I will that if all else fails.
Edit: Failed
Here is how the code looked like.
| Code: | #include <iostream>
#include <string>
#include "combatclass.cpp"
using namespace std;
void err (float eprob);
int main()
double getCombat(double att, double str, double def, double hp, double mage, double range, double pray) {
string combat_class;
double cmblvl = (0.32707 * att) + (0.249 * def) + (0.324 * str) + (0.25 * hp) + (0.124 * pray);
double rangelvl = (0.487 * range) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
double magelvl = (0.487 * mage) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
if ((cmblvl > magelvl) && (cmblvl > rangelvl)) {
combat_class = "Warrior";
}
else if ((rangelvl > magelvl) && (rangelvl > cmblvl)) {
combat_class = "Ranger";
cmblvl = rangelvl;
}
else if ((magelvl > cmblvl) && (magelvl > rangelvl)) {
combat_class = "Mage";
cmblvl = magelvl;
}
else {
combat_class = "Warrior";
}
return(cmblvl);
int main()
{
double CombatLevel = getCombat(99, 99, 99, 99, 99, 99, 99);
cout << CombatLevel;
cin.get();
return 0;
} |
_________________
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Fri Jan 09, 2009 9:16 pm Post subject: |
|
|
| Code: |
#include <iostream>
#include <string>
#include "combatclass.cpp"
using namespace std;
void err (float eprob);
double getCombat(double att, double str, double def, double hp, double mage, double range, double pray);
double getCombat(double att, double str, double def, double hp, double mage, double range, double pray) {
string combat_class;
double cmblvl = (0.32707 * att) + (0.249 * def) + (0.324 * str) + (0.25 * hp) + (0.124 * pray);
double rangelvl = (0.487 * range) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
double magelvl = (0.487 * mage) + (0.249 * def) + (0.25 * hp) + (0.124 * pray);
if ((cmblvl > magelvl) && (cmblvl > rangelvl)) {
combat_class = "Warrior";
}
else if ((rangelvl > magelvl) && (rangelvl > cmblvl)) {
combat_class = "Ranger";
cmblvl = rangelvl;
}
else if ((magelvl > cmblvl) && (magelvl > rangelvl)) {
combat_class = "Mage";
cmblvl = magelvl;
}
else {
combat_class = "Warrior";
}
return cmblvl;
}
int main()
{
double CombatLevel = getCombat(99, 99, 99, 99, 99, 99, 99);
cout << CombatLevel;
cin.get();
return 0;
}
|
decline to comment
regards BanMe
|
|
| Back to top |
|
 |
sloppy Expert Cheater
Reputation: 0
Joined: 17 Aug 2008 Posts: 123
|
Posted: Sat Jan 10, 2009 1:18 am Post subject: |
|
|
@JVlania
Why did you add #include "combatclass.cpp"? you are including the file within itself.. remove it, and the declaration of err() seems equally pointless without putting it to use. Read up on the basics so you have a better understanding of what you are doing.
|
|
| Back to top |
|
 |
Cloud-Strife Master Cheater
Reputation: 0
Joined: 14 Mar 2008 Posts: 346 Location: MilkyWay
|
Posted: Sat Jan 10, 2009 1:16 pm Post subject: |
|
|
The combatclass.cpp is a different .cpp. The one I am using is combatcalc.cpp. I did not include it this time though.
Oh, and when I use Visual C++ I right click on the .cpp and click on
"build" but on the bottom box it says:
"------ Build started: Project: combatcalc, Configuration: Debug Win32 ------
There is no build command line to execute.
Performing Makefile project actions
Project : error PRJ0003 : Error spawning 'cmd.exe'.
Build log was saved at "file://c:\docs\CS250\CombatCalc\combatcalc\Debug\BuildLog.htm"
combatcalc - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========="
Then I tried again with the cmd app...g++ combatcalc.cpp -o combat.exe it worked! Then I click on combat.exe and all that comes up is the cmd window saying "126.133"
I used the code BanMe wrote. With out including combatclass.
I am thinking maybe the "126.133" could be the product I am getting from the "99s" in my script. Thus 126.133 would be my combat level?
Yes, my assumption was correct ^ Thanks to all especially BanMe.
_________________
|
|
| Back to top |
|
 |
sloppy Expert Cheater
Reputation: 0
Joined: 17 Aug 2008 Posts: 123
|
|
| Back to top |
|
 |
crayzbeef Expert Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 101
|
Posted: Sun Jan 11, 2009 1:18 am Post subject: |
|
|
| May i ask why you're inefficiently using doubles for every type of variable?
|
|
| Back to top |
|
 |
Cloud-Strife Master Cheater
Reputation: 0
Joined: 14 Mar 2008 Posts: 346 Location: MilkyWay
|
Posted: Sun Jan 11, 2009 3:59 pm Post subject: |
|
|
| crayzbeef wrote: | | May i ask why you're inefficiently using doubles for every type of variable? |
It is an inperfect replica version of a combat calculator formula that a company called Jagex made up for their game RuneScape. Supposedly it requires doubles for every variable?
_________________
|
|
| 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
|
|