You will need the pix to make it work. You can DL mine or make your own with the windows snipping tool.
Code: Select all
;<=======================================================================================================>
;<============================= Secret of Mana Support Caster Spell Leveling Bot ========================>
;<=======================================================================================================>
;This Bot Will Train The Group's Support Caster And Use Walnuts As Needed.
;Make Sure Walnuts Are In Your Inventory; This Bot Does Not Buy Them For You!
;For 2560x1440 Resolution in Fullscreen Mode; If Using Anything Different The Pictures And Search Values Will Need Editing!
;Run The Script In The Same Folder As The Pix.
;Step 1) In Game, Select The Elemental You Want To Train.
;Step 2) Run The Script; Then Click on the Game Window.
;Step 3) Hit the 1 Key; It Will Automagically Set The Support Caster As Group Lead!
;Step 4) Watch It Go!
;By PipeDreams
;https://www.autohotkey.com/boards/viewtopic.php?f=94&t=117693
;<=======================================================================================================>
#MaxHotkeysPerInterval 200
#SingleInstance Force
#Persistent
#NoEnv
SetWorkingDir, %A_ScriptDir%
Menu, Tray, Icon, SOM.ico
PID := DllCall("GetCurrentProcessId") ;PID Of Script
Process, Priority, %PID%, Normal
SetControlDelay, -1
SetBatchLines, -1
SetWinDelay, -1
CoordMode, Pixel, Screen
ZZZ = 1000
Return
Catalog:
{ ItemList = Barrel.png,Candy.png,CBar.png,Cup.png,Drum.png,FWalnut.png,Mallet.png,MBelt.png,MHerb.png,MRope.png,RJam.png
SpellList = Dryad.png,Gnome.png,Lumina.png,Luna.png,Salamando.png,Sylphid.png,Undi.png
} Return
Girl:
{ X1:=(928),Y1:=(1286),X2:=(1043),Y2:=(1386)
} Return
GirlRing:
{ X1:=(1206),Y1:=(536),X2:=(1350),Y2:=(692)
} Return
ManaChkField:
{ X1:=(1278),Y1:=(1322),X2:=(1285),Y2:=(1358)
} Return
Item/SpellSearchField:
{ X1:=(1202),Y1:=(189),X2:=(1356),Y2:=(342)
} Return
*~Esc:: ;Kills The Script.
SoundBeep, 777, 100
ExitApp
~1::
{ If (Toggle:=!Toggle)
{ WinWaitActive, Secret of Mana
GoSub, SearchGUIs
SetTimer, Go, %ZZZ%
} Else,
{ Reload
} } Return
Go:
{ WinWaitActive, Secret of Mana
Sleep ZZZ
GoSub, Girl
ImageSearch, X, Y, X1, Y1, X2, Y2, *10 Girl.png
If (!ErrorLevel) ;Found Girl
{ Send, {MButton}
Sleep, ZZZ
GoSub, GirlRing
ImageSearch, X, Y, X1, Y1, X2, Y2, *10 GirlRing.png ;If Girl Found
If (!ErrorLevel) ;Found GirlRing
{ GoSub, ManaChk
} } Else,
{ Send, {c DownTemp}
Sleep, 100
Send {c Up}
} } Return
ManaChk:
{ GoSub, ManaChkField
PixelSearch, X, Y, X1, Y1, X2, Y2, ("0x00A3C9"), 10, Fast RGB ;Mana Check
If (!ErrorLevel)
{ ;If There Is Still Blue On The Mana Bar
SetTimer, SpellSearch, %ZZZ%
SetTimer, Go, OFF
} Else,
{ ;If There Is No Blue On The Mana Bar
SetTimer, ItemSearch, %ZZZ%
SetTimer, Go, OFF
} } Return
ItemSearch:
{ WinWaitActive, Secret of Mana
GoSub, Catalog
Loop, Parse, ItemList, `,
{ GoSub, Item/SpellSearchField
ImageSearch, X, Y, X1, Y1, X2, Y2, *50 %A_LoopField%
If (!ErrorLevel) ;If Item Found
{ If A_LoopField=Barrel.png
{ GoSub, SelectRight
} If A_LoopField=Candy.png
{ GoSub, SelectRight
} If A_LoopField=CBar.png
{ GoSub, SelectRight
} If A_LoopField=Cup.png
{ GoSub, SelectLeft
} If A_LoopField=Drum.png
{ GoSub, SelectLeft
} If A_LoopField=FWalnut.png
{ Gosub, UseIt
} If A_LoopField=Mallet.png
{ GoSub, SelectRight
} If A_LoopField=MBelt.png
{ GoSub, SelectLeft
} If A_LoopField=MHerb.png
{ GoSub, SelectLeft
} If A_LoopField=MRope.png
{ GoSub, SelectLeft
} If A_LoopField=RJam.png
{ GoSub, SelectRight
} Sleep, ZZZ
Break
} } If (ErrorLevel) ;If Item Not Found
{ Send, {WheelUp}
Sleep, ZZZ
} } Return
SpellSearch:
{ WinWaitActive, Secret of Mana
GoSub, Catalog
Loop, Parse, SpellList, `,
{ GoSub, Item/SpellSearchField
ImageSearch, X, Y, X1, Y1, X2, Y2, *10 %A_LoopField%
If (!ErrorLevel) ;If Elemental Found
{ GoSub, UseIt
Break
} } If (ErrorLevel) ;If Elemental Not Found
{ Send, {WheelUp}
Sleep, ZZZ
} } Return
SelectLeft:
{ Send, {a DownTemp}
Sleep, 100
Send {a Up}
} Return
SelectRight:
{ Send, {d DownTemp}
Sleep, 100
Send {d Up}
} Return
UseIt:
{ Loop, 3
{ Send, {Space DownTemp}
Sleep, 300
Send, {Space Up}
Sleep, 300
} Sleep, 4000
SetTimer, SpellSearch, OFF
SetTimer, ItemSearch, OFF
SetTimer, Go, %ZZZ%
} Return
SearchGUIs:
{ If (SearchLocations:=!SearchLocations)
{ ;Girl
GoSub, Girl
FrameThickness := (2), FrameColor := ("YELLOW"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 1: Margin, %FrameThickness%, %FrameThickness%
Gui, 1: Color, %FrameColor%
Gui, 1: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 1: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 1: Show, NA x%X1% y%Y1%, Gui1
;GirlRing
GoSub, GirlRing
FrameThickness := (2), FrameColor := ("YELLOW"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 2: Margin, %FrameThickness%, %FrameThickness%
Gui, 2: Color, %FrameColor%
Gui, 2: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 2: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 2: Show, NA x%X1% y%Y1%, Gui2
;ManaCHK
GoSub, ManaCHKField
FrameThickness := (2), FrameColor := ("AQUA"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 3: Margin, %FrameThickness%, %FrameThickness%
Gui, 3: Color, %FrameColor%
Gui, 3: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 3: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 3: Show, NA x%X1% y%Y1%, Gui3
;ItemSearch
GoSub, Item/SpellSearchField
FrameThickness := (2), FrameColor := ("RED"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 4: Margin, %FrameThickness%, %FrameThickness%
Gui, 4: Color, %FrameColor%
Gui, 4: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 4: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 4: Show, NA x%X1% y%Y1%, Gui4
;SpellSearch
GoSub, Item/SpellSearchField
FrameThickness := (1), FrameColor := ("BLUE"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 5: Margin, %FrameThickness%, %FrameThickness%
Gui, 5: Color, %FrameColor%
Gui, 5: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 5: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 5: Show, NA x%X1% y%Y1%, Gui5
;TheScreen
The_ScreenWidth = 2557
The_ScreenHeight = 1389
X1:=(0),Y1:=(0),X2:=(The_ScreenWidth),Y2:=(The_ScreenHeight)
FrameThickness := (2), FrameColor := ("LIME"), FrameWidth := (X2-X1), FrameHeight := (Y2-Y1)
Gui, 6: Margin, %FrameThickness%, %FrameThickness%
Gui, 6: Color, %FrameColor%
Gui, 6: Add, Text, W%FrameWidth% H%FrameHeight% 0x6
Gui, 6: +LastFound -Caption +AlwaysOnTop +ToolWindow
WinSet, TransColor, 0xFFFFFF
Gui, 6: Show, NA x%X1% y%Y1%, Gui6
} Else,
{ Gui, 1:Destroy
Gui, 2:Destroy
Gui, 3:Destroy
Gui, 4:Destroy
Gui, 5:Destroy
Gui, 6:Destroy
} } Return
;<=======================================================================================================>
;<================================================ END ==================================================>
;<=======================================================================================================>
[Mod action: Moved topic from “Ask for Help (v2) > Gaming” to v1 section because this is neither asking for help nor v2 code.]