Green Macro v5 has been released for a few weeks. Now you can search images on DirectX game with new fucntions/interface in the DLL.
Download v5 at:
http://geafktools.appspot.com/download/GreenMacro_Release5.zip
Sample code (AutoIT v3) for calling the DLL to search image and send mouse click on the searched image is also available at:
geafktools.appspot.com
thanks for using Green Macro
----
note:
I was thinking of developing a version for Windows 7(64 bit), which should not be harder than the XP version, because the Win7 Version x-trap/gameguard no longer able to hook kernel functions. So developing at user mode level ought be enough to bypass it. I already have the idea but the BIG thing is I do not have a Windows 7 64 bit operation system, >_<
Will keep you posed.
Still, the quickest solution for you is...Getting a XP now, XD
thanks.
nice tools:) Me got only 1 problem me hate work with autoit....can you make me any code sample pls for C#? me need use the ddl call in C#
ReplyDeleteHi, I supposed it doesn't work with wireless keyboard and mouse?
ReplyDeleteAnd how about laptops?
it supports all kinds of keyboard/mouse/desktop/laptop, as long as it's Microsoft XP.
ReplyDelete------------------------------
as for C# code, please refer to the interface file:
https://geafktools.appspot.com/GreenMacroDLL_interface.txt
do dll import like this:
[DllImport("GreenMacroDLL.dll")]
static extern int KeyboardInput(int v_key, int down1);
call it:
int sent=KeyboardInput(0x37, 1); //key down virtual key 0x37
Thread.Sleep(40);//delay 40 ms
sent = KeyboardInput(0x37, 0); //key up virtual key 0x37
good luck!
ty :) but me now try search method to load and unload the dll....maybe with dinamic assemble load...idk..
Deleteif my project done me show you:)and maybe you can use my code later.
Thanks
ReplyDeleteme again found a problem:)
ReplyDeleteme try open and close the dll, but the dinamic importing is dosnt working. here my code what me try to use:
///////////////////////////////////////////////////////////
using System;
using System.Reflection;
namespace Program
{
Public Class1:
{
Assembly keypress =Assembly.Loadfile(@" the dll ")
}
////////////////////////////////////////////////////////////
me get error code any offset isnt good...@.@
The standard [DLLImport("dll name")]its working, but the xtarp/gameguard is blocking the fuctions in 3 sec. this why me search a method to open and close the dll...
in autoit was easy:$dll(....) DlllClose
but me dont found this functions in C#...@.@
you have any another idea how can me open and close the dll in runtime? me wait your respond...tysm.
oh and me tested the C++ dynamic import system to, but its downt working to...
me tested to add reference dll the Greenmacro to my project, but nothing...system dosnt apply the dll to reference...@.@
LOL :)
ReplyDeletein c#, try to use win32 API LoadLibrary and FreeLibrary to open/close greenmacrodll.dll...
sorry for the late reply. please let me know if it works. thanks.
me maked a test solution for show you what code working...but working only for limited time...because me try repeat the keypresses with timer, or while ciklic, and 3 min and the program dosnt open the dll. pls give me any email adress, and me send for you the source code files, and you can check it.
ReplyDeleteme created 2 solution...
1 with dynamic dll import(working only for max 3 min )
1 with dllimport (working only for max 3 min)
the loadlibrary freelibrary functions dosn't working
me tested it.
check my registered mail adress in your system, and you can mail me for communication( my user name in GreenMacro: atommacika)
okey dear Programmer, dear users i got he working code, and me share for us.
ReplyDeleteMe tested 3 versin form dll call.
1. with Api calls.(100% working, but very hard repeat the keypresses, and need know a lot of programming technic, because you need use multitask System, with Thread class)
here the source code for sample:(need create a class)
############################################################
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
namespace Rohan
{
static class Alapmetódusok
{
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
public static extern bool FreeLibrary(IntPtr hModule);
}
class Functions
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int KeyboardInput(int v_key, int down1);
public static void v_key_0()
{
{
IntPtr pDll = Alapmetódusok.LoadLibrary(@"E:\Documents and Settings\Szabó Gergely\Asztal\Macro\GreenMacroDLL.DLL");
//if (pDll == IntPtr.Zero)
IntPtr funkcióhívás = Alapmetódusok.GetProcAddress(pDll, "KeyboardInput");
//if(pAddressOfFunctionToCall == IntPtr.Zero)
KeyboardInput keyboardinput = (KeyboardInput)Marshal.GetDelegateForFunctionPointer(
funkcióhívás,
typeof(KeyboardInput));
int sent_0 = keyboardinput(0x30, 1);
Thread.Sleep(100);
sent_0 = keyboardinput(0x30, 0);
bool result = Alapmetódusok.FreeLibrary(pDll);
###########################################################
if you need repeat the keypress or any Dll function, you dneed use new TASK. there the Thread class to do it.
Here the sample Code:
###########################################################
hunter = new Thread(new ThreadStart(HunterFunction));
hunter.IsBackground = true;
hunter.Start();
//and the function.
public void HunterFunction()
{
try
{
MethodInvoker Hunter_0
=newMethodInvoker(Functions.v_key_0);
while(true)
{
BeginInvoke(Hunter_v_key_0);
Thread.Sleep(1000);
}
}
catch
{
}
}
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
this sample make a "0" keypres repeated in all 1 secound.
good lock to use it :)
if you need stop the keypres, just need set to null the function.
thanks for sharing the code. hopefully who ever use it can benefit from it, :)
ReplyDeletegood luck
Good work
ReplyDeleteThanks a lot :D
Please help me simulate left arrow key by GreenMacroDLL.dll.
ReplyDeleteMy computer is windows xp.
I use code 37(0x25) for simulate left arrow key but when run the program appear '4' in notepad.
;this is my code
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Sleep(1000);
Local $dll = DllOpen("GreenMacroDLL.dll")
if $dll <> -1 Then
$v_key=55; virtual key for key 7 : 55 (0x37)
$keydown=1;
$keyup=0;
$result1 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keydown);//key down;
Sleep(50);
$result2 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keyup);//key up
DllClose($dll)
;MsgBox(0,"keydown succeed?", $result1[0]);
;MsgBox(0,"keyup succeed?", $result2[0]);
endif
Local $dll = DllOpen("GreenMacroDLL.dll")
if $dll <> -1 Then
$v_key=37; virtual key for key left : 37 (0x25) .... appear '4' in notepad
$keydown=1;
$keyup=0;
$result1 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keydown);//key down;
Sleep(50);
$result2 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keyup);//key up
DllClose($dll)
;MsgBox(0,"keydown succeed?", $result1[0]);
;MsgBox(0,"keyup succeed?", $result2[0]);
endif
Ya...I realized that problem...the quickest fix is to turn off your "Num Lock" to see if that works for you or not. because the numpad 4,6,8,2 will also work as arrow keys if you turn off "Num Lock"...
Deletesorry for the late reply. let me know. thanks.
Thanks, it works in notepad, but in the game it does not move when press the Numpad buttons. The game character can move by only the buttons below.
ReplyDelete..... [ ↑ ]
[←] [ ↓ ] [→]
Hi, i can't run green macro in my windows xp 32bit.
ReplyDeleteit run under vmware