Rock5's GotoGuild

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Rock5's GotoGuild

#1 Post by rock5 » Fri Aug 30, 2013 4:27 am

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
Attachments
userfunction_GotoGuild.lua
Version 1.21 - Fixed typo that caused buildings at square 6 not to be found.
(21.37 KiB) Downloaded 380 times
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Bubi
Posts: 57
Joined: Tue May 04, 2010 3:51 pm

Re: Rock5's GotoGuild

#2 Post by Bubi » Fri Aug 30, 2013 4:58 am

Nice function,
but we have buildings outside the castle.
Will try if it work anyway. :D

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#3 Post by rock5 » Fri Aug 30, 2013 5:15 am

How can you have buildings outside the castle?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Rock5's GotoGuild

#4 Post by Ego95 » Fri Aug 30, 2013 7:21 am

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#5 Post by rock5 » Fri Aug 30, 2013 9:07 am

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?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Rock5's GotoGuild

#6 Post by Ego95 » Fri Aug 30, 2013 2:54 pm

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#7 Post by rock5 » Sat Aug 31, 2013 12:46 am

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?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Rock5's GotoGuild

#8 Post by lolita » Sat Aug 31, 2013 2:33 am

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
Life is a journey, not destination :D

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#9 Post by rock5 » Sat Aug 31, 2013 9:29 am

Updated to version 1.1. Added buildings outside walls.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's GotoGuild

#10 Post by Bill D Cat » Mon Sep 02, 2013 3:08 pm

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#11 Post by rock5 » Mon Sep 02, 2013 3:23 pm

Good point. I'll add it.

Edit: Done! Now version 1.2
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's GotoGuild

#12 Post by Bill D Cat » Mon Sep 02, 2013 3:59 pm

Works like a charm, thanks for the quick update.

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: Rock5's GotoGuild

#13 Post by Cindy » Fri Sep 06, 2013 5:13 pm

Is there one to exit? (I can't tell from the code what "names" are available to Goto)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#14 Post by rock5 » Fri Sep 06, 2013 11:16 pm

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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's GotoGuild

#15 Post by kuripot » Tue Dec 24, 2013 3:57 pm

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>

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: Rock5's GotoGuild

#16 Post by Bill D Cat » Tue Dec 24, 2013 5:22 pm

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"

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#17 Post by rock5 » Wed Dec 25, 2013 11:55 am

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.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's GotoGuild

#18 Post by kuripot » Thu Dec 26, 2013 7:06 am

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..

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's GotoGuild

#19 Post by rock5 » Thu Dec 26, 2013 7:54 am

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)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Rock5's GotoGuild

#20 Post by kuripot » Thu Dec 26, 2013 8:06 am

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 9 guests