[Lua/C++] Auto Join Raid group menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    gospag's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua/C++] Auto Join Raid group

    So here I am again with another rocket science question :\

    I'm trying to create a script that will Auto-put you in a raid group upon logon.

    Thus my question being: Is there a way in Lua or even C++ to autocreate or autojoin an already created raid group upon logon?


    So far I've come up with this:

    Code:
    function Raid_OnLog(event, player)
    
    -- epic lua raid join script goes here
    
    end
    RegisterServerHook(19, "Raid_OnLog")
    It's kinda nothing.. but it's a start :\

    +Rep for anyone who can help with this

    [Lua/C++] Auto Join Raid group
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Using /Trunk/LUA_ENGINE_COMMANDS.txt รข€“ Arc Scripts I was able to find:


    Plyr:GetGroupLeader() +- Returns Plyr's group's leader.
    Plyr:SetGroupLeader(player, silent) +- Set's Plyr's group's leader to player. Set silent to true if you don't want the usual announcement.
    Plyr:AddGroupMember(player [,subgroup]) +- Adds player to Plyr's group, subgroup is optional.
    Plyr:IsGroupFull() +- Returns true if Plyr's group is full.

    Plyr:GetGroupType() +- Returns Plyr's group type:

    GROUP_TYPE_PARTY = 0,
    GROUP_TYPE_RAID = 1,
    Plyr:ExpandToRaid() +- Expands Plyr's group to a raid.


    Unit/Plyr:IsInDungeon() +- return true if the creature/plr is in a dungeon.

    Unit/Plyr:IsInRaid()


    These commands you can use to help you achieve what you want to achieve, although as for the actual script I am not sure how you would do it.

  3. #3
    gospag's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    woot! thanks looks promising

    +Rep for the help and for being the only one who cared to reply =D

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think you would do something like this:

    Code:
    function Raid_OnLog(event, player)
        local PlayersInWorld = GetPlayersInWorld() -- Don't know if it requires a bit before, e.g: player:Get
        for a, plr in pairs(PlayersInWorld) do
            local leader = plr:GetGroupLeader()
            if leader:GetGroupType() == 0 then
            leader:ExpandToRaid()
            end
            if leader:IsGroupFull() ~= true then
            leader:AddGroupMember(plr) -- dunno if it shouldl be plr:AddGroupMember(leader)
            end
        end
    end
    
    RegisterServerHook(19, "Raid_OnLog")
    But if there are other groups made or the raid is full it may bug.

  5. #5
    gospag's Avatar Member
    Reputation
    1
    Join Date
    Jul 2009
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I corrected and tested it. Works only 50% :\

    It converts the normal party to raid if I'm already in a party, but crashed my world.exe if i'm not in a party.

    Here's my modified code. I changed the hook so it's easier to test now. Typing -lfg runs the script

    Code:
    local RAID_MSG = "-lfg"
    
    function Raid_OnChat(event, player, message, type, language, unit)
    
    if(message == RAID_MSG) then
        local players = GetPlayersInWorld()
        for a,plr in pairs(players) do
           local leader = plr:GetGroupLeader()
           if leader ~= nil then  -- to check if the player has a leader
              if leader:GetGroupType() == 0 then
                 leader:ExpandToRaid()
              end
           end
           if leader:IsGroupFull() ~= true then
              player:AddGroupMember(leader) -- "player who joins":AddGroupMember("leader's group") it works like this :\
           end
        end
    end
    
    end
    
    RegisterServerHook(16, "Raid_OnChat")

Similar Threads

  1. [How-To] Join a Raid Group on a Low Level Character
    By Thormn in forum World of Warcraft Guides
    Replies: 8
    Last Post: 05-22-2015, 08:25 PM
  2. Replies: 7
    Last Post: 11-07-2009, 06:01 AM
  3. How to bypass the raid group req?
    By kepappi in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 10-19-2007, 10:11 AM
  4. Steal Leader in ANY Raid Group
    By agrestic in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 01-02-2007, 11:02 PM
  5. Auto Join Bot
    By Compleet in forum World of Warcraft Bots and Programs
    Replies: 5
    Last Post: 11-25-2006, 06:37 AM
All times are GMT -5. The time now is 02:04 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search