• 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 --->
MQ VS Code Lua Autocomplete Definition Library

Lua - MQ VS Code Lua Autocomplete Definition Library (1 Viewer) 1.1

so a few things missing:

mq.TLO.Me.NumBagSlots() - undefined field

goto continue --undefined global 'continue'

::continue:: --Lua 5.1 does not support this grammar(supported in 5.2, 5.3, 5.4)

So should I change the Lua version in settings?

Lua does not have a goto (thank goodness..)
I've updated the definitions to fix the missing NumBagSlots member
 
Lua does not have a goto (thank goodness..)
I've updated the definitions to fix the missing NumBagSlots member

Looks like 5.2 added some sort of goto .....


I changed the settings.json to 5.2 and the goto errors went away

Personally, MQ is the only language where I still use goto (I may have used it in C some 20 years ago).

I am really looking forward to making some clean code in Lua :)
 
Well, you're absolutely correct! I didn't know that. Don't use it. Just don't do it. It can make for some redonkulous spaghetti code.
 
Am I right with my assumtion, that once installed, it will update itself without the need of any intervention?
I clicked within VS-Code "install another version" and got stated, that the actual version 3.6.4 is present.
 
RedMan updated MQ VS Code Lua Autocomplete Definition Library with a new update entry:

20230203

〰️Commits​


- Add and fix some datatypes (#32)

* Inherit spawn

* Minor fixes and code syntax changes

* Group member fixes

* Minor cleanup

* Alias cleanup

* Some fixes to TLO datatype fetching

* Fix TLO functions

* Fix to reagent func

* Fix math calc

* Some fixes to character data type

* Fix to fellowship

* Fix missing alias

* Fix doortarget type

* Small fix to itemlink

* Add new fields to...

Read the rest of this update entry...
 
I am confused. I believe partial cause of confusion is that the forum download link is to a github, just one of two that is needed. I didn't discover the second githun for imgui until snooping through all the posts in the discussion, which then helped make the sense of what the settings.json was looking for.
 
Hello ColdBlooded. Thanks for the autocomplete and ability to error check. I never used VSC before, nor am I a dev/coder... so your work helps me do and learn!
I wanted to share an undefined field I found, in case you are hunting for such things:

mq.TLO.DynamicZone.Leader.Flagged
Undefined field `Flagged`.

And also this error, which I am not skilled enough to articulate, but this code appears to work fine.

while mq.TLO.Task('When One Door Closes').ID() == nil do
Cannot assign `string` to parameter `integer?`.
- `string` cannot match `integer?`
- Type `string` cannot match `nil`
- Type `string` cannot match `integer`

Thanks for your hard work! Have a great day!
 
I have my structure like so, using windows, you might get the idea of how to set up the settings.json
C:\MQNext\Lua\mq-definitions
C:\MQNext\Lua\mq-imgui-definitions

My settings.json for vscode ended up C:\Users\MyComp\AppData\Roaming\Code\User\settings.json
INI:
{
    "Lua.runtime.version": "Lua 5.1",
    "Lua.workspace.library": [
        "C:\\MQNext\\lua\\mq-definitions",
        "C:\\MQNext\\lua\\mq-imgui-definitions"
    ]
}
Awesome job on this. Much Appreciated.
 
Last edited:
I am not sure what I am doing wrong, can anyone help? I have Lua LS extension installed, I have settings.json set, and yet I cannot get it to auto generate mq options as seen in screen shot.

1698434515395.png

1698434553731.png
 
Updated the github repo in the documentation (thanks for pointing this out Brain)

MetalJack,
Try installing these under the Lua directory (a subdirectory) as described in the documentation here https://github.com/macroquest/mq-definitions

Unless you need the definitions in a separate location, e.g you're writing scripts for different versions EQ Live and EQ Emu, it is highly recommended that you put the definitions under your Lua directory (i.e. a subdirectory called mq-definitions under the Lua directory). This installation will require no additional configurations and you'll be up and running right away.


See if that works first. It doesn't have to be that way, but it's the most straightforward way to start with.
 
Updated the github repo in the documentation (thanks for pointing this out Brain)

MetalJack,
Try installing these under the Lua directory (a subdirectory) as described in the documentation here https://github.com/macroquest/mq-definitions

Unless you need the definitions in a separate location, e.g you're writing scripts for different versions EQ Live and EQ Emu, it is highly recommended that you put the definitions under your Lua directory (i.e. a subdirectory called mq-definitions under the Lua directory). This installation will require no additional configurations and you'll be up and running right away.

See if that works first. It doesn't have to be that way, but it's the most straightforward way to start with.
Thanks cold, wanted to make you aware that I did the following("RedGuides Users can simply 'Watch'...") for both live and emu install and neither showed up with a directory called "mq-defintions" in the Lua directory automatically. It also doesn't show up in the Red guides launcher Lua tab for me to press install.
So i downloaded the zip and manually added it to the Lua directory and still no luck.
1699375479361.png
1699375424240.png
1699375383572.png
 
Yep I do.

Is maybe copilot that is interfering?
No. Copilot is fine side by side.
Also I can tell you have the Language server running because without it, the Mq in ---@type Mq would not be underlined. This tells me that it does not know where to find the definition for the Mq type.
My point is you do not need any changes to your settings.json file if you put the definitions in a subdirectory of the Lua directory. So downloading it manually is fine. Try removing the Lua.workspace.library entry. And restart VSCode.
 
So I removed Lua.workspace.library and had no luck. I then made leverage .vscode/settings.json folder in workspace path and defined there with no luck.
---
I then removed `---@type Mq` from the code as VSC was saying that was a problem and bam it started working. Thank you all for your patience and help getting me to the finish line.

1699456364802.png
 
Coldblooded updated MQ VS Code Lua Autocomplete Definition Library with a new update entry:

v1.1.0

## [1.1.0](https://github.com/macroquest/mq-definitions/compare/v1.0.3...v1.1.0) (2023-11-19)


### Features

* add ImGuiSliderFlags ([017fd3e](https://github.com/macroquest/mq-definitions/commit/017fd3ebc9face68d8c6bbbfa6a4b82d442feda2))
* Add mq.CreateTexture ([b6a549d](https://github.com/macroquest/mq-definitions/commit/b6a549d6601e7ea40166bc750ec269073fcfd3af))

Read the rest of this update entry...
 
This is something you need to install yourself, check out the vscode extension that’s linked on the github page. It will take care of the installation for you
 
Lua - MQ VS Code Lua Autocomplete Definition Library

Users who are viewing this thread

Back
Top