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 


[RLS / HelpMe] KeepCapsLockOn Prank.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Fri Apr 18, 2008 12:27 pm    Post subject: [RLS / HelpMe] KeepCapsLockOn Prank. Reply with quote

This is a pretty lame prank, created solely by me. What it does is keeps Caps Lock on/Makes you write in upper-case, regardless if shift is pressed or not. Smile
The problems I am having with it are stated within the source code.
Thanks for any help you may give me.
Sorry I couldn't release this as a fully functioning program. Confused

Edit: Doesn't really make a big difference, but just realised, it should have a "return 0;" at the end.
Edit 2: Almost all problems fixed, except for holding caps lock down, turns it off, and the program randomly closes/crashes other windows/doesn't let them open.



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.


Last edited by --Pillboi-- on Sat Apr 19, 2008 4:27 am; edited 2 times in total
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Fri Apr 18, 2008 1:30 pm    Post subject: Reply with quote

GetKeyState return 1,0,-127,-128:
0: If key NOT pressed and NOT toggle.
1: If key NOT pressed and toggle.
-127: If key pressed and toggle.
-128: If key pressed and NOT toggle.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Fri Apr 18, 2008 1:56 pm    Post subject: Reply with quote

Thanks, I tried to learn from your example. Thank you very much! Very Happy
Sorry, no offence, but did that .exe have malicious code on it, because after running it, my computer is screwing up.

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

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

PostPosted: Fri Apr 18, 2008 2:34 pm    Post subject: Reply with quote

It's not malicious but it DOES take up ALL of the processing time. Greedy program needs some sleep time (Sleep(10)Wink.
Back to top
View user's profile Send private message MSN Messenger
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sat Apr 19, 2008 3:36 am    Post subject: Reply with quote

Hmmm yeah. I better do some repair work to my computer. It's dying on me! It's even restarting half way through start up... Confused
Adding Sleep(10) now. Smile

Edit: It's taking 2+ minutes to open a folder, 30+ seconds to open the start menu, and SYSTEM is using up 95% of my cpu. Sad

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Sat Apr 19, 2008 4:02 am    Post subject: Reply with quote

--Pillboi-- wrote:
Hmmm yeah. I better do some repair work to my computer. It's dying on me! It's even restarting half way through start up... Confused
Adding Sleep(10) now. Smile

Edit: It's taking 2+ minutes to open a folder, 30+ seconds to open the start menu, and SYSTEM is using up 95% of my cpu. Sad
My computer working normal o.O
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sat Apr 19, 2008 7:37 am    Post subject: Reply with quote

It's probably not your program. Dw. Laughing
Anti-virus programs aren't picking up anything though.
Phew, cpu has gone back to normal. Very Happy

Back on topic - If you hold caps lock down, it seems to be turning off caps lock... (By "seems", I mean, the LED goes off. Not sure if it is actually turning it off) Re uploading my source and program now.

Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Apr 19, 2008 7:45 am    Post subject: Reply with quote

--Pillboi-- wrote:
Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput


Define it as a way to get userinput like say to get the int value from a string:

#define DEFINTION GetDlgItemInt(....);

_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

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

PostPosted: Sat Apr 19, 2008 7:58 am    Post subject: Reply with quote

lurc wrote:
--Pillboi-- wrote:
Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput


Define it as a way to get userinput like say to get the int value from a string:

#define DEFINTION GetDlgItemInt(....);


Code:
#define SOMETHING 672

int SomethingElse = SOMETHING;


Like this?
Back to top
View user's profile Send private message MSN Messenger
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sat Apr 19, 2008 10:26 am    Post subject: Reply with quote

lurc wrote:
Define it as a way to get userinput like say to get the int value from a string:

Unfortunately, I already thought of that. The reason I can't do it, is that multiple values are taken in at the same time: scanf("%d %d", &la, &lala);
And enter should only be pressed once, at the end.

Noz3001:
Code:
int SomethingElse = SOMETHING;

Makes SomethingElse equal to 672. But SOMETHING is still 672.
What I need is, a way to give SOMETHING, SomethingElse's value.

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Apr 19, 2008 10:33 am    Post subject: Reply with quote

int SomethingElse = 1;

#define SOMETHING SomethingElse

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Sat Apr 19, 2008 10:54 am    Post subject: Reply with quote

Code:
#define FIRST_PARAM      0xFF
#define SECOND_PARAM   0x2

#include <stdio.h>
#include <tchar.h>

int main()
{
   int iFirst = FIRST_PARAM;
   _tprintf( _T("%d %d"), iFirst, SECOND_PARAM );
   return 0;
}


Works fine with defines.

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

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sat Apr 19, 2008 11:13 am    Post subject: Reply with quote

Is it even possible to change the value of a #define? And, I don't think you can call functions before main?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Apr 19, 2008 11:40 am    Post subject: Reply with quote

No i dont think so, unless the mask it defines is a changing value like the GetDlgItemInt i said above.

And yes you can call functions cause its not calling a function because its not getting called until you call the definition, (which will be somewhere in a function or in main)

i like to think of definitions as just something to replace code... without the restrictions of types, parameters, etc.

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

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sat Apr 19, 2008 12:06 pm    Post subject: Reply with quote

Ah, thanks, I was getting messed up.

hmmm, if it really has to be a #define, you could do
[psuedo]
Code:
#define DEF(str1, str2) ("%s, %d", &str1, &str2)

input(astring)
input(astring2)
somefunc(DEF(astring, astring2));

Or some crazy thing like that, maybe.
Why's it have to be a #define, anyways?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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