LOTRO AutoIT HealBot v5.0 w/Fellowship Chat Commands
Posted: April 25th, 2011, 9:40 pm
THIS BOT IS STILL FUNCTIONAL, HOWEVER, THE UPDATED HEALBOT6.0 IS LISTED FURTHER BELOW. BECAUSE OF THE # OF LINES IN THE POST, i WAS FORCED TO BREAK UP THE BOT INTO SEVERAL SECTIONS, ONE IS THE COMMENTS AND CHANGE LOG, THE OTHER IS THE BOT, AND FINALLY ANOTHER POST IS THE INI FILE. SORRY, IT'S THE LIMITATION OF THE FORUMS :/
Less than 3 weeks ago, I posted my very first, *crude* heal bot. It was functional, but it was extremely limited. And now, very much like the Master Control Program of Tron that grew from a simple chess game, the HealBot has grown beyond it's original scripting.
Everything is pretty self explained from within the script itself, but much like my first post, I cannot stress enough the YOU MUST SET THE VARIABLES!!!!!!!!!!!!!!!!!!
This bot performs a wide variety of functions, and the latest incarnation also includes a pause feature to toggle healing checks on and off (useful for loading screens and changing areas)
NOTES:
.YOU MUST SETUP A FELLOWSHIP CHAT TAB
.YOU CAN ONLY ISSUE COMMANDS FROM FELLOWSHIP CHAT
.YOU HAVE TO SET YOUR VARIABLES, THE CURRENT VALUES ARE MINE
.SCRIPT CHECKS THE LAST LINE OF THE LOG, IF YOU ISSUE A COMMAND AND THEN ISSUE ANOTHER BEFORE YOU GET CONFIRMATION THAT THE FIRST COMMAND WAS DONE, IT WILL MOST LIKELY FIRE THE SECOND COMMAND ONLY. WAIT FOR CONFIRMATION THE COMMAND WAS RECEIVED AND EXECUTED BEFORE ISSUING MORE COMMANDS
.ALL COMMANDS **ARE** CASE SENSITIVE... THAT'S HOW AUTOIT WORKS!
As of 042611, 0045hrs This bot is fully functioning without errors (aside from known issues)
The Monster Script (well, not as bad as LotroBot!)
Less than 3 weeks ago, I posted my very first, *crude* heal bot. It was functional, but it was extremely limited. And now, very much like the Master Control Program of Tron that grew from a simple chess game, the HealBot has grown beyond it's original scripting.
Everything is pretty self explained from within the script itself, but much like my first post, I cannot stress enough the YOU MUST SET THE VARIABLES!!!!!!!!!!!!!!!!!!
This bot performs a wide variety of functions, and the latest incarnation also includes a pause feature to toggle healing checks on and off (useful for loading screens and changing areas)
NOTES:
.YOU MUST SETUP A FELLOWSHIP CHAT TAB
.YOU CAN ONLY ISSUE COMMANDS FROM FELLOWSHIP CHAT
.YOU HAVE TO SET YOUR VARIABLES, THE CURRENT VALUES ARE MINE
.SCRIPT CHECKS THE LAST LINE OF THE LOG, IF YOU ISSUE A COMMAND AND THEN ISSUE ANOTHER BEFORE YOU GET CONFIRMATION THAT THE FIRST COMMAND WAS DONE, IT WILL MOST LIKELY FIRE THE SECOND COMMAND ONLY. WAIT FOR CONFIRMATION THE COMMAND WAS RECEIVED AND EXECUTED BEFORE ISSUING MORE COMMANDS
.ALL COMMANDS **ARE** CASE SENSITIVE... THAT'S HOW AUTOIT WORKS!
As of 042611, 0045hrs This bot is fully functioning without errors (aside from known issues)
Code: Select all
Chat Command List:
am
Assist me, Target my Target, and attack
Assist
*Skirmish Mode* Send your Soldier to attack my Target
Follow me
Target and Follow me
Eat
Eat some buff food
Prepare for battle
*Skirmish Mode* Call your soldier, eat some food, target/follow me
Mount
Mount or Unmount your Horse, target me and follow
Healing on / Healing off
Toggles healing on and off, while off, Morale checks are not performed, but chat commands are still checked
Loot
Set the view downward and begin clicking in areas around the Pocket Healer. Works best if you move your Commander in such a way that the pocket Healer follows you to stop over/extremely near the corpse
Remove fear
Tells the Pocket Healer to remove fear from the Commander
Call soldier
*Skirmish Mode* calls the healers soldier back if he falls in combat or gets stuck
Exit script
Exits and ends the current script
The Monster Script (well, not as bad as LotroBot!)
Code: Select all
#comments-start
********************************************************************************************************************
Script: PocketHealer v5.0
Author: xXCableDogXx
Date : 04192011
Descrp: Automatic target/follow/heal boT
The purpose of this script is to allow for a "Pocket Healer" who will check your vitals and if they fall below a
certain range, begin healing. This script will then continue healing until you are healthy again. This script
will also respond to typed commands (more on this later) that will allow you to prepare your healer for a fight,
mount and follow you on horseback, and even exit the script.
This script is NOT without setup, however. And there are a few things that MUST be setup BEFORE it will actually
work. This script will have to be created, and for the best performance, it should be located in your LOTRO folder
located in your MY DOCUMENTS folder.
This script DOES NOT send/hold/log/spy for anyone other than YOU and YOUR chat. I will not receive your passwords
or your Character information, it is NOT a keylogger.
***************
*Installation:*
***************
Copy this script into a new .au3 file and name it whatever you wish. And place the files in your:
"C:\Documents and Settings\*YOUR USERNAME HERE*\My Documents\The Lord of the Rings Online"
***************
*Known Issues:*
***************
Because of the way the script checks health and the chat log, there are a few known issues that will never be able
to be avoided. Understand that A) this bot is a giant loop, B) it is logic engine, just looking to validate
statements and arguements, and C) several of the checks require specific coordinates and colors or they fail, break
-ing down the entire process. Below is a list:
1. Chat Commands: Chat commands at this juncture require the use of Fellowship chat and a user created Fellowship
tab. If you right click the General Tab you can select to Create or Add a tab. Failing to do so breaks down
the GetLastLine() function and will cause your automated character to fail in responding to your commands. Chat
Commands are also CASE SENSITIVE... if the function calls for the $LastLine to == "Mount" you cannot enter
"mount" and expect it to work, because it will not.
2. Checking Health: The script checks a certain area of the screen, which YOU must define under the variables in
the file. It checks these specific coordinates for a specific color. Anything the covers or blocks the view
of the script will cause an invalid statement, which will trigger your healing functions. This can be caused by
(but not limited to) opening a Vendor Pane which covers the area the script checks for said coordinates and
color by essentially making that color at that specific coordinate to be something OTHER than the color we are
checking.
It's more of an annoyance than an actual break in the script, simply dragging the window away from the area that
is being checked will keep it from happening. Also, in this version of the script, I have included a pause
feature that will allow you to stop performing healing checks (more on this later).
3. Sometimes you have to "reset" or change those coordinate values... I've noticed on several occasions that when I
run my game in windowed mode, and run the bot, for some reasons my coordinates are invalid. If they are off by
a single pixel, it will cause a break in the bot.
**********
*Credits:*
**********
Special thanks to all of the guys at the AutoIT forums who helped me understand a few things
BIG thanks to BotXPert <LOTROBot@gmail.com>, for allowing his script to be "open sourced" which essentially
canabalized by anyone for their own purposes.
********
*Usage:*
********
Please feel free to use this script for your own purposes, to modify and change as you see fit or need. But please
if you use this script or any part of this script in your own work and "publish", give credit to me, xXCableDogXx
it's all I ask. Thanks
********************************************************************************************************************
WISH LIST TO ADD
Want to add a GUI to preset certain variables and use an INI file
Want to add stop checks for healing so that we aren't wasting power and focusing on when to heal
Want to add stop checks for the Attack Assist to cease combat when Commander is no longer in combat
CHANGE LOG 042511
Added a Pause command to toggle healing on and off without exiting the script
Added more Globals and variables
Added new functions to handle assistance in Combat
Added Loot command
Repaired Chat Log Parser
Altered some key send delays and general delays to speed things up a tad
#comments-end
; Declare Global Variables
Global $LastLine ; This is == to the last line of the current chat log
Global $line ; This is a Line value
Global $CurrentLogFile ; This is your current log file name (set automatically)
Global $CurrentLine ; Returns the value of your Current Line in the Chat Log
Global $LastLineNumber ; Sets your Last Line Number in the Chat Log
Global $LoggedChatTab ; This is the name of your Fellowship tab
Global $HealToggle ; This is a toggle variable to start/stop healing checks
Global $TabClickX ; This is the on screen coordinate for your Fellowship tab (X)
Global $TabClickY ; Same only for (Y)
Global $CharClickX ; This is the on screen coordinate for your Commander Character (X)
Global $CharClickY ; Same only for (Y)
Global $CheckMoraleX ; This is the on screen coordinate for your Innitial Morale level check (X)
Global $CheckMoraleY ; Same only for (Y)
Global $CheckMoraleColor ; Same only for the pixel color located at X, Y
Global $ContinueCheckX ; This is the on scree coordinate for your Continue to Heal check (X)
Global $ContinueCheckY ; Same only for (Y)
Global $ContinueCheckColor ; Same only for the pixel color located at x, y
Global $CommanderName ; This is the name of the Character who will give you commands
Global $BigSingleHeal ; This is your hotkey for Bolster Courage
Global $SmallSingleHeal ; This is your hotkey for Raise the Spirit
Global $BigGroupHeal ; This is your hotkey for Triumphant Spirit
Global $SmallGroupHeal ; This is your hotkey for Inspire Fellows
Global $HorseMount ; This is your hotkey for your Mount ability
Global $EatFood ; This is your hotkey for your food (if any)
Global $GroupBuff ; This is your hotkey for Tale of Heroism
Global $RemoveFear ; This is your hotkey for Cure Fear ability
Global $CallSoldier ; This is your hotkey for Soldier ability (only available in Skirmishes)
Global $Ballad1_1 ; This is your hotkey for your Ballad of Steel
Global $Ballad1_2 ; This is your hotkey for your Ballad of Resonance
Global $Ballad1_3 ; This is your hotkey for your Ballad of Vigor
Global $Ballad2_1 ; This is your hotkey for your Ballad of Swiftness
Global $Ballad2_2 ; This is your hotkey for your Ballad of Balance
Global $Ballad3_1 ; This is your hotkey for your Ballad of Composure
Global $Ballad3_2 ; This is your hotkey for your Ballad of War
Global $Ballad3_3 ; This is your hotkey for your Ballad of Flame
Global $Cry1_1 ; This is your hotkey for your Piercing Cry
Global $Cry1_2 ; This is your hotkey for your Echoes of Battle
Global $SongOSoothing ; This is your hotkey for your Song of Soothing
Global $AssistCommander ; This is your keyboard shortcut for Assist Fellow 2
Global $CombatAssistX ; Not used anymore
Global $CombatAssistY ; Not used anymore
Global $CombatAssistColor ; Not used anymore
; Setup Global Variables
; Non- Windows Info Tool Variables
$HealToggle = 0 ; This sets the healing checks off or paused by default, changed with a chat command
$LoggedChatTab = "Fellowship" ; This sets the name of the chat tab that is logged (mine is FellowShip
; You must create a tab and whatever you name it, that's what goes in this variable
$CommanderName = "YOURCOMMANDERNAMEHERE" ; This is the name of the Character that will give you chat commands
; Hotkey Setups: You must replace the values below with the location of YOUR hotkeys, *-OR-* you could simply place your abilities where I have mine setup
; Remember that + = Shift, ^ = Control, ! = Alt, so ^1 is the same as [CONTROL]+[1], etc. If the hotkey doesn't use control/shift/alt then
; simply use the number, IE 1 or 5 or - or =, etc. Information MUST reside within the " " (quotes)
$BigSingleHeal = "^1" ; This is the hotkey for your Bolster Courage ability, + = Shift, ^ = Control, ! = Alt
$SmallSingleHeal = "^3" ; This is the hotkey for your Raise the Spirit ability, + = Shift, ^ = Control, ! = Alt
$BigGroupHeal = "^4" ; This is the hotkey for your Triumphant Spirit ability, + = Shift, ^ = Control, ! = Alt
$SmallGroupHeal = "^2" ; This is the hotkey for your Inspire Fellows ability, + = Shift, ^ = Control, ! = Alt
$HorseMount = "+1" ; This is the hotkey for your current mount, + = Shift, ^ = Control, ! = Alt
$EatFood = "+3" ; This is the hotkey for your current food to eat, + = Shift, ^ = Control, ! = Alt
$GroupBuff = "+7" ; This is the hotkey for your Tale of Heroism ability, + = Shift, ^ = Control, ! = Alt
$RemoveFear = "^5" ; This is the hotkey for your Cure Fear ability, + = Shift, ^ = Control, ! = Alt
$CallSoldier = "^8" ; This is the hotkey for your Soldied ability, + = Shift, ^ = Control, ! = Alt
$Ballad1_1 = "3" ; This is your hotkey for your Ballad of Steel + = Shift, ^ = Control, ! = Alt
$Ballad1_2 = "4" ; This is your hotkey for your Ballad of Resonance + = Shift, ^ = Control, ! = Alt
$Ballad1_3 = "5" ; This is your hotkey for your Ballad of Vigor + = Shift, ^ = Control, ! = Alt
$Ballad2_1 = "6" ; This is your hotkey for your Ballad of Swiftness + = Shift, ^ = Control, ! = Alt
$Ballad2_2 = "7" ; This is your hotkey for your Ballad of Balance + = Shift, ^ = Control, ! = Alt
$Ballad3_1 = "8" ; This is your hotkey for your Ballad of Composure + = Shift, ^ = Control, ! = Alt
$Ballad3_2 = "9" ; This is your hotkey for your Ballad of War + = Shift, ^ = Control, ! = Alt
$Ballad3_3 = "0" ; This is your hotkey for your Ballad of Flame + = Shift, ^ = Control, ! = Alt
$Cry1_1 = "1" ; This is your hotkey for your Piercing Cry + = Shift, ^ = Control, ! = Alt
$Cry1_2 = "2" ; This is your hotkey for your Echoes of Battle + = Shift, ^ = Control, ! = Alt
$SongOSoothing = "!4" ; This is your hotkey for your Song of Soothing + = Shift, ^ = Control, ! = Alt
$AssistCommander = "+{F2}" ; This is your keyboard shortcut for Assist Fellow 2 + = Shift, ^ = Control, ! = Alt
$CurrentLine = 1 ; Set the $CurrentLine to 1 so that we can mark the end of our chat log
; Windows Info Tool Specific Variables Setup
; * The following variables require than you RUN and USE the Windows Info Tool to check coordinates and colors at those coordinates, then paste the info here
; in these variables (within the " " (quotes)). If this information is NOT SET then the bot will either not function, OR continue to perform healing
; The latter being the most likely.
$CombatAssistX = "248" ; Not used anymore
$CombatAssistY = "98" ; Not used anymore
$TabClickX = "265" ; This is the on screen coordinate for your Fellowship tab (X)
$TabClickY = "472" ; Same only for (Y)
$CharClickX = "52" ; This is the on screen coordinate for your Commander Character (X)
$CharClickY = "91" ; Same only for (Y)
$CheckMoraleX = "208" ; This is the on screen coordinate for your Innitial Morale level check (X)
$CheckMoraleY = "93" ; Same only for (Y)
$CheckMoraleColor = "0x2AD80D" ; Same only for the pixel color located at X, Y
$ContinueCheckX = "208" ; This is the on scree coordinate for your Continue to Heal check (X)
$ContinueCheckY = "93" ; Same only for (Y)
$ContinueCheckColor = "0x2AD80D"; Same only for the pixel color located at x, y
#comments-start
Definitions:
Fellowship Pane = The list of character vital blocks under your main vitals block
Targeting Pane = The area of the screen where your character has targeted a companion or enemy
The best way to setup the above variables is to open the Windows Info Tool and do the following:
Open Windows Info Tool
Switch to Game (running in Windowed Mode)
Open Game Options, Change the "VITAL BAR TEXT DISPLAY" to "PERCENTAGE" under the UI Settings panel
Move the mouse pointer over your "Commanding Character" located IN THE FELLOWSHIP PANE (IE the guy you will be keeping healthy) position it over his
BRIGHT green morale bar about 2/3rds to 3/4s from FULL HEALTH
WITHOUT MOVING THE MOUSE!!!! [ALT]+[TAB] BACK to the Windows Info Tool and press [CTRL]+[ALT]+[F] (at the same time) to freeze the information (you can now move the mouse)
Click on the "SUMMARY" tab of the tool, scroll down to the heading of >>>>> MOUSE <<<<<
Copy the coordinates there to your $CheckMoraleX and $CheckMoraleY strings above. Do this for the hex color information as well (put that in $CheckMoraleColor).
Now do the exact same thing for your $ContinueCheckX, $ContinueCheckY, and $ContinueCheckColor, ONLY THIS TIME position the mouse near FULL HEALTH
Continue with this for the rest of the variables tha must be defined using this tool, use the middle of your Fellowship tab for the $TabClickXY variables, use the
middle of your Commanding Characters Picture under the Fellowship Pane for the $CharClickXY variables.
#comments-end
; Begin Scripting Setup and Checks
; Innitialize and Set Delays
Opt("WinWaitDelay", 0)
Opt("SendKeyDownDelay", 15)
Sleep(10000) ; Give us time to get into the game window
; End Innitialize
; Verify LOTRO is Open and Running
$LOTROWindowName = "The Lord of the Rings Online™: Siege of Mirkwood™"
$pid = WinGetProcess("The Lord of the Rings Online™: Siege of Mirkwood™")
If $pid = -1 Then
MsgBox(0x40000, "Error", "LOTRO Process not found. Please Start LOTRO. Exiting")
Exit
EndIf
; End Verify
; Setup Chat Logging
; *** YOU MUST HAVE CREATED A CHAT TAB CALLED FELLOWSHIP
; *** YOU MUST HAVE SET THE CHAT FILTERS TO INCLUDE FELLOWSHIP CHAT ONLY
; *** AT THIS POINT YOU CANNOT INCLUDE ANY OTHER CHAT FILTERS ELSE YOUR COMMANDS WILL NOT FIRE
; *** YOU MUST, MUST, MUST ISSUE YOUR VERBAL COMMANDS FROM FELLOWSHIP CHAT
; *** YOUR "COMMANDING" CHARACTER DOES NOT HAVE TO BE IN/ON A FELLOWSHIP CHAT TAB
; *** ONCE THIS CHAT LOG HAS BEEN INNITIALIZED AND SET, YOU DO NOT HAVE TO HAVE YOUR BOT ON/IN THIS TAB (USEFUL FOR VERIFYING LOOT DROPS)
FileDelete ($LoggedChatTab & "_*.txt")
Sleep(5000) ; Give us a little more time before the we do the next steps
MouseClick("left", $TabClickX, $TabClickY, 3, 2) ; Click on the Fellowship Chat Tab
Sleep(1000) ; Sleep for a sec
Send("{ENTER}/f .{ENTER}") ; Put our Pocket Healer in Fellowship Chat
Sleep(1000)
Send("{ENTER}/Chatlog ON{ENTER}") ; Actually turn on Fellowship Chat Logging
Sleep(500)
Send("{ENTER}/f Fellowship Channel Logged, Fellowship Tab Selected, Fellowship Channel Joined{ENTER}")
; Confirm in Chat that we have set everything up correctly
Sleep(1000)
$CurrentLogFile = $LoggedChatTab&"_"&@YEAR&@MON&@MDAY&"_1.txt" ; Can only be set once Chat Logging is turned on above
GetLastLine() ; Get and Save the Last Line of the log now
; End Chat Log Setup
; Begin Main Loop
; Checks the Value of $HealToggle for constant. If the value changes, then it begins the healing portion of the script and will NOT
; loop back to this position until it "reads" the specified command in the Fellowship Chat Log
While 1=1
; Check for any commands issued by the "Commander" in Fellowship Chat
GetLastLine()
CheckHealToggle_On()
CheckHealToggle_Off()
LootMob()
CombatAssist()
Eat_Meal()
ClickAssist()
Remove_Fear()
Mount_Unmount()
Call_Soldier()
Ask_Follow()
Prepare_Battle()
Exit_Script()
Sleep(Random(1, 2) * 1000)
; End Chat Log Checking
Select
Case $HealToggle = 0 ; While $HealingToggle is = 0, We will only perform Chat Log Checks
GetLastLine()
CheckHealToggle_On()
CheckHealToggle_Off()
LootMob()
CombatAssist()
Eat_Meal()
ClickAssist()
Remove_Fear()
Mount_Unmount()
Call_Soldier()
Ask_Follow()
Prepare_Battle()
Exit_Script()
Sleep(Random(1, 2) * 1000)
Case $HealToggle = 1 ; While $HealingToggle is = 1, We will perfoem chat log checks and morale checks
GetLastLine()
CheckHealToggle_On()
CheckHealToggle_Off()
LootMob()
CombatAssist()
Eat_Meal()
ClickAssist()
Remove_Fear()
Mount_Unmount()
Call_Soldier()
Ask_Follow()
Prepare_Battle()
Exit_Script()
Sleep(Random(1, 2) * 1000)
While PixelGetColor($CheckMoraleX, $CheckMoraleY) == $CheckMoraleColor
Sleep(Random(1, 2) * 1000)
WEnd
While PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor
Target_Follow()
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($BigSingleHeal)
Sleep(2505)
EndIf
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($BigSingleHeal)
Sleep(2505)
EndIf
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($SmallGroupHeal)
Sleep(2505)
EndIf
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($SmallSingleHeal)
Sleep(1005)
EndIf
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($SmallSingleHeal)
Sleep(2505)
EndIf
If PixelGetColor($ContinueCheckX, $ContinueCheckY) <> $ContinueCheckColor Then
Send($BigGroupHeal)
Sleep(1005)
EndIf
WEnd
Case Else
EndSelect
WEnd
; Declare Functions
;*************************************************************************************************************
; LootMob() checks for a specified text string and begins to make the Pocket Healer look downwards, Then it
; Will move the mouse to the following coordinates and send an autoloot command key
; *** YOU MUST BIND YOUR AUTOLOOT FUNCTION TO THE PERIOD [.] KEY IN ORDER FOR THIS TO WORK
; *** YOU MAY USE ANOTHER KEY, BUT YOU WILL HAVE TO CHANGE EACH OF THE SEND COMMANDS TO YOUR HOTKEY
;
; This is extremely sloppy and doesn't work as well as I want it to, but this way is functional, just a little
; Slow
Func LootMob()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Loot" Then
MouseClickDrag("right",400,200,800,600,10)
Sleep (1000)
Opt("SendKeyDownDelay", 15)
MouseMove(550,400,2)
Send(".")
MouseMove(550,460,2)
Send(".")
MouseMove(640,480,2)
Send(".")
MouseMove(700,460,2)
Send(".")
MouseMove(700,400,2)
Send(".")
MouseMove(700,350,2)
Send(".")
MouseMove(640,325,2)
Send(".")
;-------------------
MouseMove(640,250,2)
Send(".")
MouseMove(500,250,2)
Send(".")
MouseMove(500,395,2)
Send(".")
MouseMove(480,525,2)
Send(".")
MouseMove(640,525,2)
Send(".")
MouseMove(840,525,2)
Send(".")
MouseMove(840,400,2)
Send(".")
MouseMove(840,250,2)
Send(".")
Target_Follow()
Send("{ENTER}/f Done{ENTER}")
EndIf
EndFunc
;*************************************************************************************************************
; AssistMovenClick() is no longer used at this point, sending [SHIFT]+[F2} is better streamlined
Func AssistMovenClick()
MouseMove ($CombatAssistX,$CombatAssistY,0)
Sleep (500)
MouseClick ("left", $CombatAssistX,$CombatAssistY, 2, 2)
EndFunc
;*************************************************************************************************************
; CombatAssist() Checks for a specified text string and then calls on Click Assist (a function used in battle
; grounds (skirmishes)). From there it begins to send out keyboard commands to trigger your Pocket Healer's
; Tactical Combat abilities.
Func CombatAssist()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": am" Then
ClickAssist()
Send ($AssistCommander)
Send ("{ENTER}/f Assisting{ENTER}")
Sleep (1000)
Send ($Cry1_1)
Sleep (2000)
Send ($Cry1_2)
Sleep (2000)
Send ($Ballad1_1)
Sleep (2000)
Send ($Ballad1_2)
Sleep (2000)
Send ($Ballad1_3)
Sleep (2000)
Send ($Ballad2_1)
Sleep (2000)
Send ($Ballad2_2)
Sleep (2000)
Send ($Ballad1_1)
Sleep (2000)
Send ($Ballad1_2)
Sleep (2000)
Send ($Ballad1_3)
Sleep (500)
Target_Follow()
EndIf
EndFunc
;*************************************************************************************************************
;*************************************************************************************************************
; ClickAssist() Checks for a specified text string and then orders the Pocket Healer to command her Soldier to
; Assist you in combat. Then it returns to following you and healing you.
Func ClickAssist()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Assist" Then
Send ($AssistCommander)
Send ("^9")
Sleep(500)
Target_Follow()
EndIf
EndFunc
;*************************************************************************************************************
; CheckHealToggle_On() Checks for specified text string and changes the value of $HealToggle from 0 to 1 if it
; see it. If it sees this change in the Big Loop, then it will allow the Healing Check and Continue Healing
; Loops to proceed.
Func CheckHealToggle_On()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Healing on" Then
$HealToggle = 1
Send("{ENTER}/f Healing Toggled On{ENTER}")
EndIf
EndFunc ;==>CheckHealToggle
;*************************************************************************************************************
; CheckHealToggle_Off() Checks for specified text string and changes the value of $HealToggle from 1 to 0 if it
; see it. If it sees this change in the Big Loop, it will stop all healing.
Func CheckHealToggle_Off()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Healing off" Then
$HealToggle = 0
Send("{ENTER}/f Healing Toggled Off{ENTER}")
EndIf
EndFunc ;==>CheckHealToggle
;*************************************************************************************************************
; Eat_Meal() Checks for specified text string and sends the keyboard shortcut to eat food that has been
; quickslotted @ that shortcut location
Func Eat_Meal()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Eat" Then
Send($EatFood)
Sleep(1005)
Send("{ENTER}/f Done Eating{ENTER}")
EndIf
EndFunc ;==>Eat_Meal
;*************************************************************************************************************
; Remove_Fear() Checks for specified text string and sends the keyboard shortcut to remove fear from your
; Commanding Character quickslotted @ that shortcut location
Func Remove_Fear()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Remove Fear" Then
MouseClick("left", $CharClickX, $CharClickY, 3, 2)
Send($RemoveFear)
Sleep(3005)
Send("{ENTER}/f Done Casting{ENTER}")
EndIf
EndFunc ;==>Remove_Fear
;*************************************************************************************************************
; Mount_Unmount() Checks for a specified text string and sends the keyboard shortcut to mount or unmount
; your horse. upon mounting, it will then target your commanding character and /follow them
Func Mount_Unmount()
;If $LastLine = "[Fellowship] Kethla: Mount" Then
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Mount" Then
Send($HorseMount)
Sleep(5000)
Target_Follow()
Sleep(1000)
Send("{ENTER}/f Done{ENTER}")
EndIf
EndFunc ;==>Mount_Unmount
;*************************************************************************************************************
; Call_Soldier() Checks for a specified text string and sends the keyboard shortcut to call your skirmish
; Soldier.
Func Call_Soldier()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Call soldier" Then
Send($CallSoldier)
Sleep(1005)
Send("{ENTER}/f Soldier called{ENTER}")
EndIf
EndFunc ;==>Call_Soldier
;*************************************************************************************************************
; Ask_Follow() Checks for a specified text string and sets the bot to follow the Commanding Character
Func Ask_Follow()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Follow me" Then
MouseMove ($CharClickX, $CharClickY,0)
MouseClick("left", $CharClickX, $CharClickY, 3, 2)
Sleep(500)
Send("{ENTER}/follow{ENTER}")
Sleep(1000)
Send("{ENTER}/f Following you now{ENTER}")
EndIf
EndFunc ;==>Ask_Follow
;*************************************************************************************************************
; Target_Follow() Automatically Targets your commanding character and follows them, this function does not use
; a log check or keyboard command, it is called from other functions or the script itself
Func Target_Follow()
MouseMove ($CharClickX,$CharClickY,0)
MouseClick("left", $CharClickX, $CharClickY, 2, 2)
Sleep(500)
Send("{ENTER}/follow{ENTER}")
EndFunc ;==>Target_Follow
;*************************************************************************************************************
; Prepare_Battle() Checks for a specified text string and beings preperation for battle in a Skirmish instance
; it should ONLY be used in a Skirmish, although it can be used outside, it simply won't call your Skirmish
; Soldier
Func Prepare_Battle()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Prepare for battle" Then
Send($CallSoldier)
Sleep(1005)
Send($EatFood)
Sleep(1005)
;Send($GroupBuff)
Sleep(5005)
Target_Follow()
Sleep(1000)
Send("{ENTER}/f Battle Ready{ENTER}")
EndIf
EndFunc ;==>Prepare_Battle
;*************************************************************************************************************
; Exit_Script() Checks for a specfied text string and if the arguement is satisfied, it will end the script
; from running period. This does not pause features, IT KILLS THE APPLICATION RUNNING IN THE SYSTEM TRAY!!
; You must "re-run" the script if you would like to turn it on again.
Func Exit_Script()
If $LastLine = "[" & $LoggedChatTab & "] " & $CommanderName & ": Exit script" Then
Send("{ENTER}/f Ending Automation Now{ENTER}")
Sleep(500)
Exit
EndIf
EndFunc ;==>Exit_Script
;*************************************************************************************************************
; Get the last line of the log, and save that position to avoid parsing the entire log again
Func GetLastLine()
While 1
$line = FileReadLine($CurrentLogFile, $CurrentLine)
If @error = -1 Then ExitLoop
$CurrentLine = $CurrentLine + 1
WEnd
$LastLineNumber = $CurrentLine - 1
$LastLine = FileReadLine($CurrentLogFile, $LastLineNumber)
EndFunc ;==>GetLastLine