• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Beginner scripting (MQ2Events or LUA?)

Chibz

Well-known member
Joined
Nov 22, 2018
RedCents
953¢
I want to start writing my own scripts for events/raids. I have some basic experience with MQ2Events, so am comfortable with starting there. However, I don't want to invest my time on MQ2Events to possibly find out I should have gone straight to Lua.

I have no previous experience in Lua (or any coding languages).

For example, I can't find a "tank swap" script (using the "search" function). I would like to start there and experiment with writing a script (again probably in MQ2Events first) for a tank swap based on in game chat text/emotes.

So, for the new scripter, should I start in MQ2Events and expand into Lua?

Thanks!
 
I have not seen much use of mq2events post ToV era tbh. Lua is the way to go these days imo

You can also check out lem and use the library associated with that.

lots of good guidelines on here if you search up learning Lua
 
Last edited:
LEM (Lua Event Manager) as mentioned by Psy is an effective replacement for the MQ2Events plugin.

Not having knowledge of the programming language is only a temporary barrier. You can check out the documentation here. https://www.lua.org/docs.html

Barring using the documentation there are also a ton of examples available in the form of existing Lua or LEM library, as mentioned by Psy, or actual fully fleshed out scripts.

Lua can be used both as an event based system and along side existing automation, or you can use Lua to create your own. Not being familiar with programming languages at all can be a bit of a barrier. But as long as you're willing to learn the basics and then see how it is used in conjunction with macroquest then I can't foresee you having too many issues learning it. When I learned how to write macros before Lua was an option understanding the basics was basically a ticket into making my own scripts. Once you understand one language, it's usually just a matter of different syntax/bracketing that is different.
 
I want to start writing my own scripts for events/raids. I have some basic experience with MQ2Events, so am comfortable with starting there. However, I don't want to invest my time on MQ2Events to possibly find out I should have gone straight to LUA.

I have no previous experience in LUA (or any coding languages).

For example, I can't find a "tank swap" script (using the "search" function). I would like to start there and experiment with writing a script (again probably in MQ2Events first) for a tank swap based on in game chat text/emotes.

So, for the new scripter, should I start in MQ2Events and expand into LUA?

Thanks!
I'm in the same boat. Let me know what route you take to learn Lua scripting. I may follow suit :)
 
You want to go Lua. Using a framework like MQ2Events or even LEM is going to constrain you and you may end up having to do funky things as a work around.

Take the time to learn the language and write some simple things like:
- Write a simple event that detects when you hail an NPC and have the script say a phrase ( request mission, raid, etc. )
- Given a text string from chat -> nav to a location.
- Have it nav to a location, wait 15s, and return
 
I would say go Lua since you can use mq.events tlo and do all of the same things as a macro and more using the same TLO's

Syntax is a different but that is every programming\scripting language. basic principals are the same

feel free to use other scripts as references. you can learn a lot that way also.
 
Personally I would go with using the (Mighty) Lua Event Manager as they are fairly easy to work with and they also have a library of LEMs >> here <<. I too am working on writing events/conditions for raids. I went with this as an option over MQ2react and MQ2Events due to that I can almost/partially understand the language, to me it kinda sorta reads to me like pascal, and once you get the hang of it its very versatile.
 
I want to start writing my own scripts for events/raids. I have some basic experience with MQ2Events, so am comfortable with starting there. However, I don't want to invest my time on MQ2Events to possibly find out I should have gone straight to LUA.

I have no previous experience in LUA (or any coding languages).

For example, I can't find a "tank swap" script (using the "search" function). I would like to start there and experiment with writing a script (again probably in MQ2Events first) for a tank swap based on in game chat text/emotes.

So, for the new scripter, should I start in MQ2Events and expand into LUA?

Thanks!
MQ2Events has so many constraints, best to just learn Lua so you don't get limited by silly things like not being able to declare variables.

As for the tank swap thing, you'd definitely need variables to do it properly!
Two tanks with {Main tank} variable.

Something like:
[CODE lang="Lua" title="Tank Swap Event"]local mq = require('mq')
local mainTank = false

local function toggleMT()
mainTank = not mainTank
end

local function setMT(setValue)
mainTank = setValue
end

local function event_TankSwap(line)
-- turn off MT on current aggro
if (mq.TLO.Me.TargetOfTarget()) then
setMT(false)
else
setMT(true)
end
end

mq.bind("/toggleMT", toggleMT)
mq.event("tankSwap", "TANKSWAP EMOTE HERE", event_TankSwap)

while true do
mq.doevents()
mq.delay(1000)
end[/CODE]

Of course, you'd need more logic, but since it's your own Lua you can make it whatever the heck you'd like.
 
When I started wanting to do the raid events with helper scripts, I started doing them as a Lua script, 1 per event. Fairly easy to do, and then I can have a ButtonMaster that started each one up based on what zone I am in. So it is almost automated for those events I have programmed in. Now not all of these are actually working, but I have the shell in place :)

Code:
-- lua
local ZoneName = mq.TLO.Zone.ShortName()
mq.cmd('/dgza /lua stop raid_shadow')
mq.cmd('/dgza /lua stop raid_bidil')
mq.cmd('/dgza /lua stop raid_fugue')
mq.cmd('/dgza /lua stop raid_artisan')
print(ZoneName)

if (ZoneName == 'timorousfalls_raid') then
    mq.cmd('/timed 5 /dgza /lua run  raid_shadow')
elseif (ZoneName == 'mischiefplane_raid') then
    mq.cmd('/timed 5 /dgza /lua run  raid_bidil')
elseif (ZoneName == 'palloman_raid') then
    mq.cmd('/timed 5 /dgza /lua run  raid_fugue')
elseif (ZoneName == 'unkemptwoods_raid') then
    mq.cmd('/timed 5 /dgza /lua run  raid_artisan')
elseif (ZoneName == 'harbingerscradle_raid') then
    mq.cmd('/timed 5 /dgza /lua run  raid_dockofthebay')
end
 
Question - Beginner scripting (MQ2Events or LUA?)

Users who are viewing this thread

Back
Top
Cart