Page 3 of 4

Re: Monitoring ingame events.

Posted: Sun Jul 03, 2011 8:58 am
by rock5
If you are not using the filter just leave it out.

Code: Select all

EventMonitorStart("Crush","CHAT_MSG_SAY");

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 5:42 am
by lisa
Finally got back to this 1, yeah I deffinately need my check to ignore older messages.

Here is the story if you get messaged multiple times one after the other, The first triggers the event, after your code is finished for that event it then checks the next message, which in my case is some time later and acts according to that message.

This example I messaged bot 4 times in a few seconds using the gmmonitor, without the ignore old messages.

Code: Select all

Clearing target.
Large Mayan Plant Pot
Use MACRO: Executing RoMScript "AskPlayerInfo('lolliecharname');".

You have been whispered by: lolliecharname
Pausing for 30 seconds. Press Delete to stop the pause.
Time remaining 20 seconds.
Time remaining 10 seconds.
Time remaining 0 seconds.
reseting monitor
Use MACRO: Executing RoMScript "AskPlayerInfo('lolliecharname');".
1
grow

You have been whispered by: lolliecharname
Pausing for 30 seconds. Press Delete to stop the pause.
Time remaining 20 seconds.
Time remaining 10 seconds.
Time remaining 0 seconds.
reseting monitor
Use MACRO: Executing RoMScript "AskPlayerInfo('lolliecharname');".
Clearing target.
Large Mayan Plant Pot

You have been whispered by: lolliecharname
Pausing for 30 seconds. Press Delete to stop the pause.
Time remaining 20 seconds.
Time remaining 10 seconds.
Time remaining 0 seconds.
reseting monitor
Use MACRO: Executing RoMScript "AskPlayerInfo('lolliecharname');".

You have been whispered by: lolliecharname
Pausing for 30 seconds. Press Delete to stop the pause.
Time remaining 20 seconds.
Time remaining 10 seconds.
Time remaining 0 seconds.
reseting monitor
I had it set to rest for 30 seconds, if I had it set to 10 minutes then it would have paused for 40 minutes even though the last message was received 39 minutes earlier.
So yeah I am back to needing to be able to atleast have a time since message was received, so as to ignore old ones =)

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 5:51 am
by rock5
Maybe you could just reset it when you pause. If you restart the monitor it will clear the old log.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 8:06 am
by lisa
I was actually thinking along the lines of instead of using

Code: Select all

triggerTime = os.time()
in the ingame function, using

Code: Select all

triggerTime = GetTime()
Then we could use a single RoMScript("GetTime()") at the start of the event monitoring, do a comparison type thing to system os.Time() and then can use that calculation for comparing event time to os.Time()

so event log would have 4217.9599609375
or what ever the GetTime() returns.

Then in the bot code have this at start, just once. so maybe onload.

Code: Select all

clienttime = RoMScript("GetTime()")
systemtimedifference = some mathmatical thing (clienttime - + * os.Time())
In the event part have this

Code: Select all

local time, moreToCome, msg = EventMonitorCheck("GMdetect2", "1")
if msg ~= nil then
if 60 > somemaths(time - + systemtimedifference + - os.Time()) then 
-- do stuff.
end
end

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 8:38 am
by rock5
I'm all for changing the triggertime to GetTime().

It looks like what you wrote might work but didn't we find an address in memory that had the gettime value? We could compare against that too. Although your way might be easier to implement as long as it works.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 8:49 am
by lisa
Yeah it's just a theory atm, would need to do some testing to see how posible it is.

The address could work too, wouldn't be so hard to implement into it. Could add in a global in maybe settings with it. So it could be called upon by anything to access the ingame timer.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 9:22 am
by rock5
lisa wrote:Yeah it's just a theory atm, would need to do some testing to see how posible it is.

The address could work too, wouldn't be so hard to implement into it. Could add in a global in maybe settings with it. So it could be called upon by anything to access the ingame timer.
Although probably this will be the one and only time it's used. Normally if you want to time something you would use the rombot time functions.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 9:27 am
by wizzyslo
Somehow i cant get it to work all the time same problem:

Code: Select all

D:/micromacro/scripts/rom/classes/player.lua:669: onSkillCast error: [string "..
."]:5: bad argument #1 to 'find' (string expected, got nil)
game chat said this:
Cannot get log event for monitor 'Crush'. No such monitor name exists.

Code: Select all

  
<onSkillCast>
      
      repeat
          local time, moretocome, msg = EventMonitorCheck("Crush","1")
          if string.find(msg, "I'll crush you!") then
       	__WPL:setWaypointIndex(__WPL:findWaypointTag("away"));
          end
      until moretocome == false

   </onSkillCast>

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- # 21 --><waypoint x="1658" z="-4960" y="758" tag="teleport">
	while not RoMScript("UnitExists('party1')") do
		sendMacro('InviteByName("alt_name")'); yrest(1000)
	end  
 	EventMonitorStart("Crush","CHAT_MSG_SAY"); 
	</waypoint>
	<!-- # 22 --><waypoint x="1696" z="-5162" y="773">	
	waitForLoadingScreen(10); 
	
	if sendMacro("GetCurrentWorldMapID();") == 209 then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("teleport"));
		end
	</waypoint>	
	<!-- #  1 --><waypoint x="1771" z="2880" y="433">	</waypoint>
	<!-- #  2 --><waypoint x="1900" z="2873" y="433">	</waypoint>
	<!-- #  3 --><waypoint x="2116" z="2605" y="432">
	changeProfileOption("HARVEST_DISTANCE", 80);  
	yrest(2000);
	keyboardPress(key.VK_SPACE);
	</waypoint>
	<!-- #  4 --><waypoint x="2255" z="2409" y="401">	</waypoint>
	<!-- #  5 --><waypoint x="2395" z="2484" y="401" tag="away"> yrest(500)	</waypoint>
	<!-- #  4 --><waypoint x="2255" z="2409" y="401">	__WPL:setForcedWaypointType("NORMAL");	</waypoint>
	<!-- #  6 --><waypoint x="2215" z="2495" y="401">	EventMonitorStop("Crush");	</waypoint>
	<!-- #  7 --><waypoint x="1901" z="2870" y="433">	</waypoint>
	<!-- # 8 --><waypoint x="1700" z="2885" y="433">	waitForLoadingScreen(10);	</waypoint>
	</waypoints>
Should IGF write some word on chat?? I sow only "igf Event Monitor loaded." and that worning at error.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 9:35 am
by rock5
And another thing Lisa, I still don't think it's really needed. You should regularly check your messages or reset the monitor when starting to check it again.

And I been thinking about how you pause when you receive a message. Your problem is because you stop checking for messages. What if you continued checking and clearing messages while you're waiting?

Let's say you want to wait 10 minutes from the last message received. Let's say you recieve 3 messages separated by 1 minute intervales. When you get the first message you start the pause but continue checking messages. When you get the second message you reset the timer to zero and continue waiting. The same with the third message. Then 10 minutes after the 3rd message you go again having waited 12 minutes. No need to check the message time.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 9:42 am
by lisa
The issue I had before using the ignore old messages was that if I don't have the bot stuck in a loop for the set time it starts to move, even just 1 step.
That is enough for a GM to think you are actually a bot if you don't reply to their messages. Any movement is a sign of being at keyboard, at keyboard and not replying to a GM in their mind means your a bot.

wizzy add in a check to see if their is a message or not

Code: Select all

<onSkillCast>
      
      repeat
          local time, moretocome, msg = EventMonitorCheck("Crush","1")
if msg ~= nil then
         if string.find(msg, "I'll crush you!") then
          __WPL:setWaypointIndex(__WPL:findWaypointTag("away"));
          end
end
      until moretocome == false

   </onSkillCast>

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 10:34 am
by wizzyslo
If i add I get only spamming on chat: "Cannot get log event for monitor 'Crush'. No such monitor name exists." nothing else. Somehow it doesnt start monitor.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 11:02 am
by rock5
wizzyslo wrote:If i add I get only spamming on chat: "Cannot get log event for monitor 'Crush'. No such monitor name exists." nothing else. Somehow it doesnt start monitor.
That's because the monitor wont start until you get to the waypoint where it starts but the monitor is checked every time you cast a skill.

Re: Monitoring ingame events.

Posted: Mon Jul 04, 2011 11:35 am
by wizzyslo
It should start it at 1st waypoint ( # 21) after making party.
I added it at 2nd, 3rd waypoint but dont help. Only if i write it wrong.

Re: Monitoring ingame events.

Posted: Tue Jul 05, 2011 1:04 am
by rock5
wizzyslo wrote:It should start it at 1st waypoint ( # 21) after making party.
I added it at 2nd, 3rd waypoint but dont help. Only if i write it wrong.
Does it keep doing the error or only just at the start? Because I think the bot applies buffs before going to the first waypoint so you will always get that message after the initial buff casts.

Re: Monitoring ingame events.

Posted: Tue Jul 05, 2011 5:44 am
by wizzyslo
Allways does that error no matter on which waypoint it is.

Re: Monitoring ingame events.

Posted: Tue Jul 05, 2011 6:32 am
by lisa
Easiest/Best solution is probably to just check the boss is your target before checking eventmonitor.

Code: Select all

<onSkillCast>
    --  if target.Name = "boss guy" then
      repeat
          local time, moretocome, msg = EventMonitorCheck("Crush","1")
if msg ~= nil then
         if string.find(msg, "I'll crush you!") then
          __WPL:setWaypointIndex(__WPL:findWaypointTag("away"));
          end
end
      until moretocome == false
    --  end
   </onSkillCast>
Obviously that code won't work, I am at work so can't spend any time of doing the actual code but you get the idea.

Re: Monitoring ingame events.

Posted: Fri Jul 08, 2011 3:14 am
by wizzyslo
In which folder or file is addon saving events? Maybe at that way i can find what is wrong. My idea is that file where events should be saving dont exist or bot doesnt make it.

Re: Monitoring ingame events.

Posted: Fri Jul 08, 2011 4:56 am
by lisa
change bossguy to name of the boss and see if this fixes your issue.

Code: Select all

<onSkillCast>

local target = player:getTarget();

    if target and target.Name = "bossguy" then
printf("targeting mad mallen\n")
      repeat
          local time, moretocome, msg = EventMonitorCheck("Crush","1")
if msg ~= nil then
         if string.find(msg, "I'll crush you!") then
          __WPL:setWaypointIndex(__WPL:findWaypointTag("away"));
          end
end
      until moretocome == false
else
printf("Using skill but not targeting mad mullen or the name is incorrect.\n")
     end
   </onSkillCast>
With this it will print on MM if targeting him or if not targeting him. If you are targeting him and you get the not targeting print then the name is incorrect.

Re: Monitoring ingame events.

Posted: Fri Jul 08, 2011 12:14 pm
by MiesterMan
Atm this works for getting GetTime():

Code: Select all

memoryReadDoublePtr(getProc(),0x00606FF2,0)
Again, the value I gave before was right before a patch. In this case the address listed above is actually where the variable is declared in the executable and is right before the function if you'd like to write a pattern match for it.

Re: Monitoring ingame events.

Posted: Fri Jul 08, 2011 1:08 pm
by lisa
I just tested event monitor for first time since patch. For some reason it's not working for me. I'll have a look into it maybe tomorrow.