As posted in the harvester forum.... i assumed making a new post on it would be a little easier to find..
Hey everyone..
I'm new to the forums.. just bought xunleashed... i used the crafting bot and that is awesome! but i can't get this to work at all.
i edited the resource part of the script from one of the posts made in here so it looks like this
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
'Resources to look for. Syntax: HOTKEY, ResourceName
Resources = array( _
array("1", "alluvium ore"), _
array("4", "arbor"), _
array("1", "callous ore"), _
array("4", "decrepit arbor"), _
array("1", "dusky ore"), _
array("3", "fairy ring"), _
array("4", "felled high plains arbor"), _
array("4", "fetid arbor"), _
array("1", "hermetic stone"), _
array("3", "high plains fungi"), _
array("3", "high plains shrubbery"), _
array("3", "mesquite catch weed"), _
array("3", "musty roots"), _
array("3", "mystic natural garden"), _
array("3", "natural garden"), _
array("3", "natural herb garden"), _
array("1", "ore"), _
array("3", "ovegrown fairy ring"), _
array("3", "overgrown bed of greenslade"), _
array("3", "piperaceae"), _
array("3", "plains fungi"), _
array("3", "plains roots"), _
array("3", "plains shrubbery"), _
array("1", "residual ore"), _
array("1", "rhythmic stone"), _
array("1", "rigid stone"), _
array("3", "roots"), _
array("1", "sandwashed rock"), _
array("3", "stody roots"), _
array("1", "stonecrest ore"), _
array("3", "velvety roots"), _
array("4", "wind felled tree"), _
array("1", "wind swept stones"), _
array("4", "wretched arbor") _
)
Then i jumped in game to run it and my character did nothing. The script didn't stop.. it is running, but it doesn't do anything.. my character just stays in one place. Not sure what i did wrong. Here is my log
(!empty($user->lang['QUOTE'])) ? $user->lang['QUOTE'] : ucwords(strtolower(str_replace('_', ' ', 'QUOTE'))):
03/26/05 09:47:23 AM XUnleashed Client: Launching. . .
03/26/05 09:51:46 AM Found Target Process: EverQuest2.exe
03/26/05 09:51:47 AM Initializing COM Objects. . .
03/26/05 09:51:47 AM Setting up DirectX Hooks. . .
03/26/05 09:51:47 AM Found Target Process: EverQuest2.exe
03/26/05 09:51:47 AM Setting up DirectX Hooks. . .
03/26/05 09:51:50 AM FOUND: Direct3DCreate9
03/26/05 09:51:50 AM Starting Services. . .
03/26/05 09:51:50 AM ------->FOUND A StandardSERVICE: XUnleashed Windows Input Service
03/26/05 09:51:50 AM CXUWinInput::Initialize()
03/26/05 09:51:50 AM ------->FOUND A StandardSERVICE: XUnleashed TCP/IP Packet Sniffer
03/26/05 09:51:50 AM CPacketSniffer::Initialize()
03/26/05 09:51:50 AM Starting the 3rd Party Services...
03/26/05 09:51:50 AM ------->FOUND A 3rd Party Service: Wyvern's EQ2 Servicer
03/26/05 09:51:51 AM Starting Plugins. . .
03/26/05 09:51:51 AM ------->FOUND A 3rd Party Plugin: EQ2Crafter Plugin
03/26/05 09:51:51 AM Loading Window Schema. . .
03/26/05 09:51:51 AM ------->FOUND A STANDARD Plugin: XUnleashed V2 Triggers
03/26/05 09:51:51 AM Loading Window Schema. . .
03/26/05 09:51:51 AM ------->FOUND A STANDARD Plugin: XUnleashed V2 Macros
03/26/05 09:51:51 AM Loading Window Schema. . .
03/26/05 09:51:51 AM ------->FOUND A STANDARD Plugin: XUnleashed V2 Scripts
03/26/05 09:51:51 AM Loading Window Schema. . .
03/26/05 09:51:51 AM Attempting to lock onto Client. . .
03/26/05 09:51:51 AM WARNING: Requested DirectX9 Screen Format may not be compatable with XUnleashed.
03/26/05 09:51:51 AM FOUND: Direct3D9::CreateDevice()
03/26/05 09:51:51 AM DETECTED: Direct3DDevice9 Reset
03/26/05 09:51:51 AM WARNING: Requested DirectX9 Screen Format may be incompatable with XUnleashed.
03/26/05 09:51:51 AM FOUND: Direct3DDevice9::Present
03/26/05 09:51:51 AM Releasing XUnleashed DX9 BackBuffers.
03/26/05 09:51:51 AM Released XUnleashed DX9 BackBuffers.
03/26/05 09:51:51 AM Initializing DX9 BackBuffers...
03/26/05 09:52:56 AM DETECTED: Direct3DDevice9 Reset
03/26/05 09:52:56 AM WARNING: Requested DirectX9 Screen Format may be incompatable with XUnleashed.
03/26/05 09:52:56 AM FOUND: Direct3DDevice9::Present
03/26/05 09:52:56 AM Releasing XUnleashed DX9 BackBuffers.
03/26/05 09:52:56 AM Released XUnleashed DX9 BackBuffers.
03/26/05 09:52:56 AM Initializing DX9 BackBuffers...
03/26/05 09:53:02 AM XUScriptHelper->Creating Script Engine (VBScript). . .
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: XUScriptHost
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: Win32API
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: VirtualKey
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: Memory
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: SystemInfo
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: MemoryBasicInformation
03/26/05 09:53:02 AM XUScriptHelper->AddScriptItem: XUScriptPlugin
03/26/05 09:53:02 AM XUScriptHelper->Executing Script: 'EQ2Harvest Bot. version 1.1
'By WyvernX
' Install Instructions
'1. You MUST install the EQ2Service plugin. Get it from the downloads on the web page.
'2. Configure your data below
'Various Varying Variables
Dim oServiceObject, File, temp, FTarget, TargetID
Dim ResourceIndex, SpawnID, Resources, MobName, ResourceName
Dim HarvestCounter, MaxHarvests, MaxWanderDistance
Dim bQuitOnMaxHarvests, WanderDistance, bIgnoreWanderDistanceIfResourceFound
Dim BadSpawnArray, NumberOfBadSpawns
Dim RX, RY, PX, PY, RH, PH, IX, IY 'Resource, Player, Initial X and Y values
'Notes: If using patrol route, use a tight/small WanderDistance. If using wander method, use a larger one. Just remember you will wander any where in a square - distance away from the origin!!!
bIgnoreWanderDistanceIfResourceFound = true 'If a resource is outside of our wander area, harvest it anyway. (This could cause to you to move FAR away from home point!)
WanderDistance = 100 'How far the char is allowed to wander around
MaxWanderDistance = 300 'How far to stray away from starting point (if bIgnoreWanderDistanceIfResourceFound is true)
MaxHarvests = 60 'Will attempt to harvest MaxHarvests times.
bQuitOnMaxHarvets = false 'Log out after MaxHarvests is reached.
'Resources to look for. Syntax: HOTKEY, ResourceName
Resources = array( _
array("1", "alluvium ore"), _
array("4", "arbor"), _
array("2", "badger den"), _
array("1", "callous ore"), _
array("2", "critter den"), _
array("4", "decrepit arbor"), _
array("2", "deer den"), _
array("2", "dire wolf den"), _
array("1", "dusky ore"), _
array("3", "fairy ring"), _
array("4", "felled high plains arbor"), _
array("4", "fetid arbor"), _
array("1", "hermetic stone"), _
array("3", "high plains fungi"), _
array("3", "high plains shrubbery"), _
array("3", "mesquite catch weed"), _
array("5", "mob of fish"), _
array("2", "molerat den"), _
array("3", "musty roots"), _
array("3", "mystic natural garden"), _
array("3", "natural garden"), _
array("3", "natural herb garden"), _
array("1", "ore"), _
array("3", "ovegrown fairy ring"), _
array("3", "overgrown bed of greenslade"), _
array("3", "piperaceae"), _
array("3", "plains fungi"), _
array("3", "plains roots"), _
array("3", "plains shrubbery"), _
array("1", "residual ore"), _
array("1", "rhythmic stone"), _
array("1", "rigid stone"), _
array("3", "roots"), _
array("1", "sandwashed rock"), _
array("5", "school of fish"), _
array("5", "shoal of fish"), _
array("3", "stody roots"), _
array("1", "stonecrest ore"), _
array("5", "throng of fish"), _
array("3", "velvety roots"), _
array("4", "wind felled tree"), _
array("1", "wind swept stones"), _
array("4", "wretched arbor") _
)
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
' DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////
'Set the Log file for our output if necessary
logFilename = GetXUnleashedDirectory() + "\Scripts\EQ2Test.txt" 'debug log file
'Simple Log writing function
function writeLogLine (msg)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim FTarget, File, MyDate, MyTime, temp
MyDate = CStr (FormatDateTime (Date, 1))
MyTime = CStr (FormatDateTime (Time, 3))
Set FTarget = CreateObject("Scripting.FileSystemObject")
Set File = FTarget.OpenTextFile(logFilename, ForAppending, True)
temp = "[" & MyDate & " " & MyTime & "] " & msg & vbCrLf
File.Write temp
File.Close
end function
function WithinRoamArea()
'Check Distance
if (bIgnoreWanderDistanceIfResourceFound = true) then
if (distDiff(IX,RX) < MaxWanderDistance AND distDiff(IY,RY) < MaxWanderDistance) then
WithinRoamArea = true
else
WithinRoamArea = false
end if
else
if (distDiff(IX,RX) < WanderDistance AND distDiff(IY,RY) < WanderDistance) then
WithinRoamArea = true
else
WithinRoamArea = false
end if
end if
end function
sub HandleNoResourcesNearby
writeLogLine("No Resources in this area. Taking a nap!")
for s = 1 to 30
XUScriptPlugin.staStatus.Text = "No Resources nearby. Sleeping " & 30 - s
sleep 1000 'Sleep for 30 seconds.
next
XUScriptPlugin.staStatus.Text = "Going to random spot near origin"
NavigateXY oServiceObject, IX - WanderDistance + Random(0,WanderDistance * 2), IY - WanderDistance + Random(0,WanderDistance * 2)
end sub
sub HandleBadResource()
'This will take us back to "near" our starting point.
writeLogLine("HandleBadResource Called. Avoid that resource node.")
XUScriptPlugin.staStatus.Text = "Bad Resource/Target! Avoiding it for now. . ."
'NavigateXY oServiceObject, IX - WanderDistance + Random(0,WanderDistance * 2), IY - WanderDistance + Random(0,WanderDistance * 2)
BadSpawnArray(NumberOfBadSpawns) = SpawnID
NumberOfBadSpawns = NumberOfBadSpawns + 1
end sub
'How to find Resources.
'Note, it looks for preference items (lower index in the array) first.
'Might customize this later to look for nearest resources first.
sub FindResource()
writeLogLine("Finding Resource...")
XUScriptPlugin.staStatus.Text = "Looking. . ."
for i = LBound(Resources) to UBound(Resources)
SpawnID = findNearestMob(oServiceObject,Resources(i)(1))
for b = LBound(BadSpawnArray) to UBound(BadSpawnArray)
if (BadSpawnArray(b) = SpawnID) then
writeLogLine("Avoiding this resource, we couldnt get it last time!")
SpawnID = findNextNearestMob(oServiceObject)
if (SpawnID < 0) then 'No more of that type of resource!
exit for
end if
end if
next
if (SpawnID > -1) then
ResourceIndex = i
writeLogLine("Found Something...")
RX = getMobX(oServiceObject,SpawnID)
RY = getMobY(oServiceObject,SpawnID)
PX = getPlayerX(oServiceObject)
PY = getPlayerY(oServiceObject)
if (WithinRoamArea) then
writeLogLine("Woot! Found a " & Resources(i)(1))
XUScriptPlugin.staStatus.Text = "Found " & Resources(i)(1)
exit sub
else
writeLogLine("Nope, too far away!")
SpawnID = -1
end if
end if
next
if (SpawnID < 0) then
HandleNoResourcesNearby
end if
end sub
sub GotoResource()
writeLogLine("Moving to it...")
If (Index > -1) then
if (RX = 0 and RY = 0) then
writeLogLine("Bad location?")
XUScriptPlugin.staStatus.Text = "Skipping, bad location?"
Sleep 2000
else
NavigateXY oServiceObject, RX, RY
end if
end if
end sub
sub HarvestResource()
if (SpawnID > 0) then 'Make sure we still got a target
writeLogLine("Harvesting...")
XUScriptPlugin.staStatus.Text = "Harvesting. . .Only " & MaxHarvests - HarvestCounter & " more!!!"
SendKeys(Resources(ResourceIndex)(0))
HarvestCounter = HarvestCounter + 1 'One down!
sleep 5000 + Random(500,1500) 'Wait 5 seconds to harvest + a random delay of .5 to 1.5 seconds
end if
end sub
'Load in the helper functions
writeLogLine("Loading in Library: Navigator")
XUScriptPlugin.staStatus.Text = "Loading libraries... (EQ2Harvest-Navigator)"
XUScriptHost.ImportScript("EQ2Harvest\navigator.vbs")
writeLogLine("Loading in Library: EQ2Service")
XUScriptPlugin.staStatus.Text = "Loading libraries... (EQ2Harvest-EQ2Service)"
XUScriptHost.ImportScript("EQ2Harvest\EQ2Service.vbs")
writeLogLine("Creating EQ2Service Object")
XUScriptPlugin.staStatus.Text = "Loading EQ2Service..."
set oServiceObject = XUScriptPlugin.GetService("EQ2Service.Service")
if Err.Number <> 0 then
XUScriptPlugin.staStatus.Text = "EQ2Service Failed to load!"
Sleep 5000
else
writeLogLine("Doing 1 time init.")
'Any and All initialization
HarvestCounter = 0
IX = getPlayerX(oServiceObject)
IY = getPlayerY(oServiceObject)
NumberOfBadSpawns = 0
redim BadSpawnArray(MaxHarvests)
writeLogLine("Lets do this.")
'Heart of the Script.
Do while HarvestCounter < MaxHarvests
FindResource
if (SpawnID > 0) then
Sleep 2000
GotoResource
writeLogLine("Targeting Resource")
SendKeys("{TAB}") 'To Target the Resource
TargetID = getTargetID(oServiceObject)
if (TargetID > 0) then
MobName = getMobName(oServiceObject, TargetID)
writeLogLine("Targeted Resource: " & MobName)
end if
ResourceName = Resources(ResourceIndex)(1)
if (TargetID <> SpawnID) then
'Try backing up a little and try again:
writeLogLine("Wrong Target! Trying to back up a little...")
RunBackward
StopRunningBackward
SendKeys("{ESCAPE}")
SendKeys("{TAB}") 'To Target the Resource
TargetID = getTargetId(oServiceObject)
if (TargetID > 0) then
MobName = getMobName(oServiceObject, TargetIndex)
writeLogLine("Targeted Resource: " & MobName)
end if
ResourceName = Resources(ResourceIndex)(1)
if (TargetID <> SpawnID) then
HandleBadResource
writeLogLine("ARG!!! Could not target the resource!!!")
end if
end if
TargetID = getTargetID(oServiceObject)
if (TargetID = SpawnID) then HarvestResource
TargetID = getTargetID(oServiceObject)
if (TargetID = SpawnID) then HarvestResource
TargetID = getTargetID(oServiceObject)
if (TargetID = SpawnID) then HarvestResource
end if
sleep 200
loop
if (bQuitOnMaxHarvets = true) then
SendKeys("/quit{ENTER}")
end if
set File = Nothing
set FTarget = Nothing
set oServiceObject = Nothing
end if
03/26/05 09:54:10 AM Stopping Plugins. . .
03/26/05 09:54:10 AM Stopping Services. . .
03/26/05 09:54:10 AM CPacketSniffer::Terminate()
03/26/05 09:54:10 AM CXUWinInput::Terminate()
03/26/05 09:54:10 AM Releasing XUnleashed DX9 BackBuffers.
03/26/05 09:54:10 AM Released XUnleashed DX9 BackBuffers.
03/26/05 10:06:14 AM XUnleashed Client: Updating 3rd Party Plugins and Services...
03/26/05 10:06:14 AM XUnleashed Client: Patching EQ2Crafter Plugin
03/26/05 10:06:14 AM XUnleashed Client: Retrieving the file: update
03/26/05 10:06:15 AM XUnleashed Client: Patching Wyvern's EQ2 Servicer
03/26/05 10:06:15 AM XUnleashed Client: Retrieving the file: update
03/26/05 10:06:15 AM XUnleashed Client: Redirecting to alternate patch server. . .
03/26/05 10:06:15 AM XUnleashed Client: Retrieving the file: EQ2ServiceNews.txt
03/26/05 10:06:15 AM XUnleashed Client: Redirecting to alternate patch server. . .
03/26/05 10:06:16 AM XUnleashed Client: Patching complete. . .
03/26/05 10:06:17 AM XUnleashed Client: Updating 3rd Party Plugins and Services...
03/26/05 10:06:17 AM XUnleashed Client: Patching EQ2Crafter Plugin
03/26/05 10:06:17 AM XUnleashed Client: Retrieving the file: update
03/26/05 10:06:17 AM XUnleashed Client: Patching Wyvern's EQ2 Servicer
03/26/05 10:06:17 AM XUnleashed Client: Retrieving the file: update
03/26/05 10:06:17 AM XUnleashed Client: Redirecting to alternate patch server. . .
03/26/05 10:06:18 AM XUnleashed Client: Retrieving the file: EQ2ServiceNews.txt
03/26/05 10:06:18 AM XUnleashed Client: Redirecting to alternate patch server. . .
03/26/05 10:06:18 AM XUnleashed Client: Patching complete. . .
03/26/05 10:06:31 AM Uninitializing XUnleashed. . .
any help would be appreciated!!
Awesome program so far though!