Macro for creating group

  • Hello,


    How can I create group from 2 variable?
    In MA2, i can do that but not in MA3

    MA2 :

    Setuservar $salle=("Quelle salle?")

    Setuservar $partie=("Quelle zone?")

    Store group $salle$partie

    <<< $salle = 1 & $partie=3, it store a group 13 >>>


    But in MA3, i can't arrive to the same result.



    Thank's in advance...

  • I see what you are getting.


    The variable replacement inserts a space between the results.


    So with the below macro If I enter Room 1 Zone 2 I get a group stored into 1 with the name 2


    I know for sure I could do it with a plugin, but there should be a way to do it with a macro as well.

  • Only because I was curious.


    Extract the GroupStore folder onto your stick so you should end up with the following folder with a .lua and .xml file inside


    \grandMA3\shared\resource\lib_plugins\GroupStore


    Import the group_store.xml into the Plugin Pool


    Press the plugin and it should ask you two questions Tthen create the group based on your two choices.


    This is all the code does (but obviously use at your own risk :)

    Code
    1. local function Main(display_handle,argument)
    2.     local room = tonumber(TextInput("Quelle salle?"))
    3.     local zone = tonumber(TextInput("Quelle zone?"))
    4.     if (room == null) or (zone == null) then
    5.         Printf("Aucune pièce ou zone entrée")
    6.         return
    7.     end
    8.     Cmd(string.format("Store Group %d%d",  room, zone))
    9. end