Page 1 of 1

settings.lua

Posted: Mon Jan 10, 2011 12:26 am
by lisa
Trying to add more tags to skills

Code: Select all

			-- Over-ride attributes
			local priority, maxhpper, maxmanaper, cooldown, inbattle, pullonly, maxuse, autouse, rebuffcut, minxx ;
I've added another tag in the skills and it works just fine but when I try to add another then it just won't register it as being there. Is there a maximum number of things to have in it??

If so how can I work around this to add another or are there any that arn't used anymore that I can replace?

Re: settings.lua

Posted: Mon Jan 10, 2011 12:40 am
by Administrator
What do you mean? Did you add the code to actually read the information out of the XML?

Re: settings.lua

Posted: Mon Jan 10, 2011 12:50 am
by lisa
I added in the minxx

then added in a value in the profile skills

Code: Select all

		<skill name="PRIEST_WAVE_ARMOR"  modifier="" hotkey="VK_9" priority="60" minlvl="2"   minxx="5" />
Then added in a function in functions.lua

Code: Select all

function checkclass2()

for k,v in pairs(settings.profile.skills) do
		if v.minxx ~= 4 then
            settings.profile.skills[k].AutoUse = false
        else
            settings.profile.skills[k].AutoUse = true
        end


end
then added in a call to the function in profile

Code: Select all

	<onLoad><![CDATA[

		checkclass2()

	]]></onLoad>
So now I can stop the bot from trying to use any skills from second class even though the skills are setup in it's profile.

Code I put on forum is just a small picture just to give you an idea, there is obviously a lot more to it to cover all classes. Although the usage might not seem clear it really doesn't matter, the important thing is it only lets me add 1 more tag to the skill sets.

Edit:
I spent half a day trying to work out a way to make the name="PRIEST_WAVE_ARMOR" something I could use to detect the class for the skill. In the end I decided it would be much easier to just add another tag, I also wanted to add another tag for a different reason so it seemed logical to put my efforts into that avenue.

Re: settings.lua

Posted: Mon Jan 10, 2011 2:05 am
by Administrator
On line 870, you'll see where it checks the tag and calls the appropriate function. Have you added some code here?

Re: settings.lua

Posted: Mon Jan 10, 2011 3:35 am
by lisa
Think I just got a bit tired, sorry.

I have the 2 options working perfectly now, only trouble is the way it's set up at the moment when I call the functions to do what they do they over write each other, which may have been why I was never getting both working at same time. Thought I tested that but I was getting pretty tired by that stage.

I'll use mage as an example of what is happening.

I call first function and it disables all skills from table with lvl requirements above character lvl.
I then call the next function and it disables all skills except mage, this is however re-enabling the skills above character lvl.
I might need to rethink how I approach this.