• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Question - Need help with a basic auto-combine/auto-inventory macro

foromoro

Well-known member
I used to use a macro to hit the combine and auto-inventory buttons on the tradeskill window. These days it still works, but there are two problems I have with it. First, when it gets to the "Auto-inventory" part it will spam that button about 10 times instantly. I know this because we get to problem number 2, which is when it is out of inventory space and the "There are no open spaces" message pops up about 10 times in rapid succession, the macro does not end although an event is to trigger it ending upon my inventory being full.

Any input/advice where this macro is going wrong? Specifically, how to slow it down and how to get it to actually register the "no open slots" message?

Code:
#event CombineError "#*#no open slots#*#"
#event CombineError "#*#You cannot combine these items in this container type!#*#"
#event CombineError "#*#did not accept these items#*#"
#event CombineError "#*#You are missing#*#"



|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub DoCombine
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub Main

   /declare EndingVar
   /varset EndingVar 1



        /call ClearCursor
    :Loop
   /nomodkey /notify TradeskillWnd CombineButton leftmouseup
        /delay 1${Cursor.ID}
        /call ClearCursor
         /doevents
      /if (${EndingVar}==1) /goto :Loop
      /varset EndingVar 1

    /return

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Clear Cursor
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub ClearCursor
/declare x int local
:auto_inv
/if (${Cursor.ID}) {
  /if (${Cursor.Container}) {
    /for x 1 to 8
    /if (!${InvSlot[pack${x}].Item.Container}) /nomodkey /itemnotify pack${x} leftmouseup
    /next x
  } else {
    /autoinventory
  }
  /goto :auto_inv
}
/return

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Combine error
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_CombineError
    /end
/return
 
I dont know if this matters at all but on another character using another macro, the macro is not registering the "You are missing some required components" event that is defined. Did something change in VV or EQ recently to where system messages like that are not read for #Event purposes?

I remember it working a week or so ago?
 
Code:
        /delay 1${Cursor.ID}
should be
Code:
        /delay 1 ${Cursor.ID}
actually works better to account for eq/network lag
Code:
        /delay 2
        /delay 10 ${Cursor.ID}

Also not sure what you want to accomplish by that clearcursor loop. if you have a container on your cursor it will check slots 1-8 then exchange it for an item if possible, now what happens if there is nothing to swap it with e.g 1-8 is conatiners and cursor has a container = endless loop

Then your message you are checking is wrong, should be (I think, haven't tested a full inventory myself on combining)
Code:
#event CombineError  "#*#Your inventory appears full!#*#"
If the message is really "There are no open spaces" then will not ever work
Code:
#event CombineError "#*#no open slots#*#"
should be
Code:
#event CombineError "#*#There are no open spaces#*#"



Lastly I do not know if you can have multiple event's going to the came function

Could do this in your main/inventory loop
Code:
/if (${Me.FreeInventory}==0) {
   /endm
}
 
Last edited:
You can have multiple events call the same function but they are read from bottom to top so have to prioritize them in the correct order.

Fish.mac in macros directory is an example of one that has two events call the same function.
 
Code:
        /delay 1${Cursor.ID}
should be
Code:
        /delay 1 ${Cursor.ID}
actually works better to account for eq/network lag
Code:
        /delay 2
        /delay 10 ${Cursor.ID}

Also not sure what you want to accomplish by that clearcursor loop. if you have a container on your cursor it will check slots 1-8 then exchange it for an item if possible, now what happens if there is nothing to swap it with e.g 1-8 is conatiners and cursor has a container = endless loop

Then your message you are checking is wrong, should be (I think, haven't tested a full inventory myself on combining)
Code:
#event CombineError  "#*#Your inventory appears full!#*#"
If the message is really "There are no open spaces" then will not ever work
Code:
#event CombineError "#*#no open slots#*#"
should be
Code:
#event CombineError "#*#There are no open spaces#*#"



Lastly I do not know if you can have multiple event's going to the came function

Could do this in your main/inventory loop
Code:
/if (${Me.FreeInventory}==0) {
   /endm
}
Thank you for the input and helping me clean up the code! I think you were right.. I had slots and the message isnt that.
 
Also not sure what you want to accomplish by that clearcursor loop. if you have a container on your cursor it will check slots 1-8 then exchange it for an item if possible, now what happens if there is nothing to swap it with e.g 1-8 is conatiners and cursor has a container = endless loop

This is such an old code that I think I used it back when bags could not fit in bags. Going to change it up to where it just auto-inventories whatever is on its cursor until nothing left.
 
Code:
#event CombineError "#*#You cannot combine these items in this container type!#*#"
#event CombineError "#*#There are no open slots for the held item in your inventory.#*#"
#event CombineError "#*#You are missing#*#"
#event CombineSkill "#*#You can no longer advance#*#"

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub DoCombine
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub Main
    /declare doCombine bool outer TRUE
    /declare doSkill bool outer TRUE
    /declare debug int outer 0

    /while (${doCombine}) {
   
        /doevents      
        /if (${Me.FreeInventory}==0) {
            /beep
            /endm
        }
        /if (!${doSkill}) {  
            /if (!${Defined[Param0]}) {
                /bc Skill stop .... ${Me.Name}
                /beep
                /endm
            }
        }
        /delay 2s
        /if (${Cursor.ID}) {
            /delay 3s ${Cursor.ID}
            /autoinv
            /continue
        }
        /nomodkey /notify TradeskillWnd CombineButton leftmouseup
    }
/return

Sub Event_CombineSkill
    /varset doSkill FALSE
/return

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Combine error
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_CombineError
    /bc Combine stop .... ${Me.Name}
    /beep
    /endm
/return

Just for fun I reworked the code a bit, haven't tested the inventory full but did pull the message from a logfile.

To level up and check that you dont waste material on trivial combines
/mac scriptname

To make it regardless of trivial
/mac scriptname all
 
Question - Need help with a basic auto-combine/auto-inventory macro

Users who are viewing this thread

Back
Top
Cart