1. #1
    The Undying Lochton's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    FEEL THE WRATH OF MY SPANNER!!
    Posts
    37,553

    [WeakAuras] Action announcement help needed

    Heya all!

    Is there an ability to under 'Actions' (chat message) setup for a random outcome, so you don't get the same message always?
    Last edited by Lochton; 2018-12-19 at 09:04 AM.
    FOMO: "Fear Of Missing Out", also commonly known as people with a mental issue of managing time and activities, many expecting others to fit into their schedule so they don't miss out on things to come. If FOMO becomes a problem for you, do seek help, it can be a very unhealthy lifestyle..

  2. #2
    The Undying Lochton's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    FEEL THE WRATH OF MY SPANNER!!
    Posts
    37,553
    None able with a little note on it?
    FOMO: "Fear Of Missing Out", also commonly known as people with a mental issue of managing time and activities, many expecting others to fit into their schedule so they don't miss out on things to come. If FOMO becomes a problem for you, do seek help, it can be a very unhealthy lifestyle..

  3. #3
    What about putting something like this under "Custom" (click one of the custom check boxes in the Action tab, then enter this into the text box that shows up):

    Code:
        local x = math.random(100); 
        if (x > 50) then
            SendChatMessage("yay", "say");
        else
            SendChatMessage("nay", "say");
        end

  4. #4
    If you have a lot of possible messages then the code is easier to read and maintain if you use a table.

    Code:
    local strings = {"text 1", "text 2", "text 3"}
    
    SendChatMessage(strings[math.random(#strings)], "SAY")

  5. #5
    The Undying Lochton's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    FEEL THE WRATH OF MY SPANNER!!
    Posts
    37,553
    Quote Originally Posted by Generics View Post
    What about putting something like this under "Custom" (click one of the custom check boxes in the Action tab, then enter this into the text box that shows up):

    Code:
        local x = math.random(100); 
        if (x > 50) then
            SendChatMessage("yay", "say");
        else
            SendChatMessage("nay", "say");
        end
    Quote Originally Posted by quthar View Post
    If you have a lot of possible messages then the code is easier to read and maintain if you use a table.

    Code:
    local strings = {"text 1", "text 2", "text 3"}
    
    SendChatMessage(strings[math.random(#strings)], "SAY")
    Thanks you two. I'll snoop along and see what I can make.
    FOMO: "Fear Of Missing Out", also commonly known as people with a mental issue of managing time and activities, many expecting others to fit into their schedule so they don't miss out on things to come. If FOMO becomes a problem for you, do seek help, it can be a very unhealthy lifestyle..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •