Page 1 of 1

Yes/No Dialogue Box?

Posted: Fri Aug 26, 2011 12:14 pm
by grande
In Logar, I want to use Tex to buy and use a horse. I can get the part to select a 300 gold horse and I know how to implement code to mount the horse but I can't get the part in the middle where the dialogue box pops up saying "yes" or "no" to actually buy the horse.

Is there a "speakframe" command or something to select yes? Trying to avoid using mouse clicks. Yes, I looked all over on wiki and stuff for speakframe ideas.

Thanks for any help/links.

Re: Yes/No Dialogue Box?

Posted: Fri Aug 26, 2011 2:17 pm
by SpiralV
grande wrote:In Logar, I want to use Tex to buy and use a horse. I can get the part to select a 300 gold horse and I know how to implement code to mount the horse but I can't get the part in the middle where the dialogue box pops up saying "yes" or "no" to actually buy the horse.

Is there a "speakframe" command or something to select yes? Trying to avoid using mouse clicks. Yes, I looked all over on wiki and stuff for speakframe ideas.

Thanks for any help/links.
in-game

Code: Select all

/script ClickRequestDialogButton(0)
and in your script, it would be

Code: Select all

sendMacro("ClickRequestDialogButton(0)")

Re: Yes/No Dialogue Box?

Posted: Fri Aug 26, 2011 4:14 pm
by grande
Awesome, I'll try that. Thank you!

Re: Yes/No Dialogue Box?

Posted: Sun Aug 28, 2011 2:43 pm
by nokirk
SpiralV wrote:
in-game

Code: Select all

/script ClickRequestDialogButton(0)
and in your script, it would be

Code: Select all

sendMacro("ClickRequestDialogButton(0)")
A general wondering, how is it possible to find out those lua commands? It kinda can't be theromwiki.com cause most commands don't have any further explantion of usage or in case of

Code: Select all

/script ClickRequestDialogButton(0)
theromwiki.com says
Where 'number' is a number. For what, I do not know.
.

So how to find out the usage? Or how to find out which command to use in the first place? I guess there are a hundred more quite similar dialog commands that could possibly work as well guessing from the name of the command. How do addon developers find out the commands they need? Are there addons or programms that help? Been wondering that for a while, I'd really appreciate some insight :)

Re: Yes/No Dialogue Box?

Posted: Sun Aug 28, 2011 7:11 pm
by lisa
When I first started playing with making addons I used an addon called "in game scripts" It basically just makes it so you can type out your code in a text edit type box and then run it. I haven't used it for a while though.

As for actually testing the functions and the args of functions there was a programme I was told about but I never tried it, can't remember the name either, maybe someone else can remember it.

Re: Yes/No Dialogue Box?

Posted: Sun Aug 28, 2011 8:48 pm
by rock5
Most commands, if there's not an entry in the romwiki, are derived by trial and error, just going by the name of the function and what error messages say when you try to use it.

The romwiki is quite old and doesn't have all the functions but you can sometimes find dumps of all the function names in some places on the web. How they get them I don't know.

You can also look for functions and how they are used in the .fdb files in the Runes of magic "fdb" folder. For instance I could find no reference to functions related to the new partner pet and mount bag online, to add to the bot player:mount() function, but I found a 'partnerframe.lua' file in the 'interface.fdb' file and in that I could see functions being used related to the partner bag and how they were being used. I was then able to add partnerbag functionallity to the bots player:mount() function.

Re: Yes/No Dialogue Box?

Posted: Sun Aug 28, 2011 9:18 pm
by lisa
A lot of the function names I found by doing searches with CE, directly from memory.
Then yeah just trial and error, check the error message in game for what it is expecting from the function.

Re: Yes/No Dialogue Box?

Posted: Mon Aug 29, 2011 3:24 am
by rock5
How do you search memory for functions? Do you need to know machine language?

Re: Yes/No Dialogue Box?

Posted: Mon Aug 29, 2011 4:51 am
by lisa
It was a while ago now but I found something in common, cant remember if it was .sys or something similar.
just do view memory and do search memory.

Re: Yes/No Dialogue Box?

Posted: Mon Aug 29, 2011 12:40 pm
by Administrator
Another way to do it would be to write an injectable DLL to hook some C-interface Lua functions so you can catch the registration calls. Now inject it into the game when starting it up, catch all registrations, and dump them to a file. Of course this would only work for functions that are written in C. Many of the functions (such as events) are written in Lua. Still, with a bit more work, you could have it dump those, too, but it is more complicated.

Re: Yes/No Dialogue Box?

Posted: Mon Aug 29, 2011 8:15 pm
by nokirk
I just found quite an interesting addon called LuaExplorer http://rom.curse.com/downloads/rom-addo ... lorer.aspx. Maybe you guys like it aswell.

It seems quite useful, played around with it a little and found soem interesting things. However I'm searching for an addon or programm that can tell you what functions you just used when doing something, without the need to specify functions before (think thats what lua explorer does), cause still the problem is that there are so many. Or is there no other way than learnign how to read functions from memory`?

Thanks

Re: Yes/No Dialogue Box?

Posted: Mon Aug 29, 2011 8:49 pm
by rock5
Looks nice. I think I will use it the next time I'm trying to figure out the name of a frame. The global variables list might come in handy too. :)