my first c++ program

  • Join the GBAtemp community: it's free
    • 50% fewer ads
    • Reply alerts
    • Join the discussion
    • Watch & bookmark
Oh god you learnt C++?
ohmy.gif

ohnoes.png


Could I please ask what this program is for?
unsure.gif
 
the basic syntax about "while (true)" for infinite loops and such come from my very basic days of trying out devkitpro (libnds and palib)

the rest (functions and #include shit) are googled
tongue.gif


i started coding this yesterday, but i sent it to a friend of mine that said his computer went all laggy about it, so i tried to optimize it a bit. that version is the current.

overall, without counting the days of doing literally nothing in c++, 1 day of researching syntax, not making anything with it, and 2 days of making a project and researching functions what i could use in it

i like the fact that my first c++ application does not need the evil .NET framework

oh and also the millionth thing i forgot to tell is that my previous programming languages were game maker language (gml), visual basic.net, c# (for 1 week, without doing anything with it, really (not even searching stuff)). however in none of those languages can you call me a novice user. (except gml, but i mostly look up the built-in snippets)
 
CODE#include "stdafx.h"
#include
#include

int _tmain(int argc, _TCHAR* argv[])
{
char cChar;
int toggled = 0;
int chat = 1;

while(true) {
if ((chat == 1) && (GetAsyncKeyState(VK_SHIFT)==-32767)) {
switch (toggled) {
case 0: toggled = 1; break;
case 1: toggled = 0; break;
}
}

if ((GetAsyncKeyState(0x54)==-32767) && (chat = 1)) {toggled = 0; chat = 0;}
if ((chat == 0) && (GetAsyncKeyState(VK_ESCAPE)==-32767) || (GetAsyncKeyState(VK_RETURN)==-32767)) {chat = 1;}


switch ((toggled) && (chat)) {
case 0: keybd_event(0x4D, NULL, KEYEVENTF_KEYUP, NULL); break;
case 1: keybd_event(0x4D, NULL, NULL, NULL); break;
}
Sleep(100);
}

std::cin >> cChar;
}

is the source, by the way
its not like a true epic program thing, but i suck at remembering what things are supposed to do. i lost track of the code like 3 times, even if it is this tiny
tongue.gif
(the original had debugging information printed on the screen, but because it was useless (and because i couldnt get one small detail working) i removed it
 
so basically it just enables the sneak in minecraft just by pressing shift instead of holding it down?
 

Site & Scene News

New Hot Discussed User Submitted