Swapping Classes

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Swapping Classes

#1 Post by jduartedj » Mon Nov 22, 2010 6:38 pm

Hi,

I was wondering if has any1 ever done a script to change the class, I was wanting to put that in my project but I could search the forum because "class" and "Change" and too common words and the search just won't take them!

So is there a way to change classes already?

Thanks in advance
Last edited by jduartedj on Wed Dec 01, 2010 9:07 am, edited 1 time in total.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

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

Re: Swapping Classes

#2 Post by rock5 » Mon Nov 22, 2010 10:09 pm

Obviously to change class all you need to do is talk to your house maid and select the right option.

Unfortunately rombot doesn't normally change it's skill set. You could probably reload the profile like you do when you relog although I haven't tried it. Do a search for posts about reloging or changing character.

The good news is, my latest update has me thinking about changing class, so I will be working on an update that will change the skill set and recheck the action keys when it detects a change in class.
  • 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

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#3 Post by raff » Sun Nov 28, 2010 8:51 pm

I tried a profile change with:

Code: Select all

player = CPlayer.new();
settings.load();
settings.loadProfile("priest");
and it works, but it will use all skills twice, and when it's switch again, it will use skills triple times etc.

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

Re: Swapping Classes

#4 Post by rock5 » Sun Nov 28, 2010 9:32 pm

I tested it, you are right.

I don't understand why, but this doesn't work. I would have thought resetting the skills would work.

Code: Select all

player = CPlayer.new();
settings.load();
settings.profile.skills = {}
settings.loadProfile("priest");
The only way I could get it to work was to add the "settings.profile.skills = {}" to the actual part of the loadprofile function in settings.lua that loads the skills.

Add it between these 2 lines around line 670. I'll include it the next time I commit changes.

Code: Select all

	local loadSkills = function(node)
		settings.profile.skills = {}
		local elements = node:getElements();
  • 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

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#5 Post by raff » Sun Nov 28, 2010 11:38 pm

I have just tested it, and it works now, thank you :)

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#6 Post by jduartedj » Mon Nov 29, 2010 10:03 am

raff wrote:I have just tested it, and it works now, thank you :)
Nice! dudely noted!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#7 Post by raff » Tue Nov 30, 2010 2:17 pm

I have just noticed, that the <onLevelup> code in the new loaded profile won't work

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

Re: Swapping Classes

#8 Post by rock5 » Tue Nov 30, 2010 6:37 pm

raff wrote:I have just noticed, that the <onLevelup> code in the new loaded profile won't work
I have to admit I'm getting a little annoyed with comments like this. "won't work" could mean anything. Did it just not execute the code? Did it do an error? Did it do some other unexpected behavior? What happened when you noticed it didn't work?

I think maybe the administrator need to add a new forum rule for this. He already has one for creating informative titles, he should also have one saying "When reporting a problem, be informative. Was there an error message? What were you doing at the time? What happened? etc. Don't just put 'this isn't working'".

Sorry, raff, for bringing this up on your post.
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#9 Post by jduartedj » Wed Dec 01, 2010 12:31 am

rock5 wrote:
raff wrote:I have just noticed, that the <onLevelup> code in the new loaded profile won't work
I have to admit I'm getting a little annoyed with comments like this. "won't work" could mean anything. Did it just not execute the code? Did it do an error? Did it do some other unexpected behavior? What happened when you noticed it didn't work?

I think maybe the administrator need to add a new forum rule for this. He already has one for creating informative titles, he should also have one saying "When reporting a problem, be informative. Was there an error message? What were you doing at the time? What happened? etc. Don't just put 'this isn't working'".

Sorry, raff, for bringing this up on your post.
Totally agree!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#10 Post by raff » Wed Dec 01, 2010 4:20 am

Sorry, in my <onLevelup>..</onLevelup> code in the switched profile, I have:

Code: Select all

...
elseif( player.Level == 2 ) then
		elseif( player.Level == 2 ) then
			sendMacro("SetSpellPoint( 2, 2 );");
			sendMacro("SetSpellPoint( 2, 2 );");
			printf("Adding skill points to Urgent Heal\n");
So, I let the bot ran this night, he leveled the first class to level 10, switches the class and levels the second class also to lvl 10, and when I woke up and checked, the second class has not level up the skills. When I load the priest profile manually, it will level up the skills without problems.

But I found out, that you can "pre skill" your skills with SetSpellPoint( 2, 2 ), so I let the bot run this command 10 times on a specific waypoint as a workaround for this. When the priest then level ups, the skill is instantly maxed, without doing anything.

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

Re: Swapping Classes

#11 Post by rock5 » Wed Dec 01, 2010 5:41 am

raff wrote:Sorry, in my <onLevelup>..</onLevelup> code in the switched profile, I have:

Code: Select all

...
elseif( player.Level == 2 ) then
		elseif( player.Level == 2 ) then
			sendMacro("SetSpellPoint( 2, 2 );");
			sendMacro("SetSpellPoint( 2, 2 );");
			printf("Adding skill points to Urgent Heal\n");
So, I let the bot ran this night, he leveled the first class to level 10, switches the class and levels the second class also to lvl 10, and when I woke up and checked, the second class has not level up the skills. When I load the priest profile manually, it will level up the skills without problems.

But I found out, that you can "pre skill" your skills with SetSpellPoint( 2, 2 ), so I let the bot run this command 10 times on a specific waypoint as a workaround for this. When the priest then level ups, the skill is instantly maxed, without doing anything.
Are you reloading the profile as part of your script when you change class? That might be the problem because it would have the wrong skill set loaded.
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Swapping Classes

#12 Post by botje » Wed Dec 01, 2010 5:43 am

any chance of someone making a user function to swap classes?

Botje

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#13 Post by raff » Wed Dec 01, 2010 6:58 am

rock5 wrote: Are you reloading the profile as part of your script when you change class? That might be the problem because it would have the wrong skill set loaded.
ah that could it be

I have a waypointfile that runs to varanas, learns priest, go to logar, and then

Code: Select all

player = CPlayer.new();
settings.load();
settings.profile.skills = {}
settings.loadProfile("priest");
loadPaths("priest_start.xml");
priest_start.xml is:

Code: Select all

<waypoints type="RUN" >
	<!-- # 24 --><waypoint x="-1160" z="-5561">	</waypoint>
	<!-- # 25 --><waypoint x="-1199" z="-5787">	</waypoint>
	<!-- # 26 --><waypoint x="-1165" z="-5906">	</waypoint>
	<!-- # 27 --><waypoint x="-1093" z="-5968">	</waypoint>
	<!-- # 28 --><waypoint x="-934" z="-5977">	</waypoint>
	<!-- # 29 --><waypoint x="-689" z="-5965">	</waypoint>
	<!-- # 30 --><waypoint x="-446" z="-5977">	</waypoint>
	<!-- # 31 --><waypoint x="-437" z="-5963">
		player:target_NPC("Meydo");
if (player.Class2 == CLASS_PRIEST ) then
		sendMacro("ChoiceOption(2);");yrest(3000);
		sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
end
	</waypoint>
...
I will try it with changing class first and then load the new profile, thanks


botje wrote:any chance of someone making a user function to swap classes?

Botje

Code: Select all

sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
this will change the class

Code: Select all

sendMacro("SwapEquipmentItem();");
and this command will swap your equipment

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

Re: Swapping Classes

#14 Post by rock5 » Wed Dec 01, 2010 7:15 am

raff wrote:

Code: Select all

player = CPlayer.new();
settings.load();
settings.profile.skills = {}
settings.loadProfile("priest");
loadPaths("priest_start.xml");
Funny, when it came up in a previous post that skills get duplicated when you reload the profile, I tried using "settings.profile.skills = {}" like that but it didn't work. The only way I could make it work was to add it inside the loadprofile function. Are you sure that's working for you?
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Swapping Classes

#15 Post by botje » Wed Dec 01, 2010 9:49 am

ok, so when we put:

Code: Select all

sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
in a user function, we can swap both with one easy call?

Botje

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#16 Post by jduartedj » Wed Dec 01, 2010 11:04 am

botje wrote:ok, so when we put:

Code: Select all

sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
in a user function, we can swap both with one easy call?

Botje
You forgot:

Code: Select all

player:target_NPC("Meydo");
So I guess the answer is Yes, IF you have the correct NPC targeted.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Swapping Classes

#17 Post by raff » Thu Dec 02, 2010 12:05 pm

rock5 wrote: Funny, when it came up in a previous post that skills get duplicated when you reload the profile, I tried using "settings.profile.skills = {}" like that but it didn't work. The only way I could make it work was to add it inside the loadprofile function. Are you sure that's working for you?
Yes it seems everthing is working now, my priest_start.xml now looks like this:

Code: Select all

<waypoints type="RUN" >
	<!-- # 1 --><waypoint x="-1160" z="-5561">	</waypoint>
	<!-- # 2 --><waypoint x="-1199" z="-5787">	</waypoint>
	<!-- # 3 --><waypoint x="-1165" z="-5906">	</waypoint>
	<!-- # 4 --><waypoint x="-1093" z="-5968">	</waypoint>
	<!-- # 5 --><waypoint x="-934" z="-5977">	</waypoint>
	<!-- # 6 --><waypoint x="-689" z="-5965">	</waypoint>
	<!-- # 7 --><waypoint x="-446" z="-5977">	</waypoint>
	<!-- # 8 --><waypoint x="-437" z="-5963">
		player:target_NPC("Meydo");
if (player.Class2 == CLASS_PRIEST ) then
		sendMacro("ChoiceOption(2);");yrest(3000);
		sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");yrest(3000);
		sendMacro("SwapEquipmentItem();");
end

player = CPlayer.new();
settings.load();
settings.profile.skills = {}
settings.loadProfile("priest");
loadPaths("priest_start.xml");
__WPL:setWaypointIndex(9);
	</waypoint>
	<!-- # 9 --><waypoint x="-467" z="-5991">	</waypoint>
...
and I have just started the bot with a different profile and this path, and now he's fighting with the correct skills, also leveling up a skill is working

Code: Select all

Engaging enemy [Fungus] in combat.
Use 1: SCOUT_VAMPIRE_ARROWS=>   Fungus (111/111)
Use 4: PRIEST_BONE_CHILL   =>   Fungus (111/111)
Use 2: SCOUT_SHOT          =>   Fungus (105/111)
Use 3: PRIEST_RISING_TIDE  =>   Fungus (105/111)
Use 6: PRIEST_REGENERATE   =>   Fungus (68/111)
Use 2: SCOUT_SHOT          =>   Fungus (60/111)
Use 3: PRIEST_RISING_TIDE  =>   Fungus (60/111)
Use 2: SCOUT_SHOT          =>   Fungus (14/111)
Use 3: PRIEST_RISING_TIDE  =>   Fungus (12/111)
Use 5: PRIEST_URGENT_HEAL  =>   Fungus (0/111)
Fight finished. Killed 7 Fungus. (fight #7 / runtime 21521816 minutes)
Durability:99.99
Use MACRO: Looting target in distance 10.
Clearing target.
Equipment update took: 1
Use MACRO: Executing RoMScript "SetSpellPoint( 2, 2 );".
Use MACRO: Executing RoMScript "SetSpellPoint( 2, 2 );".
Adding skill points to Urgent Heal.
Moving to waypoint #5, (-3571, -7559)
Stopping waypoint: Target acquired.
botje wrote:ok, so when we put:

Code: Select all

sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
in a user function, we can swap both with one easy call?

Botje
you can use this for a function:

Code: Select all

function swapClass(npc, choice)
player:target_NPC(npc);yrest(1000)
sendMacro("ChoiceOption("..choice..");");yrest(1000);
sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
end
usage:

Code: Select all

swapClass("Meydo", 2)
meydo is the npc name and 2 is choiceoption 2, I dont know if its always the same

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#18 Post by jduartedj » Thu Dec 02, 2010 6:28 pm

raff wrote:
you can use this for a function:

Code: Select all

function swapClass(npc, choice)
player:target_NPC(npc);yrest(1000)
sendMacro("ChoiceOption("..choice..");");yrest(1000);
sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
end
usage:

Code: Select all

swapClass("Meydo", 2)
meydo is the npc name and 2 is choiceoption 2, I dont know if its always the same
Thx this is perfect. One note though, Indent the code! :d

Code: Select all

function swapClass(npc, choice)
	player:target_NPC(npc);yrest(1000)
	sendMacro("ChoiceOption("..choice..");");yrest(1000);
	sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
	sendMacro("SwapEquipmentItem();");
end
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

Post Reply

Who is online

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