Script to do a waypoint if the EOJ timer doesn't show?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#41 Post by lisa » Mon Mar 04, 2013 7:23 pm

haringpb wrote:doesn´t work anymore can we get an update or could anybody explain how i could update it?
Had a quick look and not only did the base address change a lot so did 2 of the pointers, it would be a pain to have to update this every patch.

I thought people said when the event dissappeared off screen the memory reads also failed, are you saying they used to still work for you when the event data on screen vanished?
Because if that is the case then the memory read isn't doing anything that a romscript couldn't do.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#42 Post by haringpb » Tue Mar 05, 2013 10:16 am

Well the fact that you could read out the time in ms, till event start, was important for me, but if there is anouther way i would take this as well.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#43 Post by lisa » Tue Mar 05, 2013 6:36 pm

make sure your PC clock is set to a time that is atleast close to when the event time is, event starts at :10 :30 :50
then you can use this function to rest until the time for event.
So basically you want your PC time set to server time.

Code: Select all

function restTilEvent()
	local curtime = os.date("*t")
	if curtime == nil then print("failed to get time from OS") return end	-- probably not needed
	local curmins = curtime.min
	local cursecs = curtime.sec
	if curmins > 50 then
		curmins = curmins - 50
	elseif curmins > 30 then
		curmins = curmins - 30
	elseif curmins > 10 then
		curmins = curmins - 10
	else
		curmins = curmins + 10
	end
	-- should now have value of 1 to 20
	local resttime = ((20 - curmins) * 60) - cursecs
	print("resting for "..resttime.." seconds")
	yrest(resttime*1000)
end
--=== Added ===--

I was actually hoping someone would have been able to work out that all you need is this

Code: Select all

repeat
yrest(700)
until os.date("*t").min%20 == 10
Oh well =(
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#44 Post by haringpb » Wed Mar 06, 2013 6:17 am

glad that you helped out here thanks a lot

Important for those who want to work with this as you can see i didnt use 10; 30 and 50 because it is not allways the same after patch day. On top the part where it says: i curmins > x then curmins - y. Y has to be x-1 outher ways you could get a value of zero (why ever) and a yrest of -20s which would allude to an error. And you should also add a yrest(60000) at the top, to take care that not in the same minuite where the event starts it ends and you try to do it again.

Code: Select all

function restTilEvent()
   yrest(60000)
   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
   -- should now have value of 1 to 20
   local resttime = ((20 - curmins) * 60) - cursecs
   print("resting for "..resttime.." seconds")
   yrest(resttime*1000)
end

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#45 Post by haringpb » Thu Mar 07, 2013 4:39 am

Ok after a day of testing this is my script i will use:

Code: Select all

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

function restTilEvent()
   local curtime = os.date("*t")
   if curtime == nil then print("failed to get time from OS") return end   -- probably not needed
   local curmins = curtime.min
   local cursecs = curtime.sec
   local curmins = curmins%20
   print(curmins)
   	if curmins > 7 then
		local resttime = ((27-curmins)*60) - cursecs
		if resttime > 0 then
	        print("resting for "..resttime.." seconds")
		yrest(resttime*1000)
		end
  	else
  		local resttime = ((7- curmins)* 60) - cursecs
		if resttime > 0 then
                print("resting for "..resttime.." seconds")
		yrest(resttime*1000)
		end
  	end
end

function isEventFinished()
      local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
      if Count ~= 2 then
         return true
      else
         return false
      end
end


function doquest()
	if isEventFinished() == true then
    		 restTilEvent()	
		 if isEventFinished() == false then
  		 inventory:useItem("Arrowhead Carved with Name")
   	       	 RoMScript("AcceptBorderQuest()")
  		 RoMScript("ScriptBorder:Hide()")
   		 player:target_NPC("Myan Kellas")
  	 	 CompleteQuestByName("Last Luck","public")
		 end
   	else
  		 inventory:useItem("Arrowhead Carved with Name")
  		 RoMScript("AcceptBorderQuest()")
  		 RoMScript("ScriptBorder:Hide()")
  		 player:target_NPC("Myan Kellas")
  		 CompleteQuestByName("Last Luck","public")
    	end
end

</onload>

   <!-- #  1 --><waypoint x="-2699" z="-17935" y="810">
    doquest()   
   </waypoint>
</waypoints>
this is for the event starting at .:07 ..:27 and ..:57. If you have outher timers on you server you got to change all the 27 and 7.
Last edited by haringpb on Thu Mar 07, 2013 5:43 am, edited 1 time in total.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#46 Post by lisa » Thu Mar 07, 2013 4:45 am

haringpb wrote:this is for the event starting at .:07 ..:27 and ..:57. If you have outher timers on you server you got to change all the 27 and 7.
You will probably find that your PC clock is 3 minutes different to the servers clock.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#47 Post by newton666 » Thu Mar 07, 2013 6:51 pm

this way point

Code: Select all

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

function restTilEvent()
   local curtime = os.date("*t")
   if curtime == nil then print("failed to get time from OS") return end   -- probably not needed
   local curmins = curtime.min
   local cursecs = curtime.sec
   local curmins = curmins%20
   print(curmins)
      if curmins > 7 then
      local resttime = ((27-curmins)*60) - cursecs
      if resttime > 0 then
           print("resting for "..resttime.." seconds")
      yrest(resttime*1000)
      end
     else
        local resttime = ((7- curmins)* 60) - cursecs
      if resttime > 0 then
                print("resting for "..resttime.." seconds")
      yrest(resttime*1000)
      end
     end
end

function isEventFinished()
      local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
      if Count ~= 2 then
         return true
      else
         return false
      end
end


function doquest()
   if isEventFinished() == true then
           restTilEvent()   
       if isEventFinished() == false then
         inventory:useItem("Arrowhead Carved with Name")
                 RoMScript("AcceptBorderQuest()")
         RoMScript("ScriptBorder:Hide()")
          player:target_NPC("Myan Kellas")
          CompleteQuestByName("Last Luck","public")
       end
      else
         inventory:useItem("Arrowhead Carved with Name")
         RoMScript("AcceptBorderQuest()")
         RoMScript("ScriptBorder:Hide()")
         player:target_NPC("Myan Kellas")
         CompleteQuestByName("Last Luck","public")
       end
end

</onload>

   <!-- #  1 --><waypoint x="-2699" z="-17935" y="810">
    doquest()   
   </waypoint>
</waypoints>
  
 
anyone else haveing a problem with this?
it hands in the 1st quest fine but then it won't retake the arrow quest again? anyone know's what wrong

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#48 Post by lisa » Thu Mar 07, 2013 9:52 pm

I find that if you aren't sure why something isn't doing what you expect it to do then it is a good idea to add in prints so you can know for sure what it is doing, when you work out what is wrong then you can fix what ever it is =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: Script to do a waypoint if the EOJ timer doesn't show?

#49 Post by rock5 » Fri Mar 08, 2013 12:05 am

Didn't I read something about the arrow giving alternately a daily quest and then a public quest? Maybe the second time you got the daily quest.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#50 Post by lisa » Fri Mar 08, 2013 2:38 am

May aswell set it to do daily until all dailies are done anyway as you still get the event points when doing daily
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#51 Post by haringpb » Tue Mar 19, 2013 1:25 pm

So with todays patch we got the upportunity to get a chat message when event starts and when it ends. So we could do wait for startmassage, doquest till endmassage. But im not able to make the 2 functions maybe someone could help ;)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#52 Post by lisa » Fri Mar 22, 2013 12:46 am

Code: Select all

--EventMonitorStart("eventchat", "SYSTEM_MESSAGE");

-- local time, moreToCome, name, msg = EventMonitorCheck("eventchat",1)

-- if name == getTEXT("SC_ZONE_PE_3TH_FAIL") then -- event ended

-- if name == getTEXT("SC_ZONE_PE_3TH_ST1START") then -- event started
Hopefully someone else can work out where each line needs to go.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#53 Post by haringpb » Wed Mar 27, 2013 7:27 am

So i tried to do it on my own but failed this was the idea more or less stolen from the andor script but allways got an onload error:

Code: Select all

fuction doquest()					
		EventMonitorStart("eventchat", "SYSTEM_MESSAGE");
		local time, moreToCome, name, msg, _go
		repeat
			time, moreToCome, name, msg = EventMonitorCheck("eventchat",1)
			yrest(10)
			if name == getTEXT("SC_ZONE_PE_3TH_ST1START") then
				_go = true
			end
		until _go == true
		repeat
			time, moreToCome, name, msg = EventMonitorCheck("eventchat",1)
			yrest(10)
			quest()
			if name == getTEXT("SC_ZONE_PE_3TH_FAIL")
				_go = false
			end
	        until _go == false
end

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#54 Post by lisa » Wed Mar 27, 2013 8:36 am

haringpb wrote:fuction doquest()
this made me lol

should be function

I do little typos like that all the time ;)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#55 Post by haringpb » Wed Mar 27, 2013 12:35 pm

Oh man ok correctet it and at least it starts but it doesnt do anything on event start

Code: Select all

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

function doquest()               
      EventMonitorStart("eventchat", "SYSTEM_MESSAGE");
      local time, moreToCome, name, msg, _go
      repeat
         time, moreToCome, name, msg = EventMonitorCheck("eventchat",1)
         yrest(10)
         if name == getTEXT("SC_ZONE_PE_3TH_ST1START") then
            _go = true
         end
      until _go == true
      repeat
         time, moreToCome, name, msg = EventMonitorCheck("eventchat",1)
         yrest(10)
         quest()
         if name == getTEXT("SC_ZONE_PE_3TH_FAIL") then
            _go = false
         end
           until _go == false
end

function quest()
  		 inventory:useItem("Arrowhead Carved with Name")
   	       	 RoMScript("AcceptBorderQuest()")
  		 RoMScript("ScriptBorder:Hide()")
   		 player:target_NPC("Myan Kellas")
  	 	 CompleteQuestByName("Last Luck","public")
end

</onload>

   <!-- #  1 --><waypoint x="-2699" z="-17935" y="810">
    doquest()   
   </waypoint>
</waypoints>
and yeah i got this fix for the timer ingame.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#56 Post by lisa » Wed Mar 27, 2013 6:22 pm

At first glance it looks like it should work, since it isn't then it would be a good idea to add in prints so you can work out why it isn't working.

Something like this in both loops.

Code: Select all

if name then print("Name: "..name) end
if msg then print("Msg: "..msg) end
maybe pop a print between the 2 loops so you know if it has succeeded in leaving the first loop.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#57 Post by haringpb » Thu Mar 28, 2013 8:10 am

Allright i tried and i tried and i tried and it seems like time, moreToCome, name, msg = EventMonitorCheck("eventchat",1) allways gets me a nil for name.
Or in outher worlds i cant read out the gomessage from ingame.

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

Re: Script to do a waypoint if the EOJ timer doesn't show?

#58 Post by rock5 » Thu Mar 28, 2013 9:13 am

I'll clarify the command for you.

Code: Select all

time, moreToCome, arg1, arg2 = EventMonitorCheck("monitorname", argfilter)
time and moreToCome are values returned from the function. All values after the first 2 values are the values returned from the event being monitored as defined by the argfilter.

For example we typically get chat messages like so

Code: Select all

time, moreToCome, name, msg = EventMonitorCheck("chatmonitor","4,1")
So that's the "time" and "moreToCome" values plus the 4th and 1st values returned from the event which are the "message" and "sender" respectively (different events return different values).

Code: Select all

EventMonitorCheck("eventchat",1)
This returns 3 values; time, moreToCome and the 1st argument from the event which should be the message so there is no point in using 4 variables as the last varaible will always be nil. So all you need is

Code: Select all

time, moreToCome, name = EventMonitorCheck("eventchat",1)
Although "name" is a confusing name for the message. Maybe you should use this instead

Code: Select all

time, moreToCome, msg = EventMonitorCheck("eventchat",1)
Note: You have been using the number 1. I don't see any problem using a number as long as only want one returned value, because it will be converted to a string, but if you want to return more than one then make sure to make it a string like in the "chat" example above.

Now, after all that is said, I'm not sure why you always got nil. You do realize that you will only get returned values when the event is actually triggered, don't you?
  • 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

haringpb
Posts: 29
Joined: Fri Feb 22, 2013 1:19 pm

Re: Script to do a waypoint if the EOJ timer doesn't show?

#59 Post by haringpb » Thu Mar 28, 2013 10:35 am

Allright, overworked it, and got an outher idea where it could struggle....
Is EventMonitorStart("eventchat", "SYSTEM_MESSAGE") SYSTEM_MESSAGE the right filter for this?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Script to do a waypoint if the EOJ timer doesn't show?

#60 Post by lisa » Thu Mar 28, 2013 6:03 pm

It should still technically be working, the set up is almost identical to what I did in Andor Training which works perfectly.

Code: Select all

--== monitor chat
EventMonitorStart("Tortevent", "SYSTEM_MESSAGE");
local time, moreToCome, name, msg, _go 
repeat
	time, moreToCome, name, msg = EventMonitorCheck("Tortevent",1)
	yrest(10)
	if name and string.find(name,goMessage) then
		_go = true
	end
until _go == true
EventMonitorStop("Tortevent")
The addon said the message is a SYSTEM_MESSAGE, hmmm unless it is saying that because the message saying the event from the addon is saying it using SendSystemChat.
I might have another look at it.

--=== Added ===--

I must have been half asleep when I did that post, it should actually be
"CHAT_MSG_SYSTEM"
or
"WARNING_MESSAGE"

Either will probably work as it is posted in both while you are in the zone.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 8 guests