; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@@@@@@@@@@@@@@@@@@@@@@@@ BEFORE RUNNING @@@@@@@@@@@@@@@@@@@@@
; @@@@@@@@@@@@@@@@@@@@@@@@@ READ THIS SHIT @@@@@@@@@@@@@@@@@@@@@
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@@ before starting, Ctrl+F for every instance of Send/ControlSend
; @@@ update the hotkeys to the hotkeys you have set
; @@@ also, F1 assumes @go savepoint is your preferred location, if
; @@@ you use a different key, set that as necessary
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 1 @@
; zoom however you want to zoom. THEN NEVER FUCK WITH IT
; (or else shit will be super fucked)
; the search works by first finding mobs near your char, a narrow search first
; after that if it finds no poring, it will do a wider search
; if it fails to find them it'll teleport
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 2 @@
; set the boundaries of each search this way:
; TOP LEFT NARROW -> ctrl+1
; BOTTOM RIGHT NARROW -> ctrl+2
; TOP LEFT WIDE -> ctrl+3
; BOTTOM RIGHT WIDE -> ctrl+4
;
; TOP LEFT of HP/SP info -> ctrl+5
; BOTTOM RIGHT of HP/SP info -> ctrl+6
;
; BLACK FLY WING IN A HOTKEY BAR -> ctrl+7
; see http://i.imgur.com/HoOge.jpg for visual instructions
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 3 @@ (if any of these is desired, do their steps)
;
; if you use these chars, be sure that they are all placed and zoomed in the exact same way as your main client, or they will fail to heal
;
; alt tab to clown -> win+c
; alt tab to gypsy -> win+g
; alt tab to paladin -> win+p
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 4 @@
; hover mouse over healer -> win+h
; hover mouse over warper -> win+w
; hover mouse over tooldealer -> win+t
; hover mouse over buy button to open tooldealer -> win+b
; hover mouse over down arrow in the dealer -> win+d
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 5 @@
; set your last warp to the desired destination
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ STEP 6 @@
; start off in town and press Home and it'll work :D
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; @@ OTHER NOTES:
; make sure you check the variables for configuration at the start
; of the script. if you use a min texture grf you can turn the map
; change delay to 1000 ms or so.
; try to keep it high so that if you lag and you don't fuck yourself :D
;
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; IF YOU WISH TO PAUSE AT ANY TIME, PRESS End AND IT WILL PAUSE.
; HOWEVER! Be sure to resume from the same step you were on
; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
^1::
{
MouseGetPos tl_n_xpos, tl_n_ypos
return
}
^2::
{
MouseGetPos br_n_xpos, br_n_ypos
return
}
^3::
{
MouseGetPos tl_w_xpos, tl_w_ypos
return
}
^4::
{
MouseGetPos br_w_xpos, br_w_ypos
return
}
^5::
{
MouseGetPos tl_bar_xpos, tl_bar_ypos
return
}
^6::
{
MouseGetPos br_bar_xpos, br_bar_ypos
return
}
^7::
{
MouseGetPos fwing_xpos, fwing_ypos
purchaseWings := 1
return
}
^8::
{
MouseGetPos tl_inventory_xpos, tl_inventory_ypos
return
}
^9::
{
MouseGetPos br_inventory_xpos, br_inventory_ypos
return
}
#H:: ; healer position
{
MouseGetPos hxpos, hypos
return
}
#W:: ; the location you drop your warp portal to morroc
{
MouseGetPos wxpos, wypos
return
}
#T:: ; the tool dealer location
{
MouseGetPos txpos, typos
return
}
#B:: ; the buy button location
{
MouseGetPos bxpos, bypos
return
}
#D:: ; the down arrow shit
{
MouseGetPos dxpos, dypos
return
}
Home::
{
WinGet mPID, PID, A
SetKeyDelay -1
SetControlDelay -1
SetMouseDelay -1
; time spent (in ms) waiting for maps to load
mapChangeDelay := 2000
; time between sending stuff to npc
npcDelay := 700
; your aspd delay
aspdDelay := 600
; return time to town (brotip: agi/bless last 240000, so i do 235000)
returnTime := 235000
; amoutn of times to press enter to get to the last warp
lastWarpEnterCount := 3
; set to >0 so your char buys fly wings
purchaseWings := 99
; set to 1 to reheal after buffing
rehealAfterBuffs := 1
; how many times to re-up the skills of each class before healing
clownUsesBeforeHeal := 15
gypsyUsesBeforeHeal := 15
pallyUsesBeforeHeal := 10
; if using riff, 120000
; if bragi/apples, 180000
clownReuseTime := 180000
; if using service, 180000
; if using critsong, 120000
gypsyReuseTime := 180000
; gospel has a timer of 60 seconds so this shouldn't require changing
pallyReuseTime := 60000
; irrelevant if no clown is setup
; 0 = only use 1 song
; 1 = flash between 2 songs
; 2 = flash between 3 songs
multiClown := 0
; jokers = 0x8894F9
; porings = 0x8C94FF
searchColor := 0x8C94FF
; jokers = 5
; porings = 0
searchTolerance := 0
; internal, do not change
clownUsages := 0
gypsyUsages := 0
paladinUsages := 0
mapAddr := 0x814290
weightMaxAddr := 0x83C54C
weightCurAddr := 0x83C558
maxWeight := ReadMemory(weightMaxAddr, mPID)
loop
{
Sleep %mapChangeDelay%
wingAttempts := 0
;UseHealer()
;Prebuff()
;if ( rehealAfterBuffs = 1 )
;{
; UseHealer()
;}
UseStorage()
UseWarper(lastWarpEnterCount)
Sleep %mapChangeDelay%
; you are now in your last warp area
result := ReadMemory(mapAddr, mPID)
gefeniaNum := 1701209447
if ( result != gefeniaNum )
{
ReturnToTown()
Continue
}
Loop
{
Sleep 100
if ( (A_TickCount - Tick_LastBuff) >= returnTime )
{
ReturnToTown()
Break
}
if ( CheckFlyWings() = 0)
{
ReturnToTown()
BuyFlyWings(100)
Break
}
if ( CheckHPSP() = 0)
{
ReturnToTown()
Break
}
if ( wingAttempts >= 100)
{
ReturnToTown()
Break
}
else
{
; first, a nearby search of yourself
; i recommend 6 character widths wide and 3 character heights tall
PixelSearch FoundX, FoundY, %tl_n_xpos%, %tl_n_ypos%, %br_n_xpos%, %br_n_ypos%, %searchColor%, %searchTolerance%, Fast
if ErrorLevel = 0
{
Cast(FoundX, FoundY)
if ( CheckWeight() >= 89 )
{
ReturnToTown()
Break
}
}
else
{
; a more wide search range. make sure no part of your ui is in range
PixelSearch FoundX, FoundY, %tl_w_xpos%, %tl_w_ypos%, %br_w_xpos%, %br_w_ypos%, %searchColor%, %searchTolerance%, Fast
if ErrorLevel = 0
{
Cast(FoundX, FoundY)
if ( CheckWeight() >= 89 )
{
ReturnToTown()
Break
}
}
else
{
; TELEPORT
ControlSend ,,{F5}, ahk_pid %mPID% ; teleport hotkey
Sleep 1000
wingAttempts := wingAttempts + 1
}
}
}
}
}
return
UseStorage()
{
global
ControlSend ,,=, ahk_pid %mPID% ; @storage hotkey
Sleep %npcDelay%
PixelSearch FoundX, FoundY, %tl_inventory_xpos%, %tl_inventory_ypos%, %br_inventory_xpos% , %br_inventory_ypos% , 0x29216B, 0, Fast
if ErrorLevel = 0
{
SetMouseDelay 20
Sleep 100
;msgbox %FoundX% %FoundY%
MouseMove %FoundX%, %FoundY%
Sleep 1000
MouseClickDrag L, 0, 0, 0, -300, 50, R
Sleep 1000
Send {Enter}
Sleep %npcDelay%
SetMouseDelay -1
ReturnToTown()
}
return
}return
}
CheckWeight()
{
global
currentWeight := ReadMemory(weightCurAddr, mPID)
return round(currentWeight * 100 / maxWeight)
}
ReadMemory(MADDRESS,PROGRAM)
{
hModule := DllCall("LoadLibrary", "str", "rpm.dll")
if ( A_LastError )
{
MsgBox Error: %A_LastError% | If this value is 193, then you need to use a 32-bit version of AutoHotkey OR rpm.dll is missing
return -1
}
value := DllCall("rpm\getMapID", "UInt", MADDRESS, "UInt", PROGRAM)
if ( A_LastError )
{
MsgBox Error: %A_LastError% | If this value is 193, then you need to use a 32-bit version of AutoHotkey
return -1
}
DllCall("FreeLibrary", "UInt", hModule)
return value
}
CheckHPSP()
{
global
PixelSearch FoundX, FoundY, %tl_bar_xpos%, %tl_bar_ypos%, %br_bar_xpos%, %br_bar_ypos%, 0x0000FF, 0, Fast ; search in your hp/sp amount for red - eg lower than 25%
if ErrorLevel = 0
{
return 0
}
return 1
}
BuyFlyWings(amount)
{
global
SetMouseDelay 20
MouseMove %txpos%, %typos%, 1 ; Tool Dealer
Sleep 120
Click %txpos%, %typos%
Sleep %npcDelay%
; serebii-ro specific
Send {Enter}
Sleep %npcDelay%
Send {Down}
Sleep %npcDelay%
Send {Enter}
Sleep %npcDelay%
Send {Enter}
Sleep %npcDelay%
;
;MouseMove %bxpos%, %bypos% ; Buy button
Sleep %npcDelay%
;Click %bxpos%, %bypos%
;Sleep 500
MouseMove %dxpos%, %dypos%, 1 ; to click arrow down
Sleep 120
Loop 3
{
Click %dxpos%, %dypos%
Sleep %npcDelay%
}
MouseMove -40, -15, 10, R
Sleep 500
MouseClickDrag L, 0, 0, 60, 10, 30, R ; Flywing Drag & Drop Choose amount and choose it. Make sure the y between both is CONSTANT r you will buy other shit
Sleep 1000
SendInput %amount%
Sleep 500
Send {Enter}
MouseMove %dxpos%, %dypos%, 5 ; to moove mouse to arrow down key
Sleep 300
MouseMove 200, 25, 1, R ; to set the mouse on the buy button
Sleep 500
Send { Click }
Sleep 1000
SetMouseDelay -1
}
CheckFlyWings()
{
global
PixelGetColor color, %fwing_xpos%, %fwing_ypos%, 10 ; position of flywings in your hotkey bar
if (color = 0xFFFFFF)
{
return 0
}
return 1
}
ReturnToTown()
{
global
Sleep %aspdDelay%
ControlSend ,,{F1},ahk_pid %mPID% ;@go town hotkey --> set it to a single key (eg `), because alt sends are completely unreliable
Sleep %mapChangeDelay%
}
UseWarper(lastWarpEnderCount)
{
global
Sleep %npcDelay%
MouseMove %wxpos%, %wypos%
Click %wxpos%, %wypos%
Sleep %npcDelay%
Loop %lastWarpEnderCount%
{
Sleep %npcDelay%
ControlSend ,,{Enter},ahk_pid %mPID%
}
}
UseHealer()
{
global
Sleep %npcDelay%
MouseMove %hxpos%, %hypos%
Click %hxpos%, %hypos%
Sleep %npcDelay%
Tick_LastBuff := A_TickCount
}
Prebuff()
{
global
; send skill usage just to make sure you don't get that bullshit message from the healer - likely won't matter except on the first run
; this also gives you songs for the first cast and such, too ! yay :D
if ( cPID != "" or gPID = "" or pPID = "" )
{
UseHealer()
ControlSend ,,{F3},ahk_pid %mPID% ; first aid
Sleep aspdDelay + 500
}
if ( cPID && (Tick_Clown_Timeout >= (clownReuseTime-3000)) )
{
ControlSend ,,{J}, ahk_pid %cPID% ; attention concentrate
Sleep 800
if ( multiClown = 0)
{
ControlSend ,,{B}, ahk_pid %cPID% ; encore
}
else if ( multiClown = 1)
{
ControlSend ,,{G}, ahk_pid %cPID% ; cello
Sleep 800
ControlSend ,,{T}, ahk_pid %cPID% ; bragi
Sleep 800
ControlSend ,,{G}, ahk_pid %cPID% ; cello
Sleep 800
ControlSend ,,{T}, ahk_pid %cPID% ; riff
Sleep 800
}
Tick_Clown_Timeout := A_TickCount
}
if ( gPID && (Tick_Gypsy_Timeout >= (gypsyReuseTime-3000)) )
{
ControlSend ,, {B}, ahk_pid %gPID% ; encore
Sleep 500
Tick_Gypsy_Timeout := A_TickCount
}
if ( pPID && (Tick_Pally_Timeout >= (pallyReuseTime-3000)) )
{
ControlSend ,, {B}, ahk_pid %pPID% ; gospel
Sleep 500
Tick_Pally_Timeout := A_TickCount
}
Selfbuff()
return
}
Selfbuff()
{
global
WinGetActiveStats windowName, windowWidth, windowHeight, winX, winY
winCenterX := windowWidth >> 1
winCenterY := windowHeight >> 1
; place any of your char's intown buffs here
; If it requires simply touching a hotkey, use this code
; If it requires simply using a hotkey, use this code:
; ControlSend ,,{O},ahk_pid %mPID% ; buffkey
; Sleep aspdDelay + 300
;
; If it has a casting time, put a Sleep equivalent/close to the cast time necessary next to the Sleep already provided
; For example, Zen has ~a 700 ms cast time for me, so I'd use:
; ControlSend ,,{A},ahk_pid %mPID% ; zen hotkey
; Sleep 900
; Sleep aspdDelay + 300
;
; If it requires clicking on yourself, use this code:
; ControlSend ,,{B},ahk_pid %mPID% ; blessing
; Click %centerX%, %centerY%
; Sleep ( aspdDelay + 300)
; Obviously, if a cast time is involved, be sure to add that to the sleep
;
}
Cast(x, y)
{
global
ControlSend ,,{F6},ahk_pid %mPID% ; skill hotkey
Sleep 50
Click %x%, %y%
Sleep 300
return
}
}
End::Pause