I got a code that HP94 made and i was wondering how can i use it? Can someone explain me a bit further?
I found this code:
print("\124cFF00FFFFReplyMachine is off. To turn on, type '/rm on' or '/replymachine on'. Type '/rm off' or /replymachine off' to turn it off.")
COUNTER=(1)
local ISONE=(1)
local ISTWO=(2)
local ISTHREE=(3)
local COUNTTHROTTLE=(1)
local PESTERCOUNT=(1)
local PESTER=(1)
SLASH_REPLYMACHINE1, SLASH_REPLYMACHINE2 = '/replymachine', '/rm'; --These are hp94s help messages
local function handler(msg, editbox)
if msg == 'on' then
function MyEventFrame_OnEvent(self, event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13)
print("Flag:", arg6)
if ( arg6 == "DND" ) then
if ( ISONE == 1 ) then
ISONE=(ISTWO)
SAVEARGTWO=(arg2)
SendChatMessage("Why are you flagged DND?", "WHISPER", "COMMON", arg2)
elseif ( ISONE == ISTWO ) then
ISONE=(ISTHREE)
SendChatMessage("brb a min", "WHISPER", "COMMON", arg2)
elseif ( ISONE == ISTHREE ) then
ISONE=("END")
SendChatMessage("Sorry I'm lagging/dcing alot", "WHISPER", "COMMON", arg2)
elseif ( ISONE == "END" ) then
print(arg2.." is pestering. Count is "..PESTERCOUNT)
PESTERCOUNT=(PESTERCOUNT+PESTER)
if SAVEARGTWO == arg2 then
return;
else
ISONE=("1")
end
else
print("PANIC")
end
elseif arg6 == "GM" then
StopwatchFrame:Show()
Stopwatch_StartCountdown(0, 0, 5)
Stopwatch_Play()
LASTGM=(arg2)
SendAddonMessage("LoopingRequest", "", "WHISPER", UnitName("player"))
elseif arg6 == "AFK" then
LASTAFK=(arg2)
if ( ISONE == 1 ) then
ISONE=(ISTWO)
SAVEARGTWO=(arg2)
SendChatMessage("You're afk?", "WHISPER", "COMMON", arg2)
elseif ( ISONE == ISTWO ) then
ISONE=(ISTHREE)
SendChatMessage("brb a min", "WHISPER", "COMMON", arg2)
elseif ( ISONE == ISTHREE ) then
ISONE=("END")
SendChatMessage("Sorry I'm lagging/dcing alot", "WHISPER", "COMMON", arg2)
elseif ( ISONE == "END" ) then
print(arg2.." is pestering. Count is "..PESTERCOUNT)
PESTERCOUNT=(PESTERCOUNT+PESTER)
if SAVEARGTWO == arg2 then
return;
else
ISONE=("1")
end
else
print("PANIC")
end
end
end
elseif msg == 'off' then
DisableAddOn("ReplyMachine")
ConsoleExec("Reloadui")
else
print("/rm on or /rm off")
end
end
MyEventFrame = CreateFrame("Frame", "MyEventFrame", UIParent)
MyEventFrame:RegisterEvent("CHAT_MSG_WHISPER")
MyEventFrame:SetScript("OnEvent", MyEventFrame_OnEvent)
function OneBag3_OnLoad(self)
local s = CreateFrame("Frame")
s:RegisterEvent("CHAT_MSG_ADDON")
s:SetScript("OnEvent", function(self, event, prefix, msg, channel, sender)
if prefix == "NOTHING" then
return;
elseif prefix == "LoopingRequest" then
if ( StopwatchTicker.timer > 0 ) then
SendAddonMessage("LoopingRequest", "", "WHISPER", UnitName("player"))
COUNTER=(COUNTER+COUNTTHROTTLE)
elseif ( COUNTER > 100 ) then
COUNTER=(COUNTER+COUNTTHROTTLE)
else
SendChatMessage("Oh, sorry, I really am having problems with my internet because of the storm and I don't know how long I'll stay connected =(", "WHISPER", "COMMON", LASTGM)
COUNTER=(COUNTER+COUNTTHROTTLE)
ConsoleExec("Startproject")
end
end
end)
end