Jump to content
Moopler
  • 0
Progity

Question Script to open rare treasure chest automatically?

Question

6 answers to this question

Recommended Posts

  • 3

Here's an updated pet feed script.

And for the automatic open rare box, You can make a hotkey to open the box by dragging  the item into the hotkey in maplestory and use any keypress script to spam that key.:)

 

 

Spoiler

// Auto Pet Feed [EMS 116.2]
// by Franc[e]sco




define(KEY_NORMAL,0)
define(KEY_EXTENDED,1)




// you can add more virtual key codes by getting them here
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
// for letters, the uppercase character is enough
define(VK_END,24)




// -----------------------------------------------------------------------------
// Settings




// the script will feed the pet when fullness drops below or equal to this value
// (don't forget to put # in front of the value to specify that it's decimal!)
define(FeedFullness,#70)




// the key to press to feed the pet
define(FoodKey,VK_END)




// KEY_NORMAL for most keys, KEY_EXTENDED for special keys like CTRL
// it shouldn't matter for simple keypresses
define(FoodKeyType,KEY_NORMAL)




// -----------------------------------------------------------------------------
// Addresses and offsets




// ? ? ? ? 00 00 ? ? ? ? ? ? ? ? E8 ? ? ? ? ? ? C8 ? ? ? ? ? ? ? 00 00 ? ? E8 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E8
define(PetFullnessAddy,00aa25b9) // v160.3




// TSingleton<CWndMan>::ms_pInstance
// 8B 15 ? ? ? ? 85 D2 74 23
define(TSingleton_CWndMan___ms_pInstance,0058e2d0) // v160.3




// virtual void __thiscall CWndMan::OnKey(unsigned int lparam, unsigned int wparam)
// ? ? ? ? ? 85 ? 74 ? 8D ? ? 8B ? 8B ? FF ? C2 08 00
define(CWndMan__OnKey,013dab90) // v160.3




[Enable]
alloc(PetFullnessHook,64)
alloc(PressKey,128)
label(DontFeed)




// PressKey flags and internal stuff
define(KEY_PRESS,0)
define(KEY_UP,1)
define(MAPVK_VK_TO_VSC,0)




// Pet fullness hook
PetFullnessAddy:
jmp PetFullnessHook
nop




PetFullnessHook:
mov [esi+000000D4],edx // original code 160.3
cmp edx,FeedFullness
jg DontFeed




push KEY_PRESS          // transition_state
push FoodKeyType // extended_flag
push FoodKey     // virtual_key
call PressKey




DontFeed:
jmp PetFullnessAddy+6




// void __stdcall PressKey(uint32_t virtual_key, uint32_t extended_flag, uint32_t transition_state)
PressKey:
push ebx // backup
push edx // backup
push esi // backup
push ecx // backup




mov edx, [esp+10+4] // edx = virtual keycode
mov esi, [esp+10+8] // esi = is extended keycode
mov ebx, [esp+10+C] // ebx = transition state flag
mov ecx, edx        // ecx = virtual keycode (will later contain the scancode)




// generate scancode with MapVirtualKeyA(virtual_key, MAPVK_VK_TO_VSC) << 16
// credits to Shadow and Waty
push MAPVK_VK_TO_VSC
push ecx
call MapVirtualKeyA
shl eax,#16
shl esi,#24 // extended flag
shl ebx,#31 // transition state
or eax, esi
or eax, ebx
mov ecx,eax




push ecx // lparam (keycode)
push edx // wparam (virtual keycode)
mov ecx,[TSingleton_CWndMan___ms_pInstance]
call CWndMan__OnKey




pop ecx // backup
pop esi // backup
pop edx // backup
pop ebx // backup
ret 000C




[Disable]
PetFullnessAddy:
mov [esi+000000D4],edx // original code 160.3




dealloc(PetFullnessHook)
dealloc(PressKey)

 

 

Edited by YeeShin
  • Like 2

Share this post


Link to post
  • 0
On 26/01/2016 at 11:09, YeeShin said:

Here's an updated pet feed script.

And for the automatic open rare box, You can make a hotkey to open the box by dragging  the item into the hotkey in maplestory and use any keypress script to spam that key.:)

 

 

  Hide contents


// Auto Pet Feed [EMS 116.2]
// by Franc[e]sco




define(KEY_NORMAL,0)
define(KEY_EXTENDED,1)




// you can add more virtual key codes by getting them here
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
// for letters, the uppercase character is enough
define(VK_END,24)




// -----------------------------------------------------------------------------
// Settings




// the script will feed the pet when fullness drops below or equal to this value
// (don't forget to put # in front of the value to specify that it's decimal!)
define(FeedFullness,#70)




// the key to press to feed the pet
define(FoodKey,VK_END)




// KEY_NORMAL for most keys, KEY_EXTENDED for special keys like CTRL
// it shouldn't matter for simple keypresses
define(FoodKeyType,KEY_NORMAL)




// -----------------------------------------------------------------------------
// Addresses and offsets




// ? ? ? ? 00 00 ? ? ? ? ? ? ? ? E8 ? ? ? ? ? ? C8 ? ? ? ? ? ? ? 00 00 ? ? E8 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E8
define(PetFullnessAddy,00aa25b9) // v160.3




// TSingleton<CWndMan>::ms_pInstance
// 8B 15 ? ? ? ? 85 D2 74 23
define(TSingleton_CWndMan___ms_pInstance,0058e2d0) // v160.3




// virtual void __thiscall CWndMan::OnKey(unsigned int lparam, unsigned int wparam)
// ? ? ? ? ? 85 ? 74 ? 8D ? ? 8B ? 8B ? FF ? C2 08 00
define(CWndMan__OnKey,013dab90) // v160.3




[Enable]
alloc(PetFullnessHook,64)
alloc(PressKey,128)
label(DontFeed)




// PressKey flags and internal stuff
define(KEY_PRESS,0)
define(KEY_UP,1)
define(MAPVK_VK_TO_VSC,0)




// Pet fullness hook
PetFullnessAddy:
jmp PetFullnessHook
nop




PetFullnessHook:
mov [esi+000000D4],edx // original code 160.3
cmp edx,FeedFullness
jg DontFeed




push KEY_PRESS          // transition_state
push FoodKeyType // extended_flag
push FoodKey     // virtual_key
call PressKey




DontFeed:
jmp PetFullnessAddy+6




// void __stdcall PressKey(uint32_t virtual_key, uint32_t extended_flag, uint32_t transition_state)
PressKey:
push ebx // backup
push edx // backup
push esi // backup
push ecx // backup




mov edx, [esp+10+4] // edx = virtual keycode
mov esi, [esp+10+8] // esi = is extended keycode
mov ebx, [esp+10+C] // ebx = transition state flag
mov ecx, edx        // ecx = virtual keycode (will later contain the scancode)




// generate scancode with MapVirtualKeyA(virtual_key, MAPVK_VK_TO_VSC) << 16
// credits to Shadow and Waty
push MAPVK_VK_TO_VSC
push ecx
call MapVirtualKeyA
shl eax,#16
shl esi,#24 // extended flag
shl ebx,#31 // transition state
or eax, esi
or eax, ebx
mov ecx,eax




push ecx // lparam (keycode)
push edx // wparam (virtual keycode)
mov ecx,[TSingleton_CWndMan___ms_pInstance]
call CWndMan__OnKey




pop ecx // backup
pop esi // backup
pop edx // backup
pop ebx // backup
ret 000C




[Disable]
PetFullnessAddy:
mov [esi+000000D4],edx // original code 160.3




dealloc(PetFullnessHook)
dealloc(PressKey)

 

 

Thank you very much guy, you really saved me, but i'm really don't know how to script, then can you tell me how to make a keypress script?

Edited by Progity

Share this post


Link to post
  • 0

searchstring:
db 'MapleStoryClass'
db 00
 
hook:
pushad
push 0
push searchstring
call FindWindowA
mov esi,eax

push 0
push 4E // Keycode in hex of the key, "N" here
call MapVirtualKeyA

shl eax,10
push eax
push 4E // Keycode again
push 100
push esi
call PostMessageA
popad

top kek

Share this post


Link to post
  • 0
2 hours ago, DAVHEED said:


searchstring:
db 'MapleStoryClass'
db 00
 
hook:
pushad
push 0
push searchstring
call FindWindowA
mov esi,eax

push 0
push 4E // Keycode in hex of the key, "N" here
call MapVirtualKeyA

shl eax,10
push eax
push 4E // Keycode again
push 100
push esi
call PostMessageA
popad

top kek

how can i use it? it keeps saying to put enable and disable when i try it on cheat engine

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×