Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Release] AutoHotkey script for auto click in MapleStory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
4ng3licDew
Cheater
Reputation: 0

Joined: 14 Feb 2008
Posts: 28

PostPosted: Sun Mar 09, 2008 9:53 pm    Post subject: [Release] AutoHotkey script for auto click in MapleStory Reply with quote

Hi Everyone,

I am posting an example script for AutoHotkey on how to generate auto click for key t and for left mouse button double click.

For anyone who don't know what AutoHotkey is, here is a quote from wikipedia:
Quote:

AutoHotkey is a free, open source macro-creation and automation software utility which allows users to automate repetitive tasks and modify the Windows user interface.


Initial setup:
1. You need windows xp pro sp2, 32 bits
2. Download and install AutoHotkey. Use Google and search for autohotkey.
3. Download hookHop.dll and put it into the ahk (AutoHotkey) folder. *Thanks Spoonge for his hookHop.dll. I have attached this file in this post.

Here is the ahk script. Just copy and paste it into your ahk script file.

Code:

; Load hookHop.dll into memory
hModule := DllCall("LoadLibrary", Str, "hookHop.dll")

WM_KEYDOWN := 0x100
WM_KEYUP := 0x0101
WM_CHAR := 0x0102
WM_LBUTTONDOWN := 0x0201
WM_LBUTTONUP := 0x202
WM_LBUTTONDBLCLK := 0x203

; A pos is a struct consisting of two 32-bit integers (i.e. 2*4 bytes=8)
VarSetCapacity(MyPos, 8)

VIRTUALKEY_T := 0x54
LPARAM_T := 0

timerFlag := 0
timerFlag2 := 0
cHandle := 0 ; Window handle to MapleStory

;
; Press (Control + F5) to turn on or off auto click t
;
^F5::
{
   ; Get window handle of MapleStory
   cHandle := DllCall("FindWindow", Str, "MapleStoryClass", UInt, 0)

   ; Convert virtual key value to scancode value,
   ; Shift left 16 bits (same as multiply by 2 ^ 16)
   ; then add 1
   LPARAM_T := DllCall("MapVirtualKey", Int, VIRTUALKEY_T, Int, 0) * 65536 + 1

   if (timerFlag = 0)
   {
       timerFlag = 1
      ; Set auto click every 1 second
      SetTimer, PressKey, 1000
   }
   else
   {
      timerFlag = 0
      ; Turn off auto click
      SetTimer, PressKey, Off
   }
   return
}

;
; Timer 1 callback to generate key t press event
;
PressKey:
{
   DllCall("hookHop.dll\hhPostMessageA", UInt, cHandle, UInt, WM_KEYDOWN, UInt, VIRTUALKEY_T, UInt, LPARAM_T)
   return
}

;
; Press (Control + F6) to turn on or off auto double click left mouse button
; Note: You need to move your mouse cursor over what you want to
; double click before pressing the hot key (Control + F6)
;
^F6::
{
   ; Get window handle of MapleStory
   cHandle := DllCall("FindWindow", Str, "MapleStoryClass", UInt, 0)

   ; Get cursor position
   DllCall("GetCursorPos", Str, MyPos)

   ; Update the variable's internally-stored length after calling DllCall
   VarSetCapacity(MyPos, -1)

   if (timerFlag2 = 0)
   {
      timerFlag2 = 1
      ; Set auto click every 1 second
      SetTimer, PressKey2, 1000
   }
   else
   {
      timerFlag2 = 0
      ; Turn off auto click
      SetTimer, PressKey2, Off
   }
return
}

;
; Timer 2 callback to double click left mouse button
;
PressKey2:
{
   DllCall("hookHop.dll\hhPostMessageA", UInt, cHandle, UInt, WM_LBUTTONDOWN, UInt, 0, Str, MyPos)
   DllCall("hookHop.dll\hhPostMessageA", UInt, cHandle, UInt, WM_LBUTTONUP, UInt, 0, Str, MyPos)
   DllCall("hookHop.dll\hhPostMessageA", UInt, cHandle, UInt, WM_LBUTTONDBLCLK, UInt, 0, Str, MyPos)
   DllCall("hookHop.dll\hhPostMessageA", UInt, cHandle, UInt, WM_LBUTTONUP, UInt, 0, Str, MyPos)
   return
}



Enjoy!



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.


The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites