New energy of justice farm in sarlo

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
parramet
Posts: 15
Joined: Wed Feb 13, 2013 7:49 pm

New energy of justice farm in sarlo

#1 Post by parramet » Thu Oct 24, 2013 2:06 pm

Hello,

I've been trying to make a new eoj farming waypoint for the sarlo zone since there are too many people in TB.
I noticed there are three channels and I would like to change to the next channel when I win the event.
The piece of script I found most suitable is this one.

Code: Select all

<onload>

function doquest()               
      local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      repeat
            yrest(10)
      until getLastWarning(gomsg, 10)
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
      repeat
      yrest(10)
      quest()
      until getLastWarning(endmsg, 10)
      sendMacro("ChangeParallelID(2);");
      player:rest(30)
      local id = RoMScript("GetCurrentParallelID()")
      if id ~= 2 then
      RoMScript("ChangeChar(1,nil,2)")
      waitForLoadingScreen()
      repeat
               yrest(10)
                until getLastWarning(gomsg, 10)
      end
      repeat
      yrest(10)
      quest()
      until getLastWarning(endmsg, 10)
      sendMacro("ChangeParallelID(3);");
      player:rest(30);
      id = RoMScript("GetCurrentParallelID()")
      if id ~= 3 then
      RoMScript("ChangeChar(1,nil,3)")
      waitForLoadingScreen()
      repeat
               yrest(10)
                until getLastWarning(gomsg, 10)
      end
      repeat
      yrest(10)
      quest()
      until getLastWarning(endmsg, 10)
      sendMacro("ChangeParallelID(1);");
      player:rest(30);
      id = RoMScript("GetCurrentParallelID()")
      if id ~= 1 then
      RoMScript("ChangeChar(1,nil,1)")
      waitForLoadingScreen()
      repeat
               yrest(10)
                until getLastWarning(gomsg, 10)
      end

end

function quest()
         
                 RoMScript("AcceptBorderQuest()")
         RoMScript("ScriptBorder:Hide()")
          player:target_NPC("the npc name")
          CompleteQuestByName("your quest name","public")
end

</onload>
This is the link of the thread http://www.solarstrike.net/phpBB3/viewt ... t&start=60

I'm not sure why but this is not working for me , i put the name of the quest and the npc but once I win he event nothing happens.I would apreciate any tip on the issue.

Thank you.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#2 Post by rock5 » Thu Oct 24, 2013 10:32 pm

The only reason I can see for it not changing channel is if it is already in the target channel. The script assumes you start in channel 1. If you start in channel 2 then it will do that channel twice before moving to channel 3.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#3 Post by rock5 » Thu Oct 24, 2013 11:40 pm

Because I hate to see repetition (and I can think of some improvements), here's my version of the function.

Code: Select all

	function doquest()               
		local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
		local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
		
		-- Wait for go message
		repeat
				yrest(10)
		until getLastWarning(gomsg, 10)
		
		-- Keep doing quest until end message 
		repeat
			yrest(10)
			quest()
		until getLastWarning(endmsg, 10)
		
		-- Change to next active channel
		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
		
		-- New channel found. Change to it
		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
  • - Changes to the next channel so it doesn't matter which you start in.
    - It wont assume 3 channels. It will use however many channels there are.
    - Skips inactive channels (greyed out ones). Only applicable to certain servers.
    - Doesn't matter which character you use. You don't have to change the character number.
Note: untested.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

parramet
Posts: 15
Joined: Wed Feb 13, 2013 7:49 pm

Re: New energy of justice farm in sarlo

#4 Post by parramet » Fri Oct 25, 2013 6:28 pm

Hi,

I apreciate the help , that script looks so cool . I can't follow the lines really. Sadly I still dont make it work. Do I need to download some userfunction first to read the events? this line of code changes me of channel perfectly so the problem is not that i cant change the channel but seems mm dont read the mesages.

Code: Select all

id = RoMScript("GetCurrentParallelID()");
if id == 1 then 
RoMScript("ChangeParallelID(2)"); 
elseif id == 2 then 
RoMScript("ChangeParallelID(3)");
elseif id == 3 then 
RoMScript("ChangeParallelID(1)");
end
yrest(30000);
end
The game is still alive.
Cya.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#5 Post by rock5 » Fri Oct 25, 2013 11:06 pm

So are you saying it does the event, changes channel, but when the event starts again it doesn't do it again? Sounds like you are only calling the function once. In your original code you don't show the waypoint where the function would be called. Maybe you should show us your whole waypoint file.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

parramet
Posts: 15
Joined: Wed Feb 13, 2013 7:49 pm

Re: New energy of justice farm in sarlo

#6 Post by parramet » Sat Oct 26, 2013 2:02 pm

Hello again ,

Ok lets try to do this more simple , I've calculated that its perfect to change the channel every 15mins, so that I get the 35 + 10 from the ending event on the next channel . I could even work it out if its a quest count .

How that sounds?
Thanks man.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#7 Post by rock5 » Sat Oct 26, 2013 2:27 pm

So what exactly are you going to do now? Use a timer? I thought the Sarlo events were 20m.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

parramet
Posts: 15
Joined: Wed Feb 13, 2013 7:49 pm

Re: New energy of justice farm in sarlo

#8 Post by parramet » Wed Oct 30, 2013 11:35 am

Pfffff

Damn, they fkd me this time with the patch . They have changed the rewards on the public event in sarlo now, and found what I'm doing . Probably they read this thread.... Now I can't win the event alone anymore so all this investigation to change the channel is useless now . Sad.

Pofatlan
Posts: 11
Joined: Sat Sep 14, 2013 2:29 am
Location: Hungary

Re: New energy of justice farm in sarlo

#9 Post by Pofatlan » Fri Jan 10, 2014 10:48 am

Hi Rock5!
Not working the script:

Code: Select all

function doquest()               
      local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
      
      -- Wait for go message
	  print("Wait for event start...\n")
      repeat
            yrest(10)
      until getLastWarning(gomsg, 10)
      
      -- Keep doing quest until end message
      repeat
         yrest(10)
         quest()
      until getLastWarning(endmsg, 10)
Image

Pls help for me, thanks :)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#10 Post by rock5 » Fri Jan 10, 2014 2:08 pm

That's because the event ingame messages have color information added. If you search around you might find an example. From memory it should be

Code: Select all

     until getLastWarning("|cffffff80"..gomsg.."|r", 10)
Also be aware there are 2 end messages, 1 for when the event completed successfully and 1 for when it didn't. The other end message is "SC_ZONE_PE_3TH_ST1OVER".
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Pofatlan
Posts: 11
Joined: Sat Sep 14, 2013 2:29 am
Location: Hungary

Re: New energy of justice farm in sarlo

#11 Post by Pofatlan » Fri Jan 10, 2014 3:12 pm

Thanks rock5!

But script don't work... :S

Code: Select all

local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
      
      -- Wait for go message
	  print("Wait for event start...\n") -- wait here :S 
      repeat
            yrest(10)
      until getLastWarning("|cffffff80"..gomsg.."|r", 10)
      
      -- Keep doing quest until end message
	  print("Event has ben started...\n")
      repeat
         yrest(10)
         quest()
      until getLastWarning("|cffffff80"..endmsg.."|r", 10)
 
I don't know what is the problem...
I always want to know when event start and when it end.
The event window sometimes visible and sometimes not visible. Does it influens this script?
I read this forum, but not find the working script... :(

Please help me again :) Thanks a lot!

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: New energy of justice farm in sarlo

#12 Post by noobbotter » Fri Jan 10, 2014 3:58 pm

Rock mentioned that there are 2 separate messages that could appear to indicate the end of the event.
Also be aware there are 2 end messages, 1 for when the event completed successfully and 1 for when it didn't. The other end message is "SC_ZONE_PE_3TH_ST1OVER".
I would add the second message and check for both (either/or) as such:

Code: Select all

local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
     local endmsg2 = getTEXT("SC_ZONE_PE_3TH_ST1OVER")
      -- Wait for go message
     print("Wait for event start...\n") -- wait here :S
      repeat
            yrest(10)
      until getLastWarning("|cffffff80"..gomsg.."|r", 10)
     
      -- Keep doing quest until end message
     print("Event has ben started...\n")
      repeat
         yrest(10)
         quest()
      until getLastWarning("|cffffff80"..endmsg.."|r", 10) or getLastWarning("|cffffff80"..endmsg2.."|r", 10)
Don't know if it will work or not... can't test it from here.

Pofatlan
Posts: 11
Joined: Sat Sep 14, 2013 2:29 am
Location: Hungary

Re: New energy of justice farm in sarlo

#13 Post by Pofatlan » Fri Jan 10, 2014 4:06 pm

not detect the start of the event has not even come to the end:

Code: Select all

	
Code:
local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
     
      -- Wait for go message
     print("Wait for event start...\n") -- wait here :S
      repeat
            yrest(10)
      until getLastWarning("|cffffff80"..gomsg.."|r", 10)
print("Wait for event start...\n") <-- wait here :S

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#14 Post by rock5 » Fri Jan 10, 2014 10:07 pm

The second arguments in getLastWarning is a limit, in seconds, since the message appeared. So you are only looking for messages that appeared in t he last 10s. You should set this to the biggest number you can that still omits the message from the last event. Eg. If events start every 20m then you could set it to 1200s (20x60) or maybe a bit shorter to make sure there is no overlap.

Code: Select all

until getLastWarning("|cffffff80"..gomsg.."|r", 1150)
The same, of course, is true of the end messages.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Pofatlan
Posts: 11
Joined: Sat Sep 14, 2013 2:29 am
Location: Hungary

Re: New energy of justice farm in sarlo

#15 Post by Pofatlan » Sat Jan 11, 2014 4:20 pm

Hi rock5!

unfortunately this script don't work... it bothers me that I'm clumsy and this script does not work...
I must do something wrong because I cant receive statring event message... but it is very importat for me.

I tried all possibilities from forum, but maybe I haven't got enough knowledge..

This is my first trying which Lisa showed. The result is:

Image

wait and wait and wait... no result
do I have to write in waipoint (commandline.xml)? Or is its enough to runn how picture show?

The only thing which worked:

Code: Select all

function waitForEventStart()
      repeat
         yrest(1000) -- check every second
         local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
         if Count == 2 and YourTargetScore > ScorePE then break end
      until false
   end
But it has also mistake: if event windows desapired this script don't work. I read in another solution, that I have to leave current zone and go back NPC.
I think this implementation is complicated... the bot couldn't move only talk to NPC (accepted 2 quest, and completed one cuest, and try again until event finis)

Code: Select all

player:target_NPC(120273) -- Papp Hesof
AcceptQuestByName("Unknown Energy");
AcceptQuestByName("Final Analysis");
yrest(250);
qStatus = getQuestStatus("Unknown Energy");
 if (qStatus == "complete") then
  CompleteQuestByName("Unknown Energy");
rock5 this is your implementation:

Code: Select all

function doquest() 
	local msg
      local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
      local endmsg = getTEXT("SC_ZONE_PE_3TH_FAIL")
      
      -- Wait for go message
	  print("Wait for event start...\n")
      repeat
            yrest(10)
      until getLastWarning("|cffffff75"..gomsg.."|r", 1150)
      
      -- Keep doing quest until end message
	  print("Event has started...\n")
      repeat
         yrest(10)
         quest()
      until getLastWarning("|cffffff75"..endmsg.."|r", 1150)
Do I have to use anything else for working this script (another addon or userfunction)?
Does your script have to work where there is EOJ event (Tergothen Bay, Roroazan, Chrysalia, Merdhin Tundra, ... )?
Is my system wrong?
I use:
MicroMacro v1.04.132
RomBot 3.29 revision 770

If everything is ok, why it don't work? What is missing (except my knowledge :) ) ?

Thank you for helping!

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: New energy of justice farm in sarlo

#16 Post by rock5 » Sat Jan 11, 2014 10:42 pm

Pofatlan wrote:This is my first trying which Lisa showed.
That should print any warning messages that appear on the screen. Did the message appear while that was running? If the warning appeared and nothing was printed in MM then maybe the message you want to capture is not a warning message. Maybe it's an alert message. But I do know the event messages are warning messages, unless they are different on your server. I don't know if that's possible.
Pofatlan wrote:rock5 this is your implementation:
...
Do I have to use anything else for working this script (another addon or userfunction)?
It's possible you need a time addon such as d303fix. Why are you using color "|cffffff75"? Didn't I say "|cffffff80"? If yo haven't been able to print the message, what makes you think it is wrong?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests