Grats on trying to learn C++
This code spams the ~ key to pickup items. Bewear it does not turn off if you press enter to chat :P somone can add this in

*put a hotkey for enter to turn it off then back on or something
Code:
HotKeySet("{END}", "close") ;So that we can press "END" to stop the script in case something goes wrong. ALWAYS do this!
HotKeySet("{PAUSE}", "loot") ;So that we can press "END" to stop the script in case something goes wrong. ALWAYS do this!
$loot = false
MsgBox(4096, "TwelveSky2 AutoLooter by MegaByte", "To use this autolooter just hit the pause key. To disable it press the pause key again. To exit it just close the script in the system tray. This autolooter will only loot when the game window has focus.", 10)
Do
;Nothing
if WinWaitActive("TwelveSky2") >0 Then
if $loot=true Then
Send("`")
EndIf
EndIf
Sleep(1);
Until 1<>1;
Func close() ;This is a function and doesn't actually run unless you tell it to. For example
Exit
EndFunc
Func loot()
if $loot=true Then
$loot=False
Beep ( 500, 100 )
Else
$loot=true
Beep ( 600, 100 )
EndIf
EndFunc