Learning to code! Please help

Posts 115 of 16 · Page 1 of 2
Learning to code! Please help
I guess this is an introduction of sorts and i have some questions for you guys. I am trying to teach myself c++ but i do not know anyone who can code so i cant ask questions. I am using visual studio community to do this. Basically i am trying to create a simple program at first and move from there. First i want to create a simple key pressing program to attack, buff on timers, and hopefully "screen scrape" to read my health and mana points, convert it to a percentage and then use potions with key presses at certain percentages of health. later i want to learn to include mouse movements, and just in general improve my code. I believe this would be considered a trainer. Looking for any advice, tips, code snipets, anything would be appreciated. After doing a lot of research i see there are multiple ways to do keypresses, and i guess my main concern is how to get the keypresses to go into the game i am playing and not into the console or anything like that. Eventually i would like to make it so i can do other things on my computer while my code injects the key presses into the game. Allowing me to write an exam paper while i "train" at the same time! Any input, or examples of code for this would be amazing! Thanks guys, and I hope i am a good fit to the community.
Quote Originally Posted by Timbojh21 View Post
I guess this is an introduction of sorts and i have some questions for you guys. I am trying to teach myself c++ but i do not know anyone who can code so i cant ask questions. I am using visual studio community to do this. Basically i am trying to create a simple program at first and move from there. First i want to create a simple key pressing program to attack, buff on timers, and hopefully "screen scrape" to read my health and mana points, convert it to a percentage and then use potions with key presses at certain percentages of health. later i want to learn to include mouse movements, and just in general improve my code. I believe this would be considered a trainer. Looking for any advice, tips, code snipets, anything would be appreciated. After doing a lot of research i see there are multiple ways to do keypresses, and i guess my main concern is how to get the keypresses to go into the game i am playing and not into the console or anything like that. Eventually i would like to make it so i can do other things on my computer while my code injects the key presses into the game. Allowing me to write an exam paper while i "train" at the same time! Any input, or examples of code for this would be amazing! Thanks guys, and I hope i am a good fit to the community.

To much text, learn to format before you learn to code.
Here's a tip
Learn a scripting language first, if that's too hard give up
Honestly, space out that text bruddah.
Quote Originally Posted by Timbojh21 View Post
I guess this is an introduction of sorts and i have some questions for you guys. I am trying to teach myself c++ but i do not know anyone who can code so i cant ask questions. I am using visual studio community to do this. Basically i am trying to create a simple program at first and move from there. First i want to create a simple key pressing program to attack, buff on timers, and hopefully "screen scrape" to read my health and mana points, convert it to a percentage and then use potions with key presses at certain percentages of health. later i want to learn to include mouse movements, and just in general improve my code. I believe this would be considered a trainer. Looking for any advice, tips, code snipets, anything would be appreciated. After doing a lot of research i see there are multiple ways to do keypresses, and i guess my main concern is how to get the keypresses to go into the game i am playing and not into the console or anything like that. Eventually i would like to make it so i can do other things on my computer while my code injects the key presses into the game. Allowing me to write an exam paper while i "train" at the same time! Any input, or examples of code for this would be amazing! Thanks guys, and I hope i am a good fit to the community.

How long you code already? If youre a real beginner you should start at easier things if you wanna create a game i can only recommend a good engine like ue4 or unity these are free

All right long time since i was in an actual development environment first you need the libary for the specific code and there are so much ways you could do it
here an short snipped recognizes when you pull the mouse button and let you work further with it
Is it this what you searched for?

void CheckMouseButtonStatus()
{
//Check the mouse left button is pressed or not
if ((GetKeyState(VK_LBUTTON) & 0x80) != 0)
{
AfxMessageBox(_T("LButton pressed"));
}
//Check the mouse right button is pressed or not
if ((GetKeyState(VK_RBUTTON) & 0x80) != 0)
{
AfxMessageBox(_T("RButton pressed"));
}
}

You already done the basic tutorial steps and programs like hello world, a age verification in dos a calculator and this shit right?
I am very sorry!

I guess i didnt make much sense.

I am creating a game hack, for a role playing game.

I would like to start with a simple program that uses my attacks in game.

1,2,3,4,5,6,7,8,9,0 are all keys i can use on the hot bar to assign attacks, buffs, and potions for the game

Basically i would like to create a more sophisticated macro to train in the game.

I believe this is called a trainer hack.

I am looking for an example of a key pressing code snippet.

I would like to create a program to read my health and mana bars in the role playing game, do a math equation to convert it to a %%
and set my Bot to press a keyboard button to use a health/mana potion at a certain % of health or mana.

Should i do this through screen scraping my video game to allow my code to read my health and mana?

or should i actually go through the games code and receive the information that way.

I am also looking into creating a loop. i want the bot to spam z1zz1z1z1z1z1

and set certain key presses on timer loops.

How would i create a loop to press a key every 2 minutes (120 seconds) to buff my strength in game.
Quote Originally Posted by Timbojh21 View Post
I am very sorry!

I guess i didnt make much sense.

I am creating a game hack, for a role playing game.

I would like to start with a simple program that uses my attacks in game.

1,2,3,4,5,6,7,8,9,0 are all keys i can use on the hot bar to assign attacks, buffs, and potions for the game

Basically i would like to create a more sophisticated macro to train in the game.

I believe this is called a trainer hack.

I am looking for an example of a key pressing code snippet.

I would like to create a program to read my health and mana bars in the role playing game, do a math equation to convert it to a %%
and set my Bot to press a keyboard button to use a health/mana potion at a certain % of health or mana.

Should i do this through screen scraping my video game to allow my code to read my health and mana?

or should i actually go through the games code and receive the information that way.

I am also looking into creating a loop. i want the bot to spam z1zz1z1z1z1z1

and set certain key presses on timer loops.

How would i create a loop to press a key every 2 minutes (120 seconds) to buff my strength in game.



So first i would not do this in c++ i would just create an script you can implement AutoHotkey library's into your c++ compoiler makes this whole thing 100 times easier

There are ways you can do it totally in c++ loop an button for example you could bring in an sleep timer or an counter but really just use auto hotkey....


"I would like to create a program to read my health and mana bars in the role playing game, do a math equation to convert it to a %%
and set my Bot to press a keyboard button to use a health/mana potion at a certain % of health or mana."

There are different ways
you could create an prog that screenshots every second and recognizes when your health or your mana drops then auto press the health pot

You could find out the pointers with Ce and actually create an lua script in Ce but you also can use the different pointers for your hack in c++

An spambot loop is very easy

http://www.mpgh.net/forum/showthread.php?t=184539


 
An simple tutorial credits goes to KillEmAll
Okay, Well, Here is a simple tutorial, To create a VERY Simple SpamBot.
I will be coding this with Visual basic 2008 Express Edition.
So, Lets get started.

1. Make a new Windows Form Application
2. Add 2 buttons, 2 textboxes, and a timer, And rename the buttons Start, And Stop.
3. On one of the textboxes, Right click and select "Properties", In the properties menu, Look for "Multi-Line", Once you find Multi-Line, Set it to true.
4. Make the multi-line textbox big, And resize it over the smaller textbox.
5. Double click on the timer, And add this code:
Code:
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
If you want it to be continous, Take out SendKeys.Send("{Enter}"). Also, Make sure the TextBox1.Text is the correct textbox!
6. Double click on "Start", And enter this code:
Code:
Timer1.Interval = TextBox2.Text
Timer1.Start()
7. Double click on "Stop", And enter this code:
Code:
Timer1.Interval = TextBox2.Text
Timer1.Stop()
8. Now debug the program, And test it out!
If it runs smooth, You have just made your own SpamBot!
You can add labels that say "Message:" And "Interval:" For example.
Now, If you run the SpamBot below 50 or so, It will slow down your computer quite a bit. I suggest from 500-2000 as the interval!


Sry for my broken english btw
Wow thank you!! i appreicate it

I figured out that it is easier to cheat engine into the game and aquire the integer value of my current/total health.

How can i divide two integers to create a percentage? i want to use that percentage as a queue to use a key


how would i tell my program to stop the spam to press a certain key every 2 minutes? and then restart the spam of z1z1z1
Wrong place to post!
I would love to start coding, but i just can't start, everyone shows examples, but i need an explanation. ;(
Quote Originally Posted by ETHerthethaethaetheh View Post
I would love to start coding, but i just can't start, everyone shows examples, but i need an explanation. ;(
There are some very good tutorials for c++ on youtube the point is to understand the logic if you got that everything else will be easy
I think you're talking about macros.

Start with VBA.
btw there's a whole section for that
Start with basic logic, then how memory/programs work if you want to write cheats. From there learn simple languages and work your way to up to the most basic language you need to write a cheat. You could alternatively use something like cheat engine to make simple cheats, but it won't help with the more fancy stuff like DLL injection, drivers, etc.
any recommendations on how to start learnign c++. I have a pretty good understanding of programming and how it works. I have made a few programs on autohotkeys, python etc, but mostly keypresses, sleeps, loops, loops in loops, infinite loops
Quote Originally Posted by Timbojh21 View Post
any recommendations on how to start learnign c++. I have a pretty good understanding of programming and how it works. I have made a few programs on autohotkeys, python etc, but mostly keypresses, sleeps, loops, loops in loops, infinite loops


- - - Updated - - -

Or just go in programming school

Quote Originally Posted by ETHerthethaethaetheh View Post
I would love to start coding, but i just can't start, everyone shows examples, but i need an explanation. ;(
This ^^ .......
Posts 115 of 16 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?