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 


{c++} how to check if all my DWORD keys are the same
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Sat Jun 23, 2012 5:39 pm    Post subject: Reply with quote

wat
Back to top
View user's profile Send private message MSN Messenger
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 5:40 pm    Post subject: Reply with quote

uh I don't know anything about c++ but shouldn't you just use if then else statements?
_________________
bsdfbdsfb
Back to top
View user's profile Send private message
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 5:41 pm    Post subject: Reply with quote

akaecius wrote:
uh I don't know anything about c++ but shouldn't you just use if then else statements?

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
NotReallySureWhatGoesHere
Expert Cheater
Reputation: -1

Joined: 20 Feb 2012
Posts: 110

PostPosted: Sat Jun 23, 2012 5:42 pm    Post subject: Reply with quote

http://www.cplusplus.com/reference/algorithm/for_each/

http://www.cplusplus.com/doc/tutorial/control/
Back to top
View user's profile Send private message
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 5:42 pm    Post subject: Reply with quote

Shrooms wrote:
akaecius wrote:
akaecius wrote:
uh I don't know anything about c++ but shouldn't you just use if then else statements?


you realize how huge the if statement would be...

that's just what I'm guessing you could do. I bet there's some hyper smart function that someone else knows about.

I, however, would just do it like that if I knew how to code.

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
RazZ91
Grandmaster Cheater Supreme
Reputation: 0

Joined: 20 Apr 2007
Posts: 1207
Location: Europe

PostPosted: Sat Jun 23, 2012 5:43 pm    Post subject: Reply with quote

Why'd you post this in random spam and not in the programming section? o.o

For your question, the answer is 42.
Back to top
View user's profile Send private message
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 5:48 pm    Post subject: Reply with quote

I have a question though, since, you know, it seems like you care that your code is optimized etc.

why are all your variables(I'm assuming those are variables dwlootkey etc.) why do they all have such long names? That's duuuuum

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
RazZ91
Grandmaster Cheater Supreme
Reputation: 0

Joined: 20 Apr 2007
Posts: 1207
Location: Europe

PostPosted: Sat Jun 23, 2012 5:50 pm    Post subject: Reply with quote

Shrooms wrote:
akaecius wrote:
I have a question though, since, you know, it seems like you care that your code is optimized etc.

why are all your variables(I'm assuming those are variables dwlootkey etc.) why do they all have such long names? That's duuuuum


who gives a fuck about the names....


You seem to do.
Back to top
View user's profile Send private message
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 5:51 pm    Post subject: Reply with quote

RazZ91 wrote:
Shrooms wrote:
akaecius wrote:
I have a question though, since, you know, it seems like you care that your code is optimized etc.

why are all your variables(I'm assuming those are variables dwlootkey etc.) why do they all have such long names? That's duuuuum


who gives a fuck about the names....


You seem to do.

well you seem to like to lessen your work load so when you're writing down your text I'm assuming you'd like to write the least amount possible, which is then again why I'm asking as to why your variable names are so long.

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Sat Jun 23, 2012 5:55 pm    Post subject: Reply with quote

I don't get it...

is this what you want?

Code:
boolean allSameKeys(DWORD dwLootKey,DWORD dwAttackKey,DWORD dwHealthKey,DWORD dwManaKey,DWORD dwSkill1Key,DWORD dwSkill2Key,DWORD dwSkill3Key){
DWORD test = dwLootKey;
int count = 0;
boolean allsame = false;

if (dwAttackKey == test){
count++;
}
if (dwHealthKey == test){
count++;
}
if (dwManaKey == test){
count++;
}
if (dwSkill1Key == test){
count++;
}
if (dwSkill2Key == test){
count++;
}
if (dwSkill3Key == test){
count++;
}
if (count == 6){
allsame = true;
}
return allsame;
}
Back to top
View user's profile Send private message MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Jun 23, 2012 6:00 pm    Post subject: Reply with quote

[code]

Last edited by Noz3001 on Sat Jun 23, 2012 6:05 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
bfsdbsdfbdsfb
Grandmaster Cheater
Reputation: 54

Joined: 06 Sep 2007
Posts: 702
Location: Oh noez.

PostPosted: Sat Jun 23, 2012 6:00 pm    Post subject: Reply with quote

gogodr wrote:
I don't get it...

is this what you want?

Code:
boolean allSameKeys(DWORD dwLootKey,DWORD dwAttackKey,DWORD dwHealthKey,DWORD dwManaKey,DWORD dwSkill1Key,DWORD dwSkill2Key,DWORD dwSkill3Key){
DWORD test = dwLootKey;
int count = 0;
boolean allsame = false;

if (dwAttackKey == test){
count++;
}
if (dwHealthKey == test){
count++;
}
if (dwManaKey == test){
count++;
}
if (dwSkill1Key == test){
count++;
}
if (dwSkill2Key == test){
count++;
}
if (dwSkill3Key == test){
count++;
}
if (count == 6){
allsame = true;
}
return allsame;
}

But what if he wants it to detect if just two of them are the same as well?

He could just do if/then/else and add a bunch of "or"s under the ifs.

_________________
bsdfbdsfb
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Sat Jun 23, 2012 6:03 pm    Post subject: Reply with quote

he said all
Back to top
View user's profile Send private message MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Jun 23, 2012 6:19 pm    Post subject: Reply with quote

Code:
DWORD d =
        (dwLootKey ^ dwAttackKey)
        | (dwHealthKey ^ dwManaKey)
        | (dwSkill1Key ^ dwSkill2Key)
        | (dwSkill3Key ^ dwLootKey);


if d != 0, one or more is different. If d == 0, they are all the same.

Right?
Back to top
View user's profile Send private message MSN Messenger
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Sat Jun 23, 2012 6:26 pm    Post subject: Reply with quote

I have no idea with ^

I don't see it in

DWord (word low)
DWord (word low, word high)
DWord & operator+= (word a)
DWord operator+ (word a)
DWord operator- (DWord a)
DWord operator- (word a)
word operator/ (word divisor)
word operator% (word a)
bool operator! () const
word GetLowHalf () const
word GetHighHalf () const
word GetHighHalfAsBorrow () const

is it supposed to be a logic XOR ?
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 -> Random spam All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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