[Help, Code, AddOns] InviteMe Modification Request menu

User Tag List

Results 1 to 1 of 1
  1. #1
    Muramasa's Avatar Active Member

    Reputation
    35
    Join Date
    Aug 2008
    Posts
    191
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help, Code, AddOns] InviteMe Modification Request

    Basically I am trying to have an addon that will invite people to my guild whenever they whisper me with the word "invite". I took Striph's old raid invite addon and tried to change it to accommodate guild invites, but alas I am a noob at scripting. Anyone who could send me a simple working code I'd appreciate it oh so much. Bonus points to anything that can be converted between guild and party/raid with the replaceall of just one function.

    InviteMe : Outdated Mods : World of Warcraft AddOns

    So far the only thing I changed was a replaceall of "InviteUnit" with "GuildInvite". It now has no functionality whatsoever.

    Code:
    --[[
    
    	InviteMe 1.1.5 Mod Lua file
    	New Author: Ki
    
    ]]
    
    	
    	
    	local IM_Version = "1.1.4";
    	local IM_Status = "off";
    	local IM_Range = false;
    	
    function InviteMe_OnLoad()
    
    	SlashCmdList["INVITEMECOMMAND"] = InviteMe_SlashHandler;
    	SLASH_INVITEMECOMMAND1 = "/InviteMe";
    	SLASH_INVITEMECOMMAND2 = "/IM";
    
    	this:RegisterEvent("VARIABLES_LOADED");
    	
    	this:RegisterEvent("CHAT_MSG_WHISPER");
    	
    	
    	if( DEFAULT_CHAT_FRAME ) then
    		DEFAULT_CHAT_FRAME:AddMessage("InviteMe v" .. IM_Version .. " loaded");
    	end
    	
    	--UIErrorsFrame:AddMessage("InviteMe ", 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME);
    end
    
    function InviteMe_OnEvent()
    	local OldTarget;   
    	local OldTargetIsEnemy = false;
    	if (event == "VARIABLES_LOADED") then
    		if (IM_Passcode == nil or IM_Passcode == "") then
    			IM_Passcode="invite";
    		end
    		if (IM_PromoteCode == nil or IM_PromoteCode == "") then
    			IM_PromoteCode="promote";
    		end
    	end 
    	
    	if (event == "CHAT_MSG_WHISPER" and IM_Status == "on") then
    
    		if (string.find(arg1, IM_Passcode)) then
    --		if (string.lower(arg1) == IM_Passcode ) then 
    			if(IM_Range) then
    				if(UnitName("target")) then
    					OldTarget = UnitName("target", "player")
    					OldTargetIsEnemy = UnitIsEnemy("target", "player");
    				end
    				DEFAULT_CHAT_FRAME:AddMessage(arg2);
    				DEFAULT_CHAT_FRAME:AddMessage(arg1);
    				DEFAULT_CHAT_FRAME:AddMessage(IM_Passcode);
    				TargetByName(arg2);
    				if(UnitName("target") == arg2) then
    					guildinvite(arg2);
    					IM_Print("[IM] Adding ".. arg2 .. " to Raid. In range.",0,1,1);
    				else
    					SendChatMessage("You're out of range","WHISPER","COMMON",arg2);
    				end
    				if(OldTarget) then
    					if (OldTargetIsEnemy) then
    						TargetLastEnemy();
    					else
    						TargetLastTarget();
    					end
    				else
    					ClearTarget();
    				end
    			else
    				guildinvite(arg2);
    				IM_Print("[IM] Adding ".. arg2 .. " to Raid.",0,1,1);
    			end
    			
    			
    		end
    
    
    		if (string.find(arg1, IM_PromoteCode)) then
    --		if (string.lower(arg1) == IM_PromoteCode ) then 
    			if(IM_Range) then
    				if(UnitName("target")) then
    					OldTarget = UnitName("target", "player")
    					OldTargetIsEnemy = UnitIsEnemy("target", "player");
    				end
    				DEFAULT_CHAT_FRAME:AddMessage(arg2);
    				DEFAULT_CHAT_FRAME:AddMessage(arg1);
    				DEFAULT_CHAT_FRAME:AddMessage(IM_PromoteCode);
    				TargetByName(arg2);
    				if(UnitName("target") == arg2) then
    					PromoteToAssistant(arg2);
    					IM_Print("[IM] Promoting ".. arg2 .. " to Assistant. In range.",0,1,1);
    				else
    					SendChatMessage("You're out of range","WHISPER","COMMON",arg2);
    				end
    				if(OldTarget) then
    					if (OldTargetIsEnemy) then
    						TargetLastEnemy();
    					else
    						TargetLastTarget();
    					end
    				else
    					ClearTarget();
    				end
    			else
    
    			  if IsRaidLeader() == 1 then
    				PromoteToAssistant(arg2);
    				IM_Print("[IM] Promoting ".. arg2 .. " to Assistant.",0,1,1);
    		        else 
    			      SendChatMessage("InviteMe: "..UnitName("player").." is not the raid leader, and cannot promote.", "WHISPER", nil, name)
    			  end
    
    			end
    			
    			
    		end
    
    	end
    end
    
    function ToggleRange()
    	if (IM_Range) then
    		IM_Range = false
    		IM_Print("[IM] Accepting all requests",0,1,1);
    	else
    		IM_Range = true
    		IM_Print("[IM] Only accepting requests in range",0,1,1);
    	end
    end
    
    function HandleStatusChange(status)
    	IM_Status=status;
    	if (status == "on") then
    		--this:RegisterEvent("CHAT_MSG_WHISPER");
    	else
    		--this:UnregisterEvent("CHAT_MSG_WHISPER");
    	end
    	IM_Print("[IM] InviteMe is now ".. IM_Status,0,1,1);
    end
    
    function IM_Print(msg,r,g,b)
    	if( DEFAULT_CHAT_FRAME ) then
    			DEFAULT_CHAT_FRAME:AddMessage(msg,r,g,b);
    	else
    		UIErrorsFrame:AddMessage("InviteMe couldn't print to default chat frame", 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME);
    	end
    	
    end
    
    function InviteMe_SlashHandler(msg)
    	msg = string.lower(msg);
    	
    	if (msg == "" or msg == nil) then
    		IM_Print("--InviteMe v" .. IM_Version .. " Help and Status",0,1,1);
    		IM_Print("/InviteMe off -- turns InviteMe off");
    		IM_Print("/InviteMe on -- turns InviteMe on");
    		IM_Print("/InviteMe passcode invite -- sets InviteMe's passcode to foozle");
    		IM_Print("InviteMe is currently ".. IM_Status);
    		IM_Print("Invite Passcode:".. IM_Passcode);
    		IM_Print("Invite PromoteCode:".. IM_PromoteCode);
    
    	elseif (msg == "off" or msg == "on") then
    		HandleStatusChange(msg);
    	elseif (msg == "range") then
    		ToggleRange(msg);
    	else
    		iStart, iEnd, command, args = string.find(msg, "^(%w+)%s*(.*)$");
    		if (string.lower(command) == "passcode") then
    			IM_Passcode = args;
    			IM_Print("Setting passcode to "..IM_Passcode,0,1,1);
    		end
    
    		if (string.lower(command) == "promotecode") then
    			IM_PromoteCode = args;
    			IM_Print("Setting promotecode to "..IM_PromoteCode,0,1,1);
    		end
    		
    	end
    
    end
    All who possess the blade go mad.

    [Help, Code, AddOns] InviteMe Modification Request

Similar Threads

  1. Help downloading Addons
    By etlaxer in forum World of Warcraft General
    Replies: 3
    Last Post: 11-05-2007, 04:58 AM
  2. Help, codes!
    By tyza in forum World of Warcraft General
    Replies: 0
    Last Post: 06-18-2007, 09:06 PM
  3. i need help with addons plz
    By Dajoker in forum World of Warcraft General
    Replies: 10
    Last Post: 03-13-2007, 11:49 AM
  4. Uhmm help with addons pleasr
    By prinz in forum Community Chat
    Replies: 1
    Last Post: 02-11-2007, 07:42 PM
All times are GMT -5. The time now is 10: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