Page 1 of 2

Rock5's GotoGuild

Posted: Fri Aug 30, 2013 4:27 am
by rock5
Here is a little userfunction I created for navigating around the guild castle. It uses the Dijkstra algorithm to find the shortest path to your destination.

Syntax:
  • GotoGuild(destination)
  • Where 'destination' can be a point number, point name or structure/object name or id.
Examples:

Code: Select all

GotoGuild(27) -- By point number
GotoGuild("Vault") -- By point name
GotoGuild("Library") -- By structure name
  • You'll nearly always be using the structure names.
Features:
  • - Opens gate into castle if needed.
    - Always goes to front of large structures.
GuildPath2.jpg

Re: Rock5's GotoGuild

Posted: Fri Aug 30, 2013 4:58 am
by Bubi
Nice function,
but we have buildings outside the castle.
Will try if it work anyway. :D

Re: Rock5's GotoGuild

Posted: Fri Aug 30, 2013 5:15 am
by rock5
How can you have buildings outside the castle?

Re: Rock5's GotoGuild

Posted: Fri Aug 30, 2013 7:21 am
by Ego95
How can you have buildings outside the castle?
When the guild level is higher and your buildings have a higher tier you can unlock the spots to build some buildings at the left and the right side outside your castle

Re: Rock5's GotoGuild

Posted: Fri Aug 30, 2013 9:07 am
by rock5
I didn't know that. Could you run a command for me? Start the commandline and copy and paste the following command into MM.

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
Then copy and paste the print out here. Then I can add those buildings. Check the link in my signature if you don't know how to copy and paste in MM.

Do you have all the spots filled? Do you know if more become available?

Re: Rock5's GotoGuild

Posted: Fri Aug 30, 2013 2:54 pm
by Ego95

Code: Select all

Gate,0,-652
Gate,-652,0
Gate,652,0
Guild Treasury Switch,44,645
Guild Treasury Gate,0,648
Farm VI,-950,546
Fortification,0,0
Main Building,0,264
Small Foundation I,-950,-547
Large Foundation,-950,546
Large Foundation,408,203
Stable VII,408,-223
Processing Factory III,184,-381
Large Foundation,184,-381
Tower of Increased Learning VI,-995,-601
Tower of Mystic Fortune VI,-904,-546
Tower of Perfect Defense VI,907,-490
Tower of Invincible Attack VI,998,-546
Tower of Rapid Growth VI,907,-601
Processing Factory III,952,546
Small Foundation I,952,-546
Large Foundation,952,546
Tower of Magic Protection VI,-995,-490
Arsenal VI,-184,-381
Guild Quest Board III,80,-221
Guild Castle Throne,0,595
Guild Quest Board II,-120,-221
Processing Factory VI,408,203
Large Foundation,408,-223
Drill Ground VI,-408,-223
Large Foundation,-408,-223
Forge VII,454,510
Small Foundation II,408,454
Academy VII,-408,453
Guild Castle Transport Point,-77,-529
Library VII,-408,203
Large Foundation,-184,-381
Guild Mailbox,-44,637
Guild Quest Board I,-80,-221
Large Foundation,-408,203
Field VII,454,399
Lumber Yard VII,362,454
Main Fortress Gate,0,-86
Guild Castle Transport Point,77,-529
Large Foundation,-408,454
This is, what I got. I deleted all unnecessary decorations we had in our castle. I don't know exactly how many spots are aviable but those we have are filled. On the left side next to sqare 1 we have got one building, on the left side next to sqare 3 we have got a hp buff tower, a tp tower and a droprate tower. On the right side next to sqare 6 we have got an exp tower, a matk/patk tower and a def tower. I think a spot next to sqare 8 should be possible too.

Re: Rock5's GotoGuild

Posted: Sat Aug 31, 2013 12:46 am
by rock5
I see there is 4 extra positions. Just a quick question; if you do the command above at the spot you first appear when entering the guild castle, does it list all the structures or are any out of range?

Re: Rock5's GotoGuild

Posted: Sat Aug 31, 2013 2:33 am
by lolita
rock5 wrote:Just a quick question; if you do the command above at the spot you first appear when entering the guild castle, does it list all the structures or are any out of range?
Yes all buildings outside castle are in list, i checked today.
here is screenshot of building menu how it's look like
Image

Re: Rock5's GotoGuild

Posted: Sat Aug 31, 2013 9:29 am
by rock5
Updated to version 1.1. Added buildings outside walls.

Re: Rock5's GotoGuild

Posted: Mon Sep 02, 2013 3:08 pm
by Bill D Cat
Just an observation, but I think you have at least one more path that needs to be added to improve this userfunction.

The two rear pads outside the castle walls would be better connected by running around behind the castle itself. The current path takes you in one side gate, around the front of the inner gate, then back out the other side gate. The two front pads are connected by running around the front of the castle, so this just seemed like an overlooked option for finding the best path.

Re: Rock5's GotoGuild

Posted: Mon Sep 02, 2013 3:23 pm
by rock5
Good point. I'll add it.

Edit: Done! Now version 1.2

Re: Rock5's GotoGuild

Posted: Mon Sep 02, 2013 3:59 pm
by Bill D Cat
Works like a charm, thanks for the quick update.

Re: Rock5's GotoGuild

Posted: Fri Sep 06, 2013 5:13 pm
by Cindy
Is there one to exit? (I can't tell from the code what "names" are available to Goto)

Re: Rock5's GotoGuild

Posted: Fri Sep 06, 2013 11:16 pm
by rock5
There are 2 places to exit.

At the NPC.

Code: Select all

GotoGuild("Vault") -- This is one of the named points
player:target_NPC("Whatever her name is")
ChoiceOptionByName("I want to leave")
I don't know what her name is and I don't know the option text but you get the idea.

And at the teleport site.

Code: Select all

GotoGuild("Portal Point") -- This should be the actual name of the teleport point.
portal = player:findNearestNameOrId("Portal point")
player:moveTo(portal,true)
Again I don't know what the portal point is called.

Re: Rock5's GotoGuild

Posted: Tue Dec 24, 2013 3:57 pm
by kuripot
regarding this... i dont know hot to use the GotoGuild
http://www.solarstrike.net/phpBB3/viewt ... =27&t=5351
i just put the command?

Code: Select all

GotoGuild("Portal Point") -- This should be the actual name of the teleport point.
portal = player:findNearestNameOrId("Portal point")
player:moveTo(portal,true)
and my bot know where the portal located and dont need to put the coordinate??
and put

Code: Select all

GotoGuild(112898); -- Drill Ground III
and bot knows the drill ground location?? like this???
from

Code: Select all

<!-- leaving castle -->
	<!-- #  1 --><waypoint x="0" z="-485" y="5" tag="gate">	</waypoint>
	<!-- #  2 --><waypoint x="-74" z="-527" y="7">
		if RoMScript("StaticPopup1:IsVisible()") then
		sendMacro('StaticPopup_OnClick(StaticPopup1, 1);') yrest(2000);
       		waitForLoadingScreen()
		else
		__WPL:setWaypointIndex(__WPL:findWaypointTag("gate"));	
		end
	</waypoint>
to

Code: Select all

<!-- leaving castle -->
GotoGuild("Portal Point") -- This should be the actual name of the teleport point.
portal = player:findNearestNameOrId("Portal point")
player:moveTo(portal,true)
		if RoMScript("StaticPopup1:IsVisible()") then
		sendMacro('StaticPopup_OnClick(StaticPopup1, 1);') yrest(2000);
       		waitForLoadingScreen()	
		end
	</waypoint>
and

Code: Select all

	<!-- castle to drill -->
	<!-- # 16 --><waypoint x="0" z="-484" y="29">	</waypoint>
	<!-- # 17 --><waypoint x="109" z="-295" y="31">	</waypoint>
	<!-- # 18 --><waypoint x="476" z="-18" y="29">	</waypoint>
	<!-- # 19 --><waypoint x="871" z="4" y="28">	</waypoint>
	<!-- # 20 --><waypoint x="960" z="296" y="25">	</waypoint>
	<!-- # 21 --><waypoint x="948" z="569" y="33">
		player:target_Object(112898); -- Drill Ground III
		sendMacro("ChoiceOption(1);");
		waitForLoadingScreen();
		loadPaths("drillground_survive");
	</waypoint>
to
<!-- castle to drill -->
GotoGuild(112898); -- Drill Ground III
sendMacro("ChoiceOption(1);");
waitForLoadingScreen();
loadPaths("drillground_survive");
</waypoint>

Re: Rock5's GotoGuild

Posted: Tue Dec 24, 2013 5:22 pm
by Bill D Cat
I think you can use it with just partial names, though that might make it language dependent.

Code: Select all

GotoGuild("Drill Ground") -- Any level drill ground
GotoGuild("Guild Castle Transport Point") -- The teleport exit to return to Obsidian/Varanas by the front gate.
Using a specific ID would possibly only find the exact level building, and I'm not sure that Rock5's userfunction splits the building level from the name the same way the bot handles the stackable buff names.

Code: Select all

Sys112896_name="Drill Ground I"
Sys112897_name="Drill Ground II"
Sys112898_name="Drill Ground III"
Sys112899_name="Drill Ground IV"
Sys112900_name="Drill Ground V"
Sys112901_name="Drill Ground VI"
Sys112902_name="Drill Ground VII"
Sys112903_name="Drill Ground VIII"
Sys112904_name="Drill Ground IX"
Sys112905_name="Drill Ground X"

Re: Rock5's GotoGuild

Posted: Wed Dec 25, 2013 11:55 am
by rock5
Yeah, just use the partial name.

Also, from memory, once you go to the drill ground then it might be still out of range to target with player:target_Object. Just use player:target_NPC("Drill Ground") instead.

Re: Rock5's GotoGuild

Posted: Thu Dec 26, 2013 7:06 am
by kuripot
its working

Code: Select all

GotoGuild("Drill Ground") -- Any level drill ground
but the transport are not working... my character going to nowhere

Code: Select all

GotoGuild("Guild Castle Transport Point") -- The teleport exit to return to Obsidian/Varanas by the front gate.
so i use the vault

Code: Select all

GotoGuild("Vault") -- This is one of the named points
player:target_NPC("Guild Castle Housekeeper")
ChoiceOptionByName("I want to leave the Guild Castle")
if RoMScript("StaticPopup1:IsVisible()") then
sendMacro('StaticPopup_OnClick(StaticPopup1, 1);') yrest(2000);
waitForLoadingScreen()
but its better if my character use the portal cos it is closer than the vault..

Re: Rock5's GotoGuild

Posted: Thu Dec 26, 2013 7:54 am
by rock5
GotoGuild just takes you near the target location. What you do there is up to you. Once you are at the transport point you will have to go into the portal your self. Eg.

Code: Select all

portal = player:findNearestNameOrId("Guild Castle Transport Point")
player:moveTo(portal,true) yrest(2000) 
sendMacro('StaticPopup_OnClick(StaticPopup1, 1);')
waitForLoadingScreen(20)

Re: Rock5's GotoGuild

Posted: Thu Dec 26, 2013 8:06 am
by kuripot
im in between of two portal.. because if you leave the drill ground automatically port to main gate between two Guild Castle Transport Point
what range i need to use the Guild Castle Transport Point