|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Musicdocbuff.vbs '
' '
' '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' assumes doc and musician '
' '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' History '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'to do add driod call and bivlovi eating
'Setup constants
Const Dbg = 0 'Are we debuging?
Const XUDir = "C:\xunleashed\" 'Location of SWGChatLog.txt
Const ActionX = 137 'X trigger location for action
Const ActionY = 25 'Y trigger location for action
Const MindX = 52 'X trigger location for action
Const MindY = 33 'Y trigger location for action
Const HealTrigger = 12632256 'Trigger color for a heal
Const vkEnter = 13
Const AllowList1 ="xxxxx xxxxx " 'names case sensative
Const AllowList2 ="xxxx xxxx" 'seperate with space
'Dimension variables
Dim Fso
Dim Logfile
Dim DebugFile
Dim LogLine
Dim Target
Dim Finish
Dim AllowedList
Dim Buffie
Dim targname
Dim TargetCommand
Dim h
Dim i
Dim TellTarget
Dim Flo
Dim Allowed
'Open the ChatLog file
Set Logfile = XUScriptHost.OpenLogFile(XUDir & "SWGChatLog.txt")
'Set finished to false
Finish = 0
Allowed = 0
DoCommand("/stand")
DoCommand("/startmusic Rock")
'Start the main buffing loop
Do
'Wait for Musicbuff request
LogLine = XUScriptHost.WaitForLogFileText(LogFile,"logout",1000)
If InStr(LogLine,"logout") > 0 then
Finish=1
End If
'wait for a tell and check to see if its a buff
LogLine = XUScriptHost.WaitForLogFileText(LogFile,"tells",30000)
'Musicbuff request
If InStr(LogLine,"music") > 0 then
BuffMind
End If
'wait for doc ham buff request
If InStr(LogLine,"ham") > 0 then
BuffHam
End If
DoCommand("/target a")
DoCommand("/flo 1")
DoCommand("/smile")
'Run loop until Finished is true
Loop until Finish = 1
'Close the ChatLog file
XUScriptHost.CloseLogFile(Logfile)
DoCommand("/stop")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Subroutines '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub BuffMind
'Get Target name
targname = mid(cstr(LogLine),22,InStr(LogLine,"tells") - 22)
Allowed = 0
If InStr(AllowList1,targname) > 0 then Allowed = Allowed + 1
If InStr(AllowList2,targname) > 0 then Allowed = Allowed + 1
If Allowed = 0 then exit sub
TargetCommand = "/target " & targname
'Target Buffie
DoCommand(TargetCommand)
'build target say command
TellTarget = "/say " & targname & " Please listen to me now your buff will start in 30 seconds"
'Say how long they need to wait
DoCommand(TellTarget)
'Wait 30 seconds
XUScriptHost.Sleep 30000
'set perform
DoCommand("/setperform")
TellTarget = "/say " & targname & " Your buff is starting now Heal me if action is low"
DoCommand("/startmusic virtuoso")
'tell buffie they have 8 mins till finshed
DoCommand(TellTarget)
'Set loop for 10 times
i=0
Do While i < 10
'perform florish
Florish
i=i+1
If i = 2 then
TellTarget = "/say " & targname & " 25 percent done with buff "
DoCommand(TellTarget)
End If
If i = 4 then
TellTarget = "/say " & targname & " 50 percent done with buff"
DoCommand(TellTarget)
End If
If i = 6 then
TellTarget = "/say " & targname & " 75 percent done with buff"
DoCommand(TellTarget)
End If
Loop
TellTarget = "/say " & targname & " buff is finished you have 30 seconds to stop listen"
'Tell buffie to stop listening
DoCommand(TellTarget)
XUScriptHost.Sleep 30000
'Heal action back up to full
DoCommand("/stop")
XUScriptHost.Sleep 10000
HealActon
'restart playing music
doCommand("/stand")
XUScriptHost.Sleep 10000
DoCommand("/startmusic virtuoso")
'Clear LogLine - Make sure old buffmind is no longer there
LogLine = " "
DoCommand("/target a")
End Sub
Sub BuffHam
'Get Target name
targname = mid(cstr(LogLine),22,InStr(LogLine,"tells") - 22)
TargetCommand = "/target " & targname
Allowed = 0
If InStr(AllowList1,targname) > 0 then Allowed = Allowed + 1
If InStr(AllowList2,targname) > 0 then Allowed = Allowed + 1
If Allowed = 0 then exit sub
'Target Buffie
DoCommand(TargetCommand)
'build target say command
TellTarget = "/say " & targname & " Please stay 6m or closer to me now your Doc buffs will start in 30 seconds"
'Say how long they need to wait
DoCommand(TellTarget)
'Stop Music
DoCommand("/stop")
XUScriptHost.Sleep 10000
'Kneel
DoCommand("/kneel")
XUScriptHost.Sleep 10000
HealMind
'Buff Commands
DoCommand("/healenhance health")
XUScriptHost.Sleep 25000
HealMind
DoCommand("/healenhance strength")
XUScriptHost.Sleep 25000
HealMind
DoCommand("/healenhance constitution")
XUScriptHost.Sleep 25000
HealMind
DoCommand("/healenhance action")
XUScriptHost.Sleep 25000
HealMind
DoCommand("/healenhance quickness")
XUScriptHost.Sleep 25000
HealMind
DoCommand("/healenhance stamina")
XUScriptHost.Sleep 25000
'restart playing music
doCommand("/stand")
XUScriptHost.Sleep 10000
DoCommand("/startmusic Rock")
'Clear LogLine - Make sure old buffmind is no longer there
LogLine = " "
End Sub
'Perform a florish sequences
Sub Florish
h=1
Do while h < 9
Flo = "/flo " & h
DoCommand(Flo)
XUScriptHost.Sleep 4500
h=h+1
Loop
End Sub
'The DoCommand subroutine types a given command and hits ENTER
Sub DoCommand(varCommand)
XUScriptHost.SendKeys cstr(varCommand)
DoKey vkEnter, 500
XUScriptHost.Sleep 50
End Sub
Sub DoKey(varKey,varTime)
XUScriptHost.KeyDown(CInt(varKey))
XUScriptHost.Sleep CInt(varTime)
XUScriptHost.KeyUp(CInt(varKey))
End Sub
'heals Action if it is low
Sub HealActon
DoCommand("/target a")
do while XUScriptHost.GetPixelColor(ActionX,ActionY) = HealTrigger
DoCommand("/tend Damage")
XUScriptHost.Sleep 5000
loop
End Sub
'Kneel and rest for Mind
Sub HealMind
do while XUScriptHost.GetPixelColor(MindX,MindY) = HealTrigger
XUScriptHost.Sleep 5000
loop
End Sub
|