daemitus / SomethingNeedDoing

85 stars 58 forks source link

Levequest Hand-In Macro #135

Open jmpnul opened 1 year ago

jmpnul commented 1 year ago

Not sure where the best spot to put this, but thought it was worth sharing. Delete if this is inappropriate.

handins = 99
levequest = "Mindful Study"
quest_npc = "Grigge"
handin_npc = "Ahldiyrn"

for i = 1,handins,1 do

    if (GetNodeText("_ToDoList", {8, 11}) == levequest) then
        yield('/echo Levequest already active, skipping')
    else

        -- Quest Accept
        yield('/target ' .. quest_npc)
        yield('/send NUMPAD0')
        while (not IsAddonVisible("Talk")) do yield('/wait 0.1') end
        yield('/click talk')
        yield('/click talk')
        while (not IsAddonVisible("SelectString")) do yield('/wait 0.1') end
        yield('/click select_string2')
        while (not IsAddonVisible("JournalDetail")) do yield('/wait 0.1') end
        yield('/click guild_leve_alchemist')

        -- Unstick JournalDetail (bug with guild_leve_alchemist clicking)
        yield('/click guild_leve_alchemist')
        yield('/send NUMPAD0 <wait.0.1>')
        yield('/send NUMPAD2 <wait.0.1>')
        yield('/send NUMPAD0 <wait.0.1>')

        while (not IsAddonReady("JournalDetail")) do yield('/wait 0.1') end
        text = GetNodeText("JournalDetail", {19})

        if (text == levequest) then
            yield("/echo Correct levequest found!")
            yield("/click journal_detail_accept <wait.0.5>")
            yield("/send ESCAPE")
            while (not IsAddonVisible("SelectString")) do yield('/wait 0.1') end
            yield("/send ESCAPE <wait.0.5>")
        else
            yield('/send NUMPAD8 <wait.0.1>')
            yield('/send NUMPAD0 <wait.0.1>')

            while (not IsAddonVisible("JournalDetail")) do yield('/wait 0.1') end
            text = GetNodeText("JournalDetail", {19})

            if (text == levequest) then
                yield("/echo Correct levequest found!")
                yield("/click journal_detail_accept <wait.0.5>")
                yield("/send ESCAPE")
                while (not IsAddonVisible("SelectString")) do yield('/wait 0.1') end
                yield("/send ESCAPE <wait.0.5>")
            else
                yield("/echo Levequest not found!")
            end
        end
    end

    -- Quest Hand In

    yield('/target ' .. handin_npc)
    yield('/send NUMPAD0')
    while (not IsAddonVisible("Talk")) do yield('/wait 0.1') end
    yield('/click talk')
    yield('/click talk')
    yield('/wait 0.5')
    yield('/click request_hand_over')
    while (not IsAddonReady("SelectYesno")) do yield('/wait 0.1') end
    yield('/click select_yes')
    while (not IsAddonVisible("Talk")) do yield('/wait 0.1') end
    yield('/click talk')
    yield('/click talk')
    while (not IsAddonVisible("Talk")) do yield('/wait 0.1') end
    yield('/click talk')
    yield('/click talk')
    while (not IsAddonReady("JournalResult")) do yield('/wait 0.1') end
    yield('/click journal_result_complete <wait.1>')

    yield('/echo Complete ' .. tostring(i) .. '/' .. tostring(handins))
end

This macro requires the auto-handin plugin, but should be editable to not require it. Would love some additions to the clicklib to script clicking any button (maybe by searching NodeText). Bit of a bug with the click guildleve command which has a workaround.

ghost commented 11 months ago

Not sure if your script works or not, but just wanted to tell you that the levequest for tsai tou vounou is better option. You can gather all the required items for it. With the leve you are using, you need berkanan sap and you either need to buy it with gil, fate gems or wait long times for retainer to bring the sap to you.

jmpnul commented 11 months ago

Thanks Yukkun, apparently I'm too lazy to actually check which is most efficient, but not too lazy to make the script. I've done more testing, and it's definitely fragile, but it does work. All it requires is the "Auto Turn-in" tweak from pandora's toolbox, though I'm sure you could easily edit the code to not require it.

Edit: Did some research, from material costs on my Data-Centre, to Gil reward and the extra lightning crystals you get, Mindful Study is by far the best option in my opinion. Also requires fewer materials, as well as not being dependent on any timed nodes (Tsai Vounou requires Lemonette which is a timed node). Every venture returns 15x berkanan sap, so with my 2 battle retainers, i get 30x per hour. It's never been an issue farming it that way for me, especially using Auto-Retainer to plan out my ventures.

yoojTV commented 9 months ago

This is interesting! Do you have the repo for the auto hand-in plugin? I was trying this out, but it seems to not actually put the item in when Ahldiryn asks for it. Is there anything I am doing wrong? I tried it both for Alchemist leves and Culinarian leves, so maybe I need that plugin to be able to actually use this script for turning in leves (and to save me from carpal tunnel ahaha)

ghost commented 9 months ago

This is interesting! Do you have the repo for the auto hand-in plugin? I was trying this out, but it seems to not actually put the item in when Ahldiryn asks for it. Is there anything I am doing wrong? I tried it both for Alchemist leves and Culinarian leves, so maybe I need that plugin to be able to actually use this script for turning in leves (and to save me from carpal tunnel ahaha)

I'm not sure which auto hand-in jmpnul uses but I use TextAdvance, YesAlready and also some settings from Pandora's Box.