Targetting/locating guild buildings
Targetting/locating guild buildings
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
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
Re: Targetting/locating guild buildings
Maybe you could do something like this:
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
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)
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
Re: Targetting/locating guild buildings
Hmm.... How do I read my guild tag? (Based on the tag, i could have pre-programmed map file(s))
Re: Targetting/locating guild buildings
For the drill ground i use player:target_Object(112901); which works fine for me.
Re: Targetting/locating guild buildings
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
Re: Targetting/locating guild buildings
Most class methods (functions) start with a small letter. It should be
Also this function accepts partial names so the above should suffice.
Code: Select all
player:findNearestNameOrId("Stable")
- 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
Re: Targetting/locating guild buildings
Ok, well
Try
Like rock said, you can search for partial names so player:findNearestNameOrId("Stable") is enough
I hope there aren't any mistakes in the code, I'm not home atm
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
Re: Targetting/locating guild buildings
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
Re: Targetting/locating guild buildings
I'm using a simple tag based waypoint to navigate to the correct location:
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.
Code: Select all
guild = api:GetGuildInfo()
__WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
-dx
P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.
Re: Targetting/locating guild buildings
Do you have different waypoint files you load based on the guild name? (I'm not sure I am understanding the second part correctly)dx876234 wrote:I'm using a simple tag based waypoint to navigate to the correct location:
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.Code: Select all
guild = api:GetGuildInfo() __WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
-dx
P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.
Re: Targetting/locating guild buildings
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
Re: Targetting/locating guild buildings
FYI, this doesn't work:
but this does:
Code: Select all
player:target(stable.Adress)
Code: Select all
player:target_NPC(stable.Id)
Re: Targetting/locating guild buildings
Cindy wrote:FYI, this doesn't work:Code: player:target(stable.Adress)
Addressrock5 wrote:Should be 'stable.Address' not 'stable.adress'.
Did you try
Code: Select all
ChoiceOptionByName(optiontext)
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Targetting/locating guild buildings
I do:Cindy wrote:Do you have different waypoint files you load based on the guild name? (I'm not sure I am understanding the second part correctly)dx876234 wrote:I'm using a simple tag based waypoint to navigate to the correct location:
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.Code: Select all
guild = api:GetGuildInfo() __WPL:setWaypointIndex(__WPL:findWaypointTag(guild))
-dx
P.S. The api:GetGuildInfo() is a straight call to the GetGuildInfo() function.
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>
Re: Targetting/locating guild buildings
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.Cindy wrote:FYI, this doesn't work:
but this does:Code: Select all
player:target(stable.Adress)
Code: Select all
player:target_NPC(stable.Id)
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()
- 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
Re: Targetting/locating guild buildings
Great, thanks all
Re: Targetting/locating guild buildings
error
removing "api:" didn't help either. What do I need? thanksguild = api:GetGuildInfo()
Re: Targetting/locating guild buildings
Code: Select all
guild = RoMScript('GetGuildInfo("player")');
Re: Targetting/locating guild buildings
Why? Is that not good enough for you? Do you want more information? Well here is the full command,
The meaning of some of those returned values are obvious, some not so obvious. I'll leave you to figure out what they mean.
Code: Select all
local guildName, leaderName, bRecruit, alreadyCreate,
MaxMemberCount, Score, GuildNote, Introduce,
isLeader, isBBSEnable, isOpenGuild, Level, IsOwnHouse, IsOpenVisit = GetGuildInfo();
- 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
Re: Targetting/locating guild buildings
Works for me, though the original poster of it had "api:" I thought I am missing something.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests