How to select eggs as a Quest Item in an EC macro

The original thread got closed before I could respond.

Add the highlighted code fragment to the Source\Actions.lua file in your custom UI folder.

For those who do not want to type that:
        if (type == 40723 or type == 40724 or type == 40725 or type == 40727 or type == 40728) and 
            (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then 
            for i = 1, #Actions.itemQuantities[obj] do 
                local id  = Actions.itemQuantities[obj][i] 
                RegisterWindowData(WindowData.ObjectInfo.Type, id) 
                local item = WindowData.ObjectInfo[id] 
                if item then 
                    if item.hueId ~= 1258 then 
                        HandleSingleLeftClkTarget(id) 
                        return 
                    end 
                end 
            end         
        end 

Then create a macro with the following commands
Toggle Quest Item
WaitForTarg
TargetByType (select any egg)
Delay(.5)
Cancel Cursor Target

Then have it repeat 10 times.

This has saved me over 7000 mouse clicks.

Comments

  • ArchangelArchangel Posts: 461
    TimSt said:
    The original thread got closed before I could respond.

    Add the highlighted code fragment to the Source\Actions.lua file in your custom UI folder.

    For those who do not want to type that:
            if (type == 40723 or type == 40724 or type == 40725 or type == 40727 or type == 40728) and 
                (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then 
                for i = 1, #Actions.itemQuantities[obj] do 
                    local id  = Actions.itemQuantities[obj][i] 
                    RegisterWindowData(WindowData.ObjectInfo.Type, id) 
                    local item = WindowData.ObjectInfo[id] 
                    if item then 
                        if item.hueId ~= 1258 then 
                            HandleSingleLeftClkTarget(id) 
                            return 
                        end 
                    end 
                end         
            end 

    Then create a macro with the following commands
    Toggle Quest Item
    WaitForTarg
    TargetByType (select any egg)
    Delay(.5)
    Cancel Cursor Target

    Then have it repeat 10 times.

    This has saved me over 7000 mouse clicks.

    Thanks!
  • SethSeth Posts: 2,926
    edited May 2022
    Agreed. That question was valid and should not lock.  They should just prune that thread leave to those who know how to script EC to respond.

    I am also looking into the EC Lua to transfer items in organizer by type only. Quest only accept items in main pack, so there is a lot of transfers to do.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • TimStTimSt Posts: 1,874
    Seth said:
    Agreed. That question was valid and should not lock.  They should just prune that thread leave to those who know how to script EC to respond.

    I am also looking into the EC Lua to transfer items in organizer by type only. Quest only accept items in main pack, so there is a lot of transfers to do.
    I have also made the changes in order to use an organizer.  I need to clean up the code since I blindly updated 7 places.
  • GwenGwen Posts: 210
    Ended not very good for me. 
    I copied original file in the same directory. ( I use Pinco UI) 
    Altered file  by altering all function. 
    Save all . After logging first time my gaming screen  was really tiny. I relogin tried to make macro => it didnt work.     So I went to check files and both (altered and copy) are gone, deleted by game. 
    If you are doing something like this save your file soewhere else. 
    @TimSt ; can you share your file please. 
  • SethSeth Posts: 2,926
    edited May 2022
    TimSt said:
    Seth said:
    Agreed. That question was valid and should not lock.  They should just prune that thread leave to those who know how to script EC to respond.

    I am also looking into the EC Lua to transfer items in organizer by type only. Quest only accept items in main pack, so there is a lot of transfers to do.
    I have also made the changes in order to use an organizer.  I need to clean up the code since I blindly updated 7 places.

    I have posted an "ignore hue" organizer tweak in the @Arroth_Thaiel thread, please have a look.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • SethSeth Posts: 2,926
    Gwen said:
    Ended not very good for me. 
    I copied original file in the same directory. ( I use Pinco UI) 
    Altered file  by altering all function. 
    Save all . After logging first time my gaming screen  was really tiny. I relogin tried to make macro => it didnt work.     So I went to check files and both (altered and copy) are gone, deleted by game. 
    If you are doing something like this save your file soewhere else. 
    @ TimSt  can you share your file please. 

    Aw... Pinco is heavy... if that is the new EC then I will sit on the CC side...
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • TimStTimSt Posts: 1,874
    Gwen said:
    Ended not very good for me. 
    I copied original file in the same directory. ( I use Pinco UI) 
    Altered file  by altering all function. 
    Save all . After logging first time my gaming screen  was really tiny. I relogin tried to make macro => it didnt work.     So I went to check files and both (altered and copy) are gone, deleted by game. 
    If you are doing something like this save your file soewhere else. 
    @ TimSt  can you share your file please. 
    My changes will not work in Pinco's UI.  Pinco's uses totally different code to target by type.  I know what change to make but you will still run into the issue that Pinco's updater automatically overwrites any changes to its files.
  • poppspopps Posts: 4,035
    edited May 2022
    @TimSt

    Thanks !!

    It is unfortunate that it won't work with Pinco's UI....

    What I do not understand, is why, at least according to this Post https://forum.uo.com/discussion/comment/76787/#Comment_76787 from @PlayerSkillFTW , to my understanding, Pinco, when asked, indicated this addition was not available with his UI because of the many types/hues that eggs come with...

    But, in your OP post here, I seem to understand, these many hues/types do not cause a problem.... so, why would they then be a problem in Pinco's UI ?

    @Mariah , sometimes, you hurry up a bit too much to lock a Thread.... perhaps ?
  • YoshiYoshi Posts: 3,322
    “I said it could be done but apparently my response got overruled”
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • poppspopps Posts: 4,035
    TimSt said:
    Gwen said:
    Ended not very good for me. 
    I copied original file in the same directory. ( I use Pinco UI) 
    Altered file  by altering all function. 
    Save all . After logging first time my gaming screen  was really tiny. I relogin tried to make macro => it didnt work.     So I went to check files and both (altered and copy) are gone, deleted by game. 
    If you are doing something like this save your file soewhere else. 
    @ TimSt  can you share your file please. 
    My changes will not work in Pinco's UI.  Pinco's uses totally different code to target by type.  I know what change to make but you will still run into the issue that Pinco's updater automatically overwrites any changes to its files.
    @TimSt

    Question.

    If a player regularly uses Pinco and, yet, to avoid having to click Quest items for eggs a zillion times, would want to use the regular (non-Pinco) EC..... would making the changes that you suggest mess up their Pinco UI set up ?

    I am asking this, after reading @Gwen post....

    How can a player regularly using Pinco's UI can then temporarily switch to the non-Pinco UI just to make it possible to make this Macro to select 10 eggs as Quest items without messing up their Pinco's UI set up that they normally use for playing ?

    Thanks !
  • SethSeth Posts: 2,926
    edited May 2022
    popps said:
    TimSt said:
    Gwen said:
    Ended not very good for me. 
    I copied original file in the same directory. ( I use Pinco UI) 
    Altered file  by altering all function. 
    Save all . After logging first time my gaming screen  was really tiny. I relogin tried to make macro => it didnt work.     So I went to check files and both (altered and copy) are gone, deleted by game. 
    If you are doing something like this save your file soewhere else. 
    @ TimSt  can you share your file please. 
    My changes will not work in Pinco's UI.  Pinco's uses totally different code to target by type.  I know what change to make but you will still run into the issue that Pinco's updater automatically overwrites any changes to its files.
    @ TimSt

    Question.

    If a player regularly uses Pinco and, yet, to avoid having to click Quest items for eggs a zillion times, would want to use the regular (non-Pinco) EC..... would making the changes that you suggest mess up their Pinco UI set up ?

    I am asking this, after reading @ Gwen post....

    How can a player regularly using Pinco's UI can then temporarily switch to the non-Pinco UI just to make it possible to make this Macro to select 10 eggs as Quest items without messing up their Pinco's UI set up that they normally use for playing ?

    Thanks !
    Just pick your own custom UI at the login screen.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • TimStTimSt Posts: 1,874
    edited May 2022
    If Pinco reads this forum here is the code fragment to add to ContainerWindow.GetItemIDByType to make his UI work the same as my code above works.



    In case you are adventurous you can add that to the file C:\Program Files (x86)\Electronic Arts\Ultima Online Enhanced\UserInterface\Pinco's UI\Source\Containers\ContainerWindow\ContainerWindow.lua between lines 8668 and 8669.  But you will need to skip the autoupdater by directly using "EC PlaySound.exe"

    For those who do not want to type that
            elseif objectType == 40723 or objectType == 40724 or objectType == 40725 or objectType == 40727 or objectType == 40728 then
                local eggTypes = {40723, 40724, 40725, 40727, 40728}
                ContainerWindow.UpdateBackpackItems() --need up-to-date data
                for junk, eType in pairs(eggTypes) do
                    -- scan all the hue of this object type available
                    if Interface.BackPackItems[eType] then
                        for hueID, itemIds in pairs(Interface.BackPackItems[eType]) do
                            if hueID ~= 1258  then
                        -- scan all the item id of this object type & hue
                                for id, amount in pairs(itemIds) do
                                    foundId = id
                                end
                                if math.isValidID(foundId) then
                                    return foundId
                                end
                            end
                        end
                    end
                end
                return 0


  • SethSeth Posts: 2,926
    @TimSt

    Do we need to revert this line after this event for other quest to work?
    if (type == 40723 or type == 40724 or type == 40725 or type == 40727 or type == 40728) and 
                (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then
    Original line is
    if obj == type then
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • GwenGwen Posts: 210
    TimSt said:
    If Pinco reads this forum here is the code fragment to add to ContainerWindow.GetItemIDByType to make his UI work the same as my code above works.



    In case you are adventurous you can add that to the file C:\Program Files (x86)\Electronic Arts\Ultima Online Enhanced\UserInterface\Pinco's UI\Source\Containers\ContainerWindow\ContainerWindow.lua between lines 8668 and 8669.  But you will need to skip the autoupdater by directly using "EC PlaySound.exe"

    For those who do not want to type that
            elseif objectType == 40723 or objectType == 40724 or objectType == 40725 or objectType == 40727 or objectType == 40728 then
                local eggTypes = {40723, 40724, 40725, 40727, 40728}
                ContainerWindow.UpdateBackpackItems() --need up-to-date data
                for junk, eType in pairs(eggTypes) do
                    -- scan all the hue of this object type available
                    if Interface.BackPackItems[eType] then
                        for hueID, itemIds in pairs(Interface.BackPackItems[eType]) do
                            if hueID ~= 1258  then
                        -- scan all the item id of this object type & hue
                                for id, amount in pairs(itemIds) do
                                    foundId = id
                                end
                                if math.isValidID(foundId) then
                                    return foundId
                                end
                            end
                        end
                    end
                end
                return 0


    This works for me. 
    I cannot understand what do you mean by <<directly using "EC PlaySound.exe">> 
    I tried it. Under Administrator, it replaces my  altered file. Doesnt matter I start usual launcher or ECPlaysound.  So I just launch UO (with Pinco) and after it all started alter file . I have altered saved in other location, so I just replace it. 
  • TimStTimSt Posts: 1,874
    Seth said:
    @ TimSt

    Do we need to revert this line after this event for other quest to work?
    if (type == 40723 or type == 40724 or type == 40725 or type == 40727 or type == 40728) and 
                (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then
    Original line is
    if obj == type then
    You insert my code just above the original line
    if obj == type then
    and leave the original line in.  That will allow the other quests and macros to continue to work while the event is going on.
  • ArchangelArchangel Posts: 461
    I just saw that Pinco has updated and added the function  :)
  • poppspopps Posts: 4,035
    edited May 2022
    Archangel said:
    I just saw that Pinco has updated and added the function  :)
    @Archangel ;

    You mean, it is now possible to make a Macro that self-plays 10 times to mark as Quest items 10 eggs ?

    Question.

    Does it only work if there is precisely 10 eggs in one's own main backpack (that is, if there is 11+ it goes wild not knowing what egg to mark) or does it work regardless of how many eggs one might have in one's own backpack?

    Care to share how you created your Macro in EC with Pinco ?
    Thanks.
  • ArchangelArchangel Posts: 461
    popps said:
    Archangel said:
    I just saw that Pinco has updated and added the function  :)
    @ Archangel 

    You mean, it is now possible to make a Macro that self-plays 10 times to mark as Quest items 10 eggs ?

    Question.

    Does it only work if there is precisely 10 eggs in one's own main backpack (that is, if there is 11+ it goes wild not knowing what egg to mark) or does it work regardless of how many eggs one might have in one's own backpack?

    Care to share how you created your Macro in EC with Pinco ?
    Thanks.
    Yes, I just read about it on Pincos Discord and tried it.. I'm not great at doing macros but it worked (almost perfectly). 

    there's a new action called "target by item name". Drag it to a new macro, then right click it and chose the options "ignore hue" and "ignore quest item". Add the Toggle quest item set to repeat 10 times and it worked nicely (but only toggled 9 eggs, so my macro isn't the best example) 

    Oh, don't forget to have the quest active.. Nothing will happen if you have not accepted the quest


  • SethSeth Posts: 2,926
    TimSt said:
    Seth said:
    @ TimSt

    Do we need to revert this line after this event for other quest to work?
    if (type == 40723 or type == 40724 or type == 40725 or type == 40727 or type == 40728) and 
                (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then
    Original line is
    if obj == type then
    You insert my code just above the original line
    if obj == type then
    and leave the original line in.  That will allow the other quests and macros to continue to work while the event is going on.
    Ah ok noted. It.needs another "end".

    I wonder if the following would be enough:
    if (obj == 40723 or obj == 40724 or obj == 40725 or obj == 40727 or obj == 40728) then

    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • SethSeth Posts: 2,926
    edited June 2022
    I feel this is better and faster:

    Toggle Quest Item
    Waitfortarg (wait for cursor under Cursor Targeting)
    TargetByType (select any egg)
    Cursor Target Current
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • TimStTimSt Posts: 1,874
    The following new macro speeds things up if you are using the normal EC with my code change:
    Toggle Quest Item
    WaitForTarg
    TargetByType, Delay 0.5, TargetByType, Delay 0.5, TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5
    Cancel Target Current

    By getting rid of the macro looping things sped up a lot.
  • SethSeth Posts: 2,926
    edited June 2022
    That makes sense, since the first step allow multiple select.

    I always thought that after the target by type, for cursor targeting should use "cursor current target". It interesting the above also works for cursor targeting.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • TimStTimSt Posts: 1,874
    I want to further automate the quest by having the macro accept the quest, continue the quest, accept the reward.  I tried the following commands respectively but nothing happens.
    script GumpsParsing.PressButton(800,1)
    script GumpsParsing.PressButton(810,1)
    script GumpsParsing.PressButton(803,1)

    I am thinking maybe the button IDs maybe the issue.  I've tried 1, 2, 3, 4, 5, 6, 7, 8 without luck.

    Any idea of what I am doing wrong? 
  • YoshiYoshi Posts: 3,322
    "I just line up the health bar of the npc and line up the accept buttons, the EC saves the location of the quest gump and you can just click through each time"
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • PawainPawain Posts: 10,203
    Yoshi said:
    "I just line up the health bar of the npc and line up the accept buttons, the EC saves the location of the quest gump and you can just click through each time"
    This works in CC also for that turn in session.  You can click pretty fast with them lined up.
    Focus on what you can do, not what you can't.
  • YoshiYoshi Posts: 3,322
    edited June 2022
    "Has anyone reported any side effects to making Tim's modifications to the UI?
    I am having a couple of issues with seemingly unrelated UIs - properties not displaying on vendor search results, tilt not working on map
    could be caused by other modifications i have made.."
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • SethSeth Posts: 2,926
    edited June 2022
    So far so good, these codes are pretty harmless. Even if I want it to affect other areas it won't because the codes are not on the same file. There are probably 100s of isolated UI Lua files
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • SethSeth Posts: 2,926
    TimSt said:
    The following new macro speeds things up if you are using the normal EC with my code change:
    Toggle Quest Item
    WaitForTarg
    TargetByType, Delay 0.5, TargetByType, Delay 0.5, TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5,TargetByType, Delay 0.5
    Cancel Target Current

    By getting rid of the macro looping things sped up a lot.
    I tried this method and it seems to retarget the earlier eggs sometimes. The first method to toggle quest item and then repeat does work better. 
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • SethSeth Posts: 2,926
    TimSt said:
    I want to further automate the quest by having the macro accept the quest, continue the quest, accept the reward.  I tried the following commands respectively but nothing happens.
    script GumpsParsing.PressButton(800,1)
    script GumpsParsing.PressButton(810,1)
    script GumpsParsing.PressButton(803,1)

    I am thinking maybe the button IDs maybe the issue.  I've tried 1, 2, 3, 4, 5, 6, 7, 8 without luck.

    Any idea of what I am doing wrong? 
    I just created another button to target the quest and manually click the one button to accept or submit quest items. I will do the above automation only if we need to repeat like 10 or 20 times, e.g. planting.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
Sign In or Register to comment.