Autohotkey Winactivate Partial Title

autohotkey winactivate partial title
/*
@author Aria

This is a script for botting on flat maps
The bot doesn’t need window focus when attacking, but it needs window focus when moving the character
Feel free to distribute this script on other forums, but link back to the original thread so that users can get support if needed
I recommend installing a text editor like Notepad++ or Visual Studio Code to make editing this script easier

This bot is intended to make grinding require much less attention, not allow you to bot 24/7
You should not leave this bot unattended; GMs CAN and WILL inspect you for botting

autohotkey winactivate partial title get more info autohotkey winactivate partial title
An alarm will play if:
-another player enters your map, allowing you to respond to them
-the number of mobs hasn’t changed recently
-the amount of NX you have hasn’t changed recently
-your character is far away from the position you started the bot at
-you are on a different map than you started the bot at

The bot will try to save you if you get a lie detector from a player/GM, since a lie detector will prevent you from gaining NX or killing mobs, causing an alarm to be triggered
I wouldn’t be surprised if the server staff implemented measures to counteract that, so you shouldn’t rely too much on that form of detection
You may want to add color detection to the bot, which will allow you to fully detect elite bosses, lie detectors, etc
autohotkey winactivate partial title check here autohotkey winactivate partial title

;===================Instructions for use===================
COMPILE THIS SCRIPT (right click -> compile or run Ahk2Exe) AND RENAME THE EXE FILE TO SOMETHING THAT ISN’T SUSPICIOUS BEFORE STARTING IT
You may want to change the value of some variables in the “User-defined variables” section
You will have to change the value of “wallXPos” if you are hugging a wall
Start this script in the map you want to bot at by the position
You can find more detailed instructions on the thread

OSSYRIA STAFF CAN SEE YOUR RUNNING PROCESSES BY USING THE !PROCESSES COMMAND, WHICH IS WHY YOU NEED TO RENAME THE EXE FILE TO SOMETHING THAT ISN’T SUSPICIOUS
Known servers which block AutoHotkey: Ossyria, Aries, Global MapleStory
autohotkey winactivate partial title more info autohotkey winactivate partial title

If you know how to script with AutoHotkey, you should change the behavior of this script
It is inevitable that October and his staff will see this script and develop measures against it
GMs target people in offline mode, so don’t have that enabled

If you wish to view debug output, download DebugView from https://docs.microsoft.com/en-us/sysinternals/downloads/debugview
*/

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
autohotkey winactivate partial title click here autohotkey winactivate partial title
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; This function will return the correct address regardless of the
; bitness (32 or 64 bit) of both the AHK exe and the target process
; That is they can both be 32 bit or 64 bit, or the target process
; can be 32 bit while ahk is 64bit
getProcessBaseAddress(WindowTitle, MatchMode=3) ;WindowTitle can be anything ahk_exe ahk_class etc
{
autohotkey winactivate partial title more info autohotkey winactivate partial title
mode := A_TitleMatchMode
SetTitleMatchMode, %MatchMode% ;mode 3 is an exact match
WinGet, hWnd, ID, %WindowTitle%
if !hWnd
return ; return blank failed to find window
; GetWindowLong returns a Long (Int) and GetWindowLongPtr return a Long_Ptr
BaseAddress := DllCall(A_PtrSize = 4
? “GetWindowLong”
: “GetWindowLongPtr”, “Ptr”, hWnd, “Uint”, -6, “UInt”)
SetTitleMatchMode, %mode% ; In case executed in autoexec
autohotkey winactivate partial title check here autohotkey winactivate partial title
return BaseAddress ; If DLL call fails, returned value will = 0
}
;———————————————–
ReadMemory(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%

VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall(“OpenProcess”, “Int”, 24, “Char”, 0, “UInt”, pid, “UInt”)
DllCall(“ReadProcessMemory”, “UInt”, ProcessHandle, “Ptr”, MADDRESS, “Ptr”, &MVALUE, “Uint”,4)
autohotkey winactivate partial title more info autohotkey winactivate partial title
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
result := result<>32 ;convert from unsigned to signed int
return, result
}
;Reads the value of a single pointer + offset in MapleStory
win_title = “Ossyria”
ReadMapleMemory(POINTER, OFFSET)
{
;AHK uses window title
autohotkey winactivate partial title read more autohotkey winactivate partial title
return ReadMemory(ReadMemory(POINTER, “Ossyria”) + OFFSET, “Ossyria”)
;return ReadMemory(ReadMemory(POINTER, %win_title%) + OFFSET, %win_title%)
}
;————————————————————

;===================v162 Pointers===================
;This bot will work on most private servers, but you need to edit the values if you are playing a different version of MS
;Partial values for other servers can be found on the thread
CUserLocal := 0x01E1ABF4
CharXOff := 0x0000D0F0
autohotkey winactivate partial title here autohotkey winactivate partial title
CharYOff := CharXOff + 4

;Warning if familiar isn’t present
apFamiliar := 0xBB30
AtkCountOff := 0x0000BF84

;Warning if mob count hasn’t changed in last X seconds
MobBase := 0x01E1F2C4 ;aka CMobPool
MobCountOff := 0x00000010

autohotkey winactivate partial title website autohotkey winactivate partial title
;GMs may try to warp players to another channel
ServerBase := 0x01E1ABF0
WorldOff := 0x00002194
ChannelOff := WorldOff + 8
;Warning if NX hasn’t changed in last X seconds
NXOffset := 0x00005D64

;Warning if more than X people in a map
PeopleBase := 0x01E1F2C0
PeopleCountOff := 0x00000018
autohotkey winactivate partial title read more autohotkey winactivate partial title

;Warning if not in specified map
MapInfoBase := 0x01E1F9E8
MapIDOff := 0x000013E4

PlayerX := ReadMapleMemory(CUserLocal, CharXOff)
PlayerY := ReadMapleMemory(CUserLocal, CharYOff)
AttackCount := ReadMapleMemory(CUserLocal, AtkCountOff)
FamiliarPresent := ReadMapleMemory(ReadMapleMemory(CUserLocal, apFamiliar), 4) ;The value this pointer returns is 0 if no familiar is present
MobCount := ReadMapleMemory(MobBase, MobCountOff)
autohotkey winactivate partial title click here autohotkey winactivate partial title
Channel := ReadMapleMemory(ServerBase, ChannelOff) ;Note: Channel count starts at 0
NXAmount := ReadMapleMemory(ServerBase, NXOffset)
PeopleCount := ReadMapleMemory(PeopleBase, PeopleCountOff)
MapID := ReadMapleMemory(MapInfoBase, MapIDOff)

;===================Automatic variables===================
startingMap := MapID ;Start on the map you are botting on
startingChannel := Channel ;If you’re not on the channel you started on, a GM obviously warped you to another one, so the script will stop and play the highest priority alert
warnFamiliar = False ;If you’re using a familiar, start the bot with it enabled, the bot will warn you if you need to resummon it
autohotkey winactivate partial title get more info autohotkey winactivate partial title
isRunning = False

;used for botting on maps where we stand still and attack
;the bot will attempt to walk back to the position it started at if it is far away
;If you are botting by a wall, start the bot by the wall you are standing against
startingPosX := PlayerX
startingPosY := PlayerY

;===================User-defined variables===================
autohotkey winactivate partial title read more autohotkey winactivate partial title
;used for botting on flat maps if you are moving from side to side, due to auto aggro on Ellinia this isn’t needed
mapRightSide = 0
mapLeftSide = 0

;Send a warning and play a sound if the player count is different
;Edit the number of players depending on the number of buffers you have
warnPlayerCount = 0
autoDC = False ;Kill MS if the current playercount != warnPlayerCount, not recommended since if you DC if a GM enters the map, it shows you’re using this script

;The bot will play a sound if no NX has been gained within a certain time period
autohotkey winactivate partial title read more autohotkey winactivate partial title
lastNX := NXAmount
lastTimeNXGained := A_TickCount
warningDelay := 30000 ;Warning delay in milliseconds

;If set to true, the script will play a sound each loop if there is no familiar present
familiarAlert = False

;The script will play a sound if the mob count hasn’t changed in a certain time period
lastMobCount := MobCount
lastMobChange := A_TickCount
autohotkey winactivate partial title here autohotkey winactivate partial title
warnMobCount = False

attackSleep = 100 ;Time to sleep (in milliseconds) between pressing each key (which should be much lower than the time your attack takes)
movementRange = 200 ;X distance the char is allowed to wander, set this to a higher value if you are hugging a wall (like 200)

;If set to true, the script will make your player hug a wall and attack in just one direction
;Face your character in the direction you want to attack
hugWall = True
wallXPos = 0 ;The X position of the wall you are going to hug, which you can find by looking at the value for “PlayerX” when the messagebox below appears
outOfWallRange = False ;This is used to let the script know it has to turn around in the direction it is attacking in if it moves out of range and has to walk back
autohotkey winactivate partial title read more autohotkey winactivate partial title

;Stuff related to keys
attackKey = {Control} ;Change this key to {Control down} if you’re playing a class that holds down the attack key

;You can add your own buff times and delays here if you want to cast more buffs
lastTimeBuffed1 := A_TickCount ;A_TickCount is the number of milliseconds since the computer was rebooted, it has nothing to do with the default value of buffKey1 being the ‘a’ key
buffDelay1 = 60000
buffKey1 = a
;To add more buffs, copy the code above and change the numbers at the end ex. lastTimeBuffed1 to lastTimeBuffed2
autohotkey winactivate partial title read more autohotkey winactivate partial title
;then do the same for the auto buff code at the very bottom of the script (the block of code starting at “if(A_TickCount – lastTimeBuffed1 > buffDelay1)”)
lastTimeBuffed2 := A_TickCount
buffDelay2 = 60000
buffKey2 = s ;change this to whatever your second buff key is if the key is different

autohotkey winactivate partial title here autohotkey winactivate partial title

;Shows information about the game
MsgBox, PlayerX %PlayerX% PlayerY %PlayerY% AttackCount %AttackCount% FamiliarPresent %FamiliarPresent% MobCount %MobCount% Channel %Channel% NXAmount %NXAmount% PeopleCount %PeopleCount% MapID %MapID%
isRunning := True

loop
{
PlayerX := ReadMapleMemory(CUserLocal, CharXOff)
autohotkey winactivate partial title here autohotkey winactivate partial title
PlayerY := ReadMapleMemory(CUserLocal, CharYOff)
AttackCount := ReadMapleMemory(CUserLocal, AtkCountOff)
FamiliarPresent := ReadMapleMemory(ReadMapleMemory(CUserLocal, apFamiliar), 4) ;0 if no familiar present
MobCount := ReadMapleMemory(MobBase, MobCountOff)
Channel := ReadMapleMemory(ServerBase, ChannelOff) ;Note: Channel count starts at 0
NXAmount := ReadMapleMemory(ServerBase, NXOffset)
PeopleCount := ReadMapleMemory(PeopleBase, PeopleCountOff)
MapID := ReadMapleMemory(MapInfoBase, MapIDOff)

if (isRunning == True)
autohotkey winactivate partial title here autohotkey winactivate partial title
{
if(lastNX != NXAmount)
{
lastTimeNXGained := A_TickCount
lastNX := NXAmount
}
else if(A_TickCount – lastTimeNXGained > warningDelay)
{
OutputDebug, “Warning: No NX gained recently”
SoundBeep, 800, 500
autohotkey winactivate partial title read more autohotkey winactivate partial title
}

if(lastMobCount != MobCount)
{
lastMobChange := A_TickCount
lastMobCount := MobCount
}
else if(A_TickCount – lastMobChange > warningDelay)
{
OutputDebug, “Warning: No mobs killed recently”
autohotkey winactivate partial title here autohotkey winactivate partial title
SoundBeep, 800, 500
}

if(startingChannel != Channel)
{
OutputDebug, “Warning: On different channel than we started on”
SoundBeep, 800, 500
WinActivate, “Ossyria”
;Stop all player movement
Send {Left up}
autohotkey winactivate partial title read more autohotkey winactivate partial title
Send {Right up}
}

if(PeopleCount != warnPlayerCount)
{
OutputDebug, “Warning: Player count is different!”
SoundBeep, 800, 500
if(autoDC == True)
{
WinClose “Ossyria”
autohotkey winactivate partial title read more autohotkey winactivate partial title
}
}

if(warnFamiliar == True and FamiliarPresent == 0)
{
OutputDebug, “Notice: No familiar is present!”
SoundBeep, 800, 500
}

if(startingMap != MapID)
autohotkey winactivate partial title here autohotkey winactivate partial title
{
OutputDebug, “Warning: Map ID has changed! We are now on map ID: “, %MapID%
SoundBeep, 800, 500
WinActivate, Ossyria
;Stop all player movement
Send {Left up}
Send {Right up}
}
else if(hugWall)
{
autohotkey winactivate partial title here autohotkey winactivate partial title
;You will need to define custom behavior to handle your character being away from the Y position you started at
;That is because your character may have died, been warped away, etc
;and you will need to write different code for each map to walk back to your original position
;Depending on the map you are botting on, you may also want to remove some checks
if(PlayerY > startingPosY + movementRange or PlayerY < startingPosY – movementRange)
{
OutputDebug, “Warning: Away from Y pos we started at”
SoundBeep, 800, 500
outOfWallRange = True
WinActivate, Ossyria
autohotkey winactivate partial title website autohotkey winactivate partial title
}
;if you’re away from the wall, you’ve been knocked away by an elite mob and may want to handle killing it yourself
;or a GM may have teleported you
else if(PlayerX > startingPosX + movementRange)
{
OutputDebug, “Warning: To the right of the X pos we started at”
SoundBeep, 800, 500
outOfWallRange = True
WinActivate, Ossyria
Send {Left down}
autohotkey winactivate partial title read more autohotkey winactivate partial title
Sleep, 50
}
else if(PlayerX < startingPosX – movementRange)
{
OutputDebug, “Warning: To the left of the X pos we started at”
SoundBeep, 800, 500
outOfWallRange = True
WinActivate, Ossyria
Send {Right down}
Sleep, 50
autohotkey winactivate partial title check here autohotkey winactivate partial title
}
else
{
Send {Left up}
Send {Right up}
if(outOfWallRange == True or AttackCount > 90)
{
WinActivate, Ossyria
delay = 500 ;change this to change how far your character moves
;Comment out the code you are not using by adding/removing a semicolon before each line
autohotkey winactivate partial title click here autohotkey winactivate partial title
;Comments will appear green in most text editors (ex. Notepad++, Visual Studio Code)
;The code below moves your character all the way to the wall, then back in the direction of where you normally attack, attacks once
;then moves forward a bit more and attacks again to guarantee the attack counter is reset

;If your character normally faces to the left, uncomment this code if it is commented and comment out the second block of code
;Example maps where you would face left: TP Stumps, LIF3, Somewhere in Crimsonwood
Send {Right down}
i = 0
while (i < 100) ;Attempt to walk right for 10 seconds until we are within 50 units away from the wall
{
autohotkey winactivate partial title check here autohotkey winactivate partial title
PlayerX := ReadMapleMemory(CUserLocal, CharXOff)
if(PlayerX < startingPosX + 50)
{
Break
}
Sleep, 100
i += 1
}
Sleep, %delay%
Send {Right up}
autohotkey winactivate partial title here autohotkey winactivate partial title
Sleep, %delay%
Send %attackKey%
Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
Send {Left down}
Sleep, %delay%
Send {Left up}
Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
Send {Left down}
Sleep, %delay%
Send {Left up}
autohotkey winactivate partial title check here autohotkey winactivate partial title
Sleep, %delay%

;If your character normally faces to the right, leave this code uncommented and comment out the first block of code
;Example maps where you would face right: Colo 2
;Send {Left down}
;i = 0
;while (i < 100) ;Attempt to walk right for 10 seconds until we are within 50 units away from the wall
;{
; PlayerX := ReadMapleMemory(CUserLocal, CharXOff)
; if(PlayerX > startingPosX – movementRange)
autohotkey winactivate partial title more info autohotkey winactivate partial title
; {
; Break
; }
; Sleep, 100
; i += 1
;}
;Send {Left up}
;Sleep, %delay%
;Send %attackKey%
;Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
autohotkey winactivate partial title check here autohotkey winactivate partial title
;Send {Right down}
;Sleep, %delay%
;Send {Right up}
;Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
;Send {Right down}
;Sleep, %delay%
;Send {Right up}
;Sleep, %delay%
outOfWallRange = False
}
autohotkey winactivate partial title check here autohotkey winactivate partial title
else
{
Attack()
}
}
}
else
{
;Moves your character back to the botting spot if you are knocked too far away and/or if an elite mob pushes you away
;I haven’t added facing back in the direction you were attacking in yet, so use a class with an AoE that hits both sides
autohotkey winactivate partial title check here autohotkey winactivate partial title
;You should also use Stance in order to minimize the number of times you are knocked back

;You will need to define custom behavior to handle your character being away from the Y position you started at
;That is because your character may have died, been warped away, etc
;and you will need to write different code for each map to walk back to your original position
if(PlayerY > startingPosY + movementRange or PlayerY < startingPosY – movementRange)
{
OutputDebug, “Warning: Away from Y pos we started at”
SoundBeep, 800, 500
WinActivate, Ossyria
autohotkey winactivate partial title website autohotkey winactivate partial title
}
else if(PlayerX > startingPosX + movementRange)
{
OutputDebug, “Warning: To the right of the X pos we started at”
SoundBeep, 800, 500
WinActivate, Ossyria
Send {Left down}
Sleep, 50
}
else if(PlayerX < startingPosX – movementRange)
autohotkey winactivate partial title get more info autohotkey winactivate partial title
{
OutputDebug, “Warning: To the left of the X pos we started at”
SoundBeep, 800, 500
WinActivate, Ossyria
Send {Right down}
Sleep, 50
}
else ;Code to handle resetting attack count
{
;You can add custom behavior, like taking a portal that transports you to another position within the map in order to reset your attack counter
autohotkey winactivate partial title get more info autohotkey winactivate partial title
;Maps where that is viable: Temple of Time, Boars, certain TP maps

Send {Left up}
Send {Right up}
if(AttackCount > 90)
{
WinActivate, Ossyria
Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
;The code below moves your character in the opposite direction of where you normally attack, attacks once
;then moves back in the direction you normally face when botting
autohotkey winactivate partial title get more info autohotkey winactivate partial title
delay = 500 ;change this to change how far your character moves

;Comment out the code you are not using by adding/removing a semicolon before each line

;If your character normally faces to the left, uncomment this code and comment out the second block of code
;Example maps where you would face left: TP Stumps, LIF3, Somewhere in Crimsonwood
Send {Right down}
Sleep, %delay%
Send {Right up}
Sleep, %delay%
autohotkey winactivate partial title check here autohotkey winactivate partial title
Send %attackKey%
Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
Send {Left down}
Sleep, %delay%
Send {Left up}
Sleep, %delay%

;If your character normally faces to the right, leave this code uncommented and comment out the first block of code
;Example maps where you would face right: Colo 2
;Send {Left down}
autohotkey winactivate partial title here autohotkey winactivate partial title
;Sleep, %delay%
;Send {Left up}
;Sleep, %delay%
;Send %attackKey%
;Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
;Send {Right down}
;Sleep, %delay%
;Send {Right up}
;Sleep, %delay%
}
autohotkey winactivate partial title check here autohotkey winactivate partial title
else
{
Attack()
}
}
}
}
Sleep, 50
}

autohotkey winactivate partial title click here autohotkey winactivate partial title
Attack()
{
;Cast our first buff if it’s been 60 seconds since the last time we cast it
if(A_TickCount – lastTimeBuffed1 > buffDelay1)
{
Sleep, 1500 ;Change this sleep delay depending on how long your attack animation is
ControlSend, ,%buffKey1%, Ossyria ;buffKey1 is a by default
Sleep, 1000 ;Change this sleep delay depending on how long your buff animation is
lastTimeBuffed1 := A_TickCount
}
autohotkey winactivate partial title here autohotkey winactivate partial title

;ControlSend, ,%attackKey%, Ossyria
ControlSend, ,{Control}, Ossyria
;Send {Control}
Sleep, %attackSleep%
}

;Pressing this key will stop the script
;You may want to change it
F11::
autohotkey winactivate partial title here autohotkey winactivate partial title
{
ExitApp
}
autohotkey winactivate partial title

Tags: autohotkey winactivate partial title, www bcfakes com

Leave a Comment