Ja, D3D-Menu wirst du mit Autoit nicht gerade schaffen. Da ich heute nett bin, geb ich dir mein C++-Menu.
@MoepMeep: Soweit ich weiß macht man das mit einer *.dll. Ich habe noch keine D3D-Hook ohne *.dll gesehen. Bin mir aber nicht sicher, ob es vielleicht doch einen Weg gibt.
Menu.cpp
Code:
#include "stdafx.h"
// Menu
const D3DCOLOR txtBlack = D3DCOLOR_ARGB( 255, 0, 0, 0 );
const D3DCOLOR txtGreen = D3DCOLOR_ARGB( 255, 0, 255, 0 );
const D3DCOLOR txtGray = D3DCOLOR_ARGB( 0, 125, 125, 125 );
const D3DCOLOR txtRed = D3DCOLOR_ARGB( 255, 255, 0, 0 );
const D3DCOLOR txtPink = D3DCOLOR_ARGB( 255, 255, 0, 255 );
const D3DCOLOR txtWeith = D3DCOLOR_ARGB( 0, 255, 255, 255 );
int ShowMenu = 0;
int Is_Credit_on = 1;
int i = 1;
int t = 0;
int Show_Text = 1;
POINT curPos;
LPDIRECT3DTEXTURE9 texturPink;
ButtonStats buttonstats[ Size_of_Menu ] = { };
bool IsCursorOverButton( int X, int Y, int W, int H, int SpacingBuff, int Spacing );
void MenuFunktions( LPDIRECT3DDEVICE9 m_pDevice, ID3DXFont* pFont, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount, int myStride );
struct MenuData
{
int x;
int y;
int bright;
int withe;
};
MenuData MenuSettings =
{
0,
0,
200,
250
};
struct MenuOpt
{
char* Name;
bool IsMouseOver;
bool Checked;
};
MenuOpt MenuOption[ Size_of_Menu ] = { };
void AddItem( char* OptionName, int Index )
{
MenuOption[ Index ].Name = OptionName;
}
void DrawRect( LPDIRECT3DDEVICE9 Device_t, int X, int Y, int L, int H, D3DCOLOR color )
{
D3DRECT rect = { X, Y, X + L, Y + H };
Device_t->Clear( 1, &rect, D3DCLEAR_TARGET, color, 0, 1 );
}
void DrawMenuFont( ID3DXFont* pFont, int X, int Y, D3DCOLOR Color, char* format )
{
RECT FontRect = { X, Y, X + 120, Y + 16 };
pFont->DrawTextA( NULL, format, -1, &FontRect, DT_NOCLIP , Color );
}
void DrawNonFilledRect( IDirect3DDevice9* dev, int x, int y, int w, int h, DWORD color )
{
DrawRect( dev, x, y, w, 1, color );
DrawRect( dev, x, y, 1, h, color );
DrawRect( dev, x, y + h, w, 1, color );
DrawRect( dev, x + w, y, 1, h, color );
}
void GenetateTex( LPDIRECT3DDEVICE9 Device )
{
GenerateTexture( Device, &texturPink, txtPink );
}
void CreateMenu( LPDIRECT3DDEVICE9 Device, ID3DXFont* Font, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount, int MyStride )
{
if ( i == 1 )
{
AddItem( "Charms", 0 );
AddItem( "Zoom Hack", 1 );
AddItem( "Swear Filter", 2 );
AddItem( "Credits", 3 );
GenetateTex( Device );
i = 0;
}
if ( GetAsyncKeyState( VK_DELETE ) & 1 )
{
GetCursorPos( &curPos );
MenuSettings.x = curPos.x;
MenuSettings.y = curPos.y;
ShowMenu = !ShowMenu;
}
if ( ShowMenu == 1 )
{
DrawRect( Device, MenuSettings.x - 62, MenuSettings.y, MenuSettings.bright - 98, MenuSettings.withe - 140, txtWeith );
for ( int i = 0; i < Size_of_Menu; i++ )
{
DrawRect( Device, MenuSettings.x, MenuSettings.y + (i * 30), 40, 20, txtGray );
if ( IsCursorOverButton( MenuSettings.x, MenuSettings.y, 40, 20, i, 30 ) )
{
MenuOption[ i ].IsMouseOver = TRUE;
}
else
{
MenuOption[ i ].IsMouseOver = FALSE;
}
if ( MenuOption[ i ].IsMouseOver )
{
if ( GetAsyncKeyState( VK_LBUTTON ) & 1 )
{
MenuOption[ i ].Checked = !MenuOption[ i ].Checked;
}
}
if ( MenuOption[ i ].Checked )
{
DrawMenuFont( Font, MenuSettings.x - 62, MenuSettings.y + ( i * 30 ) + 1, txtBlack, MenuOption[ i ].Name );
DrawMenuFont( Font, MenuSettings.x + 3, MenuSettings.y + ( i * 30 ) + 1, txtGreen, " [ ON ]" );
buttonstats[ i ].IsChecked = TRUE;
}
else
{
DrawMenuFont( Font, MenuSettings.x - 62, MenuSettings.y + ( i * 30 ) + 1, txtBlack, MenuOption[ i ].Name );
DrawMenuFont( Font, MenuSettings.x + 3, MenuSettings.y + ( i * 30 ) + 1, txtRed, "[ OFF ]" );
buttonstats[ i ].IsChecked = FALSE;
}
}
}
MenuFunktions( Device, Font, PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount, MyStride );
}
bool IsCursorOverButton( int X, int Y, int W, int H, int SpacingBuff, int Spacing )
{
GetCursorPos( &curPos );
if( curPos.x >= X && curPos.x <= X + W && curPos.y >= Y + ( SpacingBuff * Spacing ) && curPos.y <= Y + H + ( SpacingBuff * Spacing ) )
{
return TRUE;
}
else
{
return FALSE;
}
}
void MenuFunktions( LPDIRECT3DDEVICE9 m_pDevice, ID3DXFont* pFont, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount, int myStride )
{
if ( ( buttonstats[ 3 ].IsChecked == TRUE && Is_Credit_on == 1 ) ) // Credits
{
DrawFont( pFont, 420, 1, txtGreen, "An example how to detour D3D functions. Created by yihaaa." );
DrawFont( pFont, 420, 20, txtGreen, "Credits goes to: Twice and Azorbix. Still, and always, coding for fun!" );
Is_Credit_on = 0;
}
else
{
Is_Credit_on = 1;
}
if ( ( buttonstats[ 0 ].IsChecked == TRUE ) ) // Charms
{
if ( myStride == 52 )
{
m_pDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
m_pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
m_pDevice->SetTexture( 0, texturPink );
m_pDevice->DrawIndexedPrimitive( PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
}
}
if ( ( buttonstats[ 1 ].IsChecked == TRUE ) ) // Zoom Hack
{
}
}
Edit: An dem Menu muss noch etwas verbessert werden vorallem mit der Schrift :P Wer das copy&paste übernimmt wird Probleme bekommen, wenn es offen ist!
Könnte man das nicht einfach über das Game drüberpixeln?
Hab was mit WinAPI probiert.
Es hat auch teilweise geklappt.
Teilweise deshalb, weil das ganze flimmert.
Der Screen sieht schon sehr noch einem D3D-Hook aus. Ich habe noch nie wirklich etwas mit AutoIt gemacht. Wenn du es einfach die Pixel überschreiben willst, würde ich das noch mal überdenken. Bei CS:S hat meine eine FPS-Rate von ca. 100, d.h. 100 Bilder/Sekunde. Wenn du dann noch überschreieben willst, musst du genau so viele machen. Da wrist du mit der Perforamance von Autoit Probleme bekommen und dein Rechner wird langsam.
Könnte man das nicht einfach über das Game drüberpixeln?
Hab was mit WinAPI probiert.
Es hat auch teilweise geklappt.
Teilweise deshalb, weil das ganze flimmert.
Das alles wurde mit AutoIT geschrieben.
Es muss also möglich sein.
Addet mich mal in Skype, würde gerne mal erfahren wie das ganze funktioniert.
@yihaaa
Leider kann ich mit C++ nichts anfangen :-)
Wenn du mir das ganze aber zeigen könntest, wäre ich sehr dankabar.
Ganz genau, es flimmert, das ist normal, wenn du mit GDI über DirectX Anwendungen zeichnen willst. Ohne D3D Hook wirst du kein vernünftiges Ingame Menü hinbekommen, es sei denn, du machst einfach ein unabhängiges Fenster, was die ganze Zeit im Vordergrund ist und Events nach eigenem Verarbeiten an das Spiel weiterleitet, aber das bezeichne ich nicht als Ingame Menü, sondern als völlig idiotische Idee.
D3D Hooks sind rein theoretisch auch mit Autoit möglich, aber das wäre mir persönlich zu viel Aufwand. Lern einfach eine richtige Sprache
[Frage]Ingame Hack Menü mit AutoIT 04/28/2011 - AutoIt - 5 Replies Hey Leute,
würde gerne wissen, ob, oder wie man ein Ingame Hack Menü codet.
Danke für alle Antworten.
MfG
Yevii
AutoIt Frage zu einen Spammer mit GUI Menü 08/22/2010 - AutoIt - 3 Replies Hallo, ich versuche derzeit einen Spammer zu machen, ich hab mir schon AutoIt Grundlagen durchgelesen und weiterführendes auch...
Ich mache jetzt zu Übung einen Coder, einen selbst schießenden AimBot hab ich bereits mit etwas Hilfe geschafft (armes Moorhuhn^^).
Also so siehts aus:
Ich weiß nicht, warum es nicht starten will, wenn ich 1 in Interval schreibe und etwas in die erste Textbox eingebe, HotKey ist die UP also die Hochtaste...
#include <EditConstants.au3>
#include...