Luxon Faction Vanquish - Mount Qinkai Bot

09/19/2018 02:47 RitIRL#1
Hi All,

Luxon Vanquish for faction.

You can find the config from Line 95.

Global $nMinSleep = 60000 * 20 ; 20 Minutes - This is random sleep min every 4 runs
Global $nMaxSleep = 60000 * 60 ; 60 Minutes - This is random sleep max every 4 runs
Global $iDonateReward = 1 ; 1 == Faction, 2 == Jadeite Shard - Donate Reward
Global $bDonateAtCavalon = false ; True = Cavalon, False = Guild Hall
Global $iRunNum = 99 - Runs, This can be edited in UI

Bot supports backtracking with increased ranges if unable to vanquish first run
Party will heal to > 85% average before continuing after a fight
Disable rendering support

Current Initialize method is WinGetProcess("Guild Wars"), you can change this to a specific character name in the UI or in script.

On line 351, the fuction CanPickUpEx is used to check if certain items can be picked up. This is defaulted to common items that are used for Nicholas the Traveler, Golds, Greens, Tomes, Dyes, Lockpicks, Scrolls. Just add the modelid you want to pick up as a case and return true. For example I want to pick up bottle of grog as its pirate week currently. see below

Case 30855 ; Bottle of Grog Model ID
Return True

On line 447 is the fight function, this is currently set to use my SoS build OACjAuiMJRXTnNfTdilTVTQT0gA. This may differ in your case and may not work.

My current hero team is [Only registered and activated users can see links. Click Here To Register...]

# Credits

savsuds - Item Model ID's
Underavelvetmoon - I think I may have borrowed some ideas from pickup functionality
mhaendler - Disable Rendering
mrflibblehat - Waypoints (PvEvolved)
TheArkanaProject - Waypoints (PvEvolved)
09/22/2018 20:12 Bamisaur#2
Vanquished the area once and then my character got stuck talking to the Luxon Scavenger for the other 7 hours haha.
09/24/2018 10:24 HasuObs123#3
same experience like Bamisaur, Vanquished the area once and then my character also got stuck @ Cavalon.. any Ideas?
10/11/2018 21:24 Sky828#4
Very good bot thanks 25-30min per run.
I'd recommend swapping Icy Veins to BiP (with 8 Blood Magic) on the Necro.

Things I fixed:
-"Global $bDonateAtCavalon = False" works for me. When you said to set it to true it goes to my GH and gets stuck. Setting it to False makes it donate at Cavalon perfectly.
-"847 = Keen Oni Claw", not 417 as is in the code.
-Added 849 to include Guardian Moss.
-Added 932 to include Monstrous Fangs.
-Never used Summon Spirits. Now it does if you are still in combat.
-Very frequently missed 1-3 Wallow groups near the start of the run so had to go all the way back; wasted around 5 minutes. Occured just after "[-5895, -3959, 1200, "Second Guardian & Wallows"], _" where it moves onto Wallow Patrol too quickly. Added an extra waypoint and increased target detection ranges across all waypoints. Seems to be more reliable now.
-Increased faction amount to 40000 before it donates it to increase up-time. This number will be your faction cap minus ~15k.

Things I haven't fixed:
-Picks up all dyes instead of just black, cba to change this right now.
-Occasionally gets stuck in Cavalon. Hopefully won't be a hard fix.
10/31/2018 18:47 Koopa141#5
Does anybody know how to add a command for finding and opening locked chests?
11/01/2018 00:58 Underavelvetmoon#6
Quote:
Originally Posted by Koopa141 View Post
Does anybody know how to add a command for finding and opening locked chests?
You would have to know the spawn points/places to check for chests otherwise calling it frequently would probably cause rather high CPU usage. Just add it after any coords or whatever.

Code:
 Func FindChest()
	Local $ChestSpawn = 0
	If GetIsDead(-2) Then Return
       ;If $bCanContinue = False Then Return
	rndsleep(250)

	For $i = 0 To 4
	If GetIsDead(-2) Then Return
		TargetNextItem()
		Sleep(50)
		$Target = GetCurrentTarget()
		Sleep(50)
		$IsStatic = GetIsStatic($Target)
		Sleep(50)
		If $IsStatic = True Then
			$ChestSpawn = $ChestSpawn + 1

			$ChestX = DllStructGetData($Target, 'X')
			$ChestY = DllStructGetData($Target, 'Y')

			GoSignpost($Target)
			Sleep(50)
			OpenChest()
		EndIf
	Next

	If $ChestSpawn > 0 Then
		;Out("Found Chest")
		;$bChests = $bChests + 1
		PickUpLoot()
	Else
		;Out("No Chests @ current pos")
	EndIf
 EndFunc
11/02/2018 01:13 Selas#7
Quote:
Originally Posted by Underavelvetmoon View Post
Just add it after any coords or whatever.
If I got a function like the one below: how do I implement the chest function?
Simply calling ChestFunc after every enemy coordinates causes some trouble, because the function VQ starts all over again. So how do I keep the bot executing the function VQ while doing chests?
I could obviously disjoint the whole function, adding the chest function after every step and cause an extra-long code, but I would like to know the more efficient way. :)
Code:
 Func VQ()
	CurrentAction("Waiting to really complete load")
	rndslp(10000)
	CurrentAction("Taking blessing")
	GoNearestNPCToCoords(-8394, -9801)
;Dialog(0x83)
;	rndslp(1000)
	Dialog(0x85)
	rndslp(1000)
	Dialog(0x86)
	rndslp(1000)
	$DeadOnTheRun = 0
	AdlibRegister("CheckPartyDead", 500)
;~ 	AdlibRegister("TpSpirit", 1000)
	AdlibRegister("Luxonpoint", 1000)

	If $DeadOnTheRun = 0 Then $enemy = "Yeti"
	If $DeadOnTheRun = 0 Then AggroMoveToEx(-13046, -9347, $enemy)

	If $DeadOnTheRun = 0 Then $enemy = "Yeti"
	If $DeadOnTheRun = 0 Then AggroMoveToEx(-17348, -9895, $enemy)

	If $DeadOnTheRun = 0 Then $enemy = "Oni and Wallows"
	If $DeadOnTheRun = 0 Then AggroMoveToEx(-14702, -6671, $enemy)

	If $DeadOnTheRun = 0 Then $enemy = "Oni and Wallows"
	If $DeadOnTheRun = 0 Then AggroMoveToEx(-11080, -6126, $enemy, 2000)

	If $DeadOnTheRun = 0 Then $enemy = "Yeti"
	If $DeadOnTheRun = 0 Then AggroMoveToEx(-13426, -2344, $enemy)
[...]
EndFunc
11/02/2018 13:18 Koopa141#8
Add the FindChest function to the MoveAndAggro function in Line 311.

Code:
Func MoveandAggro($aWaypoints, $iStart = 0, $iFinish = 5000, $iStep = 1, $nRange = 1200)
	If $iFinish = 5000 Then
		$iFinish = UBound($aWaypoints) - 1
	EndIf

	For $i = $iStart to $iFinish step $iStep
		Out("Moving to waypoint - " &  $aWaypoints[$i][3])
		Local $nWaypointX = $aWaypoints[$i][0]
		Local $nWaypointY = $aWaypoints[$i][1]
		FindChest()

		AggroMoveToEx($nWaypointX, $nWaypointY, $nRange)
		If GetAreaVanquished() Then
			Return
		EndIf
	Next
EndFunc
Furthermore you have to change the name of the PickupLoot function to PickUpLootEx

Code:
Func FindChest()
	Local $ChestSpawn = 0
	If GetIsDead(-2) Then Return
       ;If $bCanContinue = False Then Return
	rndsleep(250)

	For $i = 0 To 4
	If GetIsDead(-2) Then Return
		TargetNextItem()
		Sleep(50)
		$Target = GetCurrentTarget()
		Sleep(50)
		$IsStatic = GetIsStatic($Target)
		Sleep(50)
		If $IsStatic = True Then
			$ChestSpawn = $ChestSpawn + 1

			$ChestX = DllStructGetData($Target, 'X')
			$ChestY = DllStructGetData($Target, 'Y')

			GoSignpost($Target)
			Sleep(50)
			OpenChest()
		EndIf
	Next

	If $ChestSpawn > 0 Then
		;Out("Found Chest")
		;$bChests = $bChests + 1
		PickupLootEx()
	Else
		;Out("No Chests @ current pos")
	EndIf
 EndFunc