Page 1 of 1

EOJ Chrysila farm

Posted: Sun Dec 22, 2013 9:54 pm
by Florafauna

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onload>

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

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("xxxxxx");
   AcceptQuestByName(xxxxx1);
   AcceptQuestByName(xxxxx2);
   repeat
   queststate = getQuestStatus(xxxxxx1);
          if queststate == "complete" then      
      CompleteQuestByName(xxxxx1);
      else
      CancelQuest(xxxxx2);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() > 3 then
         print("Waiting till it's less crowded")
         repeat
            yrest(15000)
         until 4 > CountPlayers(nil,true) 
   end
end

function GMdetectionname()

EventMonitorStart("detectGMname", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Master\');");yrest(150);

local time, moreToCome, msg = EventMonitorCheck("detectGMname", "1")
if msg ~= nil then
RoMScript("Logout();");
end

EventMonitorStop("detectGMname")

end

registerTimer("GMdetection", secondsToTimer(10), GMdetectionname);function GMdetectionname()
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      

</onload>

<!-- #  1 --><waypoint x="-9414" z="-18353" y="932" tag="Home">
   if getZoneId() == number(a1) then
      waitForEventStart()
          doquest()
   end
   if getZoneId() == number(a2) then
      doquest()
   end
   if getZoneId() == number(a3) then
      doquest3()
      restTilEvent()
      channel()
   end
   __WPL:setWaypointIndex(__WPL:findWaypointTag("Home));
</waypoint>
<!-- #  2 --><waypoint x="-9397" z="-18357" y="932" tag="Timer">   
   __WPL:setForcedWaypointType("TRAVEL")   
</waypoint>
<!-- #  3 --><waypoint x="-9257" z="-18444" y="904">   </waypoint>
<!-- #  4 --><waypoint x="-9175" z="-18543" y="895">   </waypoint>
<!-- #  5 --><waypoint x="-9065" z="-18758" y="851">   </waypoint>
<!-- #  6 --><waypoint x="-8936" z="-18846" y="863">   </waypoint>
<!-- #  7 --><waypoint x="-8885" z="-18921" y="882">   </waypoint>
<!-- #  8 --><waypoint x="-8885" z="-18920" y="881">   </waypoint>
<!-- #  9 --><waypoint x="-8854" z="-18991" y="905">   </waypoint>
<!-- # 10 --><waypoint x="-8806" z="-19152" y="905">   </waypoint>
<!-- # 11 --><waypoint x="-8592" z="-19389" y="905">   </waypoint>
<!-- # 12 --><waypoint x="-8730" z="-19168" y="907">   </waypoint>
<!-- # 13 --><waypoint x="-8839" z="-19000" y="898">   </waypoint>
<!-- # 14 --><waypoint x="-8960" z="-18804" y="856">   </waypoint>
<!-- # 15 --><waypoint x="-9097" z="-18740" y="851">   </waypoint>
<!-- # 16 --><waypoint x="-9166" z="-18529" y="886">   </waypoint>
<!-- # 17 --><waypoint x="-9269" z="-18424" y="907">   </waypoint>
<!-- # 18 --><waypoint x="-9386" z="-18362" y="931">   </waypoint>
</waypoints>

can anyone help me fix
says Failed to Compile and run Lua code for waypointlist onLoad event

Re: EOJ Chrysila farm

Posted: Sun Dec 22, 2013 10:47 pm
by Florafauna

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onload>

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()
	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

function doquest3()  
         local endmsg = getTEXT("|cffffff75Regional event has ended successfully!|r")

	repeat
		yrest(11)
		 quest()
end

function quest()
	  player:target_NPC("xxxxxx");
  AcceptQuestByName(xxxxx1);
  AcceptQuestByName(xxxxx2);
  repeat
  queststate = getQuestStatus(xxxxx1);
 	  if queststate == "complete" then
	completeQuestByName(xxxxx1);
	else
	CancelQuest(xxxxx2);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() > 7 then
         print("Waiting till it's less crowded")
         repeat
            yrest(15000)
         until 10 > CountPlayers(nil,true) 
   end
end

</onload>

<!-- #  1 --><waypoint x="-9414" z="-18353" y="932" tag="Home">
   if getZoneId() == number(a1) then
      waitForEventStart()
          doquest()
   end
   if getZoneId() == number(a2) then
      doquest()
   end
   if getZoneId() == number(a3) then
      doquest3()
      restTilEvent()
      channel()
   end
   __WPL:setWaypointIndex(__WPL:findWaypointTag("Home"));
</waypoint>
my script is suppose to stay in one spot and just swap channels EOJ event
Final Analysis and Unknown energy EOJ event in Chrysalia