Swapping Classes

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
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 » Sun Jan 02, 2011 9:31 pm

This code was provided to me by raff. I give him full credit even if i changed the code slightly.

USAGE: swapClass([npc, choice]) where npc is the name of the npc to target and choice it the number of the choice to choose in the talk dialog. if no npc is given it assumes it is already targeted and if no choice is given then it defaults to 3 which is the house maids' choice nr.

Latest file: V2.1 - included redoing the bot macros

V2.0 - added a macro to the game macros that does the same but ingame

V1.01 - fixed a syntax error (my bad!)


for version 2.0 ingame macro all you need is to select a housemaid and run the macro.
Attachments
addon_swapClass.lua
V2.1
(1.4 KiB) Downloaded 362 times
addon_swapClass.lua
V2.0 (jduartedj)
(1.36 KiB) Downloaded 208 times
addon_swapClass.lua
V1.01
(570 Bytes) Downloaded 195 times
addon_swapClass.lua
v1.0
(558 Bytes) Downloaded 186 times
Last edited by jduartedj on Sun Jan 16, 2011 11:39 pm, edited 2 times 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 » Sun Jan 02, 2011 10:12 pm

I see a couple of problems.

The big one is that different classes need different skill sets loaded. I actually have that on my todo list. But you might not intend to fight with it, so that's ok.

Second, not everyone swaps their equipment when they change class. I guess it could just be commented out. But then why swap your equipment if you can't fight with that class?

I guess it would mostly be useful for switching class to turn in quests and leveling up your secondary class.

In that situation I usually just use the createpath options to target_NPC and choose the change class option, but then I have streamline installed so this might still be useful for those that don't.
  • 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

#3 Post by jduartedj » Mon Jan 03, 2011 8:16 am

Well I've heard of that problem before. But until there is a way to fast and safe reloading your profile This will be only meant for small stuff. But yeah delivering quests would on top of the list. Also Loading a new profile mid-bot would be useful to me. would it be to anyone?
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#4 Post by lisa » Thu Jan 06, 2011 9:49 pm

rock5 wrote:I see a couple of problems.

The big one is that different classes need different skill sets loaded. I actually have that on my todo list. But you might not intend to fight with it, so that's ok.
I'm in the middle of setting up a M/P set of WP to do 1-10/10. I'm setting the profile to have all skills I need for both classes in the <skills_mage> set. That way when I change class I can use the priest skills to fight with. I'm using the ""setActionKeyToId"" to set the skills so both classes have skills required on the appropriate buttons that is set in the <skills_mage>.
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: Swapping Classes

#5 Post by rock5 » Fri Jan 07, 2011 2:29 am

lisa wrote:
rock5 wrote:I see a couple of problems.

The big one is that different classes need different skill sets loaded. I actually have that on my todo list. But you might not intend to fight with it, so that's ok.
I'm in the middle of setting up a M/P set of WP to do 1-10/10. I'm setting the profile to have all skills I need for both classes in the <skills_mage> set. That way when I change class I can use the priest skills to fight with. I'm using the ""setActionKeyToId"" to set the skills so both classes have skills required on the appropriate buttons that is set in the <skills_mage>.
A better idea might be to put all your skills between <skills> tags instead. That way if you have to restart your bot when your character is a priest (like when your client crashes or your internet connection is interrupted) the skills will still be available.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#6 Post by lisa » Fri Jan 07, 2011 3:44 am

I copy pasted the skills to the priest section. =)

Edit:

Only real issue I have is the bot tries to use the skills that it can't possibly use. i.e. Flame when on priest. Doesn't cause issues but slows bot down when it sits for 1-2 secs waiting for skill to cast before continueing with other skills.

Any chance of adding in the skill.lua that it detects main class and if it's a primary skill from secondary class then not to try to use it.
So for P/M it checks main class which is priest and so doesn't try to cast flame which is a mage only skill.
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: Swapping Classes

#7 Post by rock5 » Fri Jan 07, 2011 6:03 am

How about

Code: Select all

for k,v in pairs(settings.profile.skills) do
    -- List of skills you want to use only as priest
    if v.Name == "FIRST_TO_DISABLE" or
       v.Name == "SECOND_TO_DISABLE" or
       v.Name == "THIRD_TO_DISABLE" then
        if player.Class == CLASS_PRIEST then
            settings.profile.skills[k].AutoUse = true
        else
            settings.profile.skills[k].AutoUse = false
        end
    end

    -- List of skills you want to use only as mage
    if v.Name == "FIRST_TO_DISABLE" or
       v.Name == "SECOND_TO_DISABLE" or
       v.Name == "THIRD_TO_DISABLE" then
        if player.Class == CLASS_MAGE then
            settings.profile.skills[k].AutoUse = true
        else
            settings.profile.skills[k].AutoUse = false
        end
    end
end
Wow, that turned out more complex than I thought it would.

Maybe use it in the onload section of the profile or in the waypoint file after the bot changes class. It disables the disables the non-primary class skills.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#8 Post by lisa » Fri Jan 07, 2011 11:32 am

Works great, thanks =)

For some reason I can't get the following to work.

Code: Select all

		setActionKeyToMacro(0, 1);
I'm probably missing something simple =(

When you change class for the first time the new class doesn't have the macro setup for 0 on action bar and since bot is already running it doesn't set it up for you.

Hope you don't think I am hijacking your thread jd, it's all to do with swapping classes and issues that arise from doing so.
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: Swapping Classes

#9 Post by rock5 » Fri Jan 07, 2011 6:19 pm

lisa wrote:Works great, thanks =)

For some reason I can't get the following to work.

Code: Select all

		setActionKeyToMacro(0, 1);
I'm probably missing something simple =(

When you change class for the first time the new class doesn't have the macro setup for 0 on action bar and since bot is already running it doesn't set it up for you.

Hope you don't think I am hijacking your thread jd, it's all to do with swapping classes and issues that arise from doing so.
Each class has it's own action bar so when you change class the action bar changes too. So you would have to re-set it when you change class if it doesn't already exist.

Plus the action keys go from 1 to 80, I believe, so I don't think that command will work.

Edit: Wait, I just realized what you wanted. Try running

Code: Select all

setupMacros()
after changing class. That should set up the action key 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#10 Post by jduartedj » Fri Jan 07, 2011 7:12 pm

Lisa keep up the good work!
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#11 Post by lisa » Fri Jan 07, 2011 9:38 pm

rock5 wrote:How about

Code: Select all


for k,v in pairs(settings.profile.skills) do
    -- List of skills you want to use only as priest
    if v.Name == "PRIEST_RISING_TIDE" then
        if player.Class1 == CLASS_PRIEST then
            settings.profile.skills[k].AutoUse = true
        else
            settings.profile.skills[k].AutoUse = false
        end
    end

    -- List of skills you want to use only as mage
    if v.Name == "MAGE_ELEMENTAL_CATALYST" or
       v.Name == "MAGE_FLAME" then
        if player.Class1 == CLASS_MAGE then
            settings.profile.skills[k].AutoUse = true
        else
            settings.profile.skills[k].AutoUse = false
        end
    end
end
Wow, that turned out more complex than I thought it would.

Maybe use it in the onload section of the profile or in the waypoint file after the bot changes class. It disables the disables the non-primary class skills.
Not a direct quote, adjusted player.Class to player.Class1 and added skills I wanted to use/not use =)
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: Swapping Classes

#12 Post by rock5 » Fri Jan 07, 2011 11:23 pm

lisa wrote: adjusted player.Class to player.Class1
I'm happy that was the only typo considering I wrote that on the spot. :)
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#13 Post by lisa » Fri Jan 07, 2011 11:40 pm

Works good for now =)

My next project is to make up a set of functions to call dependant on class.

i.e.

Code: Select all

 	levelupSkill(_PRIMARY, 1)
have it call to the settings elsewhere to detect class and then lvl up designated skills.

Code: Select all

        if player.Class1 == CLASS_MAGE then
        _PRIMARY == MAGE_FLAME
        _SECONDAY == MAGE_FIREBALL
end

        if player.Class1 == CLASS_PRIEST then
        _PRIMARY == PRIEST_RISING_TIDE
        _SECONDAY == PRIEST_URGENT_HEAL

end
I am purely guessing at the coding, not something I have really learnt yet lol

Something similar for the adding skills to action bar.

If I can get that going then my 1-10/10 won't be specific for mage as it is now.

Edit:
Had another thought, I could create different profile files i.e. SR.xml which would be a scout/rogue and have in profile to set some variables so that the right skills are lvled up when called for and also change the waypoints to set to rogue in class hall. This would probably be a better way of doing it.

Edit 2:
After some help from rock5 I have that skill coding working exactly how I want it to. Might have something to add to forum after weekend. It is looking like I should be able to make any class and also any second class do the 1-10/10. Need a few days to make sure it runs smoothly though.

It's funny it look me a couple hours to create the 1-10/10 but a few days to test it and clean up any bugs lol
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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#14 Post by jduartedj » Sun Jan 16, 2011 9:12 pm

Major update 2.0
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#15 Post by lisa » Sun Jan 16, 2011 11:13 pm

You've got this

Code: Select all

	sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
	sendMacro("SwapEquipmentItem();");
try this

Code: Select all

	sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
yrest(1000);
		player:update();
yrest(1000);
		setupMacros()
yrest(1000);
		sendMacro("SwapEquipmentItem();");
It will make sure the new class has a bot macro setup.
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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Swapping Classes

#16 Post by jduartedj » Sun Jan 16, 2011 11:26 pm

Yeah I guess it's a good thing.

EDIT: update to V2.1 with

Code: Select all

	sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
	sendMacro("SwapEquipmentItem();");
	player:update();
	setupMacros();
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Swapping Classes

#17 Post by lisa » Mon Jan 17, 2011 10:10 am

You need the setup macro before the swap equipment as swap equipment uses the macro to send an ingame command.
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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests