The generic question is, how does one pick the 2nd last option in a dialog box?
I want to go to the stable and get the highest level buff. Different guilds have different level stables, if I could just chose '2nd last' option somehow, that would be perfect.
How to select highest level available buff at stable?
Re: How to select highest level available buff at stable?
I am sure you asked this already in a different topic and I answered it.
after it leaves the loop counter will be 1 more than the number of options you have, so - 2 from it to get second last option?
There are no doubt more efficient ways to do it, probably even an in game function that returns the number of options. Looking at the games wiki is a good place to find such functions.
http://runesofmagic.gamepedia.com/List_of_Functions
In your case just dolisa wrote: Did you tryCode: Select all
ChoiceOptionByName(optiontext)
Code: Select all
local counter = 1
local option
repeat
option = RoMScript("GetSpeakOption("..counter..")")
counter = counter + 1
until not option
There are no doubt more efficient ways to do it, probably even an in game function that returns the number of options. Looking at the games wiki is a good place to find such functions.
http://runesofmagic.gamepedia.com/List_of_Functions
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: How to select highest level available buff at stable?
Probably GetNumSpeakOption(). I don't think it includes "Leave Conversation" in the count. So you can use
to select the last option.
Code: Select all
RoMScript("ChoiceOption(GetNumSpeakOption())")
- 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: How to select highest level available buff at stable?
Oh.. I thought I asked it, but I couldn't find it so I figured I only thought about asking it.
The problem with the name scheme is that I don't know what the highest level buff will be (since I don't know what level the stable is).
(Well technically, I could know, but I would like to write the code so as to it works for any and all levels of stables.)
I will try Rock's idea, thanks!
The problem with the name scheme is that I don't know what the highest level buff will be (since I don't know what level the stable is).
(Well technically, I could know, but I would like to write the code so as to it works for any and all levels of stables.)
I will try Rock's idea, thanks!
Re: How to select highest level available buff at stable?
Works great, though I got 3rd last option (ie one buff lower than max) I will do more testing tomorrow.
Re: How to select highest level available buff at stable?
That's strange. Using my example? Maybe you should print the value first and see what it prints. Using commandlineCindy wrote:Works great, though I got 3rd last option (ie one buff lower than max) I will do more testing tomorrow.
Code: Select all
print(RoMScript("GetNumSpeakOption()"))
- 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
Who is online
Users browsing this forum: Ahrefs [Bot] and 60 guests