How to select highest level available buff at stable?

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

How to select highest level available buff at stable?

#1 Post by Cindy » Thu Sep 05, 2013 5:34 pm

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.

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

Re: How to select highest level available buff at stable?

#2 Post by lisa » Thu Sep 05, 2013 8:42 pm

I am sure you asked this already in a different topic and I answered it.
lisa wrote: Did you try

Code: Select all

ChoiceOptionByName(optiontext)
In your case just do

Code: Select all


local counter = 1
local option
    repeat
		option = RoMScript("GetSpeakOption("..counter..")")
        counter = counter + 1
    until not option
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
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

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

Re: How to select highest level available buff at stable?

#3 Post by rock5 » Fri Sep 06, 2013 12:10 am

Probably GetNumSpeakOption(). I don't think it includes "Leave Conversation" in the count. So you can use

Code: Select all

RoMScript("ChoiceOption(GetNumSpeakOption())")
to select the last option.
  • 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: How to select highest level available buff at stable?

#4 Post by Cindy » Fri Sep 06, 2013 4:58 pm

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!

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

Re: How to select highest level available buff at stable?

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

Works great, though I got 3rd last option (ie one buff lower than max) I will do more testing tomorrow.

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

Re: How to select highest level available buff at stable?

#6 Post by rock5 » Sat Sep 07, 2013 1:02 am

Cindy wrote:Works great, though I got 3rd last option (ie one buff lower than max) I will do more testing tomorrow.
That's strange. Using my example? Maybe you should print the value first and see what it prints. Using commandline

Code: Select all

print(RoMScript("GetNumSpeakOption()"))
I just tested it myself. It worked for me. It selected the second one (I a level 2 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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest