Quantcast
Download
(5 Kb)
Download
Updated: 03-28-17 03:41 PM
Pictures
File Info
Compatibility:
Tomb of Sargeras (7.2.0)
Updated:03-28-17 03:41 PM
Created:07-05-16 02:38 PM
Downloads:174
Favorites:3
MD5:
7.2.0

gmMounts

Version: 720-2017032801
by: gmarco [More]

gmMounts
(previously known as MountRndCat)

This is a tiny addon that let you define custom categories and then random summon a mount from them.

To use the addon you FIRST need to rename the file categories-sample.lua to categories.lua in the addon directory and edit it with the names of your favorite mounts.

If you modify the categories.lua file while the game client is active you have to reload the game interface with command:

/reload

Usage:

Create a macro like this to summon your mounts:


/gmm [btn:2] flying ; [btn:3] repair ; [swimming] ground ; [mod:shift] funny ; [mod:alt] favorites!; all!

or simply use the command from the cli, i.e.:


/gmm - This help
/gmm category - Summon a random mount from your 'category' list
/gmm favorites! - Summon a random mount from your favorite list
/gmm all! - Summon a random mount

The categories are shared on all characters on the same account.


Here is a categories.lua suitable for alliance players (english client):


Lua Code:
  1. gmMounts_tbl = {
  2.    
  3.     flying = {
  4.         "Swift Green Gryphon",
  5.         "Swift Blue Gryphon",
  6.         "Swift Red Gryphon",
  7.     },
  8.    
  9.     ground = {
  10.         "Swift Mistsaber",
  11.         "Swift Moonsaber",
  12.       },
  13.    
  14.     repair = {
  15.         "Traveler's Tundra Mammoth",
  16.         "Grand Expedition Yak",
  17.     },
  18.    
  19.     funny = {
  20.         "Azure Water Strider",
  21.         "Sea Turtle",
  22.    
  23.     },
  24.    
  25.     combo = {
  26.         "Sandstone Drake",
  27.         "Mekgineer's Chopper",
  28.     },
  29.    
  30.    
  31.    -- add your custom categories here
  32. }

N.B. Please remember to backup your custom categories.lua before updating.

-- I also whish to thanks SDPhantom and Phanx for their help, code and suggestions that help me so much in understanding and writing my first addon

v720-2017032801
- bump toc

v1.0-2016102601
- bump toc

v1.0-2016070501
- changed name and references to gmMounts
- bump toc for 7.0
- used the new C_MountJournal functions

--- Previous changes of MountRndCat

v1.0-2015101801
- fixed a bug where a mount with the same name but with 2 ids can't be summoned (thanks to Phanx for the input and ideas)
- add the default category " favorites! " which randomly summon a mount from the favorites.
Basically it is the same of the "Summon Random Favorite Mount" spell, but I need it to use in a macro.
To do it you can also use a simple:

C_MountJournal.Summon(0)

but I found it acts more as a switch than a summon.
So you press once it summon a random favorite you press twice it dismiss.
I have to check it better.

- add the default category " all! " which randomly summon a mount
- fix the code to prevent to summon the active mount

v1.0-2015062401
- bump toc for 6.2

v1.0-2015022501
-bump toc for 6.1

v1.0-2014101501
- bump toc for 6.0
- migrate to C_MountJournal API

v1.0-2013091001
- bump toc for 5.4

v1.0-2013052101
- bump toc for 5.3

v1.0-2013030401
- bump toc

v1.0-2015062401
- bump toc for 6.2

v1.0-2015022501
-bump toc for 6.1

v1.0-2014101501
- bump toc for 6.0
- migrate to C_MountJournal API

v1.0-2013091001
- bump toc for 5.4

v1.0-2013052101
- bump toc for 5.3

v1.0-2013030401
- bump toc
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Author
Date
1.0-2016102601
5kB
gmarco
10-26-16 01:06 PM
1.0-2016070501
5kB
gmarco
07-05-16 02:40 PM


Post A Reply Comment Options
Unread 06-14-17, 05:40 AM  
aallkkaa
A Deviate Faerie Dragon

Forum posts: 11
File comments: 1
Uploads: 0
I love your addon but I had to make a couple tweaks to it.
The output of running fc core.lua core-ORIGINALBAK.lua where "core.lua" is my modified version and "core-ORIGINALBAK.lua" is your original version is as follows:
Code:
Comparing files core.lua and CORE-ORIGINALBAK.LUA
***** core.lua
        if category=="help" then
                print(prgname .. ":")
                print("/gmm help - This help")
                print("/gmm category - Summon a random mount from your 'category' list")
***** CORE-ORIGINALBAK.LUA
        if category=="" then
                print(prgname .. ":")
                print("/gmm  - This help")
                print("/gmm category - Summon a random mount from your 'category' list")
*****

***** core.lua
                C_MountJournal.SummonByID(CategoryMounts[number])
                -- print(prgname .. " is summoning... " .. name)

***** CORE-ORIGINALBAK.LUA
                C_MountJournal.SummonByID(CategoryMounts[number])
                print(prgname .. " is summoning... " .. name)

*****

***** core.lua
        elseif category=="" then
***** CORE-ORIGINALBAK.LUA
*****
The first change makes it so that the help message is displayed upon
Code:
/gmm help
instead of upon
Code:
/gmm
The third/last change makes it so /gmm does nothing. I need this so that the following macro works (almost) as it would were I to use /castrandom <condition-based parameters> instead of /gmm <condition-based categories>:
Code:
/gmm [nomounted, swimming] swimming; [nomounted, flyable] flying; [nomounted] ground;
/dismount [mounted]
Aside from using categories' names instead of a comma-separated list of mounts' names, the difference from using /gmm instead of /castrandom is that I had to add a final semicolon to the end to simulate a /gmm "" and do nothing (in case the character is indoors or whatever) and not get an error message in the process.

The second change is simply what you suggested earlier in this thread, so as to not display the "Summoning ..." chat message.

I'm not acutally asking you to implement these changes but I figured you might like to know how people are using and editing your addon.
Last edited by aallkkaa : 06-14-17 at 05:40 AM.
Report comment to moderator  
Reply With Quote
Unread 03-29-17, 02:51 AM  
gmarco
A Cobalt Mageweaver
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 226
File comments: 136
Uploads: 36
Originally Posted by AkumaGekido
Hi, tried a few random mount addons, but none of them seemed to let you use flying mounts in non-flying areas. Found this one and it's just what I want. Just wondering though if there's a way to turn off the chat announcement when summing a mount. Again great addon.

Hi,
there is no defined cfg that you can set at the moment to silent it.

I can implement it easily in a next version btw.
In the meantime you can comment out the lines that make the output.

So, for example, line 109:

Lua Code:
  1. print(prgname .. " is summoning... " .. name)

should become in this way:

Lua Code:
  1. -- print(prgname .. " is summoning... " .. name)

Stay tuned and thanks for your kind appreciation.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Report comment to moderator  
Reply With Quote
Unread 03-29-17, 02:27 AM  
AkumaGekido
A Murloc Raider

Forum posts: 6
File comments: 15
Uploads: 0
Hi, tried a few random mount addons, but none of them seemed to let you use flying mounts in non-flying areas. Found this one and it's just what I want. Just wondering though if there's a way to turn off the chat announcement when summing a mount. Again great addon.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: