Hallo,
das ist mein erster Post, also sagt Bescheid, falls ich ne Forenregel übersehen habe
Ich habe ein kleines Projekt, welches eine Art Overlay ist. es zeigt wasd(...)-Drücke an und soll beim streamen /Guide erstellen helfen.
hier ist der Code:
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=gfx\Icon_LotusClean_Black.ico
#AutoIt3Wrapper_Outfile_x64=KeyPressesv0.4.exe
#AutoIt3Wrapper_Res_Comment=by Askuriel
#AutoIt3Wrapper_Res_Fileversion=0.4.0
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Version: v0.4
Author: Askuriel (navren@aol.com)
Script Function:
Shows Keypresses on screen
Active Line of work: 88
#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
#include <Constants.au3>
#include <Array.au3>
GUISetIcon("icon.ico")
TraySetIcon("icon.ico")
HotKeySet("{F7}", "close")
$hDLL = DllOpen("user32.dll")
$ini = @ScriptDir & "\config.ini"
$gfx = @ScriptDir & "\gfx\"
$bgColor = IniRead($ini, "BGColors", IniRead($ini, "Options", "BackgroundColor", ""), "")
$w_key=IniRead($ini,"Options","w",01) ; 57
$a=IniRead($ini,"Options","a",01) ; 41
$s=IniRead($ini,"Options","s",01) ; 53
$d=IniRead($ini,"Options","d",01) ; 44
$jump=IniRead($ini,"Options","jump",01) ; 20
$crouch=IniRead($ini,"Options","crouch",01) ; 11
$melee=IniRead($ini,"Options","melee",01) ; 45
$sprint=IniRead($ini,"Options","sprint",01) ; 10
$Keycodes = StringSplit("08|09|0C|0D|10|11|12|13|14|1B|20|21|22" & _
"|23|24|25|26|27|28|29|2A|2B|2C|2D|2E|30" & _
"|31|32|33|34|35|36|37|38|39|41|42|43|44" & _
"|45|46|47|48|49|4A|4B|4C|4D|4E|4F|50|51" & _
"|52|53|54|55|56|57|58|59|5A|5B|5C|60|61" & _
"|62|63|64|65|66|67|68|69|6A|6B|6C|6D|6E" & _
"|6F|70|71|72|73|74|75|76|77|78|79|7A|7B" & _
"|90|91|A0|A1|A2|A3|A4|A5", "|")
$sprint_pressed=0
Global $key_pressed[100]
#region ### START Koda GUI section ### Form=
$Form
= GUICreate("KeyPresses", 220, 245, IniRead($ini, "Options", "x", 0),
IniRead($ini, "Options", "y", 0),$WS_POPUP,
$WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_TRANSPARENT)
GUISetState()
#endregion ### END Koda GUI section ###
#region splash
SplashImageOn("splash",$gfx&"Splash.jpg",1000,600,Default,Default,1)
While 1
If Check() Then ExitLoop
WEnd
Func Check()
Local $i
Local $Keycodes = StringSplit("01|02|04|05|06" & _
"|08|09|0C|0D|10|11|12|13|14|1B|20|21|22" & _
"|23|24|25|26|27|28|29|2A|2B|2C|2D|2E|30" & _
"|31|32|33|34|35|36|37|38|39|41|42|43|44" & _
"|45|46|47|48|49|4A|4B|4C|4D|4E|4F|50|51" & _
"|52|53|54|55|56|57|58|59|5A|5B|5C|60|61" & _
"|62|63|64|65|66|67|68|69|6A|6B|6C|6D|6E" & _
"|6F|70|71|72|73|74|75|76|77|78|79|7A|7B" & _
"|90|91|A0|A1|A2|A3|A4|A5", "|")
For $i in $Keycodes
If _IsPressed(String($i)) Then Return 1
Next
Return 0
EndFunc
SplashOff()
#endregion splash
ConsoleWrite(@CRLF&"BG
options not
empty("&IniRead($ini,"Options","Backgroundcolor","")&"), setting
BG as "&$bgColor)
GUISetBkColor($bgColor)
ConsoleWrite(@CRLF&"Filtering transparent BG")
_WinAPI_SetLayeredWindowAttributes($form, 0x123456, 250)
_GDIPlus_Startup()
#region init buttons
;min 10,10 from border
;10px free between images
; W image x:80, y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/w.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; A image x:10, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/a.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; S image x:80, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/s.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; D image x: 150, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/d.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; Jump image x:10,y:150
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/jump.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; Crouch image x:10,y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/crouch.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
; Melee image x:150,y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/melee.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
;Sprint image x:150,y:220
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/sprint.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
#endregion init buttons
redraw()
ConsoleWrite(@CRLF&"buttons initialized and drawn")
While 1
If GUIGetMsg() = $GUI_EVENT_RESTORE Then redraw()
If GUIGetMsg() = $GUI_EVENT_MINIMIZE Then GUISetState(@SW_MINIMIZE)
If GUIGetMsg() = $GUI_EVENT_CLOSE Then close()
For $i in $Keycodes
If _IsPressed(String($i)) Then
ConsoleWrite(@CRLF&$i &" pressed")
$key_pressed[$i]=1
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir&"/gfx/"&$i&"_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
Switch $i
Case $w_key
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,80,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $a
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $s
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,80,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $d
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $jump
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $crouch
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $melee
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $sprint
$sprint_pressed=1
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case Else
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
EndSwitch
ElseIf _isPressed(String($i)) = 0 And $key_pressed[$i]=1 Then
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir&"/gfx/"&$i&".png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
Switch $i
Case $w_key
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,80,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $a
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $s
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,80,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $d
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,80,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $jump
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $crouch
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,10,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $melee
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,10,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Case $sprint
if $sprint_pressed =1 Then
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Else
EndIf
Case Else
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1,150,150,60,60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
EndSwitch
Else
EndIf
Next
WEnd
DllClose($hDLL)
Func close()
_GDIPlus_Shutdown()
DllClose($hDLL)
Exit
EndFunc ;==>close
Func redraw()
; Crouch image x:10,y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/crouch_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/crouch.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; W image x:80, y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/w_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/w.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; Melee image x:150,y:10
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/melee_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/melee.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 10, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; A image x:10, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/a_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/a.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; S image x:80, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/s_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/s.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 80, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; D image x: 150, y:80
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/d_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/d.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 80, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
; Jump image x:10,y:150
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/jump_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/jump.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 10, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
;Sprint image x:150,y:220
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/sprint_pressed.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
Sleep(50)
$hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/gfx/sprint.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1, 150, 150, 60, 60)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage1)
EndFunc ;==>redraw
Exit
Alles anzeigen
[autoit]
[/autoit][/autoit]
hier ein video dazu: http://www.youtube.com/watch?v=9HnxDDoX1o0
Das Problem, vor dem ich stehe ist folgendes:
Angenommen Ich will z.B. einen Guide erstellen und den Leuten zeigen, was ich drücke.
Ich starte das Programm und bekomme das Fenster. So weit so gut.
Falls ich streame und xSplit benutze, kann ich dies einfach als ScreenRegion einfügen und die Sache hat sich erledigt.
ABER: Was ist, wenn ich FRAPS benutzen will?
Fraps nimmt das Tool logischerweise nicht auf.
Also muss ich eine Möglichkeit finden, um das möglich zu machen.
Die Tastenanschläge will ich nicht unbedint in eine txt o.Ä schreiben, da das dann einn Keylogger wäre und nichts in einem Tool zu suchen hat.
Ich hoffe ihr könnt mir hier helfen
Askuriel