Targetting/locating guild buildings

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Targetting/locating guild buildings

#1 Post by Cindy » Sun Aug 18, 2013 11:26 pm

So, I am trying to script getting the mount buff from the stable, as well as doing minis in the drill grounds. Anyone tackle the problem of finding the right building in the castle? (Different castles have the buildings at different locations)

Secondly, this seems like a stupid question but I can't figure out the answer.

How do I target the stable to get the popup menu? Same with the Drill grounds?

Thanks in advance

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

Re: Targetting/locating guild buildings

#2 Post by Ego95 » Mon Aug 19, 2013 3:03 pm

Maybe you could do something like this:

Code: Select all

local stable = player:FindNearestNameOrId("Stable I") or player:FindNearestNameOrId("Stable II")  or player:FindNearestNameOrId("Stable III") or player:FindNearestNameOrId("Stable IV") or player:FindNearestNameOrId("Stable V") -- until Stable X
if stable then player:target(stable.adress)
To open the dialog I think you should use player:target_NPC("...")
About the different locations of buildings there isn't much you can do. You could probably check your current guild and then let your characzer run to a spot in the guild castle first before targeting the buildings.

Additionally it's maybe a good idea to use the wallhack because of those small fences some guild buildings have got.

I hope there aren't any mistakes in the code, I'm not home atm

AlterEgo95

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

Re: Targetting/locating guild buildings

#3 Post by Cindy » Mon Aug 19, 2013 6:11 pm

Hmm.... How do I read my guild tag? (Based on the tag, i could have pre-programmed map file(s))

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Targetting/locating guild buildings

#4 Post by haringpb » Tue Aug 20, 2013 3:20 am

For the drill ground i use player:target_Object(112901); which works fine for me.

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

Re: Targetting/locating guild buildings

#5 Post by Cindy » Tue Aug 20, 2013 11:37 pm

Code: Select all

The game client did not crash.
11:34pm - [string "             -- Front left Tile, is it Stable? ( Stable ..."]
:2: attempt to call method 'FindNearestNameOrId' (a nil value)

Code: Select all

<!-- # 10 --><waypoint x="-121" z="-421" y="6">		-- Front left Tile, is it Stable? ( Stable III - 112469) ( Stable VI - 112472)
		local stable = player:FindNearestNameOrId("Stable I") or player:FindNearestNameOrId("Stable II")  or player:FindNearestNameOrId("Stable III") or player:FindNearestNameOrId("Stable IV") or player:FindNearestNameOrId("Stable V") -- until Stable X
		if stable then player:target(stable.adress)
		 -- player:target_NPC(112472);
			sendMacro("ChoiceOption(6);");
			__WPL:setWaypointIndex(__WPL:findWaypointTag("exitcastle"));
		end
		if not player.Mounted then
		  player:mount();
		end		
note when i use my commented out code, it works. (But can't use to find the stable).

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

Re: Targetting/locating guild buildings

#6 Post by rock5 » Wed Aug 21, 2013 1:18 am

Most class methods (functions) start with a small letter. It should be

Code: Select all

player:findNearestNameOrId("Stable")
Also this function accepts partial names so the above should suffice.
  • 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: Targetting/locating guild buildings

#7 Post by Ego95 » Wed Aug 21, 2013 7:02 am

Ok, well
I hope there aren't any mistakes in the code, I'm not home atm
:D

Try

Code: Select all

<!-- # 10 --><waypoint x="-121" z="-421" y="6">      -- Front left Tile, is it Stable? ( Stable III - 112469) ( Stable VI - 112472)
      local stable = player:findNearestNameOrId("Stable")
      if stable then player:target(stable.adress)
         yrest(2000)
         sendMacro("ChoiceOption(6);");
         __WPL:setWaypointIndex(__WPL:findWaypointTag("exitcastle"));
      end
      if not player.Mounted then
        player:mount();
      end      
Like rock said, you can search for partial names so player:findNearestNameOrId("Stable") is enough

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

Re: Targetting/locating guild buildings

#8 Post by rock5 » Wed Aug 21, 2013 7:27 am

Should be 'stable.Address' not 'stable.adress'.
  • 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

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: Targetting/locating guild buildings

#9 Post by dx876234 » Wed Aug 21, 2013 8:33 am

I'm using a simple tag based waypoint to navigate to the correct location:

Code: Select all

guild = api:GetGuildInfo()
__WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
and then have a tag="guild" for each guild I run in as location of buildings are different, then I do a findNearest.. as above to open the building independent of level.

-dx

P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.

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

Re: Targetting/locating guild buildings

#10 Post by Cindy » Wed Aug 21, 2013 10:00 pm

dx876234 wrote:I'm using a simple tag based waypoint to navigate to the correct location:

Code: Select all

guild = api:GetGuildInfo()
__WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
and then have a tag="guild" for each guild I run in as location of buildings are different, then I do a findNearest.. as above to open the building independent of level.

-dx

P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.
Do you have different waypoint files you load based on the guild name? (I'm not sure I am understanding the second part correctly)

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

Re: Targetting/locating guild buildings

#11 Post by Cindy » Wed Aug 21, 2013 10:09 pm

Next question. Based on the level of the stable, there are options for picking the level of the buff. How can I pick the 2nd Last option, not knowing what the total number of options in the dialog (ie, some sort of logic for the "4" below)?

Code: Select all

		local stable = player:findNearestNameOrId("Stable")
		if stable then player:target(stable.Adress)
		 -- player:target_NPC(112472);
			sendMacro("ChoiceOption(4);");
		end
		if not player.Mounted then
		  player:mount();
		end	

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

Re: Targetting/locating guild buildings

#12 Post by Cindy » Thu Aug 22, 2013 12:31 am

FYI, this doesn't work:

Code: Select all

 player:target(stable.Adress)
but this does:

Code: Select all

player:target_NPC(stable.Id)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Targetting/locating guild buildings

#13 Post by lisa » Thu Aug 22, 2013 1:22 am

Cindy wrote:FYI, this doesn't work:Code: player:target(stable.Adress)
rock5 wrote:Should be 'stable.Address' not 'stable.adress'.
Address

Did you try

Code: Select all

ChoiceOptionByName(optiontext)
stable.Id
should actually tell you which level the stable is because each level would have a different Id, that might help with ur option choices.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

dx876234
Posts: 188
Joined: Sat Jul 24, 2010 6:13 am

Re: Targetting/locating guild buildings

#14 Post by dx876234 » Thu Aug 22, 2013 1:37 am

Cindy wrote:
dx876234 wrote:I'm using a simple tag based waypoint to navigate to the correct location:

Code: Select all

guild = api:GetGuildInfo()
__WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
and then have a tag="guild" for each guild I run in as location of buildings are different, then I do a findNearest.. as above to open the building independent of level.

-dx

P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.
Do you have different waypoint files you load based on the guild name? (I'm not sure I am understanding the second part correctly)
I do:

Code: Select all

<waypoint x=...>
guild = api:GetGuildInfo()
__WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
</waypoint>

<!-- for guild NN, move to stable -->
<waypoint x=.... tag="NN> </waypoint>
<waypoint x=....>
local stable = player:FindNearestNameOrId("Stable I") or player:FindNearestNameOrId("Stable II")  or player:FindNearestNameOrId("Stable III") or player:FindNearestNameOrId("Stable IV") or player:FindNearestNameOrId("Stable V") -- until Stable X  -- Prolly want this in a function to re-use
...
</waypoint>


<!-- for guild XX, move to stable -->
<waypoint x=.... tag="XX> </waypoint>
<waypoint x=....>
local stable = player:FindNearestNameOrId("Stable I") or player:FindNearestNameOrId("Stable II")  or player:FindNearestNameOrId("Stable III") or player:FindNearestNameOrId("Stable IV") or player:FindNearestNameOrId("Stable V") -- until Stable X  -- Prolly want this in a function to re-use
...
</waypoint>

-dx

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

Re: Targetting/locating guild buildings

#15 Post by rock5 » Thu Aug 22, 2013 6:43 am

Cindy wrote:FYI, this doesn't work:

Code: Select all

 player:target(stable.Adress)
but this does:

Code: Select all

player:target_NPC(stable.Id)
Even if you used the correct address, ie. stable.Address, these commands are different. player:target_NPC (and player:target_Object) search for something by name or id, targets it and then attacks it (clicks on it). In the case of an NPC, for example, it opens a dialog.

player:target only targets the object. It does no action. The equivalent to target_NPC then is

Code: Select all

player:target(stable.Address)
Attack()
As to which you should use, you usually use player:target_NPC on npcs and objects that open dialogs. You usually use player:target_Object when you are collecting something that either disappears or has a casting bar appear, because target_Object has extra options to deal with those. You use player:target and Attack, if you have already found the object, to avoid the extra search target_NPC would do and to make sure it clicks the object you found and not another.
  • 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

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

Re: Targetting/locating guild buildings

#16 Post by Cindy » Sat Aug 24, 2013 1:02 pm

Great, thanks all :)

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

Re: Targetting/locating guild buildings

#17 Post by Cindy » Wed Aug 28, 2013 6:19 pm

error
guild = api:GetGuildInfo()
removing "api:" didn't help either. What do I need? thanks

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

Re: Targetting/locating guild buildings

#18 Post by Cindy » Wed Aug 28, 2013 6:41 pm

Code: Select all

guild = RoMScript('GetGuildInfo("player")');
This works.. anything better?

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

Re: Targetting/locating guild buildings

#19 Post by rock5 » Thu Aug 29, 2013 12:58 am

Why? Is that not good enough for you? Do you want more information? Well here is the full command,

Code: Select all

	local guildName, leaderName, bRecruit, alreadyCreate, 
	MaxMemberCount, Score, GuildNote, Introduce,
	isLeader, isBBSEnable, isOpenGuild, Level, IsOwnHouse, IsOpenVisit = GetGuildInfo();
The meaning of some of those returned values are obvious, some not so obvious. I'll leave you to figure out what they mean.
  • 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

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

Re: Targetting/locating guild buildings

#20 Post by Cindy » Thu Aug 29, 2013 6:10 am

Works for me, though the original poster of it had "api:" I thought I am missing something.

Post Reply

Who is online

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