Swapping Classes
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Only post additional bot resources here. Please do not ask unrelated questions.
Swapping Classes
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.
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!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Swapping Classes
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.
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
Re: Swapping Classes
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!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Swapping Classes
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>.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.
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: Swapping Classes
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.lisa wrote: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>.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.
- 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: Swapping Classes
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.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Swapping Classes
How about
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.
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
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
Re: Swapping Classes
Works great, thanks =)
For some reason I can't get the following to work.
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.
For some reason I can't get the following to work.
Code: Select all
setActionKeyToMacro(0, 1);
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Swapping Classes
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.lisa wrote:Works great, thanks =)
For some reason I can't get the following to work.
I'm probably missing something simple =(Code: Select all
setActionKeyToMacro(0, 1);
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.
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()
- 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: Swapping Classes
Lisa keep up the good work!
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Swapping Classes
Not a direct quote, adjusted player.Class to player.Class1 and added skills I wanted to use/not use =)rock5 wrote:How aboutWow, that turned out more complex than I thought it would.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
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.
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: Swapping Classes
I'm happy that was the only typo considering I wrote that on the spot.lisa wrote: adjusted player.Class to player.Class1
- 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: Swapping Classes
Works good for now =)
My next project is to make up a set of functions to call dependant on class.
i.e.
have it call to the settings elsewhere to detect class and then lvl up designated skills.
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
My next project is to make up a set of functions to call dependant on class.
i.e.
Code: Select all
levelupSkill(_PRIMARY, 1)
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
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Swapping Classes
Major update 2.0
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Swapping Classes
You've got this
try this
It will make sure the new class has a bot macro setup.
Code: Select all
sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
Code: Select all
sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
yrest(1000);
player:update();
yrest(1000);
setupMacros()
yrest(1000);
sendMacro("SwapEquipmentItem();");
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: Swapping Classes
Yeah I guess it's a good thing.
EDIT: update to V2.1 with
EDIT: update to V2.1 with
Code: Select all
sendMacro("ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS)");
sendMacro("SwapEquipmentItem();");
player:update();
setupMacros();
Thanks for reading!
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Swapping Classes
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: No registered users and 6 guests