• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
Resource icon

Lua - Skills2 (1 Viewer) 0.4.3

Thanks for reporting. Even that if you are doing something wrong I could code it better with some controls.
I will look straight into it :)

Update
So by looking at it I think
Attachment 37786: is due to you not having a target
Attachment 37787: Spells not defined in your config file, typo etc.

I will add some controls to it.
Pardon my noobishness - i don't know how to get an export of the errors....

Creating ini file....

...ata\Local\VeryVanilla\MacroQuest\Release\Lua\skills2.Lua:289: attempt to concatenate a nil value
stack traceback:
...ata\Local\VeryVanilla\MacroQuest\Release\Lua\skills2.Lua in function 'Cast Spells'
...ata\Local\VeryVanilla\MacroQuest\Release\Lua\skills2.Lua:396: in main chunk

then it shuts down

As I said, it works fine for every other class I've tried it on and that has been several
 
I made a new version that fix both issues. Let me know if you wan't to test it before I release it.
I also added the function to "Focus Specialize skill" so you can select a skill to level up first.
 
Blasty updated Skills2 with a new update entry:

Focus Specialize skill

This update holds a few things
  • Implemeted Focus Specialize skill (Will increase this skill before all others - defined in the INI file)
  • Shadow Knight bug fix
  • Check if the spell are in the spellbook
  • Bugfix with distance check
  • Added missing target notification
Note that there is a MQ2 bug with skillcap for specialized skills.

And thanks for all the feedback!

Read the rest of this update entry...
 
Hi. Was using this with a paladin. It doesn't seem to be destroying Summoned: Hammer of Wrath. Filled up inventory and then bugged out.
Try to replace
Line around 54
INI:
local destroy_forage = {
        ["Roots"] = true,
        ["Your Forage Item"] = true
    }
    while mq.TLO.Cursor.ID() do
        if destroy_forage[mq.TLO.Cursor.Name()] then
        mq.cmd('/destroy')
        end
        mq.cmd('/autoinv')
        mq.delay(100)
    end

Line around 148
INI:
local CursorCheck = function()
    local destroy_summon = {
        ["Hammer of Wrath"] = true,
        ["Your Summon Item"] = true
    }
    while mq.TLO.Cursor.ID() do
        if destroy_summon[mq.TLO.Cursor.Name()] then
        mq.cmd('/destroy')
        end
        mq.cmd('/autoinv')
        mq.delay(100)
    end
end
 
Well Blasty I tried out your Spells2.Lua and heres what I have found....

1. Overview is okay but you could go into a little more detail about how it works.

2. Their is no information on its use... Dose it work on all classes? Do you have to set up the spells first in the spell gems if you are trying to raise up your spell skills.

3. Above you mentioned and INI, where is it located and does this create the ini or do you have to create one for it to use?

4. Where do you put the Spells2.Lua file? Do you have to create a folder for it?

5. Does this work in the Lua Task Manager to control start and stop of the Lua file?

I am not saying that this is bad. I ran into the same thing as nubcake and started looking for answers.... I am sure that this is good but when you can't get it running then its kind of a let down.

Zeb
The Questions you ask here are exactly what I'm looking for. Where can I find these answers? I'd like to try Skills2 but have never tried to use a Lua script before. Where do I put the scripts once I've downloaded it. I put it in the Lua folder but when I type /lua run skills2 I get the message that it can't find Skills2 in the filesystem. What do I do to make it work?
Thank you for asking these important basic questions. Is there a resource here for beginners that guides us through downloading, installing and running luas?
 
Last edited:
I'm sorry @Zebadiah I feel this feedback you give is more to show you how the basic wortk with MQNext and Lua.
I fully agree that a Lua script should be very easy to use and I really like all feedback I get. I strive to implement as much as I can. :)

Anyway if you need help in understanding skills2 feel free to PM me on Discord and I'll gladly help you.
The Questions that Zebadiah ask here are exactly what I'm looking for. Where can I find these answers? I'd like to try Skills2 but have never tried to use a Lua script before. Where do I put the scripts once I've downloaded it? I put it in the Lua folder but when I type /lua run skills2 I get the message that it can't find Skills2 in the filesystem. What do I do to make it work?
Is there a resource here for beginners that guides us through downloading, installing and running luas?
 
The Questions you ask here are exactly what I'm looking for. Where can I find these answers? I'd like to try Skills2 but have never tried to use a Lua script before. Where do I put the scripts once I've downloaded it. I put it in the Lua folder but when I type /lua run skills2 I get the message that it can't find Skills2 in the filesystem. What do I do to make it work?
Thank you for asking these important basic questions. Is there a resource here for beginners that guides us through downloading, installing and running luas?

your best bet for keeping all the "extra" things that are on Redguides, but not part of the very vanilla compile, is to "watch" the first page on a resource's page.. so on the overview section of this resource, there is the watch button on right side.. select that.. then once you refresh your Redguides launcher, the resource will show up in the list .. so under luas, skills2 will show up, and you just let it install it for you

Easier than you trying to figure where to put stuff.. in some cases, there are some files in the root Lua, then some additional files in subfolders.. so if you miss one, or wrong folder, it wont work.. this method eliminates all that..

Hope that helps?
 
your best bet for keeping all the "extra" things that are on Redguides, but not part of the very vanilla compile, is to "watch" the first page on a resource's page.. so on the overview section of this resource, there is the watch button on right side.. select that.. then once you refresh your Redguides launcher, the resource will show up in the list .. so under luas, skills2 will show up, and you just let it install it for you

Easier than you trying to figure where to put stuff.. in some cases, there are some files in the root Lua, then some additional files in subfolders.. so if you miss one, or wrong folder, it wont work.. this method eliminates all that..

Hope that helps?
Thank you so much! That worked perfectly. Is there a resource file or instruction manual that I can access to learn things like this? There is so much that I don't know I don't know! Where can I go to learn other things like this that have been staring me in the face and I never knew it.
I'm very grateful.
 
hey blasty I added in Intimidation for myself just figured I'd letcha know it was missing
not entirely sure of all the npcs it works on but I know blacksmith Gerta in PoK and the GH training dummies for sure
 
Last edited:
Is there a GUI for this Lua? I tried to stop the Lua with the command /stops and all it does is say "Stopping after this round..." stays like that for ever.

Super great Lua thanks
 
I had a couple of issues trying to get this to work for me, mostly sorted out when I worked out that the skills2.ini file that's created is put in the mq2/config folder, not the Lua folder with the skills2.Lua! I would love if this were in the instructions somewhere!
The second issue I had is that it doesn't seem to allow for a set of primary and secondary specializations for each class. I'd love to see it with something like

[Enchanter] Abjuration=Minor Shielding Alteration=Strengthen Conjuration=Mesmerize Divination=True North Evocation=Chaotic Feedback PrimarySpecialization=Alteration SecondarySpecialization=Conjuration

This way you could use it for multiple classes at the same time, and have a sensible set of defaults - maybe even with selection boxes in the Lua script window. It would iterate through PrimarySpecialization first, then SecondarySpecialization, then the remaining skills, (possibly with a check on character level and class first to see if it was relevant yet)

Some further information on 2022 changes to specializations is at https://www.redguides.com/community/threads/specialization-guide-strat-2022.82181/

A reasonably sensible default would be
Cleric: Alt/Abj
Druid: Alt/Conj
Enchanter: Alt/Conj
Magician: Conj/Evoc
Necro: Alt/Conj
Shaman: Alt/Conj
Wizard: Evoc/Abj
with a note on these defaults in the description, and a pointer to where/how to change them, and a note that there's a quest in Temple of Solusek Ro to change specializations if you get it wrong or change your mind.
 
I've had a go at implementing the primary/secondary specialisation, and here's what I've come up with. I'm not sure how foolproof it is, but it worked on the limited testing I was able to do.

I've left in all my debug comments (which I used print() for, not debug() )

primary and secondary specialisations:
--[[
Skills2 0.4.2 - Original Author: Blasty
Maintained for RedGuides by Blasty 2022-07-08
Purpose: The Lua script will help you level up almost all your skills (Active, Passive and spell)
Feature: Will auto increase most of your skills, meditate when needed and stop when finished
]]
local mq = require('mq')

local SPA = false
local SAA = false
local SBEG = false
local SS = false
local SSAFE = false

-- UseMerc: If you want to use a Merc set to "true" (recommended)
local UseMerc = false

local castingskills = {'Abjuration','Alteration','Conjuration','Divination','Evocation'}
local memspells = function (skills) end

mq.delay(1000)
mq.cmd('/mqclear')
mq.cmd.echo('Running Lua Skills2 0.4.2 by Blasty')
mq.cmd.echo('If you like the script make sure to give some RedCent to the author: Blasty')

local PrePACheck = function ()
    if mq.TLO.Me.Skill('sneak')() and not mq.TLO.Me.AbilityReady('sneak')() then mq.cmd('/doability "sneak"') end
    if mq.TLO.Me.Skill('hide')() and not mq.TLO.Me.AbilityReady('hide')() then mq.cmd('/doability "hide"') end
end

local PassiveAbility = function ()
    if not mq.TLO.Me.Standing() then mq.cmd('/stand') end
    if mq.TLO.Me.Skill('forage')() and mq.TLO.Me.AbilityReady('forage')() and mq.TLO.Me.Skill('forage')() < mq.TLO.Skill('forage').SkillCap() then mq.cmd('/doability "forage"') end
    if mq.TLO.Me.Skill('mend')() and mq.TLO.Me.AbilityReady('mend')() and mq.TLO.Me.Skill('mend')() < mq.TLO.Skill('mend').SkillCap() then mq.cmd('/doability "mend"') end
    if mq.TLO.Me.Skill('sneak')() and mq.TLO.Me.AbilityReady('sneak')() and mq.TLO.Me.Skill('sneak')() < mq.TLO.Skill('sneak').SkillCap() then
        mq.cmd('/doability "sneak"')
        mq.delay(1000)
        mq.cmd('/doability "sneak"')
    end
    if mq.TLO.Me.Skill('hide')() and mq.TLO.Me.AbilityReady('hide')() and mq.TLO.Me.Skill('hide')() < mq.TLO.Skill('hide').SkillCap() then
        mq.cmd('/doability "hide"')
        mq.delay(1000)
        mq.cmd('/doability "hide"')
    end
    if mq.TLO.Me.Skill('feign death')() and mq.TLO.Me.AbilityReady('feign death')() and mq.TLO.Me.Skill('feign death')() < mq.TLO.Skill('feign death').SkillCap() then
        mq.cmd('/doability "feign death"')
        mq.delay(500)
        mq.cmd('/stand')
    end
    if mq.TLO.Me.Skill('tracking')() and mq.TLO.Me.AbilityReady('tracking')() and mq.TLO.Me.Skill('tracking')() < mq.TLO.Skill('tracking').SkillCap() then
        mq.cmd('/doability "tracking"')
        mq.delay(500)
        if mq.TLO.Window('TrackingWnd').Child('TRW_DoneButton')() then mq.cmd('/notify TrackingWnd TRW_DoneButton leftmouseup') end
    end
    while mq.TLO.Cursor.ID() do
        --mq.cmd('/destroy')
        mq.cmd('/autoinv')
        mq.delay(100)
    end
    if mq.TLO.Me.Skill('tracking')() >= mq.TLO.Skill('tracking').SkillCap() and mq.TLO.Me.Skill('feign death')() >= mq.TLO.Skill('feign death').SkillCap() and mq.TLO.Me.Skill('hide')() >= mq.TLO.Skill('hide').SkillCap() and mq.TLO.Me.Skill('sneak')() >= mq.TLO.Skill('sneak').SkillCap() and mq.TLO.Me.Skill('mend')() >= mq.TLO.Skill('mend').SkillCap() and mq.TLO.Me.Skill('forage')() >= mq.TLO.Skill('forage').SkillCap() then
        mq.cmd.echo('All passive skills are maxed!')
        SPA = false
    end
end

local CheckMerc = function ()
    if mq.TLO.Me.Mercenary() ~= 'ACTIVE' then
        mq.cmd('/multiline ; /beep ; /beep ; /beep ;')
        mq.cmd.echo('\ar You do not have a Merc up! \ax Unsuspend your Merc and try again ')
        SAA = false
        return false
    end

    if mq.TLO.Target.Type() ~= 'Mercenary' and mq.TLO.Group.Members() then
        for i=1,mq.TLO.Group.Members() do
            if (mq.TLO.Group.Member(i).Mercenary()) then
                local MercID = mq.TLO.Group.Member(i).ID()
                mq.cmd('/target id '..MercID)
                mq.cmd('/nav target')
                mq.delay(1000)
            end
        end
    end
    mq.cmd('/face')
    return true
end

local ActiveAbility = function ()
    if UseMerc then
        if not CheckMerc() then do return end end
    end
    if mq.TLO.Target.ID() and mq.TLO.Target.Distance() >= 12 then mq.cmd('/nav target') end
    if mq.TLO.Me.Skill('kick')() and mq.TLO.Me.AbilityReady('kick')() and mq.TLO.Me.Skill('kick')() < mq.TLO.Skill('kick').SkillCap() then mq.cmd('/doability "kick"') end
    if mq.TLO.Me.Skill('flying kick')() and mq.TLO.Me.AbilityReady('flying kick')() and mq.TLO.Me.Skill('flying kick')() < mq.TLO.Skill('flying kick').SkillCap() then mq.cmd('/doability "flying kick"') end
    if mq.TLO.Me.Skill('frenzy')() and mq.TLO.Me.AbilityReady('frenzy')() and mq.TLO.Me.Skill('frenzy')() < mq.TLO.Skill('frenzy').SkillCap() then mq.cmd('/doability "frenzy"') end
    if mq.TLO.Me.Skill('slam')() and mq.TLO.Me.AbilityReady('slam')() and mq.TLO.Me.Skill('bash')() < mq.TLO.Skill('bash').SkillCap() then mq.cmd('/doability "slam"') end
    if mq.TLO.Me.Skill('round kick')() and mq.TLO.Me.AbilityReady('round kick')() and mq.TLO.Me.Skill('round kick')() < mq.TLO.Skill('round kick').SkillCap() then mq.cmd('/doability "round kick"') end
    if mq.TLO.Me.Skill('tiger claw')() and mq.TLO.Me.AbilityReady('tiger claw')() and mq.TLO.Me.Skill('tiger claw')() < mq.TLO.Skill('tiger claw').SkillCap() then mq.cmd('/doability "tiger claw"') end
    if mq.TLO.Me.Skill('Taunt')() and mq.TLO.Me.AbilityReady('Taunt')() and mq.TLO.Me.Skill('Taunt')() < mq.TLO.Skill('Taunt').SkillCap() then mq.cmd('/doability "Taunt"') end
    if mq.TLO.Me.Skill('Disarm')() and mq.TLO.Me.AbilityReady('Disarm')() and mq.TLO.Me.Skill('Disarm')() < mq.TLO.Skill('Disarm').SkillCap() then mq.cmd('/doability "Disarm"') end
    if mq.TLO.Me.Skill('Backstab')() and mq.TLO.Me.AbilityReady('Backstab')() and mq.TLO.Me.Skill('Backstab')() < mq.TLO.Skill('Backstab').SkillCap() then mq.cmd('/doability "Backstab"') end
    if mq.TLO.Me.Skill('bash')() and mq.TLO.Me.AbilityReady('bash')() and mq.TLO.Me.Skill('bash')() < mq.TLO.Skill('bash').SkillCap() and mq.TLO.InvSlot('offhand').Item.Type.Find('shield') then mq.cmd('/doability "bash"') end
    if mq.TLO.Me.Skill('bash')() >= mq.TLO.Skill('bash').SkillCap() and mq.TLO.Me.Skill('Backstab')() >= mq.TLO.Skill('Backstab').SkillCap() and mq.TLO.Me.Skill('Disarm')() >= mq.TLO.Skill('Disarm').SkillCap() and mq.TLO.Me.Skill('Taunt')() >= mq.TLO.Skill('Taunt').SkillCap() and mq.TLO.Me.Skill('tiger claw')() >= mq.TLO.Skill('tiger claw').SkillCap() and mq.TLO.Me.Skill('round kick')() >= mq.TLO.Skill('round kick').SkillCap() and mq.TLO.Me.Skill('frenzy')() >= mq.TLO.Skill('frenzy').SkillCap() and mq.TLO.Me.Skill('flying kick')() >= mq.TLO.Skill('flying kick').SkillCap() and mq.TLO.Me.Skill('kick')() >= mq.TLO.Skill('kick').SkillCap() then
        mq.cmd.echo('All active skills are maxed!')
        SAA = false
    end
end

local Begging = function ()
    if mq.TLO.Me.Skill('Begging')() >= mq.TLO.Skill('Begging').SkillCap() then
        if mq.TLO.Zone.ID() == 383 then
            mq.cmd.echo('Begging is maxed out! returning to POK')
            mq.cmd('/travelto "The Plane of Knowledge"')
        else
            mq.cmd.echo('Begging is maxed out!')
        end
        SBEG = false
        do return end
    end
    if mq.TLO.Zone.ID() and mq.TLO.Zone.ID() ~= 383 then
        mq.cmd('/travelto "Freeportwest"')
    end
    while mq.TLO.Navigation.Active() or mq.TLO.Me.Zoning() do
        mq.delay(3000)
    end
    
    if mq.TLO.Zone.ID() == 383 then
        mq.cmd('/target Diggs')
        if mq.TLO.Target.Distance() >= 12 then
            mq.cmd('/nav locxy 132 -120')
            while mq.TLO.Navigation.Active() do
                mq.delay(1000)
            end
            mq.cmd('/nav target')
            while mq.TLO.Navigation.Active() do
                mq.delay(1000)
            end       
        end   
        if mq.TLO.Me.Skill('Begging')() and mq.TLO.Me.AbilityReady('Begging')() and mq.TLO.Me.Skill('Begging')() < mq.TLO.Skill('Begging').SkillCap() then mq.cmd('/doability "Begging"') end
    end   
end

local CursorCheck = function()
    while mq.TLO.Cursor.ID() do
        --mq.cmd('/destroy')
        mq.cmd('/autoinv')
        mq.delay(100)
    end
end

local InitIniFile = function ()
    if not mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),'Abjuration')() or not mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),'Alteration')() or not mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),'Conjuration')() or not mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),'Divination')() or not mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),'Evocation')() then
        mq.cmd.echo('Creating Ini file...')
        if mq.TLO.Me.Class() == 'Beastlord' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Endure Cold"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Salve"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Summon Drink"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "Sense Animals"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Blast of Frost"')
        end
        if mq.TLO.Me.Class() == 'Cleric' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Endure Poison"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Minor Healing"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Halo of Light"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Strike"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Alteration"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Abjuration"')
        end
        if mq.TLO.Me.Class() == 'Druid' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Skin like Wood"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Minor Healing"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Summon Food"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "Camouflage"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Burst of Fire"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Alteration"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Conjuration"')
        end
        if mq.TLO.Me.Class() == 'Enchanter' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Minor Shielding"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Strengthen"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Mesmerize"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Chaotic Feedback"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Alteration"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Conjuration"')
        end
        if mq.TLO.Me.Class() == 'Necromancer' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Minor Shielding"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Lifetap"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Coldlight"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Word of Shadow"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Alteration"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Conjuration"')
        end
        if mq.TLO.Me.Class() == 'Magician' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Minor Shielding"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Renew Elements"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Summon Brass Choker"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Burst of Flame"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Evocation"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Conjuration"')
        end
        if mq.TLO.Me.Class() == 'Paladin' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Courage"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Salve"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Hammer of Wrath"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Cease"')
        end
        if mq.TLO.Me.Class() == 'Ranger' then
            mq.cmd.echo('Starting')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Endure Fire"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Salve"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Dance of the Fireflies"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "Glimpse"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Ignite"')
        end
        if mq.TLO.Me.Class() == 'Shadow Knight' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Endure Cold"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Siphon Strength"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Disease Cloud"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "Sense the Dead"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Ward Undead"')
        end
        if mq.TLO.Me.Class() == 'Shaman' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Endure Cold"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Minor Healing"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Summon Drink"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Burst of Flame"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Alteration"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Conjuration"')
        end
        if mq.TLO.Me.Class() == 'Wizard' then
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Abjuration" "Minor Shielding"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Alteration" "Root"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Conjuration" "Halo of Light"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Divination" "True North"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "Evocation" "Blast of Cold"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "PrimarySpecialisation" "Evocation"')
            mq.cmd('/ini "Skills2.ini" "'.. mq.TLO.Me.Class() .. '" "SecondarySpecialisation" "Abjuration"')
        end
        mq.cmd('/ini "Skills2.ini" "Focus Specialize skill" "Specialize"')
        mq.cmd('/ini "Skills2.ini" "Focus Specialize skill" "Note" "Define:Abjuration,Alteration,Conjuration,Divination, Evocation (only one skill) or leave it empty to skip focus"')       
        mq.cmd.echo('Ini file created')
    end   
end

memspells = function (skills)
    local ValidatesOk = true
    local wait = function (i)
        while not mq.TLO.Me.SpellReady(i)() do
            mq.delay(100)
        end
    end
    for i=1, #skills do
        if mq.TLO.Me.Gem(i)() ~= mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),skills[i])() then       
            if mq.TLO.Me.Book(mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),skills[i])())() then   
                mq.cmd('/memspell '..i..' "'..mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),skills[i])())
                wait(i)
            else
                print('\arMissing spell: '..mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),skills[i])())
                mq.cmd('/beep')
                ValidatesOk = false
            end
        end
    end
    if not ValidatesOk then mq.cmd('/lua stop Skills2') end
    if not mq.TLO.Me.Standing() then mq.cmd('/stand') end
end

local CastSpells = function (skills)
    local run = false
    local CastSkill

    
    if mq.TLO.Me.PctMana() < 10 then
        mq.cmd.echo('Low on mana - medding to 100%')
        mq.cmd('/sit')
        while mq.TLO.Me.PctMana() < 99 do
            mq.delay(10000)
        end
    end   
    
    if UseMerc then
        if not CheckMerc() then
            SS = false
            return false
        end
    end

    if mq.TLO.Target.ID()<=0 then
        print('\arWarning! A target is needed for some spells')
        mq.cmd('/beep')
    end

    for i=1, #skills do
        if skills[i] == 'Abjuration' then
            specName = 'Abjure'
        else specName = skills[i]
        end
        
--        print("School: ", skills[i], " ", mq.TLO.Me.Skill(skills[i])(), " / ", mq.TLO.Me.SkillCap(skills[i])(),
--          "   Specialization ", mq.TLO.Me.Skill('Specialize '..specName)(), " / ", mq.TLO.Me.SkillCap('Specialize '..specName)())
        
        if mq.TLO.Me.Skill(skills[i])() < mq.TLO.Skill(skills[i]).SkillCap() or
--            mq.TLO.Me.SkillCap('Specialize '..specName)() <= 0) or
           mq.TLO.Me.Skill('Specialize '..specName)() < mq.TLO.Me.SkillCap('Specialize '..specName)() then
            mq.cmd('/cast "'.. mq.TLO.Ini('Skills2.ini',mq.TLO.Me.Class(),skills[i])() ..'"')
            while mq.TLO.Me.Casting() do
                mq.delay(100)
            end
            mq.delay(1500)
            CursorCheck()           
            run = true
        end
    end
    
    if not run then
        SS = false
        mq.cmd.echo('\ayAll spell abilities and specialize abilities are \a-gmaxed \ayout...')
    end
end

local TrainSpells = function()
    local SkillsToTrain
    
    InitIniFile()
    
    
    local primarySpec = mq.TLO.Ini('Skills2.ini', mq.TLO.Me.Class(), 'PrimarySpecialisation')()
    local secondSpec = mq.TLO.Ini("Skills2.ini", mq.TLO.Me.Class(), "SecondarySpecialisation")()
    
--    print("Character is a level ",mq.TLO.Me.Level(), " ", mq.TLO.Me.Class())
    
--    print("Primary spec in ini is ", mq.TLO.Ini('Skills2.ini', mq.TLO.Me.Class(), 'PrimarySpecialisation'))
--    print("Secondary spec in ini is ", mq.TLO.Ini("Skills2.ini", mq.TLO.Me.Class(), "SecondarySpecialisation"))
    
--    print("Char has points spent in Secondary Forte: ",mq.TLO.Me.AltAbility('Secondary Forte').PointsSpent())
    
    local primarySpecName
    
-- for skillcaps on specializations, we use mq.TLO.Me.SkillCap() rather than mq.TLO.Skill().SkillCap
-- because the cap in general at a level is different to the cap for a particular character at a level   
-- due to how EQ changes caps based on your specialization.

    if primarySpec ~= nil then
        primarySpecName = 'Specialize '..primarySpec
        if primarySpec == 'Abjuration' then primarySpecName = 'Abjure' end
        -- print("skillcap of primarySpec: ", primarySpecName, " : ", mq.TLO.Me.SkillCap(primarySpecName)())
        if mq.TLO.Me.SkillCap(primarySpecName)() == 0 then
            primarySpec = nil
            primarySpecName = nil
            -- print("char has no spec skill")
        end
    else
        primarySpec = nil
        primarySpecName = nil
    end
--    print("Effective Primary spec name is ", primarySpecName)
    
    local secondSpecName
    
    if secondSpec then
        secondSpecName= 'Specialize '..secondSpec
        if secondSpec == 'Abjuration' then secondSpecName = 'Specialize Abjure' end
--        print('secondspecname = ', secondSpecName, '; ', mq.TLO.Me.Skill(secondSpecName)(), "/", mq.TLO.Me.SkillCap(secondSpecName)())
        if mq.TLO.Me.SkillCap(secondSpecName)() <= 0 or
            mq.TLO.Me.AltAbility('Secondary Forte').PointsSpent() <=0 then
                secondSpec = nil
                secondSpecName = nil
        end
    end
    
--    print("Effective Secondary spec name is ", secondSpecName)
    
    if primarySpec ~= nil then
--        print('primaryspec not nil')
        if mq.TLO.Me.Skill(primarySpecName)() < mq.TLO.Me.SkillCap(primarySpecName)() - 40 then
--            print('primary spec needs training - skillstotrain is primary: ',primarySpec)
            SkillsToTrain = {primarySpec}
        elseif secondSpecName ~= nil then
--            print('secondspec not nill')
            if mq.TLO.Me.Skill(secondSpecName)() < mq.TLO.Me.SkillCap(secondSpecName)() - 40 then
--                print('Train primary and secondary skills - ', primarySpec, ' & ', secondarySpec)
                SkillsToTrain= {primarySpec, secondSpec}
            else
--                print("Let's train them all")
                SkillsToTrain = castingskills
            end
        end
    else
--        print("Let's train them all")
        SkillsToTrain = castingskills
    end
    
--    print('castingskills is length ',#castingskills)
--    print('SkillsToTrain is length ', #SkillsToTrain)
--    print('{PrimarySpec} is ',{primarySpec},' , length ', #{primarySpec})
--    for i = 1 , #SkillsToTrain do print("Training ", SkillsToTrain[i]) end
    memspells(SkillsToTrain)       
    CastSpells(SkillsToTrain)   
end

local safefall = function ()
    if not mq.TLO.Me.Skill('Safe fall')() then
        print('\ar You do not have Safefall as a skill- Ending safefall')
        SSAFE = false
        do return end
    end
    if mq.TLO.Me.Skill('Safe fall')() >= mq.TLO.Skill('Safe fall').SkillCap() then
        print('Safefall is maxed out!')
        SSAFE = false
        do return end
    end
    if mq.TLO.Zone.ID() ~= 202 then
        mq.cmd('/travel "POKnowledge"')
        while mq.TLO.Navigation.Active() or mq.TLO.Me.Zoning() do
            mq.delay(3000)
        end
    end
    if mq.TLO.Zone.ID() == 202 then
        mq.cmd('/nav locxyz 803 -376 -96')
        while mq.TLO.Navigation.Active() do
            mq.delay(100)
        end
        mq.cmd('/nomodkey /keypress forward hold')
        mq.delay(1200)
        mq.cmd('/nomodkey /keypress forward')
    end
end

mq.bind('/SSAFE', function()
    SSAFE = true
    mq.cmd.echo('\ayDoing Safefall. Please note that this will take you to POK.')
end)

mq.bind('/SPA', function()
    SPA = true
    mq.cmd.echo('\ayDoing passive skills...')
end)

mq.bind('/SAA', function()
    SAA = true
    mq.cmd.echo('\ayDoing active skills...')
    if not UseMerc then
        mq.cmd.echo('Note: Make sure to have a target to skill up on (Damage etc)')
    end
end)

mq.bind('/SBEG', function()
    SBEG = true
    mq.cmd.echo('\ayDoing begging. Please note that this will take you to West Freeport and return to POK once done!')
end)

mq.bind('/SS', function()
    SS = true
    mq.cmd.echo('\ayDoing skills for spells...')
    if not UseMerc then
        mq.cmd.echo('Note: Make sure to have a target to skill up on (Damage etc)')
    end
end)

mq.bind('/SDA', function()
    SPA = true
    SAA = true
    SS = true
    mq.cmd.echo('\ayDoing all skills (Begging excluded')
end)

mq.bind('/StopS', function()
    SPA = false
    SAA = false
    SS = false
    SSAFE = false
    mq.cmd.echo('\ayStopping after this round...')
end)

mq.cmd.echo('')
mq.cmd.echo('\a-gTo max out all passive skills like Forage, Mend...: \ay/SPA')
mq.cmd.echo('\a-gTo max out all active skills like Kick, Backstab...: \ay/SAA')
mq.cmd.echo('\a-gTo max out all spells abilities like Alteration, Conjuration...: \ay/SS')
mq.cmd.echo('\a-gTo max out begging: \ay/SBEG')
mq.cmd.echo('\a-gTo max out safefall: \ay/SSAFE')
mq.cmd.echo('\a-gTo max all skills: \ay/SDA \a-g (Begging and Safefall excluded)')
mq.cmd.echo('\a-gStopping everything.: \ay/StopS')
mq.cmd.echo('')

-- pre check for rouges
PrePACheck()

while true do   
    -- Waiting for inputs...
    if SPA then PassiveAbility() end
    if SAA then ActiveAbility() end
    if SS then TrainSpells() end
    if SBEG then Begging() end
    if SSAFE then safefall() end
    mq.delay(1000)
end
 
Lua - Skills2

Users who are viewing this thread

Back
Top