• 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

Macro - Multidimensional Array in MAC file?

Is it possible to make a multidimentional array in a macro ?? I don't know Lua.. and i need to be able to create a multidimental array.

Basicly.. I have a routine that pulls back 5 numbers.. and associates each number with a string value... once i run the values through a loop to get the lowest number.. i need to return the associated string value for that array item...

So.. like this:

array slot --- value --- String
1 ---- 142 ---- Head
2 ---- 221 ---- Feet
3 ---- 65 ---- Arms
4 ---- 76 ---- Chest
5 ---- 9 ---- Neck


Once i run through the loop to pull back the LOWEST number valuer for the list set of the array value ( 142/221/65/76/9 ) .. it returns back 9 ... correctly.. but i need set the STRING value associated with the array slot for value 9 ... ( NECK )

Is this doable??

I know how to setup a 2 dimentional array and pull back a value... but not 3....

Code:
    /declare x int local
    /declare myArray[5] int local

    /varset myArray[1] ${Guk_WinsToGo}
    /varset myArray[2] ${Miragul_WinsToGo}
    /varset myArray[3] ${Mistmoore_WinsToGo}
    /varset myArray[4] ${Ruj_WinsToGo}
    /varset myArray[5] ${Tak_WinsToGo}
    
    |set a default value for the greatestNumber, the first entry in the array works well
    /declare greatestNumber int local ${myArray[1]}
    |start at 2 since we already have the first value loaded, no reason to compare it to itself.
    /for x 2 to ${myArray.Size}
        |if myArray[x] is lower than the currently set lowest number
        /if (${myArray[${x}]} > ${greatestNumber}) {
            |set the lowest number to myArray[x]
            /varset greatestNumber ${myArray[${x}]}
        }
    /next x
 
Declare Three Dimensional Array in Macro Code
Code:
/declare myArray[10,10,10]

In Lua its a bit different:
Maybe a bit harder to get your head around - but i urge you to try. Use ChatGPT to clarify stuff - because it knows Lua quite well.

Lua 3 Dimensional Array
Code:
local array = {}

for i = 1, 10 do
  array[i] = {} -- Create the second dimension
  for j = 1, 10 do
    array[i][j] = {} -- Create the third dimension
    for k = 1, 10 do
      array[i][j][k] = whatever you like
    end
  end
end
 
Macro - Multidimensional Array in MAC file?

Users who are viewing this thread

Back
Top
Cart