09-30-2009, 02:34 AM
I discovered this macro program several years back, and soon found out it is far more than a simple macro system you will find with most programs. It is capable of much more including the ability to create graphical user interfaces, otherwise known as, GUI's. The browser window you're reading this in right now is a GUI. Autohotkey has a vast amount of commands you can use to do practically whatever might need to be done. If you finish a program, and want to share it you can compile the script into an executable file (exe). The most impressive part is this software is it's still free, and will likely remain free. If you want to step into basic programming, and eventually learn advanced programming Autohotkey is a great place to start.
http://www.autohotkey.com/
Below is a script I wrote that compiles into a race game. Basically progress bars are turned into race progress with random processing. That ensures the end result is always random, and different. You start with a set amount of money, and bet on which progress bar will win the race. Please feel free to download Autohotkey, and run my interesting game!
http://www.autohotkey.com/
Below is a script I wrote that compiles into a race game. Basically progress bars are turned into race progress with random processing. That ensures the end result is always random, and different. You start with a set amount of money, and bet on which progress bar will win the race. Please feel free to download Autohotkey, and run my interesting game!

Quote:; RaceGame.AHK - Made by: .AHK
#NoEnv
#SingleInstance Ignore
Balance = 2000
R_Played = 0
Status1 = 1
Status2 = 1
Status3 = 1
Status4 = 1
Status5 = 1
Racer1W = 0
Racer2W = 0
Racer3W = 0
Racer4W = 0
Racer5W = 0
AmountW = 0
AmountL = 0
Racer1 = 0
Racer2 = 0
Racer3 = 0
Racer4 = 0
Racer5 = 0
Gui, Color, C0C0C0
Gui Font, S11
Gui Add, Progress, w350 h15 cBlue BackgroundWhite Range0-500 vRacer1
Gui Add, Progress, w350 h15 cBlack BackgroundWhite Range0-500 vRacer2
Gui Add, Progress, w350 h15 cRed BackgroundWhite Range0-500 vRacer3
Gui Add, Progress, w350 h15 cYellow BackgroundWhite Range0-500 vRacer4
Gui Add, Progress, w350 h15 cGreen BackgroundWhite Range0-500 vRacer5
Gui Add, Button, W75 H20 gStart, Start Race
Gui Add, Button, x+20 y+-20 W60 H20 gRestart, Restart
Gui Add, Text, x370 y8, Racer #1
Gui Add, Text, y+7, Racer #2
Gui Add, Text, y+7, Racer #3
Gui Add, Text, y+7, Racer #4
Gui Add, Text, y+7, Racer #5
Gui Add, Text, x275 y135, Balance
Gui Add, Edit, x+5 y+-20 r1 W100 +ReadOnly, $%Balance%
Gui Add, Radio, x10 vNoBet Checked, No Bet
Gui Add, Radio, x+5 y+-16 vBet1, Bet #1
Gui Add, Radio, x+5 y+-16 vBet2, Bet #2
Gui Add, Radio, x10 vBet3, Bet #3
Gui Add, Radio, x+9 y+-16 vBet4, Bet #4
Gui Add, Radio, x+5 y+-16 vBet5, Bet #5
Gui Add, Text, x243 y180, Amount to Bet
Gui Add, Edit, vBetAmount x+5 y+-20 r1 W70 Number Limit8, 100
Gui Add, Text, x10 y230, Rounds Played
Gui Add, Edit, x+5 y+-20 r1 W45 +ReadOnly, 0
Gui Add, Text, x+15 y+-20, Amount Won
Gui Add, Edit, x+5 y+-20 r1 W70 +ReadOnly, $0
Gui Add, Text, x+15 y+-20, Amount Lost
Gui Add, Edit, x+5 y+-20 r1 W70 +ReadOnly, $0
Gui Add, Edit, x430 y6 H20 W35 +ReadOnly, 0
Gui Add, Edit, y+3 H20 W35 +ReadOnly, 0
Gui Add, Edit, y+3 H20 W35 +ReadOnly, 0
Gui Add, Edit, y+3 H20 W35 +ReadOnly, 0
Gui Add, Edit, y+3 H20 W35 +ReadOnly, 0
Gui Show, Center, Race Game
Return
Restart:
Reload
Return
GuiClose:
ExitApp
Return
Start:
Gui +OwnDialogs
Gui Submit, NoHide
If betamount IS space
betamount = 0
If betamount > %balance%
{
MsgBox 0, Lower Bet, The amount to bet is above your balance.
Return
}
Loop {
Sleep 75
If (Status1 = 0 AND Status2 = 0 AND Status3 = 0 AND Status4 = 0 AND Status5 = 0)
Break
If Racer1 >= 500
{ Racer1W++
Break
}
If Racer2 >= 500
{ Racer2W++
Break
}
If Racer3 >= 500
{ Racer3W++
Break
}
If Racer4 >= 500
{ Racer4W++
Break
}
If Racer5 >= 500
{ Racer5W++
Break
}
n = 1
Gosub S_progress
If Complete = 1
Break
n = 2
Gosub S_progress
If Complete = 1
Break
n = 3
Gosub S_progress
If Complete = 1
Break
n = 4
Gosub S_progress
If Complete = 1
Break
n = 5
Gosub S_progress
If Complete = 1
Break
}
ControlSetText Edit1, $%balance%
If balance = 0
{
MsgBox 4, Game Over, You lost all your money! Restart the game?
IfMsgBox Yes
Reload
Else
ExitApp
}
R_Played++
ControlSetText Edit3, %R_Played%
ControlSetText Edit4, $%AmountW%
ControlSetText Edit5, $%AmountL%
ControlSetText Edit6, %Racer1W%
ControlSetText Edit7, %Racer2W%
ControlSetText Edit8, %Racer3W%
ControlSetText Edit9, %Racer4W%
ControlSetText Edit10, %Racer5W%
GuiControl,, Racer1, 0
GuiControl,, Racer2, 0
GuiControl,, Racer3, 0
GuiControl,, Racer4, 0
GuiControl,, Racer5, 0
Racer1 = 0
Racer2 = 0
Racer3 = 0
Racer4 = 0
Racer5 = 0
Complete = 0
Status1 = 1
Status2 = 1
Status3 = 1
Status4 = 1
Status5 = 1
Return
DeriveFall() {
Tn = 0
Loop 6 {
Random, Rn, 0,2
Tn += Rn
}
Return Tn
}
S_progress:
If Status%n% <> 0
Status%n% := DeriveFall()
If Status%n% = 0
Return
Random count, 1, 10
GuiControl,, Racer%n%, +%count%
Racer%n% := (Racer%n% + count)
If Racer%n% >= 500
If bet%n% = 1
{
balance := (balance + betamount)
amountw := (amountw + betamount)
Racer%n%W += 1
MsgBox 0, Win, You won $%betamount%
Complete = 1
} Else {
If nobet = 0
{
balance := (balance - betamount)
amountl := (amountl + betamount)
Racer%n%W += 1
MsgBox 0, Loss, You lost $%betamount%
Complete = 1
}
}
Return


