Get character slot

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
ratzuk
Posts: 19
Joined: Wed Dec 01, 2010 7:39 am

Get character slot

#1 Post by ratzuk » Sat Jan 08, 2011 11:48 am

Hi, I know you can get the name of the current player using player.Name. Is it possible to retrieve the slot number (1-8) of the current player?

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

Re: Get character slot

#2 Post by rock5 » Sat Jan 08, 2011 8:40 pm

ratzuk wrote:Hi, I know you can get the name of the current player using player.Name. Is it possible to retrieve the slot number (1-8) of the current player?
You mean on the character selection screen?

Try

Code: Select all

CharacterSelectListScrollBar:GetValue() + 1
  • 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

ratzuk
Posts: 19
Joined: Wed Dec 01, 2010 7:39 am

Re: Get character slot

#3 Post by ratzuk » Sun Jan 09, 2011 5:02 am

No, not on the character selection screen, while the bot is running.

I'll explain what I am trying to do:
I use the autologin (Loginxml) to run the Elven daily for tokens on an account with 8 characters using random character names. I would like the bot to give an indication of it's progress by outputting the current slot number to the bot window as it progresses.

Such as:

Code: Select all

printf("Bot"..<BotNumber>.." Completed "..dailyQuestCount.." from " .. dailyQuestsPerDay ..    " daily quests, now " .. dailyQuestsPerDay - dailyQuestCount .. " remain.");
Where <BotNumber> is the current character slot

Thanks

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

Re: Get character slot

#4 Post by rock5 » Sun Jan 09, 2011 7:21 am

ratzuk wrote:No, not on the character selection screen, while the bot is running.
I didn't mean at the selection screen(how can you enter a command there anyway?). I was asking you if you meant you wanted to know which character you are playing from the character selection screen because I didn't now what you meant by "character slot"?

I just rechecked it, it looks like I was wrong anyway. It doesn't work.

Had another look and found

Code: Select all

CHARACTER_SELECT.selectedIndex
that should hold the last character selected. See if that works.

One of these days I gotta update AutoLogin. It's on my todo list.
  • 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

ratzuk
Posts: 19
Joined: Wed Dec 01, 2010 7:39 am

Re: Get character slot

#5 Post by ratzuk » Mon Jan 10, 2011 5:28 am

rock5 wrote:I was asking you if you meant you wanted to know which character you are playing from the character selection screen
No I want to know the character number from within the bot itself so it can report how far through the available characters it is (1-8)

What i need to know is how to send the value of:

Code: Select all

CHARACTER_SELECT.selectedIndex
back to the bot in some way, as using it from within the bot

Code: Select all

<waypoint x="31845" z="4588">
			local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()"); 
     			if 10 == dailyQuestCount then
					printf("Completed "..dailyQuestCount.." from " .. dailyQuestsPerDay ..    " daily quests. Change character.");
      				sendMacro("}LoginNextToon=true;a={")
         			sendMacro("Logout();"); yrest(60*1000) -- wait 1m for next character to load
         
         			-- Re-initialize player
         			player = CPlayer.new();
         			settings.load();
         			settings.loadProfile("default"); -- Profile name
         			yrest (4000)
         
         			loadPaths("Elven Island/Daily"); -- First script
      			else
      				printf("Bot "..CHARACTER_SELECT.selectedIndex.." Completed "..dailyQuestCount.." from " .. dailyQuestsPerDay ..    " daily quests, now " .. dailyQuestsPerDay - dailyQuestCount .. " remain.");
      			end
			player:target_NPC("Blinsik");
			sendMacro("OnClick_QuestListButton(1, 2)"); yrest(750);
			sendMacro("AcceptQuest()"); yrest(2000);	
		</waypoint>
gives an error

Code: Select all

[string "..."]:16: attempt to index global 'CHARACTER_SELECT' (a nil value)
BTW AutoLogin is working perfectly

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

Re: Get character slot

#6 Post by rock5 » Mon Jan 10, 2011 6:31 am

ratzuk wrote:No I want to know the character number from within the bot itself so it can report how far through the available characters it is (1-8)
That's what I meant. I know what your asking but obviously I'm not making myself clear. Anyway, let's just move on.
ratzuk wrote:What i need to know is how to send the value of:

Code: Select all

CHARACTER_SELECT.selectedIndex
back to the bot in some way
You do it as you would normally do to get a value from the game,

Code: Select all

RoMScript("CHARACTER_SELECT.selectedIndex")
You were treating it as a rombot variable which it isn't. That's why you got the error.
  • 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

ratzuk
Posts: 19
Joined: Wed Dec 01, 2010 7:39 am

Re: Get character slot

#7 Post by ratzuk » Mon Jan 10, 2011 7:46 am

rock5 wrote: You do it as you would normally do to get a value from the game,

Code: Select all

RoMScript("CHARACTER_SELECT.selectedIndex")
You were treating it as a rombot variable which it isn't. That's why you got the error.
Thanks rock5. All working now :D

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 0 guests