Like many, I've got a very basic understanding of coding with AHK. The thing I want to work on is learning a different approach to writing. Since I have no experience with any coding languages, my approach to problems and tasks is to reproduce keystrokes and mouse clicks when I make a script. It gets the job done but I want to get better.
I like to use games as a way to learn and, earlier this week, my kid got me into playing Minecraft. It's a pretty fun game, basically digital Lego building. I thought it would be cool to figure out a way to build a structure using AHK.
Here's my auto wall builder code and it works well. I was just wondering if there's a different way to write it, a different approach? I don't know if that makes sense. Sorry. lol Maybe Minecraft is a bad example.
Code: Select all
Numpad1::
Loop 5
{
Loop 4
{
Send {Space Down}
sleep 150
Send {RButton}
sleep 100
Send {Space Up}
sleep 200
}
Send {D Down}
sleep 280
Send {D Up}
sleep 500
Send {A Down}
sleep 400
Send {A Up}
}
Loop 4
{
Send {Space Down}
sleep 150
Send {RButton}
sleep 100
Send {Space Up}
sleep 200
}
Loop 5
{
Loop 4
{
Send {Space Down}
sleep 150
Send {RButton}
sleep 100
Send {Space Up}
sleep 200
}
Send {A Down}
sleep 280
Send {A Up}
sleep 500
Send {D Down}
sleep 400
Send {D Up}
}
Loop 4
{
Send {Space Down}
sleep 150
Send {RButton}
sleep 100
Send {Space Up}
sleep 200
}
return