Monitoring ingame events.

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: Monitoring ingame events.

#21 Post by lisa » Wed Jun 29, 2011 11:44 pm

Originally I have this to deal with old messages

Code: Select all

local time, moreToCome, name, msg = EventMonitorCheck("GMdetect", "4,1")
--lots more code
-- 
--
	EventMonitorStart("GMdetect2", "CHAT_MSG_SYSTEM");
		if (43140 + 60) >= os.time() - time then -- (43140 + **) ignore messages that are more then ** seconds ago.
        sendMacro("AskPlayerInfo(\'"..name.."\');")
I got the 43140 purely by testing the time that the addon returned and did comparison to os.time() which now seems like a bad way to do it, very bad lol
It would work on my machine for my time but probably not for others.
I should really just do a comparison of time to time instead of trying to use os.time()

I'll have a play with it and see what I come up with.
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: Monitoring ingame events.

#22 Post by rock5 » Thu Jun 30, 2011 12:12 am

Yeh I doubt it would be the same fo everyone. I got a difference of 50437. I'd even be surprised if it's the same for you after you've restarted the computer and game. To be sure you would have to get the os.time from the game which is what I don't like. That's a RoMScript for every check.

Wouldn't it solve your problem if the ingamefunctions returned the age of the message instead of the time of the message? Do we need the time of the message?
  • 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: Monitoring ingame events.

#23 Post by lisa » Thu Jun 30, 2011 12:22 am

I don't need time of message at all, just age is enough.
It is purely so it doesn't check old messages that have already been checked.

If you imagine a bot running for 6 hours, in the first 4 hours your friends keep trying to contact you and message all sorts of hello's. Then a GM messages you because you've been im millers for 5 hours straight. Without ignoring old messages it would be checking through all of the previous messages aswell and doing a RoMScript for every single message to get the player info to check if they are actually a GM.

So yeah short story is age of message is all that is required.
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: Monitoring ingame events.

#24 Post by rock5 » Thu Jun 30, 2011 12:59 am

lisa wrote:I don't need time of message at all, just age is enough.
It is purely so it doesn't check old messages that have already been checked.
You don't have to worry about that. Messages that are returned are deleted from the log. You wont ever get the same message twice.
lisa wrote:If you imagine a bot running for 6 hours, in the first 4 hours your friends keep trying to contact you and message all sorts of hello's. Then a GM messages you because you've been im millers for 5 hours straight. Without ignoring old messages it would be checking through all of the previous messages aswell and doing a RoMScript for every single message to get the player info to check if they are actually a GM.
So what happens in this case is when you check your messages after your friends have tried to contact you, those messages get cleared from the log. When the gm messages you, it should be the only message in the log.

You shouldn't have any problems with big logs if you check your messages regularly.
  • 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: Monitoring ingame events.

#25 Post by lisa » Thu Jun 30, 2011 2:33 am

Hmm I seem to remember having issues when I didn't use the timer.

Basically it is set up to monitor for any whispers, timer is 5 seconds.
If there is a whisper It then starts another monitor for system chat.
then does the in game function for checking player info.
checks that second monitor for indications of being a GM and acts accordingly.
ends second monitor and just keeps with first montor of whispers running 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

wizzyslo
Posts: 119
Joined: Sun Nov 01, 2009 6:09 pm

Re: Monitoring ingame events.

#26 Post by wizzyslo » Thu Jun 30, 2011 4:11 am

rock5 wrote:Firstly, have you read the wiki?
http://www.solarstrike.net/wiki/index.p ... _Functions
How should i know what some parts mean if i didnt look on wiki? But some things i'm not understand becouse i'm asking.

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Monitoring ingame events.

#27 Post by MiesterMan » Thu Jun 30, 2011 6:17 pm

I dunno if this helps but I'm showing address 0x9E3C30 as the current value of what is returned by: RoMScript("GetTime();");

I know event timing is different but I could never really understand it. Based on iterators or something wierd?

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

Re: Monitoring ingame events.

#28 Post by rock5 » Thu Jun 30, 2011 9:52 pm

MiesterMan wrote:I dunno if this helps but I'm showing address 0x9E3C30 as the current value of what is returned by: RoMScript("GetTime();");

I know event timing is different but I could never really understand it. Based on iterators or something wierd?
This is a great idea, why didn't I think of it? That address seems no good though. Mine doesn't show the time at that address. I did a search myself and found 3 addresses. One is a static address 0x9A8288 which is about 1 second behind what GetTime() reports. One is a pointer value 0x9C57EC offset 0xE14 which is closer but not exact. And the last is a really low value 0x18EDE4 which isn't static but I think the low value would put it outside the games memory region. I looked for a pointer for it and came up with 0x9B596C and offsets 0x88 and 0x7AC.

If I print all 3 and GetTime() at the same time the last one exactly matches GetTime() so maybe the game gets the time from the system?

If I'm to use any of these I need to know which is reliable. Can someone try the above 3 addresses and see if it shows the time as returned by GetTime()?
So that's,
Address 0x9A8288
Address 0x9C57EC Offset 0xE14
Address 0x9B596C Offsets 0x88 and 0x7AC
  • 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: Monitoring ingame events.

#29 Post by lisa » Thu Jun 30, 2011 11:09 pm

any chance of a commandline script to print from the memory address =)
At work so haven't got the time to go through CE and such but a simple print of the addresses might be enough.
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: Monitoring ingame events.

#30 Post by rock5 » Fri Jul 01, 2011 1:52 am

lisa wrote:any chance of a commandline script to print from the memory address =)
At work so haven't got the time to go through CE and such but a simple print of the addresses might be enough.
That was awhile ago but luckily I haven't closed the micromacro window I was working in and the command is still onscreen.

Code: Select all

print(RoMScript("GetTime()")) print(memoryReadFloat(getProc(),0x18ede4)) print(memoryReadFloat(getProc(), 0x9a8288)) print(memoryReadFloatPtr(getProc(),0x9c57ec, 0xe14))
  • 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: Monitoring ingame events.

#31 Post by lisa » Fri Jul 01, 2011 2:00 am

Code: Select all

3836.9089355469
0
3836.2905273438
0

Code: Select all

4161.9267578125
0
4161.029296875
0

Code: Select all

4217.9599609375
0
4216.8745117188
0

Code: Select all

4288.2548828125
0
4287.2641601563
0
did straight copy paste of the code you just posted.
gap between 1st and third varies but 2nd and 4th returned 0.
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Monitoring ingame events.

#32 Post by lisa » Fri Jul 01, 2011 2:08 am

I adjusted operating system time and got this

Code: Select all

4347.2299804688
0
4346.2827148438
0
Both were less then last print, so it deffinately seems to go by the OS clock.

Edit:: I am blind, times weren't before previous at all. So ignore that bit =(
Last edited by lisa on Mon Jul 04, 2011 6:03 am, edited 1 time in total.
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: Monitoring ingame events.

#33 Post by rock5 » Fri Jul 01, 2011 3:54 am

On second look I think that was the wrong command I sent you.

But at least we know now that static address was good but the first pointer address wasn't. That just leaves the pointer to the low address.

After lots of testing it looks like I can't get a reliable address for it. I guess that just leaves the static address 0x9a8288.

That means we can have the ingame function save the time using GetTime() and compare it against the time stored at this address. No need to need to use extra romscripts.
  • 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

sfrattini
Posts: 35
Joined: Wed Jun 03, 2009 3:45 pm

Re: Monitoring ingame events.

#34 Post by sfrattini » Fri Jul 01, 2011 7:07 pm

wizzyslo wrote:
rock5 wrote:Firstly, have you read the wiki?
http://www.solarstrike.net/wiki/index.p ... _Functions
How should i know what some parts mean if i didnt look on wiki? But some things i'm not understand becouse i'm asking.
Hi,

I thought I knew how to use micromacro rom (I can bot inis, sell, travel, fly, use ingame macro etc...) until I got here and started to try this function.
I have tried 50 times and at the end I agree with wizzyslo, Wiki is not clear enough on this.
Would it be possible to post a Noob friendly working sample of a boss monitoring SAY_CHAT and performing an action based on specific text?
With clear indication on where to put and what to put ?

Thanks in advance and sorry for this, I enjoy the bot but this gets a bit too much complicate for my poor scripting skills.

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Monitoring ingame events.

#35 Post by MiesterMan » Fri Jul 01, 2011 8:23 pm

Sorry, I didn't do a lot of testing with this. I checked in on two client and they both had it. I also did a search in OllyG and there was a func that wrote to the address so I assumed it was the static. I can't remember if this was before the last patch or not but that could also be a factor.

One big problem with this kind of address scanning is that it's a very small grouped piece of info so I'm guessing it would be hard to find a pattern to match for it. Similar to the "Quests Completed" byte I found. After next patch, the pointer and the offset could be completely different and I'd have to manually search again because I wasn't smart enough to understand admin's very user friendly pattern matching tutorial (I just don't know enough about assembly :().

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

Re: Monitoring ingame events.

#36 Post by rock5 » Sat Jul 02, 2011 5:17 am

sfrattini wrote:Hi,

I thought I knew how to use micromacro rom (I can bot inis, sell, travel, fly, use ingame macro etc...) until I got here and started to try this function.
I have tried 50 times and at the end I agree with wizzyslo, Wiki is not clear enough on this.
Would it be possible to post a Noob friendly working sample of a boss monitoring SAY_CHAT and performing an action based on specific text?
With clear indication on where to put and what to put ?
For starters, these fiunctions aren't meant for beginner programmers. Basically if you don't know what I'm talking about then you don't have the skill to use them. You also need to understand about ingame events and event monitoring. Ingame addons can monitor certain events and act on them. My ingamefunctions event addon alows the bot to tell it what events to monitor. It then monitors those events and logs the events when they are triggered. The bot then needs to retrieve entries in the ingame log and act on them. When entries are retrieved they are deleted so you don't need to delete it after retrieving it. When an event is triggered a bunch of arguments are returned based on the event. These arguments are what gets logged as well as the time of the event.

So here's how you use it;
  • First you have to tell the ingame function to start monitoring the event. In this case you probably want to monitor CHAT_MSG_SAY. You can find a list of events and their returned arguments here. http://www.theromwiki.com/List_of_Events.

    Code: Select all

    EventMonitorStart("BossSaid","CHAT_MSG_SAY",",,,BossName")
    The ingame event monitor will now log any chat messages from "BossName" under the name of "BossSaid" .Where you start monitoring will depend. In this case you could do this command at a waypoint before reaching the boss.
  • Then you need to regularly check for messages. Again where you do this will depend. Mainly it will depend on how frequently you need to check it. Lets say you check them onLeaveCombat. Of all the arguments returned by the event you are only interested in the message itself which is the first argument therefore we will use a filter of "1" to return only the first argument.

    Code: Select all

    local time, moretocome, msg = EventMonitorCheck("BossSaid","1")
    if string.find(msg, "string to match") then 
        -- Boss said it, react!
        -- Take action here
    end
    Because there might be more than one message in the log then to check all messages do.

    Code: Select all

    repeat
        local time, moretocome, msg = EventMonitorCheck("BossSaid","1")
        if string.find(msg, "string to match") then 
            -- Boss said it, react!
            -- Take action here
        end
    until moretocome == false
  • Finally, to stop monitoring the event after the boss fight, at a waypoint after the boss use

    Code: Select all

    EventMonitorStop("BossSaid")
  • 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

sfrattini
Posts: 35
Joined: Wed Jun 03, 2009 3:45 pm

Re: Monitoring ingame events.

#37 Post by sfrattini » Sun Jul 03, 2011 1:37 am

Thanks Rock. let's see if I got it right...my intention is to try to bot Okander "Mad Man" Mallen for meme.
Whenever he casts the crush skill he says "I'll crush you!". So what I have been trying to do is to run event monitor on SAY and check it on skillCast (during battle), but still no luck.
Question: EventMonitorStart("Crush","CHAT_MSG_SAY",",,,Okander"); does this name needs to be exactly like Boss name? if yes, how can I use the quotes in the name without screwing up the function?
Also, I have PRIEST_HOLY_AURA skill defined in profile as requested...Please have a look at the code below, thanks again.

Code: Select all

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

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

	</onSkillCast>

	<!-- #  1 --><waypoint x="1910" z="2849" y="433">	</waypoint>   -- INI entrance
	<!-- #  2 --><waypoint x="1972" z="2779" y="433">	</waypoint>
	<!-- #  3 --><waypoint x="2014" z="2731" y="433">	</waypoint>
	<!-- #  4 --><waypoint x="2205" z="2502" y="401">
	EventMonitorStart("Crush","CHAT_MSG_SAY",",,,Okander");
	
								</waypoint>
	<!-- #  5 --><waypoint x="2315" z="2388" y="401">	
	yrest(1000);
								</waypoint>		-- get aggro here

	<!-- #  4 --><waypoint x="2205" z="2502" y="401">	</waypoint>
	<!-- #  3 --><waypoint x="2014" z="2731" y="433">	</waypoint>
	<!-- #  2 --><waypoint x="1972" z="2779" y="433">	</waypoint>
	<!-- #  1 --><waypoint x="1910" z="2849" y="433">	
	EventMonitorStop("Crush");	
							</waypoint>  -- INI exit

</waypoints>

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

Re: Monitoring ingame events.

#38 Post by lisa » Sun Jul 03, 2011 1:49 am

Without looking into if it is all correct, you must know one thing

Code: Select all

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

   </onSkillCast>

goes into your profile, not your waypoint file.
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: Monitoring ingame events.

#39 Post by rock5 » Sun Jul 03, 2011 4:33 am

I think the name does need to be exact. You can use,

Code: Select all

EventMonitorStart("Crush","CHAT_MSG_SAY",",,,Okander \"Mad Man\" Mallen "); 
  • 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

sfrattini
Posts: 35
Joined: Wed Jun 03, 2009 3:45 pm

Re: Monitoring ingame events.

#40 Post by sfrattini » Sun Jul 03, 2011 7:50 am

Hi,

it took me a bit of tweaking but I made it work!
Regarding the name, I removed it from the arguments and it seems the function is simply checking anything on SAY.

Code: Select all

EventMonitorStart("Crush","CHAT_MSG_SAY",",,,");
I see this going between 30-40 meme /hour with a 5-10% death possibility, still not best but worth the effort I think.
Thanks guys u the best ;)
Last edited by sfrattini on Sun Jul 03, 2011 9:43 am, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest