### Install and Load Module with Custom Error Handling Source: https://docs.macroquest.org/lua/luarocks-modules Use PackageMan.InstallAndLoad for more granular control over package installation and loading failures. This example uses mq/Utils.Library.Include for graceful failure handling before attempting to install. ```lua local mq = require('mq') local PackageMan = require('mq/PackageMan') local Utils = require('mq/Utils') local sql = Utils.Library.Include('lsqlite3') if not sql then sql = PackageMan.InstallAndLoad('lsqlite3') end if not sql then print('Could not load or install lsqlite3') end ``` -------------------------------- ### Array Example: Populate and Retrieve Data Source: https://docs.macroquest.org/reference/data-types/datatype-array Demonstrates how to declare an integer array, populate it with random numbers, and then retrieve and echo the values. Array indexing starts at 1. ```MQScript sub main /declare myArray[9] int local 0 /declare myCounter int local /echo =============[Put Data]================= /for myCounter 1 to ${myArray.Size} /varset myArray[${myCounter}] ${Math.Rand[999]} /echo Put a random number in Index ${myCounter} of myArray /next myCounter /echo =============[Get Data]================= /for myCounter 1 to ${myArray.Size} /echo Index ${myCounter} in myArray is ${myArray[${myCounter}]} /next myCounter /return ``` -------------------------------- ### Install LuaRocks Module with Error Handling Source: https://docs.macroquest.org/lua/luarocks-modules Use `PackageMan.Install` for granular control over module installation. This example shows how to check for specific installation failure codes, like user cancellation. ```lua local mq = require('mq') local PackageMan = require('mq/PackageMan') local Utils = require('mq/Utils') local sql = Utils.Library.Include('lsqlite3') if not sql then if PackageMan.Install('lsqlite3') == 2 then print('User canceled the install, cannot proceed') mq.exit() else sql = require('lsqlite3') end end ``` -------------------------------- ### MQ2FPS Plugin Configuration Examples Source: https://docs.macroquest.org/plugins/discontinued/mq2fps A collection of example commands to control FPS display, mode, position, and rendering rates. ```bash /maxfps fg 25 /maxfps bg 25 /fps on /fps mode absolute /fps 10,25 /render fg 1 /render bg 75 ``` -------------------------------- ### Display Help and Examples Source: https://docs.macroquest.org/plugins/community-plugins/mq2targets Displays the help information and usage examples for MQ2Targets commands. ```text /watch help ``` -------------------------------- ### Task Indexing Examples Source: https://docs.macroquest.org/reference/data-types/datatype-task?q= Examples demonstrating how to access tasks by index and by name, and retrieve their properties. ```APIDOC ## Task Indexing Examples Access tasks by index or name to retrieve their properties. ``` /echo ${Task[2].Title} /echo ${Task[3].WindowIndex} /echo ${Task[Into The Muck].WindowIndex} /echo ${Task[hatch].Type} ``` Example: ``` /echo ${Task[hatch]} is listed as number ${Task[hatch].Index} in the tasklist. ``` Example: ``` /echo The ${Task[hatch]} first objective is to ${Task[hatch].Objective[1].Instruction} ``` Example: ``` /echo The ${Task[hatch]} first objective status is ${Task[hatch].Objective[1].Status} ``` Example: ``` /echo The ${Task[hatch]} first objective should be completed in ${Task[hatch].Objective[1].Zone} ``` Example: ``` /echo I should be working on ${Task[hatch].Step} in ${Task[hatch].Step.Zone} ``` ``` -------------------------------- ### MacroQuest /pet Attack Examples Source: https://docs.macroquest.org/reference/commands/pet?q= Examples demonstrating how to use the /pet command with the 'attack' and 'qattack' actions to target a specific spawn ID. ```text /pet attack 1234 /pet qattack 1234 ``` -------------------------------- ### Example Custom Plugin Configuration File Source: https://docs.macroquest.org/main/developing/cmake An example of a generated custom plugin configuration file, listing plugins and their paths. ```cmake # Auto-generated plugin configuration file # Generated by plugins.cmake # Platform: x64 # Toolset: v143 add_custom_vcxproj("plugins/MQ2Nav" "MQ2Nav" "external") add_subdirectory("C:/dev/MyCustomPlugin") ``` -------------------------------- ### MQ2Melee Plugin Header and Initialization Source: https://docs.macroquest.org/plugins This C++ code snippet shows the typical header and initial setup for an MQ2 plugin, including author information, version, and necessary includes. It's used as an example when compiling plugins. ```cpp //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // MQ2Melee.cpp | // Author: s0rCieR | // Version: 3.000 | // Date: 20060213 |yes it should be //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #define aabug when alt abilities broken! #define cabug when combat abilities broken! //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include PreSetup("MQ2Melee"); PLUGIN_VERSION(3.000); ``` -------------------------------- ### Example: /shiftkey with /itemnotify Source: https://docs.macroquest.org/reference/commands/shiftkey An example of using /shiftkey to execute the /itemnotify command with the 'pack1 leftmouseup' arguments. ```macroquest /shiftkey /itemnotify pack1 leftmouseup ``` -------------------------------- ### MacroQuest /pet Command Examples Source: https://docs.macroquest.org/reference/commands/pet Examples demonstrating how to use the /pet command to make your pet attack or queue an attack on a specific spawn ID. ```text /pet attack 1234 /pet qattack 1234 ``` -------------------------------- ### Example HUD String Configuration Source: https://docs.macroquest.org/plugins/community-plugins/mq2targets An example of how to configure the HUDString in the MQ2Targets.ini file for detailed spawn information. ```text HUDString=&clr${Target.CleanName}(${Target.Race}) ${Target.Level}${Target.Class.ShortName} ${Target.Distance}&arr(${Target.HeadingTo}) ``` -------------------------------- ### Basic Item Search Example Source: https://docs.macroquest.org/plugins/community-plugins/mq2linkdb A simple example of using the /link command to search for an item. The result will be sent as a tell. ```bash /link baby joseph sayer ``` -------------------------------- ### Login Character Examples Source: https://docs.macroquest.org/plugins/core-plugins/autologin/loginchar Provides practical examples of how to use the /loginchar command with different authentication methods and profiles. ```plaintext /loginchar vox:aradune ``` ```plaintext /loginchar drinal^user123^aradune^mypass123 ``` ```plaintext /loginchar MyProfile_vox:Vaelen ``` -------------------------------- ### EQBC INI Configuration Example Source: https://docs.macroquest.org/plugins/community-plugins/mq2eqbc Example MQ2EQBC.ini configuration file showing settings for connection, UI, and custom connections. ```ini [Settings] AllowControl=1 AutoConnect=1 AutoReconnect=1 ReconnectRetrySeconds=15 LocalEcho=0 SaveByCharacter=0 SilentCmd=1 TellWatch=1 GuildWatch=1 GroupWatch=1 FSWatch=1 UseWindow=1 Keybind=. [Window] ChatTop=600 ChatBottom=800 ChatLeft=700 ChatRight=1100 Fades=0 Alpha=255 FadeToAlpha=255 Duration=500 Locked=1 Delay=2000 BGType=1 BGTint.red=0 BGTint.green=0 BGTint.blue=0 FontSize=3 UseMyTitle=1 WindowTitle=Custom Title Goes Here With No Quotes [Last Connect] Server=10.0.0.1 Port=2112 [Custom1] Server=10.0.0.1 Port=2115 Password=custompass [Custom2] Server=soe.sony.com [Custom3] Server=eqbc.google.com Port=1337 ``` -------------------------------- ### AdvMelee Announce Example Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 Example of setting the channel for announcing melee actions. Use '/bc' for MQ/EQBC or '/g' for group chat. ```ini ACAnnounce=/bc ``` -------------------------------- ### Pet Casting Example Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 Example of how to set a spell to cast for creating or recalling a pet. This syntax is similar to MQ2Cast. ```ini _PetCast=Animate Dead|gem8|smii ``` -------------------------------- ### Example Custom Server Configurations Source: https://docs.macroquest.org/plugins/core-plugins/autologin?q= Examples of custom server configurations for popular MacroQuest-compatible emulator servers. These entries are added to the MQ2AutoLogin.ini file. ```ini ; Host=login.eqemulator.net [Servers] EZ (Linux) x4 Exp=[] EZ Server - Custom Zones, Vendors, Quests, Items, etc Imperium_EQ=[] Imperium Server - Solo Level/Duo+ Raid PEQTGC=[] PEQ] The Grand Creation | Dragons of Norrath Project Lazarus=[] Project Lazarus HiddenForest=[] The Hidden Forest [ www.thehiddenforest.org ] Haven=[] Wayfarers Haven [wayfarershaven.com] CWR=[] Clumsy's World [Velious, Semi-Custom, QoL+] DxBx=[] DreadBox:Re-Dredged BETA E9 Profusion=[] Enine's ProFusion EQTitan=[] EQT ) EQTitan [Legit PoP/LDoN/GoD] The Firiona Vie Project=[] FVP - The Firiona Vie Project (Kunark) IxiQuest=IxiQuest - (ixiquest.com) Classic to Velious + KMRA=Raid Atticts (Fully Custom) [Solo/Group/Raid] The Dark Exile=[] The Dark Exile Showdowrest=[[R] ] Shadowrest Alternate Everquest=[[R] ]Alternate EQ Might=[[R] ] EQ Might ``` ```ini ; Host=login.projecteq.net [Servers] Project Lazarus=Project Lazarus ``` -------------------------------- ### Initial Setup and Reconfiguration Source: https://docs.macroquest.org/main/developing/cmake?q= Run this command for the first-time setup to initialize submodules and generate the solution. It is also used to reconfigure the build after pulling upstream changes. ```powershell .\gen_solution.ps1 ``` ```powershell .\gen_solution.ps1 ``` -------------------------------- ### Get Item Price by Name Source: https://docs.macroquest.org/reference/data-types/datatype-pointmerchant Retrieve the price of a merchant item by its name. This example specifically gets the price for 'Ebon Hammer'. ```MacroQuest /echo ${PointMerchant.Item[Ebon Hammer].Price} ``` -------------------------------- ### Initial Setup and Reconfiguration with gen_solution.ps1 Source: https://docs.macroquest.org/main/developing/cmake Run gen_solution.ps1 for first-time setup to initialize submodules and generate the solution. Re-run it after pulling upstream changes to reconfigure. ```powershell # First-time setup (initializes submodules, generates solution) .\gen_solution.ps1 # Reconfigure after pulling upstream changes .\gen_solution.ps1 ``` -------------------------------- ### Get Item Price by Index Source: https://docs.macroquest.org/reference/data-types/datatype-pointmerchant Retrieve the price of a merchant item using its index. This example shows how to get the price for item at index 1. ```MacroQuest /echo ${PointMerchant.Item[1].Price} ``` -------------------------------- ### Set Engage HP Percentage Source: https://docs.macroquest.org/macros/gallery/autobot.mac?q= Sets the percentage of a mob's HPs at which the bot should start engaging in melee, debuffing, dotting, and nuking. For example, '/engagehps 95' starts engagement at 95% HP. ```MQ2 /engagehps 95 ``` -------------------------------- ### Install and Load Module with Different Load Name Source: https://docs.macroquest.org/lua/luarocks-modules Use the two-parameter overload of PackageMan.InstallAndLoad when the LuaRocks package name differs from its load name. This example installs 'luafilesystem' but loads it as 'lfs', with custom error handling. ```lua local mq = require('mq') local PackageMan = require('mq/PackageMan') local Utils = require('mq/Utils') local lfs = Utils.Library.Include('lfs') if not lfs then lfs = PackageMan.InstallAndLoad('luafilesystem', 'lfs') end if not lfs then print('Could not load or install luafilesystem/lfs') end ``` -------------------------------- ### Example YAML Configuration Source: https://docs.macroquest.org/lua/pickle?q= A sample YAML structure for configuration. Note the indentation-based syntax. ```yaml settings: - setting1: somevalue - setting2: - nestedSetting: anothervalue ``` -------------------------------- ### Get Total Spawn Count Source: https://docs.macroquest.org/reference/top-level-objects/tlo-spawncount?q= Displays the count of all spawns in the current zone. No special setup is required. ```MacroQuest MQScript /echo ${SpawnCount} ``` -------------------------------- ### Example TLO Usage: EQBC.ToonName Source: https://docs.macroquest.org/plugins/community-plugins/mq2eqbc/mq2eqbc-revisions Illustrates using the EQBC.ToonName TLO to get the character's name as seen by EQBC. ```lua /if (${EQBC.ToonName.Equal}) { // im bugged or have a ghost, so do my fix routine } ``` -------------------------------- ### Get Keyring Item Name by Index (Another Example) Source: https://docs.macroquest.org/reference/data-types/datatype-keyringitem Demonstrates retrieving the name of a different keyring item using its index. ```MacroQuest /echo ${Mount[2].Name} ``` -------------------------------- ### Executing a ModMove Path with Parameters Source: https://docs.macroquest.org/macros/gallery/related-include-files Executes the 'example2' path using the mbwayplay command with parameters to begin, zone, and chain to the next path. This demonstrates how to initiate a path and control its behavior. ```macro /mb mbwayplay example2 b t c ``` -------------------------------- ### Example of #bind with a Mana Tracking Subroutine Source: https://docs.macroquest.org/reference/macro-directives/macro-bind This example shows how to create a '/MyMana' command that displays the user's current mana. It includes a loop to continuously update mana and a subroutine to handle the bind. ```MacroQuest #bind MyMana /MyMana Sub Main /declare CurMan int outer 0 :loop /varset CurMan ${Me.CurrentMana} /doevents /delay 5 /goto :loop /return Sub Bind_MyMana /call MyMana /return Sub MyMana /echo My Mana is ${CurMan} /return ``` -------------------------------- ### Access Rightmost Characters of a String Source: https://docs.macroquest.org/reference/top-level-objects/tlo-string?q= Returns the rightmost characters of a string. This example shows how to get the last two characters of the string 'foo'. ```MacroQuest ${String[foo].Right[2]} ``` -------------------------------- ### Running a Macro with Arguments Source: https://docs.macroquest.org/macros/getting-started Demonstrates how to execute a macro with additional parameters. Ensure the macro's documentation specifies the required arguments. ```MQScript /macro macroname 1 2 3 ``` -------------------------------- ### Load a Specific Plugin Source: https://docs.macroquest.org/reference/commands/plugin This example demonstrates how to load the 'mq2melee' plugin. Loading a plugin may also add it to the MacroQuest.ini for future sessions. ```bash /plugin mq2melee load ``` -------------------------------- ### Get AutoLogin Plugin Identifier Source: https://docs.macroquest.org/plugins/core-plugins/autologin/tlo-autologin?q= Outputs the string "AutoLogin" when the plugin is loaded. This is a basic example to verify the plugin's presence and access its identifier. ```MacroQuest /echo ${AutoLogin} # Outputs "AutoLogin" ``` -------------------------------- ### Get Spell Duration by ID Source: https://docs.macroquest.org/reference/top-level-objects/tlo-spell Retrieves the duration of a spell in ticks using its numerical ID. This example demonstrates accessing spell properties directly via their ID. ```MacroQuest Script /echo ${Spell[1620].Duration} ``` -------------------------------- ### String Manipulation Examples Source: https://docs.macroquest.org/reference/data-types/datatype-string Demonstrates common string operations including finding substrings, extracting left/right portions, and getting mid-segments. These functions are useful for parsing and manipulating text data. ```MacroQuest /declare TestString abcdebc /echo ${TestString.Find[bc]} | Will return 2 /echo ${TestString.Left[2]} | Will return "ab" /echo ${TestString.Left[-2]} | Will return "abcde" /echo ${TestString.Mid[2,3]} | Will return "bcd" /echo ${TestString.Right[2]} | Will return "bc" /echo ${TestString.Right[-2]} | Will return "cdebc" ``` -------------------------------- ### MQ2Melee Example Command with Options Source: https://docs.macroquest.org/plugins/community-plugins/mq2melee Example of how to use the /melee command with various options enabled or disabled. True/1 can be used for 'on', and false/0 for 'off'. ```text /melee on aggro=on taunt=on kick=1 bash=0 intimidation=true disarm=true ``` -------------------------------- ### Set Leash Length Source: https://docs.macroquest.org/macros/gallery/autobot.mac?q= Sets the maximum distance the bot will allow itself to get from its follow target before resuming following. For example, '/leashlength 25' sets the leash length to 25 feet. ```MQ2 /leashlength 25 ``` -------------------------------- ### Initialize GemOpt.inc Source: https://docs.macroquest.org/macros/gallery/gemopt.inc Declare necessary variables and call the GemOpt include before your main macro loop. ```MQ2Macro /declare numGem int outer /declare OWgem int outer /call GemOpt ``` -------------------------------- ### Buy Item Script Example Source: https://docs.macroquest.org/macros/gallery/script-examples Example of using the 'Buy' procedure to purchase items. This snippet demonstrates buying 'water flask' for 75 yenny. ```MacroQuest [Script-BuyStuff] Commands=1 C1=/call Buy "water flask" 75 yenny ``` -------------------------------- ### Remote Command Execution via Tell Source: https://docs.macroquest.org/macros/gallery/rogue-helper-command-list?q= Demonstrates how a master can send a tell to a rogue to execute commands. The tell must start with '/' for RH to process it. Examples include multi-line commands and simple actions like camping. ```macroquest /tell pokey /multiline ; /target Mary ; /hug ; /kiss ``` ```macroquest /tell dokey /camp ``` -------------------------------- ### AdvDebuff Spell Configuration Source: https://docs.macroquest.org/macros/gallery/modbot Example configuration for a single debuff spell within Modbot's AdvDebuff section. This setup includes spell details, targeting parameters, and announcement formats. Note the ADTarBegHP1 setting to prioritize this slow spell on adds. ```ini ADGem1=2 ADSpell1=Turgur's Insects ADSpellFoci1= ADDurMod1=0 ADSpellAlias1=slow ADAnnounce1=/bc Slowed <<[+y+] %t [+x+]>> with[+g+] %s [+x+] ADSpellMinMana1=10 ADSpellRecast1=2 ADSpellCastonResist1=malos ADSpellDelay1=0 ADTarCnt1=1 ADTarType1=11 ADTarBegHP1=200 ADTarEndHP1=15 ADIfSpellImmune1= ADUseHoTT1=0 ADPreCondition1=TRUE ``` -------------------------------- ### MQ2MoveUtils Command Syntax Examples Source: https://docs.macroquest.org/plugins/community-plugins/mq2moveutils/mq2moveutils-v11-revisions Demonstrates the new syntax for managing MQ2MoveUtils settings, including 'set' for configuration and 'toggle' for state changes. Use these commands to adjust verbosity, stuck logic, and other plugin behaviors. ```mq2 //The same as before /command help /command debug /command pause /command unpause /command save /command load /command imsafe //Different: "set" - this is just a basic foundation /command set verbosity on|off /command set fullverbosity on|off /command set stucklogic on|off //Different: "toggle" - this is used to toggle values /command toggle mpause /command toggle mousepause /command toggle breakonkb /command toggle breakonmouse /command toggle autosave /command toggle feign /command toggle autopause /command toggle advancedautopause <---still doesnt work any better dont bother using really /command toggle stucklogic /command toggle verbosity /command toggle fullverbosity /command toggle nohott /command toggle hidehelp /command toggle breakongate /command toggle breakonwarp /command toggle alwaysdrunk /command toggle alwaysbackwards /command toggle alwaysccw /command toggle alwaysloose <---this only applies to moveto atm /command toggle breakonsummon ``` -------------------------------- ### Navigate to LuaRocks Install Directory Source: https://docs.macroquest.org/lua/luarocks-modules Change the current directory to your LuaRocks installation path before running installation commands. ```bash C:\Users\dannu\Downloads\luarocks-3.6.0-win32>cd C:\Users\dannu\Downloads\luarocks_install C:\Users\dannu\Downloads\luarocks_install> ``` -------------------------------- ### AdvCure Gem Example Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 Example of specifying the source of a cure spell in the AdvCure section. This example indicates casting from gem 3. ```ini Gem=3 ``` -------------------------------- ### Basic Path Definition and Execution Source: https://docs.macroquest.org/macros/gallery/related-include-files Defines a path named 'example2' with specific waypoints and parameters for movement, zoning, and chaining to another path. This is a fundamental example of how to set up and execute a path. ```macro [example1] WPCount=5 WP1=-912.25 2725.55 WP2=-818.70 2627.16 sell magus WP3=-735.19 2674.32 door WP4=-805.75 2687.67 pull WP5=-912.25 2725.55 [example2] WPCount=5 WP1=-912.25 2725.55 WP2=-818.70 2627.16 door WP3=-735.19 2674.32 WP4=-805.75 2687.67 door WP5=-912.25 2725.55 example3 b t c [example3] WPCount=5 WP1=-912.25 2725.55 example2 e WP2=-818.70 2627.16 WP3=-735.19 2674.32 door WP4=-805.75 2687.67 WP5=-912.25 2725.55 example4 e [example4] WPCount=5 WP1=-912.25 2725.55 WP2=-818.70 2627.16 door WP3=-735.19 2674.32 sell magus WP4=-805.75 2687.67 WP5=-912.25 2725.55 example3 e t c ``` -------------------------------- ### Task Usage Example Source: https://docs.macroquest.org/reference/top-level-objects/tlo-task?q= Example of how to access task information. ```APIDOC ## Usage ``` /echo ${Task[1].Title} ``` Will return the name of the first task, or the current shared task if one exists. ``` -------------------------------- ### vcpkg.txt Manifest Example Source: https://docs.macroquest.org/main/developing/vcpkg Define required packages for your project in a vcpkg_mq.txt file. Packages are listed one per line. Features can be specified in brackets. ```text yaml-cpp sleepy-discord[websocketpp] ``` -------------------------------- ### Example Usage of /bccmd set and /bccmd toggle Source: https://docs.macroquest.org/plugins/community-plugins/mq2eqbc/mq2eqbc-revisions Illustrates the new syntax for managing plugin settings using '/bccmd set on/off' or '/bccmd toggle '. ```bash /bccmd toggle tellwatch /bccmd set tellwatch on /bccmd set tellwatch off /bccmd set reconnectsecs # ``` -------------------------------- ### Start mqoverlay Source: https://docs.macroquest.org/reference/commands/mqoverlay?q= Use the 'start' parameter to turn on the overlay. ```text /mqoverlay start ``` -------------------------------- ### LuaRocks Installation Output Source: https://docs.macroquest.org/lua/luarocks-modules?q= The output shows the LuaRocks installer detecting the LuaJIT environment, performing system checks, and configuring the installation paths for LuaRocks, Lua interpreter, compiler, and rocktrees. ```text C:\Users\dannu\Downloads\luarocks-3.6.0-win32>rem=rem --[[--lua LuaRocks 3.6.x installer. ======================== == Checking system... == ======================== Attempting to install without admin privileges... Looking for Lua interpreter Found luajit.exe, testing it... checking for C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\lib\lua5.1.lib checking for C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\lib\lua51.lib Found lua51.lib checking for C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\include\luajit\lua.h Found lua.h *** WARNING ***: could not analyse the runtime used, defaulting to MSVCR80 Runtime check completed. arch: 14c -> IMAGE_FILE_MACHINE_I386 Looking for Microsoft toolchain matching runtime MSVCR80 and architecture x86 checking: HKLM\Software\Microsoft\VisualStudio\8.0\Setup\VC checking: HKLM\Software\Microsoft\VCExpress\8.0\Setup\VS Cannot auto-detect Windows SDK version from MSVCR80 ========================== == System check results == ========================== Will configure LuaRocks with the following paths: LuaRocks : C:\Users\dannu\Downloads\luarocks_install Config file : C:\Users\dannu\Downloads\luarocks_install\config-5.1.lua Rocktree : C:\Users\dannu\Downloads\luarocks_install\systree Lua interpreter : C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\tools\luajit.exe binaries : C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\tools libraries : C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\lib includes : C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\include\luajit architecture: x86 binary link : lua51.lib with runtime MSVCR80.dll Compiler : Microsoft (make sure it is in your path before using LuaRocks) Press to start installing, or press + to abort. Use install /? for installation options. ============================ == Installing LuaRocks... == ============================ Installing LuaRocks in C:\Users\dannu\Downloads\luarocks_install... Created LuaRocks command: C:\Users\dannu\Downloads\luarocks_install\luarocks.bat Created LuaRocks command: C:\Users\dannu\Downloads\luarocks_install\luarocks-admin.bat Configuring LuaRocks... Created LuaRocks hardcoded settings file: C:\Users\dannu\Downloads\luarocks_install\lua\luarocks\core\hardcoded.lua Created LuaRocks config file: C:\Users\dannu\Downloads\luarocks_install\config-5.1.lua Creating rocktrees... Created system rocktree : "C:\Users\dannu\Downloads\luarocks_install\systree" Local user rocktree exists : "C:\Users\dannu\AppData\Roaming\LuaRocks" ============================ == LuaRocks is installed! == ============================ You may want to add the following elements to your paths; Lua interpreter; PATH : C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\tools PATHEXT : .LUA LuaRocks; PATH : C:\Users\dannu\Downloads\luarocks_install LUA_PATH : C:\Users\dannu\Downloads\luarocks_install\lua\?.lua;C:\Users\dannu\Downloads\luarocks_install\lua\?\init.lua Local user rocktree (Note: %APPDATA% is user dependent); PATH : %APPDATA%\LuaRocks\bin LUA_PATH : %APPDATA%\LuaRocks\share\lua\5.1\?.lua;%APPDATA%\LuaRocks\share\lua\5.1\?\init.lua LUA_CPATH: %APPDATA%\LuaRocks\lib\lua\5.1\?.dll System rocktree PATH : C:\Users\dannu\Downloads\luarocks_install\systree\bin LUA_PATH : C:\Users\dannu\Downloads\luarocks_install\systree\share\lua\5.1\?.lua;C:\Users\dannu\Downloads\luarocks_install\systree\share\lua\5.1\?\init.lua LUA_CPATH: C:\Users\dannu\Downloads\luarocks_install\systree\lib\lua\5.1\?.dll Note that the %APPDATA% element in the paths above is user specific and it MUST be replaced by its actual value. For the current user that value is: C:\Users\dannu\AppData\Roaming. C:\Users\dannu\Downloads\luarocks-3.6.0-win32> ``` -------------------------------- ### AdvMelee Command Example Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 Example of setting MQ2Melee commands to be used by the bot. ```ini ACMeleeCmd=/melee plugin=1 ``` -------------------------------- ### LuaRocks Installation Command Source: https://docs.macroquest.org/lua/luarocks-modules?q= This command installs LuaRocks using the provided MQ LuaJIT include, library, and binary paths. It's configured for a self-contained, local installation without admin privileges. ```bash C:\Users\dannu\Downloads\luarocks-3.6.0-win32>.\install.bat /P C:\Users\dannu\Downloads\luarocks_install /SELFCONTAINED /INC "C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\include\luajit" /LIB "C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\lib" /BIN "C:\Users\dannu\workspace\mqnext\contrib\vcpkg\installed\x86-windows-static\tools" /NOADMIN ``` -------------------------------- ### XTarInfo Plugin Configuration Example Source: https://docs.macroquest.org/plugins/core-plugins/xtarinfo?q= This is an example configuration file (MQ2XTarInfo.ini) for the XTarInfo plugin. It demonstrates how to set default options and customize UI elements for different characters or groups. ```INI [Default] UsePerCharSettings=0 ShowDistance=1 DistanceLabelToolTip=XTarget Distance [UI_default] UseExtLayoutBox=0 ExtDistanceLoc=0,-20,70,0 ; This label is used as a template for distance. LabelBaseXT=Player_ManaLabel [UI_Drakah] ; Custom settings built into plugin ExtDistanceLoc=0,-20,80,0 ; End Built-In Settings [UI_Freq_SteelDragon] ; Custom settings built into plugin ExtDistanceLoc=3,-10,70,28 LabelBaseXT=PW_ManaLabel ; End Built-In Settings [UI_Melee] ; Custom settings built into plugin ExtDistanceLoc=0,-20,90,0 ; End Built-In Settings [UI_RGInnerUI] ; Custom settings built into plugin UseExtLayoutBox=1 ; End Built-In Settings [UI_sars] ; Custom settings built into plugin UseExtLayoutBox=1 ExtDistanceLoc=0,12,30,-20 ; End Built-In Settings [UI_Simple_SticeGroup] ; Can use defaults [UI_Sparxx] ; Custom settings built into plugin ExtDistanceLoc=0,-10,80,0 ; End Built-In Settings [UI_zliz] ; Can use defaults ``` -------------------------------- ### MQ2Melee Plugin Header Example Source: https://docs.macroquest.org/plugins?q= This is an example of the initial lines of code for the MQ2Melee plugin, including header information and preprocessor directives. It demonstrates the expected structure for plugin source files. ```cpp //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // MQ2Melee.cpp | // Author: s0rCieR | // Version: 3.000 | // Date: 20060213 |yes it should be //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // #define aabug when alt abilities broken! // #define cabug when combat abilities broken! //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include PreSetup("MQ2Melee"); PLUGIN_VERSION(3.000); ``` -------------------------------- ### Load Bard HUD Example Source: https://docs.macroquest.org/plugins/core-plugins/hud_q= Demonstrates how to load a HUD configuration specifically for a Bard class from the MQ2HUD.ini file. ```bash /loadhud bard ``` -------------------------------- ### Sing Command Example Source: https://docs.macroquest.org/plugins/community-plugins/mq2twist Example of using the /sing command, which is equivalent to the /twist hold command. ```bash /sing 4 Same as above ``` -------------------------------- ### MQ /mqtarget Spawn Search Examples Source: https://docs.macroquest.org/reference/commands/mqtarget?q= Demonstrates various ways to use the /mqtarget command with spawn search parameters to target NPCs or PCs based on proximity, line of sight, and other criteria. ```text /mqtarget npc radius 100 zradius 50 alert 1 ``` ```text /mqtarget pc range 30 35 lfg ``` ```text /mqtarget npc los radius 220 ``` ```text /mqtarget ${Spawn[alert 1]} ``` ```text /mqtarget ${Spawn[noalert 1]} ``` -------------------------------- ### Basic Script Example: HelloWorld Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 A simple script that echoes 'Hello World' and resets a timer if it exceeds 5 seconds. This demonstrates basic command execution and conditional logic within a script. ```INI [Script-HelloWorld] Commands=2 C1=/echo Hello World C2=/if ({Timer}>50) /varset Timer 5s C3=/goto :Top ``` -------------------------------- ### MQ2Melee Plugin Command Example Source: https://docs.macroquest.org/plugins/community-plugins/mq2melee?q= This command enables the MQ2Melee plugin with specific settings for aggro, taunting, kicking, bashing, intimidation, and disarming. It demonstrates the use of 'on', 'off', and numerical values for configuration. ```text /melee on aggro=on taunt=on kick=1 bash=0 intimidation=false disarm=true ``` -------------------------------- ### XTarInfo Plugin Configuration Example Source: https://docs.macroquest.org/plugins/core-plugins/xtarinfo Example configuration file (MQ2XTarInfo.ini) for the XTarInfo plugin. This file demonstrates how to set default options and customize UI elements for different character profiles. ```ini [Default] UsePerCharSettings=0 ShowDistance=1 DistanceLabelToolTip=XTarget Distance [UI_default] UseExtLayoutBox=0 ExtDistanceLoc=0,-20,70,0 ; This label is used as a template for distance. LabelBaseXT=Player_ManaLabel [UI_Drakah] ; Custom settings built into plugin ExtDistanceLoc=0,-20,80,0 ; End Built-In Settings [UI_Freq_SteelDragon] ; Custom settings built into plugin ExtDistanceLoc=3,-10,70,28 LabelBaseXT=PW_ManaLabel ; End Built-In Settings [UI_Melee] ; Custom settings built into plugin ExtDistanceLoc=0,-20,90,0 ; End Built-In Settings [UI_RGInnerUI] ; Custom settings built into plugin UseExtLayoutBox=1 ; End Built-In Settings [UI_sars] ; Custom settings built into plugin UseExtLayoutBox=1 ExtDistanceLoc=0,12,30,-20 ; End Built-In Settings [UI_Simple_SticeGroup] ; Can use defaults [UI_Sparxx] ; Custom settings built into plugin ExtDistanceLoc=0,-10,80,0 ; End Built-In Settings [UI_zliz] ; Can use defaults ``` -------------------------------- ### AdvCure Target Type - Group Example Source: https://docs.macroquest.org/macros/gallery/modbot?q= Example of setting target type to 'grp' for group spells. ```ini _grp_ for Group spells (e.g. ABTarType1=self grp) ``` -------------------------------- ### MQ2NetCure Configuration Example Source: https://docs.macroquest.org/macros/gallery/modbot Example INI settings for the MQ2NetCure plugin, specifically for watching cure status. ```ini [MQ2NetCure] Watch=1 ``` -------------------------------- ### Cleric Pet Hammer Example Source: https://docs.macroquest.org/macros/gallery/modbot-4.0 Example for cleric pet hammer, ensuring the pet is cast only when not in combat. ```ini ACBefore=/if (!{Me.Pet.ID}) /casting ''{PetCast}'' ``` -------------------------------- ### Basic /delay Examples Source: https://docs.macroquest.org/reference/commands/delay Demonstrates simple delay durations in deciseconds, seconds, and minutes. ```MacroQuest /delay 7 Delays the macro for 7 tenths of a second /delay 2s Delays the macro for 2 seconds /delay 3m Delays the macro for 3 minutes ``` -------------------------------- ### Example Custom Server Entries for Emulators Source: https://docs.macroquest.org/plugins/core-plugins/autologin Examples of how to add popular MacroQuest-compatible emulator servers to your MQ2AutoLogin.ini file. The format includes a short name and a description. ```ini ; Host=login.eqemulator.net [Servers] EZ (Linux) x4 Exp=[] EZ Server - Custom Zones, Vendors, Quests, Items, etc Imperium_EQ=[] Imperium Server - Solo Level/Duo+ Raid PEQTGC=[] PEQ] The Grand Creation | Dragons of Norrath Project Lazarus=[] Project Lazarus HiddenForest=[] The Hidden Forest [ www.thehiddenforest.org ] Haven=[] Wayfarers Haven [wayfarershaven.com] CWR=[] Clumsy's World [Velious, Semi-Custom, QoL+] DxBx=[] DreadBox:Re-Dredged BETA E9 Profusion=[] Enine's ProFusion EQTitan=[] EQT ) EQTitan [Legit PoP/LDoN/GoD] The Firiona Vie Project=[] FVP - The Firiona Vie Project (Kunark) IxiQuest=IxiQuest - (ixiquest.com) Classic to Velious + KMRA=Raid Atticts (Fully Custom) [Solo/Group/Raid] The Dark Exile=[] The Dark Exile Showdowrest=[[R] ] Shadowrest Alternate Everquest=[[R] ]Alternate EQ Might=[[R] ] EQ Might ``` -------------------------------- ### Example: Multiple Verbosity Flags Combination Source: https://docs.macroquest.org/plugins/community-plugins/mq2moveutils?q= Shows a more complex example of combining multiple verbosity flags to enable a wide range of messages. This example enables 'autopause', 'movepause', 'stick verbosity', 'stick fullverbosity', 'settings', and 'errors'. ```text To display 'autopause' (1), 'movepause' (2), 'stick verbosity' (32), 'stick fullverbosity' (64), 'settings' (8192), and 'errors' (4194304), add their values: 1 + 2 + 32 + 64 + 8192 + 4194304 = 4202595. Use this number for your flags setting: /stick set verbflags 4202595 ``` -------------------------------- ### Require lsqlite3 Module Source: https://docs.macroquest.org/lua/luarocks-modules Use PackageMan.Require to install and load the 'lsqlite3' module. This is the simplest method for package installation. ```lua local mq = require('mq') local PackageMan = require('mq/PackageMan') local sql = PackageMan.Require('lsqlite3') ```