...
10/02/07 10:53:42 AM XUScriptHelper->Creating Script Engine (VBScript). . .
10/02/07 10:53:43 AM XUScriptHelper->AddScriptItem: XUScriptHost
10/02/07 10:53:43 AM XUScriptHelper->AddScriptItem: Win32API
10/02/07 10:53:43 AM XUScriptHelper->AddScriptItem: VirtualKey
10/02/07 10:53:43 AM XUScriptHelper->AddScriptItem: Memory
10/02/07 10:53:43 AM XUScriptHelper->AddScriptItem: SystemInfo
10/02/07 10:53:44 AM XUScriptHelper->AddScriptItem: MemoryBasicInformation
10/02/07 10:53:44 AM XUScriptHelper->AddScriptItem: XUScriptPlugin
10/02/07 10:53:44 AM XUScriptHelper->Executing Script: Option Explicit
'=====================
' C O N S T A N T S
'=====================
Const ForReading = 1, ForWriting = 2, ForAppending = 8, UseAbility = "{ENTER}/useability "
Const HBver = "403"
'================================
' I M P O R T S C R I P T S
'================================
XUScriptPlugin.staStatus.Text = "Loading Globals"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_Globals_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading Functions"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_Functions_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading Classes"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_Classes_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading Harvest"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_Harvest_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading Navigation"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_Navigate_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading INI"
XUScriptHost.ImportScript("EQ2HarvestBot\HarvestBot_INI_v" & HBver & ".vbs")
XUScriptPlugin.staStatus.Text = "Loading EQ2Service Script"
XUScriptHost.ImportScript("..\Plugins\Everquest2\EQ2Service\EQ2Service.vbs")
If OktoContinue Then
XUScriptPlugin.staStatus.Text = "Waiting for XUnleashed to catch up"
sleep 1000
XUScriptPlugin.staStatus.Text = "Configuring bot environment"
End If
'============
' S E T U P
'============
Set oDebug = New DebugClass
If OktoContinue then
set oSvcObj = XUScriptPlugin.GetService("EQ2Service.Service")
do until Err.number = 0
oDebug.Print "EQ2Service load error " & cStr(Err.number) & " " & _
Err.description & ", retrying.", 0
Sleep 5000
set oSvcObj = XUScriptPlugin.GetService("EQ2Service.Service")
Loop
end if
if OktoContinue then
Set oINI = New INIClass
PCName = getplayername(oSvcObj)
SendKeys("{ENTER}/log{ENTER}")
Sleep 200
SendKeys("{ENTER}/log{ENTER}")
Sleep 200
Set oLog = New EQ2LogClass
end if
If OktoContinue then
UpdateCurrLoc
oDebug.Print "Start of Setup with " & cStr(OktoContinue) & ".", 8
ProcessINIFile
set oINI = Nothing
oDebug.PrintBanner
lastharvesttime = now
LastLogRead = now
SetClosestWaypoint
End If
If WantToUseAIM Then
XUScriptPlugin.staStatus.Text = "Loading AIMClient plugin"
oDebug.Print "Loading AIMClient plugin...", 8
Set oAIM = XUScriptPlugin.GetService("AIMClient.XUInterface") 'Grab the service
XUScriptPlugin.staStatus.Text = "Logging into AIM: " & AIM_Login
oDebug.Print "Logging into AIM: " & AIM_Login, 8
OktoContinue = oAIM.Connect(AIM_Login, AIM_Password)
If OktoContinue = False Then
XUScriptPlugin.staStatus.Text = "AIM: bad login / password"
oDebug.Print "AIM: bad login / password", 8
Sleep 2500
Else
XUScriptPlugin.staStatus.Text = "AIM: connected, synchronizing..."
oDebug.Print "AIM: connected, synchronizing...", 8
Sleep 2000
End If
End If
InitPet
Set oKH = New KeyHookClass
'====================
' M A I N L O O P
'====================
XUScriptPlugin.staStatus.Text = "HarvestBot is running"
Do while OKtoContinue
Wandering = False
if NavigateXY() then
If (AvoidPlayers and PlayerNearby()) or NOT OktoContinue then
MarkBadNode
Else
CastBuffs
HarvestResource
end if
end if
if QuitOnTimeout and (datediff("s", lastharvesttime, now() / 60)) > Timeout then
Call FatalError(formatnumber(datediff("s", lastharvesttime, now()) / 60,1) & _
" minutes since last harvest.", 1)
end if
loop
XUScriptPlugin.staStatus.Text = "HarvestBot is shutting down"
'================
' C L E A N U P
'================
if HotBar > 0 then
keydown(virtualkey.vk_shift)
Sleep 100
SendKeys(HotBarReset)
Sleep 100
keyup(virtualkey.vk_shift)
end if
If WantToUseAIM Then
oAIM.Disconnect
End If
if CampOnEnd then
SendKeys("{ENTER}/quit desktop{ENTER}")
end if
Set oSvcObj = Nothing
Set oDebug = NOTHING
Set oLog = NOTHING
Set oKH = NOTHING
Set oAIM = NOTHING
10/02/07 10:53:45 AM XUScriptHelper->Executing Script: Option Explicit
'=====================
' G L O B A L S
'=====================
Dim TellSound, PlayOnTells
Dim oSvcObj, oDebug, oLog, oINI, oKH, oAIM
Dim PCName, PCServer
Dim ZoneName, Hotbar, HotbarReset
Dim LastHarvestTime, LastLogRead, LogFileOverride, MaxHarvestAttempts, RunToRange, SleepBetweenHarvests
Dim QuitOnTimeout, Timeout, EraseBadSpawns, ClosestFirst
Dim eQuitOnTell, eQuitOnStuck, eTellSound, eUncommonSound, eRareSound, eStuckSound, eInventoryFull
Dim CampOnEnd, AvoidPlayers, AvoidRange
Dim MaxWander, Wandering, UseWayPoints, RealUseWaypoints, MaxWayPoints
Dim CurrX, CurrY, WPIndex, WayPointX, WayPointY, MoveToX, MoveToY, Waypoints, DistToTarget
Dim Resources(10,5), ResourceIndex
Dim KeyForward, KeyStepForward, KeyBackward, KeyLeft, KeyRight, KeyJump, KeyNearestPC
Dim KeyShutdown, KeyChat, KeyChat2, ChatKey, ChatKey2, ShutdownKey, PetSpellName
Dim SpawnID
Dim BadSpawns(1000), BadSpawnCount
Dim HarvestedNodes(100), HarvestedNodeCount
Dim Buffs, BuffCount, NextBuffTime, NextBuffName
Dim OKtoContinue, RelaxedNodeRadius
Dim WaypointStopMode, WaypointStopMode2, ExitReason
Dim HarvestedItemCount, HarvestedUncommonCount, HarvestedCollectionCount, HarvestedRareCount
Dim WantToUseAIM, AIM_Login, AIM_Password, AIM_Authorized, NextUpdateTime, AIM_UpdateLength
OktoContinue = True
NextBuffTime = now()
NextUpdateTime = Now()
BadSpawnCount = 0
HarvestedNodeCount = 0
HarvestedItemCount = 0
HarvestedRareCount = 0
HarvestedUncommonCount = 0
HarvestedCollectionCount = 0
WaypointStopMode = 0
LogFileOverride = ""
RelaxedNodeRadius = False
RealUseWaypoints = False
ExitReason = 0
WantToUseAIM = False
10/02/07 10:53:45 AM XUScriptHelper->Executing Script: Option Explicit
Function FixChatLogText(byVal text_to_update)
Dim pos, pos2, linkstoparse
' Strip off timestamp as number
text_to_update = Right(text_to_update, Len(text_to_update) - 12)
' Strip off timestamp as text
pos = InStr(text_to_update, "] ")
If (pos > 0) Then
text_to_update = Right(text_to_update, Len(text_to_update) - (pos + 1))
End If
' Parse \a links
linkstoparse = 0
Do
linkstoparse = linkstoparse + 1
pos = InStr(text_to_update, "\a")
If (pos > 0) Then
pos2 = InStr(text_to_update, ":")
If (pos2 > 0) Then
text_to_update = Left(text_to_update, (pos - 1)) & "<font><b>" & Right(text_to_update, Len(text_to_update) - pos2)
text_to_update = text_to_update
pos = InStr(text_to_update, "/a")
If (pos > 0) Then
text_to_update = Left(text_to_update, (pos - 2)) & "</b></font><font>" & Right(text_to_update, Len(text_to_update) - (pos + 1)) & "</font>"
End If
End If
End If
If (linkstoparse > 10) Then
pos = -1
End If
Loop While pos > 0
FixChatLogText = text_to_update
End Function
' String functions
Function HasToken(Str, Token)
if InStr(Str, Token) = 0 then
HasToken=FALSE
else
HasToken=TRUE
end if
End Function
Function StrUpToToken(byRef Str, token)
Dim Pos
Pos = InStr(CStr(Str), CStr(token))
if Pos > 0 then
StrUpToToken = Trim(Left(Str, Pos - Len(token)))
Str = Trim(Right(Str, len(Str) - (Pos + Len(Token) - 1)))
elseif Len(Str) > 0 then
StrUpToToken = Str
end if
End Function
Function StripBraces(byVal Str)
Dim StrLen
Str = trim(Str)
StrLen = Len(Str)
If HasToken(Str, "{") and HasToken(Str, "}") then
If Instr(Str, "{") = 1 and Instr(str, "}") = len(str) then
StripBraces = Right(Left(Str, StrLen-1), StrLen-2)
end if
elseif HasToken(Str, "[") and HasToken(Str, "]") then
If Instr(Str, "[") = 1 and Instr(str, "]") = len(str) then
StripBraces = Right(Left(Str, StrLen-1), StrLen-2)
end if
else
StripBraces = Str
end If
end Function
' Char conversion
Function GetVKNUM(CharStr)
Dim k
Select Case Lcase(CharStr)
Case vbCrLf
k = 13
Case "{enter}"
k = 13
Case "{space}"
k = VirtualKey.VK_SPACE
Case "{backspace}"
k = 8
Case "{bs}"
k = 8
Case "{bksp}"
k = 8
Case "{break}"
k = 19
Case "{capslock}"
k = 20
Case "{delete}"
k = 46
Case "{del}"
k = 46
Case "{down}"
k = 40
Case "{up}"
k = 38
Case "{left}"
k = 37
Case "{right}"
k = 39
Case "{end}"
k = 35
Case "{esc}"
k = 27
Case "{help}"
k = 47
Case "{home}"
k = 36
Case "{insert}"
k = 45
Case "{ins}"
k = 45
Case "{numlock}"
k = 144
Case "{num}"
k = 144
Case "{pgdn}"
k = 34
Case "{pgup}"
k = 33
Case "{prtsc}"
k = 0
Case "{scrolllock}"
k = 0
Case "{tab}"
k = 9
Case "{f1}"
k = 112
Case "{f2}"
k = 113
Case "{f3}"
k = 114
Case "{f4}"
k = 115
Case "{f5}"
k = 116
Case "{f6}"
k = 117
Case "{f7}"
k = 118
Case "{f8}"
k = 119
Case "{f9}"
k = 120
Case "{f10}"
k = 121
Case "{f11}"
k = 122
Case "{f12}"
k = 123
Case "{f13}"
k = 123
Case "{f14}"
k = 124
Case "{f15}"
k = 125
Case "{f16}"
k = 126
Case "/"
k = 111
Case Else
If Len(CharStr) = 1 Then
k = Asc(Ucase(CharStr))
Else
'Syntax Error
k = 0
End If
End Select
GetVKNUM = k
End Function
'Misc functions
Function FatalError(msg)
OKtoContinue = False
oDebug.PrintSectionStart msg & " Exiting script!", 0
oKH.DoSleep(5000)
End Function
sub Castbuffs()
Dim i
if buffcount > 0 and NextBuffTime < now() then
NextBufftime = DateAdd("h", 24, now)
sendkeys("{F1}")
For i = 0 to buffcount - 1
If buffs(i, 3) < now() then
oDebug.Print "Casting: " & buffs(i,0), 1
sendkeys(UseAbility & buffs(i,0) & "{ENTER}")
buffs(i,3) = DateAdd("n", buffs(i, 1), now)
Sleep 1000 * buffs(i,2)
end if
if buffs(i, 3) <NextBuffTime> 0 then
HavePet = True
msg = "Pet identified: " & getMobName(oSvcObj, PetID) & " ID: " & PetID
else
HavePet = False
msg = "Pet not in use"
end if
oDebug.PetDisplay msg
oDebug.Print msg,1
end sub
sub CheckPet
Dim msg, i, PetID
if HavePet then
TargetPet
if getTargetId(oSvcObj) < 1 and PetSpellName <then> 0 then
msg = "Pet identified: " & getMobName(oSvcObj, PetID) & " ID: " & PetID
else
msg = "Pet not in use"
end if
oDebug.PetDisplay msg
oDebug.Print msg,1
end if
end if
end sub
sub TargetPet
keydown(virtualkey.vk_shift)
Sleep 100
SendKeys("{F1}")
Sleep 100
keyup(virtualkey.vk_shift)
end sub
10/02/07 10:53:46 AM XUScriptHelper->Executing Script: Option Explicit
'====================
' Class Definitions
'====================
Class DebugClass
Dim DebugLevel, oLogFSO, oLogFile, LogFile
Dim SDisplay, IDisplay, DisplayNS, DisplayS2, pDisplay
Dim XXDisplay1, XXDisplay2
Private Sub Class_Initialize()
On Error Resume Next
DebugLevel = 1
Set IDisplay = XUScriptPlugin.AddTextOutHandler("InfoDisplay")
IDisplay.x = 340
IDisplay.y = 3
iDisplay.msg = "Loading, Please wait."
Set pDisplay = XUScriptPlugin.AddTextOutHandler("PetDisplay")
pDisplay.x = 340
pDisplay.y = 21
pDisplay.msg = "Loading, Please wait."
Set DisplayNS = XUScriptPlugin.AddTextOutHandler("DisplayNextStep")
DisplayNS.x = 340
DisplayNS.y = 39
DisplayNS.msg = "Loading, Please wait."
Set XXDisplay1 = XUScriptPlugin.AddTextOutHandler("XXDisplay1")
XXDisplay1.x = 340
XXDisplay1.y = 57
XXDisplay1.msg = "Loading, Please wait."
Set DisplayS2 = XUScriptPlugin.AddTextOutHandler("DisplayStatus2")
DisplayS2.x = 340
DisplayS2.y = 75
DisplayS2.msg = "Loading, Please wait."
Set XXDisplay2 = XUScriptPlugin.AddTextOutHandler("XXDisplay2")
XXDisplay2.x = 340
XXDisplay2.y = 93
XXDisplay2.msg = "Loading, Please wait."
Set SDisplay = XUScriptPlugin.AddTextOutHandler("StatusDisplay")
SDisplay.x = 340
SDisplay.y = 111
SDisplay.msg = "Loading, Please wait."
Set oLogFSO = CreateObject("Scripting.FileSystemObject")
LogFile = XUScriptHost.GetXUnleashedDirectory() & "\scripts\HarvestBot_v" & HBver & ".log"
iDisplay.msg = "2 secs for XU to catch up."
sleep 2000
If oLogFSO.FileExists(LogFile) Then
oLogFSO.DeleteFile(LogFile)
End If
err.clear
Set oLogFile = oLogFSO.OpenTextFile(LogFile, ForAppending, True)
If err.number > 0 then
oLogFile = Nothing
iDisplay.msg = "Error making Log file"
call PrintSectionStart("Error " & err.description & " LOG: " & LogFile, 0)
OktoContinue = False
err.clear
else
call PrintSectionStart("LOG: " & LogFile, 0)
End If
End Sub
Private Sub Class_Terminate()
Set IDisplay = Nothing
Set SDisplay = Nothing
Set DisplayS2 = Nothing
Set DisplayNS = Nothing
Set XXDisplay1 = Nothing
Set XXDisplay2 = Nothing
XUScriptPlugin.RemoveTextOutHandler "StatusDisplay"
XUScriptPlugin.RemoveTextOutHandler "DisplayStatus2"
XUScriptPlugin.RemoveTextOutHandler "InfoDisplay"
XUScriptPlugin.RemoveTextOutHandler "DisplayNextStep"
XUScriptPlugin.RemoveTextOutHandler "XXDisplay1"
XUScriptPlugin.RemoveTextOutHandler "XXDisplay2"
oLogFile.Close
End Sub
Public Sub SetDebugLevel(Level)
DebugLevel = CInt(Level)
call Print("Debug Level set to " & DebugLevel, 0)
End Sub
Public Sub DisplayNextStep(msg)
DisplayNS.str = msg
End Sub
Public Sub DisplayStatus2(msg)
DisplayS2.str = msg
End Sub
Public Sub SetXXDisplay(msg)
XXDisplay1.str = msg
End Sub
Public Sub SetXXDisplay2(msg)
XXDisplay2.str = msg
End Sub
Public Sub PrintInfo(msg)
IDisplay.str = msg
End Sub
Public Sub PetDisplay(msg)
pDisplay.str = msg
End Sub
Public Sub PrintStatus(msg, Level)
If (DebugLevel >= Level) then
SDisplay.str = msg
End If
End Sub
Public Sub PrintBanner()
oDebug.PrintInfo "HarvestBotv" & HBver & ": Press " & _
ShutdownKey & " to Stop harvesting or " & _
ChatKey & " to chat"
End Sub
Public Sub PrintLog(msg, Level)
If (DebugLevel >= Level) then
oLogFile.WriteLine("[" & CStr(FormatDateTime(now(), 0)) & _
"] " & msg)
End If
End Sub
Public Sub Print(msg, Level)
call PrintStatus(msg, Level)
call PrintLog(msg, Level)
End Sub
Public Sub PrintStars(Level)
call PrintLog (String(5,"*"), Level)
End Sub
Public Sub PrintBlankLine()
call PrintLog("", 10)
End Sub
Public Sub PrintSectionStart(msg, Level)
dim Stars
call PrintStars(Level)
Stars = ((52 - cInt(Len(msg))) / 2)
If Stars < 1 then
call PrintLog(msg, Level)
else
call PrintLog(String(Stars, "*") & " Start " & msg & " " & _
String(Stars, "*"), Level)
End If
End Sub
Public Sub PrintSectionEnd(msg, Level)
dim Stars
Stars = ((54 - cInt(Len(msg))) / 2)
If Stars < 1 then
call PrintLog(msg, Level)
else
call PrintLog(String(Stars, "*") & " End " & msg & " " & _
String(Stars, "*"), Level)
End If
call PrintStars(Level)
call PrintBlankLine()
End Sub
End Class
Class INIClass
Dim oINIFSO, oINIFile, INIFile
Private Sub Class_Initialize()
IniFile = GetXUnleashedDirectory() & "\Scripts\HarvestBot_v" & HBver & ".ini"
Set oINIFSO = CreateObject("Scripting.FileSystemObject")
If oINIFSO.FileExists(IniFile) Then
oDebug.Print "INI File found: " & INIFile, 0
oDebug.PrintStars 0
Else
OKtoContinue = False
oINIFSO = Nothing
Call FatalError("Missing INI File - Please unpack it from original RAR!")
End If
End Sub
Private Sub Class_Terminate()
' oINIFile.Close
End Sub
Private Function FindSection(Section)
Dim Line
Do
Line = Lcase(oINIFile.readline)
Loop until oINIFile.atendofstream or (instr(1, Line, "[" & Section & "]", vbtextcompare) <0> 0 then
PosKey = Instr(1, Line, "=", vbtextcompare) + 1
If Poskey > 1 Then
If (Len(Line) - Poskey) > 0 Then
GetVal = trim(Right(Line, Len(Line) - Poskey))
End If
exit do
End If
End If
Loop until oINIFile.atendofstream or left(Line,1) = "["
End If
oDebug.PrintLog "End GetVal with " & GetVal, 10
oINIFile.Close
End Function
End Class
Class EQ2LogClass
Dim oEQLogFSO, oEQLogFile
Private Sub Class_Initialize()
Dim LogFile, LogFileManual, LogFileAutomatic
Set oEQLogFSO = CreateObject("Scripting.FileSystemObject")
LogFile = oINI.GetVal("harvester", "eq2path", "")
PCServer = oINI.GetVal(PCName, "Server", "")
LogFileOverride = oINI.GetVal(PCName, "LogFileOverride", "")
If LogFile = "" then
Call FatalError("No EQ2 LogFile defined in INI")
ElseIf Mid(LogFile, len(LogFile)) <> "\" then
LogFile = Logfile & "\"
End If
LogFileManual = LogFile & LogFileOverride
LogFileAutomatic = LogFile & "logs\" & Trim(Replace(PCServer, "'", "")) & "\eq2log_" & PCName & ".txt"
If (LogFileOverride = "") Or (NOT oEQLogFSO.FileExists(LogFileManual)) Then
If NOT oEQLogFSO.FileExists(LogFileAutomatic) Then
Call FatalError("EQ2 LogFile not found :" & LogFileAutomatic & ": ")
Else
Set oEQLogFile = oEQLogFSO.OpenTextFile(LogFileAutomatic, ForReading, True)
do while oEQLogFile.AtEndOfStream <> True
oEQLogFile.SkipLine
loop
call oDebug.Print("EQ2 LOG File Opened: " & LogFileAutomatic, 0)
End If
Else
Set oEQLogFile = oEQLogFSO.OpenTextFile(LogFileManual, ForReading, True)
do while oEQLogFile.AtEndOfStream <> True
oEQLogFile.SkipLine
loop
call oDebug.Print("EQ2 LOG File Opened: " & LogFileManual, 0)
End If
End Sub
Private Sub Class_Terminate()
oEQLogFile.Close
End Sub
Private Function CheckItemUncommon(byval chatdesc)
Dim UncommonItemList
Dim index, pos
UncommonItemList = Array( _
"Strange Black Ore", _
" pepper ", _
" :luminous ", _
" glimmering ", _
" glowing flower", _
" glowing tooth", _
" glowing stone", _
" glowing scale", _
" Lambent", _
" sparkling " _
)
For index = 0 to ubound(UncommonItemList)
pos = instr(1, chatdesc, UncommonItemList(index), vbtextcompare)
If pos <> 0 Then
If eUncommonSound <> "" then
PlaySoundFile eUncommonSound
End If
HarvestedUncommonCount = HarvestedUncommonCount + 1
CheckItemUncommon = 1
chatdesc = FixChatLogText(chatdesc)
If WantToUseAIM Then
Call oAIM.SendMessage(AIM_Authorized, "<b>** UNCOMMON HARVEST **</b> " & chatdesc)
End If
Exit For
End If
Next
CheckItemUncommon = 0
End Function
Private Function CheckItemRarity(byval chatdesc)
Dim RareItemList
Dim index, pos
RareItemList = Array( _
"yarrow", _
"Copper Cluster", _
"Rough Lapis Lazuli", _
"Bronze Cluster", _
"Severed Alder", _
" a Low Quality", _
"Sisal Strands", _
"severed bone", _
"Silver Rluster", _
"Rough Coral", _
"Blackened Iron Cluster", _
"Bone Wood", _
" a Average Quality", _
" an Average Quality", _
"Dandelion Fiber", _
"Palladium Cluster", _
"Rough Jasper", _
" Steel Cluster", _
"Severed Fir", _
" a Medium Quality", _
"Oak Roots", _
"Ruthenium Cluster", _
"Rough Opal:", _
"Feysteel Cluster", _
"Severed Oak", _
" a High Quality", _
"Figwart Roots", _
"Rhodium Cluster", _
"Rough Ruby", _
"Ebon Cluster", _
"Severed Cedar", _
"Severed Ironwood", _
"Vanadium", _
"Cobalt Cluster", _
"Sarauga Roots", _
":Excellent Quality", _
"Rough Pearl", _
":Superb Quality" _
)
For index = 0 to ubound(RareItemList)
pos = instr(1, chatdesc, RareItemList(index), vbtextcompare)
If pos <> 0 Then
If eRareSound <> "" then
PlaySoundFile eRareSound
End If
HarvestedRareCount = HarvestedRareCount + 1
CheckItemRarity = 1
chatdesc = FixChatLogText(chatdesc)
If WantToUseAIM Then
Call oAIM.SendMessage(AIM_Authorized, "<b>** RARE HARVEST **</b> " & chatdesc)
End If
Exit For
End If
Next
CheckItemRarity = 0
End Function
'=====================================================================
' P R O C E S S C H A T L O G
'=====================================================================
Public Function Process()
Dim HarvestResults
Dim ChatText
Dim index, pos, pos2, linkstoparse, lenchat
Dim msg
Process = True
HarvestResults = Array( _
"You failed to", _
"You mine", _
"You gather", _
"You forest", _
"You acquire", _
"You found", _
"You fish" _
)
Do while NOT oEQLogFile.AtEndofStream
LastLogRead = now()
ChatText = oEQLogFile.Readline
If instr(1, chattext, "tells you", vbtextcompare) <> 0 Then
chattext = FixChatLogText(chattext)
If WantToUseAIM Then
Call oAIM.SendMessage(AIM_Authorized, chattext)
End If
If (eTellSound <> "") then
PlaySoundFile eTellSound
End If
If eQuitOnTell then
Call FatalError("Tell detected: quitting")
End If
' elseIf instr(1, chattext, "SYSTEM MESSAGE", vbtextcompare) <> 0 and instr(1, chattext, "camp out", vbtextcompare) </b> 0
End If
End If
If GetKeyState(KeyShutdown) <> LastShutdownKeyState Then
OktoContinue = False
DoSleep = False
oDebug.PrintInfo "Shutdown Pressed, exiting"
oDebug.Print "Shutdown by user request...", 1
ElseIf GetKeyState(KeyChat) <> LastChatKeyState Then
oDebug.PrintInfo "Paused while chatting, press " & ChatKey & " again to continue"
Do
sleep 115
TotalSleep = TotalSleep + 120
Loop While GetKeyState(KeyChat) <LastChatKeyState> 0) And (GetKeyState(KeyChat2) <> LastChatKeyState2) Then
tempkeystate = LastChatKeyState
LastChatKeyState = GetKeyState(KeyChat2)
oDebug.PrintInfo "Paused while chatting, press " & ChatKey & " again to continue"
Do
sleep 115
TotalSleep = TotalSleep + 120
Loop While GetKeyState(KeyChat) <> LastChatKeyState
LastChatKeyState = tempkeystate
oDebug.PrintBanner
Sleep 500
Else
Sleep 95
TotalSleep = TotalSleep + 100
End If
If TotalSleep <= Sleeptime And OktoContinue Then
DoSleep = DoSleep(Sleeptime - TotalSleep)
Else
If (Nextbuffname = "") Or (DateDiff("s", now, NextBuffTime) <0>Executing Script: Option Explicit
'=====================================================================
' H A R V E S T T A R G E T E D N O D E
'=====================================================================
sub HarvestResource()
dim tmpcounter, SendKeyCount, TargetID
tmpCounter = 0
targetid = -1
do until TargetID = SpawnID OR tmpCounter = 20
SendKeys("{TAB}") 'To Target the Resource
Sleep 100
TargetID = getTargetId(oSvcObj)
tmpCounter = tmpCounter + 1
loop
If (TargetID <SpawnID> 0 then
SendKeys(Resources(ResourceIndex, 3))
else
SendKeys(UseAbility & Resources(ResourceIndex,0) & "{ENTER}")
end if
end sub
'======================
' F I N D N O D E S
'======================
Function FindResource()
Dim index, mobname, distance, mobx, moby, foundid
Dim rx, ry, TmpSpawnID
Dim nodefinder
Dim lastdistance, thisdistance
FindResource = False
spawnid = -1
nodefinder = -1
lastdistance = 99999
thisdistance = 99999
If MaxWander > 5 Then
oDebug.PrintStatus "Looking for resources (updating node data)...", 1
oSvcObj.UpdateData
For index = 0 to 9
if resources(index,2) Then
oDebug.PrintStatus "Looking for '" & resources(index,1) & "'...", 1
tmpspawnid = oSvcObj.FindNearestMob(resources(index,1))
If NodeIsValid(TmpSpawnID) Then
rx = oSvcObj.mobx(TmpSpawnID)
ry = oSvcObj.moby(TmpSpawnID)
thisdistance = Abs(DistanceTo(rx, ry))
oDebug.PrintStatus "Looking for '" & resources(index,1) & "'... found! Distance is " & round(thisdistance, 1) & ".", 1
' Sleep(1000)
If WithinRange(rx,ry,WayPointX,WayPointY,MaxWander) or (WithinRange(rx,ry,currx,curry,15) And RelaxedNodeRadius) Then
oDebug.PrintStatus "(within range, distance is " & round(thisdistance, 1) & " versus max of " & MaxWander & ")", 1
' Sleep(1000)
' oDebug.PrintStatus "Closest " & resources(index,1) & " is " & TmpSpawnID & " named " & oSvcObj.mobname(TmpSpawnID) & " at " & rx & " " & ry & ".", 7
thisdistance = Abs(DistanceTo(rx, ry))
if ClosestFirst then
If (nodefinder < 0) or (thisdistance <lastdistance> 7) or NOT OktoContinue
' This is a simple but complex routine and deserves commenting.
' if maxwander < 6 we don't want to gather, just pass through so if we are
' within RunToRange then get the next waypoint.
' Otherwise if maxwander is > 5 meaning we want to gather and we are within
' the circle we want to gather within and we have not yet found a resource then
' look for a resource, if there are none then find next waypoint.
' This logic causes this routine to only return when it is standing in front of
' a node that needs to be harvested.
if MaxWander < 6 and DistToTarget <RunToRange> 5 and DistToTarget <= MaxWander and NavigateXY = False and DistToTarget <RunToRange>= 90 then
if Running then
StopRunning
end if
else
if NOT Running then
RunForward
end if
end if
'fine-tunes the tolerance for hdg angle to allow you to move sooner and adjust as you run
If Running then
NegHdgTol = -1
PosHdgTol = 1
Elseif DistanceTo(MoveToX, MoveToY) > 20 then
NegHdgTol = -6
PosHdgTol = 6
Else
NegHdgTol = -4
PosHdgTol = 4
End If
'If you are Running and getting nowhere then back up a bit, turn, run - jump and move on
if Running and withinrange(CurrX, CurrY, old_x, old_y, .25) then
if Wandering then
exit do
end if
runbackward(500)
if EvadeAttempts > 0 then
if DoLeftTurn then
TurnLeft(325)
else
TurnRight(650)
end if
TurnCount = TurnCount + 1
if TurnCount > 2 then
DoLeftTurn = not DoLeftTurn
TurnCount = 0
end if
end If
runforward
'if EvadeAttempts Mod 2 = 0 Then
oKH.DoSleep(50)
Jump(300)
'end if
EvadeAttempts = EvadeAttempts + 1
oKH.DoSleep(75)
'turns left as appropriate
elseif HdgDiff <NegHdgTol> 7 then
If WantToUseAIM Then
Call oAIM.SendMessage(AIM_Authorized, "<b>** BOT IS STUCK **</b> I've been stuck for a while now.")
End If
if eStuckSound <then> 5 then
StopRunning
end if
end Function
sub FindNextMoveToLocation
Dim roam, msg
if NOT FindResource then
If UseWayPoints then
WPIndex = WPIndex + 1
If WPIndex >= MaxWayPoints then
WPIndex = 0
End if
WayPointX = waypoints(WPIndex,0)
WayPointY = waypoints(WPIndex,1)
MaxWander = waypoints(WPIndex,2)
WaypointStopMode = waypoints(WPIndex,3)
MoveToX = WayPointX
MoveToY = WayPointY
if (RealUseWaypoints = True) then
msg = "Waypoint #" & WPIndex + 1 & "/" & MaxWayPoints & ": " & round(MoveToX, 0) & ", " & round(MoveToY, 0) & " (range: " & maxwander & ", mode: " & WaypointStopMode & "/" & WaypointStopMode2 &")"
else
msg = "Not using waypoints, just wandering around: " & round(MoveToX, 0) & ", " & round(MoveToY, 0) & " (range: " & maxwander & ", mode: " & WaypointStopMode2 &")"
end if
else
roam = (MaxWander / 2) - 1
Wandering = True
do
do
MoveToX = round(CurrX - roam + random(1,roam*2),1)
MoveToY = round(CurrY - roam + random(1,roam*2),1)
msg = "Wandering, Trying: " & MoveToX & ", " & MoveToY & " Range: " & maxwander
oDebug.Print msg, 1
oDebug.DisplayNextStep msg
loop until WithinRange(MoveToX,MoveToY,WayPointX,WayPointY,MaxWander)
loop until NOT WithinRange(MoveToX,MoveToY,CurrX, CurrY,roam)
msg = "Wandering, Trying: " & MoveToX & ", " & MoveToY & " Range: " & maxwander
end if
oDebug.Print msg, 1
oDebug.DisplayNextStep msg
end if
end sub
sub SetClosestWaypoint()
Dim ClosestIndex, ClosestDistance, Distance, msg
oSvcObj.UpdateData
CurrX = oSvcObj.playerX
CurrY = oSvcObj.playerY
If UseWayPoints then
ClosestIndex = 0
ClosestDistance = 9999
For WPIndex = 0 to ubound(waypoints)-1
distance = DistanceTo(Waypoints(WPIndex, 0), Waypoints(WPIndex, 1))
If distance <closestdistance> 180 then
temp = temp - 360
end if
if temp <180> 0 then
keydown(virtualkey.vk_shift)
Sleep 100
SendKeys(HotBar)
Sleep 100
keyup(virtualkey.vk_shift)
end if
Timeout = cInt(oINI.GetVal("Harvester", "Timeout", "15"))
oDebug.PrintLog "Timeout: " & Timeout, 1
QuitOnTimeout = cBool(oINI.GetVal("Harvester", "QuitOnTimeout", "False"))
oDebug.PrintLog "QuitonTimeout: " & quitontimeout, 1
oDebug.PrintSectionEnd "Processing Harvester Section", 1
oDebug.PrintSectionStart "Processing Events Section", 1
eQuitOnTell = cBool(oINI.GetVal("Events", "eQuitOnTell", "False"))
oDebug.PrintLog "QuitOnTell: " & eQuitOnTell, 1
eQuitOnStuck = cBool(oINI.GetVal("Events", "eQuitOnStuck", "False"))
oDebug.PrintLog "QuitOnStuck: " & eQuitOnStuck, 1
eTellSound = cStr(oINI.GetVal("Events", "eTellSound", ""))
oDebug.PrintLog "TellSound: " & eTellSound, 1
If eTellSound <> "" Then
eTellSound = GetXUnleashedDirectory() & "\scripts\" & eTellSound
End If
eUncommonSound = cStr(oINI.GetVal("Events", "eUncommonSound", ""))
oDebug.PrintLog "UncommonSound: " & eUncommonSound, 1
If eUncommonSound <> "" Then
eUncommonSound = GetXUnleashedDirectory() & "\scripts\" & eUncommonSound
End If
eRareSound = cStr(oINI.GetVal("Events", "eRareSound", ""))
oDebug.PrintLog "RareSound: " & eRareSound, 1
If eRareSound <> "" Then
eRareSound = GetXUnleashedDirectory() & "\scripts\" & eRareSound
End If
eStuckSound = cStr(oINI.GetVal("Events", "eStuckSound", ""))
oDebug.PrintLog "StuckSound: " & eStuckSound, 1
If eStuckSound <> "" Then
eStuckSound = GetXUnleashedDirectory() & "\scripts\" & eStuckSound
End If
eInventoryFull = cStr(oINI.GetVal("Events", "eInventoryFull", "Quit"))
oDebug.PrintLog "FullInventory: " & eInventoryFull, 1
If eInventoryFull <> "" Then
If eInventoryFull <> "Quit" Then
eInventoryFull = GetXUnleashedDirectory() & "\scripts\" & eInventoryFull
End If
End If
oDebug.PrintSectionEnd "Processing Events Section", 1
oDebug.PrintSectionStart "Processing AIM Section", 1
WantToUseAIM = CBool(oINI.GetVal("AIM", "WantToUseAIM", "False"))
oDebug.PrintLog "WantToUseAIM: " & WantToUseAIM, 1
AIM_Login = CStr(oINI.GetVal("AIM", "Login", "-username-"))
oDebug.PrintLog "AIM Login: " & AIM_Login, 1
AIM_Password = CStr(oINI.GetVal("AIM", "Password", "-password-"))
oDebug.PrintLog "AIM Password: " & AIM_Password, 1
AIM_Authorized = CStr(oINI.GetVal("AIM", "Authorized", "-authorized-"))
oDebug.PrintLog "Authorized: " & AIM_Authorized, 1
AIM_UpdateLength = CStr(oINI.GetVal("AIM", "UpdateInterval", "10"))
oDebug.PrintLog "UpdateInterval: " & AIM_UpdateLength, 1
oDebug.PrintSectionEnd "Processing AIM Section", 1
end sub
'=====================================================================
' P R O C E S S K E Y C O N F I G S E C T I O N
'=====================================================================
sub ProcessKeyConfigSection
oDebug.PrintSectionStart "Processing KeyConfig Section", 1
KeyForward = oINI.GetVal("KeyConfig", "AutoRun", "{NumLock}")
oDebug.PrintLog "AutoRun = " & KeyForward, 1
KeyStepForward = oINI.GetVal("KeyConfig", "Forward", "W")
oDebug.PrintLog "Forward = " & KeyStepForward, 1
KeyStepForward = GetVKNUM(KeyStepForward)
KeyBackward = oINI.GetVal("KeyConfig", "Backward", "S")
oDebug.PrintLog "Backward = " & KeyBackward, 1
KeyBackward = GetVKNUM(KeyBackward)
KeyLeft = oINI.GetVal("KeyConfig", "Left", "A")
oDebug.PrintLog "Left = " & KeyLeft, 1
KeyLeft = GetVKNUM(KeyLeft)
KeyRight = oINI.GetVal("KeyConfig", "Right", "D")
oDebug.PrintLog "Right = " & KeyRight, 1
KeyRight = GetVKNUM(KeyRight)
KeyJump = oINI.GetVal("KeyConfig", "Jump", "{SPACE}")
oDebug.PrintLog "Jump = " & StripBraces(KeyJump), 1
KeyJump = GetVKNUM(KeyJump)
KeyNearestPC = oINI.GetVal("KeyConfig", "NearestPC", "{F7}")
oDebug.PrintLog "NearestPC = " & StripBraces(KeyNearestPC), 1
PetSpellName = trim(oINI.GetVal("KeyConfig", "PetSpellName", ""))
oDebug.PrintLog "PetSpellName = " & PetSpellName, 1
KeyChat = oINI.GetVal("KeyConfig", "Chat", "{ENTER}")
ChatKey = uCase(StripBraces(KeyChat))
oDebug.PrintLog "Chat = " & ChatKey, 1
KeyChat = GetVKNUM(KeyChat)
KeyChat2 = oINI.GetVal("KeyConfig", "Reply", "R")
ChatKey2 = uCase(StripBraces(KeyChat2))
oDebug.PrintLog "Reply = " & ChatKey2, 1
KeyChat2 = GetVKNUM(KeyChat2)
KeyShutdown = oINI.GetVal("KeyConfig", "ShutdownBot", "{F11}")
ShutdownKey = uCase(StripBraces(KeyShutdown))
oDebug.PrintLog "Shutdown = " & ShutdownKey, 1
KeyShutdown = GetVKNUM(KeyShutdown)
oDebug.PrintSectionEnd "Processing KeyConfig Section", 1
end sub
'=====================================================================
' P R O C E S S P L A Y E R S E C T I O N
'=====================================================================
sub ProcessPlayerSection
Dim Index, INIStr
oDebug.PrintSectionStart "Processing Player Section", 1
buffcount = cint(oINI.GetVal(PCName, "Numofbuffs", "-1"))
LogFileOverride = trim(oINI.GetVal(PCName, "LogFileOverride", ""))
oDebug.PrintLog "LogFileOverride: " & LogFileOverride, 1
PCServer = trim(oINI.GetVal(PCName, "Server", ""))
oDebug.PrintLog "Server: " & PCServer, 1
if buffcount > 0 then
oDebug.PrintLog "Player: " & PCName & " Number of buffs: " & buffcount, 1
reDim buffs(buffcount, 4)
for Index = 0 to buffcount - 1
IniStr = cStr(oINI.GetVal(PCName, "buff" & cStr(Index + 1), "Invalid Entry,1,1"))
buffs(Index, 0) = trim(cStr(StrUpToToken(IniStr, ",")))
buffs(Index, 1) = cInt(StrUpToToken(IniStr, ","))
buffs(Index, 2) = cInt(StrUpToToken(IniStr, ","))
buffs(Index, 3) = now()
oDebug.PrintLog "Ability: " & buffs(Index, 0) & _
" Duration: " & buffs(Index, 1) & _
" Cast time: " & buffs(Index, 2), 1
next
ElseIf buffcount = 0 Then
oDebug.PrintLog "Not using buffs for " & PCName, 1
Else
oDebug.PrintLog "No Player Section found for " & PCName, 1
end if
oDebug.PrintSectionEnd "Processing Player Section", 1
end sub
'=====================================================================
' P R O C E S S R E S O U R C E S S E C T I O N
'=====================================================================
sub ProcessResourcesSection
dim IniStr, Index, ResourceSelected
ResourceSelected = False
oDebug.PrintSectionStart "Processing Resources Section", 1
IniStr = oINI.GetVal("resources", "collect", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "collecting"
resources(Index, 1) = "collect"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "ore", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "mining"
resources(Index, 1) = "ore"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "stone", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "mining"
resources(Index, 1) = "stone"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "wood", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "foresting"
resources(Index, 1) = "wood"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "misc", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "foresting"
resources(Index, 1) = "misc"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "den", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "trapping"
resources(Index, 1) = "den"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "roots", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "gathering"
resources(Index, 1) = "roots"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "shrub", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "gathering"
resources(Index, 1) = "shrub"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "fungi", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "gathering"
resources(Index, 1) = "fungi"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = Cint(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
IniStr = oINI.GetVal("resources", "fish", "1, False, 0, False")
Index = Cint(StrUpToToken(IniStr, ",")) - 1
resources(Index, 0) = "fishing"
resources(Index, 1) = "fish"
resources(Index, 2) = CBool(StrUpToToken(IniStr, ","))
resources(Index, 3) = CInt(StrUpToToken(IniStr, ","))
resources(Index, 4) = CBool(StrUpToToken(IniStr, ","))
for Index = 0 to 9
if resources(Index, 2) then
oDebug.PrintLog resources(Index, 1) & space(8-len(resources(Index, 1))) & _
"harvest: True" & " Hotkey: " & resources(Index, 3) & _
" Harvest even when trivial: " & resources(Index, 4), 1
ResourceSelected = True
else
oDebug.PrintLog resources(Index, 1) & space(8-len(resources(Index, 1))) & _
"harvest: False", 1
end if
next
if NOT ResourceSelected then
FatalError "No resources selected to harvest"
end if
oDebug.PrintSectionEnd "Processing Resources Section", 1
end sub
'=====================================================================
' P R O C E S S Z O N E S E C T I O N
'=====================================================================
sub ProcessZoneSection
Dim WPIndex, INIStr, keyname, index, tcx, tcy
oDebug.PrintSectionStart "Processing Zone Section", 1
'Get the zone name then trim any instance numbers from it
ZoneName = getZoneName(oSvcObj)
oDebug.PrintLog "Zone: " & ZoneName, 1
If instr(1, "0123456789", right(ZoneName,1), vbtextcompare) > 0 then
if len(zonename) < 3 then
FatalError("Invalid Zone name " & ZoneName)
else
ZoneName = trim(left(ZoneName, len(ZoneName)-2))
end if
end if
for Index = 0 to 9
Resources(Index,1) = trim(cStr(oINI.GetVal(zonename, resources(Index, 1), "UnDefined")))
next
UseWayPoints = oINI.GetVal(ZoneName, "UseWayPoints", "NotFound")
if UseWayPoints = "NotFound" then
' ZoneName = oINI.GetVal("harvester", "defaultzone")
FatalError "Zone undefined " & ZoneName
else
oDebug.PrintLog "ZoneSection: " & ZoneName, 1
MaxWander = CInt(oINI.GetVal(ZoneName, "maxwander", 100))
oDebug.PrintLog "MaxWander: " & MaxWander, 1
RelaxedNodeRadius = cBool(oINI.GetVal(ZoneName, "RelaxedRadius", "False"))
oDebug.PrintLog "RelaxedNodeRadius: " & RelaxedNodeRadius, 1
WaypointStopMode2 = 0
If CStr(oINI.GetVal(ZoneName, "NodeStopType", "relaxed")) = "strict" Then
WaypointStopMode2 = 1
End If
oDebug.PrintLog "NodeStopType: " & WaypointStopMode2, 1
UseWayPoints = cBool(UseWayPoints)
If UseWayPoints then
oDebug.PrintLog "UseWayPoints: True", 1
MaxWayPoints = Cint(oINI.GetVal(ZoneName, "Numofpoints", 0))
oDebug.PrintLog "Number of Waypoints: " & MaxWayPoints, 1
RealUseWaypoints = True
ReDim Waypoints(MaxWayPoints, 4)
for WPIndex = 0 to MaxWayPoints - 1
keyname = "waypoint" & WPIndex + 1
INIStr = oINI.GetVal(ZoneName, keyname, CurrX & "," & CurrY & ", 100")
waypoints(WPIndex,0) = cSng(StrUpToToken(INIStr, ","))
waypoints(WPIndex,1) = cSng(StrUpToToken(INIStr, ","))
waypoints(WPIndex,2) = cSng(StrUpToToken(INIStr, ","))
waypoints(WPIndex,3) = 0
If trim(cStr(StrUpToToken(INIStr, ","))) = "direct" Then
waypoints(WPIndex,3) = 1
End If
oDebug.PrintLog keyname & _
" " & formatnumber(waypoints(WPIndex, 0),2) & _
", " & formatnumber(waypoints(WPIndex, 1),2) & _
", " & formatnumber(waypoints(WPIndex,2),2) & _
", mode " & waypoints(WPIndex,3), 1
next
Else
oSvcObj.UpdateData
tcx = round(oSvcObj.playerX, 0)
tcy = round(oSvcObj.playerY, 0)
MaxWayPoints = 2
ReDim Waypoints(MaxWaypoints, 4)
waypoints(0, 0) = tcx
waypoints(0, 1) = tcy
waypoints(0, 2) = MaxWander
waypoints(0, 3) = WaypointStopMode2
waypoints(1, 0) = tcx + 0.01
waypoints(1, 1) = tcy + 0.01
waypoints(1, 2) = MaxWander
waypoints(1, 3) = WaypointStopMode2
UseWayPoints = True
oDebug.PrintLog "UseWayPoints: False", 1
End if
end if
oDebug.PrintSectionEnd "Processing Zone Section", 1
end sub
10/02/07 10:53:51 AM Looking for 3rd Party Service for services\EQ2Service.Service
10/02/07 10:53:51 AM ERROR: Could not convert to a proper CLSID
10/02/07 10:53:51 AM Looking for StandardService for standardservices\EQ2Service.Service
10/02/07 10:53:51 AM ERROR: Could not convert to a proper CLSID
10/02/07 10:53:51 AM SCRIPT ERROR: Invalid procedure call or argument
Src: XUScripts
Line:39 Error:0 Scode:800a0005
10/02/07 10:53:51 AM Failed to Parse the Script. Check it for errors.
10/02/07 10:54:33 AM ERROR: Memory Leak Detected! All DX9Device Objects not released.
|