Code: Select all
YourTargetScore = 6000
function waitForEventStart()
repeat
yrest(1000) -- check every second
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if (ScorePE == nil) then
printf("Score is nil, oh no!")
__WPL:setWaypointIndex(__WPL:findWaypointTag("Timer"));
return
end
if Count == 2 and YourTargetScore > ScorePE then break end
until false
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count ~= 2 or ScorePE >= YourTargetScore then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home"));
end
end
function doquest()
local endmsg = getTEXT("|cffffff75Regional event has ended successfully!|r")
repeat
yrest(10)
quest()
GMdetectionname()
people()
until getLastWarning(endmsg, 10)
EventMonitorStart("Tug of War Between Two Sides", "WARNING_MESSAGE");
local time, moreToCome, msg = EventMonitorCheck("Tug of War Between two Sides",1)
if msg == endmsg then
local currentchannel = RoMScript("GetCurrentParallelID()")
local newChannel = currentchannel
repeat
newChannel = newChannel + 1
if newChannel > RoMScript("GetNumParalleZones()") then
newChannel = 1
end
until RoMScript("IsZoneChannelOnLine("..newChannel..")") or newChannel == currentchannel
if newChannel ~= currentchannel then
sendMacro("ChangeParallelID("..newChannel..");");
player:rest(30)
local id = RoMScript("GetCurrentParallelID()")
if id ~= newChannel then
RoMScript("ChangeChar(\"current\,nil,"..newChannel..")")
waitForLoadingScreen()
yrest(3000)
end
end
end
end
function doquest3()
local endmsg = getTEXT("|cffffff75Regional event has ended successfully!|r")
repeat
yrest(10)
quest()
GMdetectionname()
people()
until getLastWarning(endmsg, 10)
end
function quest()
player:target_NPC("Papp Hesof");
AcceptQuestByName(425597);
AcceptQuestByName(425598);
repeat
queststate = getQuestStatus(425597);
if queststate == "complete" then
CompleteQuestByName("425597");
else
CancelQuest(425598);yrest(500);
end
until getLastWarning(endmsg, 10)
end
function restTilEvent()
repeat
yrest(700)
until os.date("*t").min%20 == 10
yrest(10000)
local curtime = os.date("*t")
local curmins = curtime.min
local cursecs = curtime.sec
if curmins > 48 then
curmins = curmins - 47
elseif curmins > 28 then
curmins = curmins - 27
elseif curmins > 8 then
curmins = curmins - 7
else
curmins = curmins + 10
end
local resttime = ((20 - curmins) * 60) - cursecs
print("resting for "..resttime.." seconds")
yrest(resttime*1000)
end
function channel()
sendMacro("ChangeParallelID("..newChannel..");");
player:rest(30)
local id = RoMScript("GetCurrentParallelID()")
if id ~= newChannel then
RoMScript("ChangeChar(\"current\",nil,"..newChannel..")")
waitForLoadingScreen()
yrest(3000)
end
end
function people()
if CountPlayers() > 8 then
print("Waiting till it's less crowded")
repeat
yrest(15000)
until 3 > CountPlayers(nil,true)
end
end
function DetectionnameAll()
EventMonitorStart("detectMaster", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Nohdrael\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Kiareko\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Lonarhune\');"); yrest(800);
repeat
local time, moreToCome, msg = EventMonitorCheck("detectMaster", "1")
if msg and string.find(msg, "Game Moderator") then
RoMScript("Logout();");
break
elseif msg and not string.find(msg, "Search failed") then
channelAll()
break
end
until moreToCome == false
EventMonitorStop("detectMaster")
end
function Detectionname3()
EventMonitorStart("detectMaster", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Nohdrael\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Kiareko\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Lonarhune\');"); yrest(800);
repeat
local time, moreToCome, msg = EventMonitorCheck("detectMaster", "1")
if msg and string.find(msg, "Game Moderator") then
RoMScript("Logout();");
break
elseif msg and not string.find(msg, "Search failed") then
restTilEvent()
channel()
break
end
until moreToCome == false
EventMonitorStop("detectMaster")
end
registerTimer("Detection", secondsToTimer(10), Detectionname3);function Detectionname3()
end
function unStick3()
waitForLoadingScreen();
if getZoneId() ~= number(a1) then
RoMScript("Logout();");
waitForLoadingScreen();
if getZoneId() ~= number(a2) then
RoMScript("Logout();");
waitForLoadingScreen();
if getZoneId() ~= number(a3) then
RoMScript("Logout();");
end
end
end
end [string "..."]:3: attempt to call global 'number' <a nil value>