Need some explanations about RoM and LUA

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#21 Post by BillDoorNZ » Tue Nov 15, 2011 8:19 pm

the code I indicated:

Code: Select all

/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "test")
should get picked up by your monitor (if it is monitoring for CHAT_MSG_SYSTEM). I just tested it and it works as I was expecting.

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

Re: Need some explanations about RoM and LUA

#22 Post by lisa » Tue Nov 15, 2011 8:22 pm

What exactly are you trying to send from game to MM?

Are you just trying to send a message to MM when an event occurs?
Are you trying to send specific information from game to MM?


I think what ever you are trying to do can be done in an easier way.
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

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#23 Post by BillDoorNZ » Tue Nov 15, 2011 8:28 pm

I believe he is trying to run execute some code while still in the rom game window to display what a specific mob drops.

The idea being that he has a mysql database with said mobs and what phat lootz etc they drop. In the game, he types some stuff to trigger said function which sends the results to the chat window. At least, thats what I think he's trying to do.

I suggested he use the monitor stuff to trigger it as I don't know of any other way to tell the bot to run a function (and he has to pass an id through - tho - he could just target it I guess and do the global key catch thing). Not sure that the bot wouldn't attack tho - if he targetted it. Perhaps something similar to you partyDPS function that he just chucks up a raid target on could work too.

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

Re: Need some explanations about RoM and LUA

#24 Post by lisa » Tue Nov 15, 2011 8:43 pm

So you want the loot to be displayed in MM and you get the loot info from a seperate database?
Is the database set up to use the mob ID's we get from memory?

You can do this quite easily all within MM and not even bother with using in game addons.

You could set up a WP to be in a loop and it just checks target Id's and displays the info from the database. Can create a table and add mob Id's to it as bot targets mobs and check the table when targeting mobs and if current mob ID is in table then don't display info, that way you don't just spam MM window with the same info over and over. Can also use same coding that is in getID.lua which displays info but doesn't keep printing the info, so new info is posted in same place in MM as old info.

If you specifically just want it for boss fights you can do a check of target HP first before doing any other code.

If you don't want it automated then just use the keypress code I posted earlier.

I don't see a need to use any coding in game at all for this.
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

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#25 Post by BillDoorNZ » Tue Nov 15, 2011 8:48 pm

lol,

I think he wants the mob drop data to be sent to the CHAT window IN the game CLIENT - not the MM window.

He has a separate MySQL db he is using - I have no idea what is in it or if it has lots of stuff from romDB's online etc.

My idea of what he wants is:

1) he sees a mob and wants to know what loot he can get off it
2) he presses a key to send a request to the bot to run his function using said mob
3) his function hits mysql for the data and then sends it to the CHAT window in-game for him to see.

You raised some good points tho - really, it should just be a key-press as you mentioned in a previous post - he can just run a waypoint that scans for the correct keypress. When it does, get the player.target and run his function with that.

User avatar
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#26 Post by Zangetsu » Tue Nov 15, 2011 8:51 pm

BillDoorNZ wrote:the code I indicated:

Code: Select all

/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "test")
should get picked up by your monitor (if it is monitoring for CHAT_MSG_SYSTEM). I just tested it and it works as I was expecting.
Returning nil in the MM window here.
lisa wrote: What exactly are you trying to send from game to MM?
Are you just trying to send a message to MM when an event occurs?
Are you trying to send specific information from game to MM?

I think what ever you are trying to do can be done in an easier way.
I'm sure it is lisa xD

To summarize, I want to type in RoM SomeFunction(1, 2, 3)
Then MM grab it and execute a script and without sending anything to the RoM server (no trace)

It seems it was possible with EventMonitor, but this isn't working when you are entering a system message and trying to grab. Working with say, that's probably because SystemMsg (typed from the client) is client side only and Say is sent to the server. SystemMsg is kinda like an echo it seems.

If you have a better idea, I'd be glad to hear you.

BillDoorNZ wrote:I believe he is trying to run execute some code while still in the rom game window to display what a specific mob drops
...
- if he targetted it. Perhaps something similar to you partyDPS function that he just chucks up a raid target on could work too.
Yeah, it's just a part of all I want to do. But the required thing to work is:

Type a command or something in the game (even displaying it in the chat window or whatever until it's not sent to the server)
MM grab this information (it's just running with a CommandLine.xml like) and after some parsing on my script, I'm executing LUA code.


All of this is working beside the Rom > MM part

User avatar
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#27 Post by Zangetsu » Tue Nov 15, 2011 9:12 pm

I know it seems pretty weird idea, but the project is similar to Bill's one.

I will make a simple way to share WPs and scripts interfaced with a database.

The idea in the future is that people could do things like:

Search WP by item drop. (ex: SearchWPByItem("SomeItem")
Then it will check the database (via LUA scripts) and check predesigned WPs file with this kind of drops and add WPs file from a hotspot to this place of farm (with mobs that drop his wanted items). It will queue all needed WPs to do:
Hotspot > Farm > Come back to hotspot at the end > Check if full > go to marchant
and
Hotspot > Farm > If full come back at hotspot > Check if full > go to marchant

Or even the same with quests (SearchWPByQuest("QuestName")

And the most important thing it's to lauch it from a different account/machine of the bot.
Machine A is botting
Machine B is playing and sending command (with a CommandLine.xml like and executing LUA scripts)

The worst is, I have the knowledge to do all of this beside finding a solution to make MM catching something like a function with parameters from RoM
All is already tested (the background part as well) but I'm stuck on this part.

I hope you're interested having things like that

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#28 Post by BillDoorNZ » Tue Nov 15, 2011 9:14 pm

something is wrong with your setup if you are not getting triggered on

Code: Select all

/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "test")
I assume the bot is running when you do it?

So your WP file is something like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
function MyFunction()
	local time, moreToCome, name, msg = EventMonitorCheck("MyFunctionEvent", "4,1")
	if time ~= nil then
		cprintf(cli.yellow, msg);
	end
end

function startTest()
      unregisterTimer("MyFunctionTimer");
      printf("MyFunctionTimer started\n");
      EventMonitorStart("MyFunctionEvent", "CHAT_MSG_SYSTEM");
      registerTimer("MyFunctionTimer", 1000, MyFunction);
end

startTest();
</onLoad>
</waypoints>
When you run it, does it print:

MyFunctionTimer started

in the MM window?

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#29 Post by BillDoorNZ » Tue Nov 15, 2011 9:18 pm

also try it with something like:

Code: Select all

/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "1", "2", "3", "4")
in case its getting the wrong parameter

User avatar
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#30 Post by Zangetsu » Tue Nov 15, 2011 9:56 pm

The first is crashing

The second is returning 1


It means instead using EventMonitor to parse a CHAT_MSG_SYSTEM like MyFunction() and sending a

Code: Select all

/script SendSystemChat("MyFunction()")
I'll have to do

Code: Select all

/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "MyFunction()", "2", "3", "4")
at the place of the "1" because it was returning 1.

Or I didn't understood the way you'll take?

Edited, sorry forgot Code tags.

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#31 Post by BillDoorNZ » Tue Nov 15, 2011 10:06 pm

yup,

sounds like your getting it sorted now :)

Code: Select all

/script SendSystemChat("sdfsfdf")
just adds the text to the system chat frame locally. It all executes locally within the game client, which is why there is no event raised either. The System part of SendSystem[/]Chat indicates which type of log message it is going to be as opposed to it being a System function / event.

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

Re: Need some explanations about RoM and LUA

#32 Post by lisa » Tue Nov 15, 2011 10:21 pm

Ok now it makes more sence, I knew there was a lot more to it then just displaying drop info from a mob lol

First make sure the event monitoring is working for you.
Head to me GM detect topic and you will find a WP to test event monitoring.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2516

If you want to send info from 1 character to another then you will no doubt have to use whispers as yes the SendSystenChat is client side and the other character won't see it. If you are playing 1 character then sending whispers is pretty easy.

Monitoring whispers is very easy and you can check out the GMdetect for how it monitors whispers and then it monitors system chat aswell.

Keep in mind whispers are logged by the server so there is a record of whispers, obviously a GM would need to know what they are searching for though. They don't sit there just reading through thousands of whispers all day long. So don't do something like. "Load BoT item:Frogs legs" because they no doubt already have a monitor set up for the word "bot".

Having said all that, are you going to be offering this service free to people?
I don't mind helping people but if you intend to take this project that we have created and then just add a few features and then try to charge people to use it then my help stops here.
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
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#33 Post by Zangetsu » Tue Nov 15, 2011 10:39 pm

Ok then it's a big line of code lol
/script igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "MyFunction()", "2", "3", "4")
Just wow, imagine with 3-4 parameters xD

Nvm, I'm typing something in the game and getting it in MM.


Now, I have to do some tweaks and if you got any ideas like previously, I'm happy to hear it!

How to make an xml file that doing nothing beside "capturing" previous command without "botting". For now I have an ugly this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
function MyFunction()
   local time, moreToCome, name, msg = EventMonitorCheck("MyFunctionEvent", "4,1")
   if time ~= nil then
      cprintf(cli.yellow, msg .. "\n");
   end
end

function startTest()
      unregisterTimer("MyFunctionTimer");
      printf("MyFunctionTimer started\n");
      EventMonitorStart("MyFunctionEvent", "CHAT_MSG_SYSTEM");
      registerTimer("MyFunctionTimer", 1000, MyFunction);
end

startTest();
yrest(30000000); -- This is ugly
</onLoad>
</waypoints>
But once we reach it, it might fuck up the whole thing. Moreover I have something strange I can't tell: When I opened the chatlog to type the command, I have "g" being typed other and other which is embarassing.
If I just let the chat input opened, it's typing "g" then prolly escape because it's closing the chat input.

Any idea?

We're getting closer and closer :D Thanks a lot for your really handful help Bill :)



Oh Lisa just posted, Imma going to quote her :P
lisa wrote: First make sure the event monitoring is working for you.
Head to me GM detect topic and you will find a WP to test event monitoring.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2516
It's on ;)
lisa wrote: If you want to send info from 1 character to another then you will no doubt have to use whispers as yes the SendSystenChat is client side and the other character won't see it. If you are playing 1 character then sending whispers is pretty easy.

Monitoring whispers is very easy and you can check out the GMdetect for how it monitors whispers and then it monitors system chat aswell.
TBH, that was my first idea, but I don't like the fact it's sent on the server. But it seems you didn't get exactly the procedure.
I'm not trying to send directly to the other char.
It's more like
CharLegit > input "functions" in SystemChat > MM monitoring it > Function = execute this LUA script > updating the database

and

BotChar > every X time MM is launching a function to see what's new on database > get the new thing > execute the appropriate LUA scripts


By this way, you aren't "recorded" on RoM servers, then you're "fine"

lisa wrote: Having said all that, are you going to be offering this service free to people?
I don't mind helping people but if you intend to take this project that we have created and then just add a few features and then try to charge people to use it then my help stops here.
Nah, I'm going to use your free resources and make people pay a LOT! :O
Seriously, of course Lisa, It will be free, I want to bring things I can bring like you did. I like your community and the time you're spending on developpement. I just want to be usefull since I have some knowledge.
I didn't wanted to talk about this project before because it's a HUGE task and didn't want to make people waiting.

Then don't worry, I'm not here for money. I'm playing RoM since 2-3 weeks waiting another MMO. I really liked the LUA part, I found your website and I start learning LUA.

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#34 Post by BillDoorNZ » Tue Nov 15, 2011 11:00 pm

try this instead - just loop endlessly with yrest in the loop.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
function MyFunction()
   local time, moreToCome, name, msg = EventMonitorCheck("MyFunctionEvent", "4,1")
   if time ~= nil then
      cprintf(cli.yellow, msg .. "\n");
   end
end

function startTest()
      unregisterTimer("MyFunctionTimer");
      printf("MyFunctionTimer started\n");
      EventMonitorStart("MyFunctionEvent", "CHAT_MSG_SYSTEM");
      registerTimer("MyFunctionTimer", 1000, MyFunction);
end

startTest();

while (true) do
  yrest(100); 
end;
</onLoad>
</waypoints>

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

Re: Need some explanations about RoM and LUA

#35 Post by lisa » Tue Nov 15, 2011 11:02 pm

Guild Wars 2?
Yeah not sure when it will be released =(

So you want the communication to be done through your sql?
So when something in your database changes then the bot does something else? So you would need to be monitoring the database and not game chat.
I think I am starting to be less clear as to what you want lol

Zangetsu wrote:yrest(30000000); -- This is ugly
LMAO

Code: Select all

while (true) do
yrest(2000)
end
Will just be an indefinate loop until script is stopped.


Ok database has lots of info on it.
Bot character decides it wants to go farm some wolf tails, checks the database and loads a WP to farm them.
So in order for the Bot character to decide this you want to tell it to do it from another character in game? So you want to type a message in game that MM registers and then sends that info via sql to then tell the other bot what to farm?

The using database to load specific WP depending on what items need farming should be simple enough.

Seems to me like you are putting a lot of effort into being able to bot remotely, does this have to do with botting from a server machine?
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
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#36 Post by Zangetsu » Tue Nov 15, 2011 11:03 pm

Yeah, thought about this right after re-reading my post but thanks :p
It seems there is no better solution to make it "idle"

Still searching about the "g" key :lol:

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#37 Post by BillDoorNZ » Tue Nov 15, 2011 11:07 pm

that 'funny stuff' is the bot pressing the 'G' key automatically. if you have a chat window open, it gets the G keypress too :)

the bot will also close the chat window automatically :)

trying ot chat while the bot is running never works. believe me, I've tried. I always end up pressing the End key to pause the bot, type my stuff, then press the Delete key to resume it.

An alternative would be to add a new method to the igf addon which does the whole lot for you. e.g.

Code: Select all


function igf_RunMyFunction()
  local target_name = UnitName("target");
  
  igf_events:OnEvent(nil, "CHAT_MSG_SYSTEM", "MyFunction()", target_name, "", "")
end


BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#38 Post by BillDoorNZ » Tue Nov 15, 2011 11:10 pm

I suspect you are trying to do a few things which is where we are getting confused.

From what I can tell, you wanna use this 'function' to push data into the DB. So you would kill a mob, see what it drops and use this stuff to add that to the database.

at some later point, you will use all that info to help build your waypoints etc and determine which files to use when your 'bot' is queried.

Is that right? or am I getting to confused now too?

User avatar
Zangetsu
Posts: 56
Joined: Fri Nov 11, 2011 5:45 pm

Re: Need some explanations about RoM and LUA

#39 Post by Zangetsu » Tue Nov 15, 2011 11:11 pm

lisa wrote:Guild Wars 2?
Yeah not sure when it will be released =(
Maybe, but waiting SWToR

lisa wrote: So you want the communication to be done through your sql?
Yeah, using my server instead passing commands via the game server, it's safer :)
lisa wrote: So when something in your database changes then the bot does something else? So you would need to be monitoring the database and not game chat.
I think I am starting to be less clear as to what you want lol
It will be more complicated and more stuffs but, yeah basically it's "checking" what he's supposed to do.


lisa wrote: Ok database has lots of info on it.
Some for now, but it will grow up really fast. More bots are farming, more the database will grow up :)

lisa wrote: Bot character decides it wants to go farm some wolf tails, checks the database and loads a WP to farm them.
So in order for the Bot character to decide this you want to tell it to do it from another character in game? So you want to type a message in game that MM registers and then sends that info via sql to then tell the other bot what to farm?
It's not the bot who decide, it's the human who update the database and it can be done via:
- The game on another PC / another character
- A website
- An tool installed on a smartphone or whatever having internet

lisa wrote: The using database to load specific WP depending on what items need farming should be simple enough.
Well not only, it will be possible to make the bot do a lot of stuff, like doing some quests, go farm this instance, invite someone, craft.
Having the remote feature + SQL make a lot of possibilities with your MM.
lisa wrote: Seems to me like you are putting a lot of effort into being able to bot remotely, does this have to do with botting from a server machine?
Of course no, this is the "HOT" feature, you can do anything permited with MM from everywhere you have internet.

So, Deal? :lol:

BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Need some explanations about RoM and LUA

#40 Post by BillDoorNZ » Tue Nov 15, 2011 11:14 pm

you could possibly also automate the whole thing by looking at the way lootomatic and lootfilter++ auto-loot from corpses. That way, when they open the loot frame and do their thing, you could grab a list of the loot and the mob and then send that.

Post Reply

Who is online

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