Page 2 of 2

Re: Rock5's GotoGuild

Posted: Thu Dec 26, 2013 8:31 am
by rock5
The code I posted has no distance limits. It should work.

Re: Rock5's GotoGuild

Posted: Sat Dec 28, 2013 6:47 am
by kuripot
rock can you included this command

Code: Select all

		player:target_Object(112898); -- Drill Ground III
		sendMacro("ChoiceOption(1);");
		waitForLoadingScreen();
in "GotoGuild("Drill Ground")" command because i think no other reason why go to "Drill Ground" rather than doing minigame in "Drill Ground"
or teach me where and what i need to edit to put that command

Re: Rock5's GotoGuild

Posted: Sat Dec 28, 2013 8:34 am
by rock5
The only purpose of gotoguild is to take you around the castle. I'm not going to add any actions at the points. It's up to the user to take what ever actions they want to take. I suggest you add the code to your drill grounds waypoint file. Because you don't know where the drill ground is, the code would have to be in the onload. Example

Code: Select all

<onload>
   if getZoneId == 401 then -- Guild Castle
      player:target_Object(112898); -- Drill Ground III
      sendMacro("ChoiceOption(1);");
      waitForLoadingScreen();   
      __WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
   end
</onload>

Re: Rock5's GotoGuild

Posted: Sun Dec 29, 2013 8:02 pm
by pod
I can't get the GotoGuild function to work, I get this reply Failed to find destination 'Drill Ground'.

Code: Select all

<onload>      
	GotoGuild("Drill Ground") -- Any level drill ground
         player:target_Object("Drill Ground"); -- Drill Ground
         sendMacro("ChoiceOption(1);");
         waitForLoadingScreen();
</onload>
This is the list I get when running

Code: Select all

ol = CObjectList() ol:update() for k,v in pairs(ol.Objects) do printf("%s,%d,%d\n",v.Name,v.X,v.Z) end
  • Tower of Invincible Attack I,-138,-325
    Guild Quest Board I,-120,-221
    Guild Castle Transport Point,77,-564
    Tower of Perfect Defense I,-183,-436
    Academy IV,408,454
    Small Foundation VI,-184,-381
    Small Foundation VI,-408,203
    Large Foundation,-408,454
    Guild Treasury Gate,0,648
    Guild Mailbox,-44,637
    Library III,184,-381
    Stable IV,-408,-223
    Large Foundation,408,454
    Drill Ground II,408,-223
    Field IV,-362,260
    <UNKNOWN>,-6,-511
    Arsenal III,408,203
    Processing Factory III,-408,453
    Forge IV,-408,148
    Large Foundation,408,203
    Tower of Rapid Growth I,-229,-325
    Lumber Yard IV,-453,260
    Guild Treasury Switch,44,645
    Gate,652,0
    Main Building,0,264
    Gate,-652,0
    Guild Castle Transport Point,-77,-564
    Large Foundation,184,-381
    Large Foundation,408,-223
    Gate,0,-652
    Fortification,0,0
    Large Foundation,-408,-223
    ,0,0
    Guild Castle Throne,0,595

Re: Rock5's GotoGuild

Posted: Sun Dec 29, 2013 11:19 pm
by rock5
Actually that happened to me too. Could it be that you have the drill ground on the same square as me? Turns out that Square6 has a typo in it's name so it can't 'find' buildings on that square. Line 100 should be

Code: Select all

	[86]={ X=408 , Z=-335, Name="Square6", Links={[1]={Num=102},[2]={Num=87},}},

Re: Rock5's GotoGuild

Posted: Mon Dec 30, 2013 5:39 am
by pod
Now it's working perfect :)

Re: Rock5's GotoGuild

Posted: Mon Dec 30, 2013 5:53 am
by rock5
Square 6 typo fixed in version 1.21.

Re: Rock5's GotoGuild

Posted: Tue Nov 04, 2014 8:08 am
by Desmond
What function for checking if the gate is closed then open them?

Re: Rock5's GotoGuild

Posted: Tue Nov 04, 2014 8:24 am
by rock5
It should automatically open the gates when needed. There is no function available for you to use separately. The functions that open the gates are local.

Re: Rock5's GotoGuild

Posted: Thu Aug 13, 2015 2:33 pm
by noobbotter
I was having an issue getting the Drill Ground to open the dialog window after using goToGuild to get there. I use this which takes me onto the center of the drillground and then initiates the dialog command:

Code: Select all

GotoGuild("Drill Ground")
DG = player:findNearestNameOrId("Drill Ground")
player:moveTo(CWaypoint(DG.X,DG.Z), true)
player:target_Object("Drill Ground"); 
sendMacro("ChoiceOption(1);");
waitForLoadingScreen();   
Thought I'd post this... it might help someone else with the same problem.

Re: Rock5's GotoGuild

Posted: Thu Aug 13, 2015 7:17 pm
by beanybabe
here is what I came up with for drill I put the 3 wp in when having trouble but I think only 1 is needed now. use the repeat yrest until for each npc in drill or you will have problem
if you call the waypoints up externally after entering drill good luck that had to many problems I merged them into the main file.

Code: Select all

	GotoGuild("Drill Ground"); -- Any level drill ground
	yrest(500)
	repeat
		yrest(500)
	until player:target_Object("Drill Ground"); -- Drill Ground
	sendMacro("ChoiceOption(1);");
	yrest(1000);
	waitForLoadingScreen();
	yrest(500);
	__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X, player.Z))   need this just after entering to stop problems
</onload>
<!-- #  1 --><waypoint x="5121" z="2521" >	</waypoint>       -- I think rock got it fixed now so 3 of these wp are not needed here now.
<!-- #  1 --><waypoint x="5121" z="2521" >	</waypoint>
<!-- #  1 --><waypoint x="5120" z="2523" >
	repeat
		yrest(500)
	until player:target_NPC(112066) -- Special Training Manager
	

Re: Rock5's GotoGuild

Posted: Fri Sep 30, 2016 1:55 pm
by beanybabe
Question on Stable buffs. Is there way to get the highest stable buff in code. Or has anyone wrote some code to get the buffs from castle. I wrote a bit of code but need way to know if buff tower is not there or stable is not there also.

Here is what I got so far. It fails if stable or a tower is not there. Be inside castle when running this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onload>

-- get buffs in castle ver 0.1
 
for k,v in pairs(settings.profile.skills) do
	v.AutoUse = false
end
-- ---------------functions ---------------------

function kill_stupid_newbie_pet()
   local function evalfunc(address)
      local obj = CPawn.new(address)
      obj:updateIsPet()
      return obj.IsPet == player.Address
   end
   if player:findNearestNameOrId(113199,nil,evalfunc ) then  -- search vicinity for your Newbie Pet
      local newbEgg = inventory:findItem(207051); -- Newbie Pet Egg
      if newbEgg then
         newbEgg:use()
         newbEgg:delete()
      end
   end
end

--Main------------------
kill_stupid_newbie_pet()

GotoGuild("Stable");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Stable");  
	sendMacro("ChoiceOption(1);");               --get first stable buff
	yrest(1000);
	
GotoGuild("Tower of Increased Learning");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Increased Learning");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
GotoGuild("Tower of Mystic Fortune");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Mystic Fortune");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
GotoGuild("Tower of Rapid Growth");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Rapid Growth");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
GotoGuild("Tower of Perfect Defense");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Perfect Defense");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
GotoGuild("Tower of Invincible Attack"); 
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Invincible Attack");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
GotoGuild("Tower of Magic Protection");  
	yrest(500)
	repeat
 		yrest(500)
	until player:target_Object("Tower of Magic Protection");  
		sendMacro("ChoiceOption(1);");
	yrest(1000);
	
</onload>		
</waypoints>