MQ2CustomBinds issues

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

MQ2CustomBinds issues

Post by dweomer » Mon Mar 15, 2004 2:02 pm

Following is a section of my spewfile with actual commands typed in orange

/bind list
WriteChatColor(MQ2 Binds)
WriteChatColor(--------------)
WriteChatColor([RANGED] Nrm:clear Alt:clear)
WriteChatColor([corpse] Nrm:X Alt:clear)
WriteChatColor(--------------)
WriteChatColor(End MQ2 Binds)
/bind corpse alt+x
WriteChatColor(Normal corpse now bound as alt)
/bind list
WriteChatColor(MQ2 Binds)
WriteChatColor(--------------)
WriteChatColor([RANGED] Nrm:clear Alt:clear)
WriteChatColor([corpse] Nrm:alt Alt:clear)
WriteChatColor(--------------)
WriteChatColor(End MQ2 Binds)

As you can see from this example, the binds are not displaying properly for the key combo with alt in it. I noticed this oddity while looking through the output of /bind eqlist. Anything with alt in the key-combo displays as just alt.

I will attempt to dig into the code to see what is causing this, but this'll be the first time ive bothered looking in any of the guts of MQ so I am sure someone else will find and fix this first :P

Also, its possible to create an empty custombind by doing /custombind add. Running the corresponding delete command /custombind delete says it deletes the empty-named custom bind but in reality does not. When attempting to unload the plugin (to get it to write the custom binds to file) if there is an empty-named bind it will crash eq :shock:

Currently it looks as if you create a custombind, and /bind it it will get added to macroquest.ini immediately, but if you delete the same custombind its' bind hangs around in the ini. And one last thing, the custombinds saving to file is rather primitive at the moment (and buggy, its possible to get it to write garbage into the file if you create just one custombind and then delete it and then unload the plugin). Is this being worked on further or is it hoped that someone will pick this up? Either way, I'll look into it some.


Yes, this feature is important as hell to me so I want it to work, and will help if needed! :D

Edit: Forgot to ask, would it be possible (or a good idea) to setup these bindings to save on a per-user basis ? And on a similar note (I realize the eqclient is "broken" in this respect) but it'd be nice to save the actual client key bindings (not just custom) on a per-user basis. Seems with this new system it should be possible to writeout all bindings on exit and load them (and by this i mean reading from file and overwriting what the client is currently set to do) when logging in.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 15, 2004 2:55 pm

I'll look into the delete part not removing it from the list.

When you delete, the actual bind key is not removed from macroquest.ini by design. The reason being, delete does the same thing as simply removing it from the list. Plugins are to remove their binds from the list when they shut down, and we want to keep your last key setting. So, there will be plenty of ghost binds in macroquest.ini. They are ONLY used when the bind name is active, they are not read from the ini until added to the list. In other words, just because it appears in macroquest.ini doesnt mean the bind is active when you run macroquest (it has to be loaded etc)

The custom bind file is written when the plugin shuts down, and it's supposed to be truncated and written from scratch. I'll check on that.

I've been thinking about per-user(or character) settings recently and I think what I will do is make a command to linearly read and execute a series of commands from a file. This could be seen as like a quake config file, we could have an autoexec.cfg and then a <character>.cfg and possibly <map>.cfg, etc.

I'll work on this stuff today.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 15, 2004 3:32 pm

To fix the problem with custom binds, make this function in MQ2CustomBinds.cpp look like this:

Code: Select all

VOID RemoveCustomBind(unsigned long N)
{
	if (N>=CustomBinds.Size)
		return;
	if (PCUSTOMBIND pBind=CustomBinds[N])
	{
		[color=red]RemoveMQ2KeyBind(pBind->Name);
		delete pBind;
		CustomBinds[N]=0;[/color]
	}
}
The area that changed is in red.

I'll work on the other stuff now and get a zip out in an hour or two.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

alt key-combo display issue

Post by dweomer » Mon Mar 15, 2004 4:05 pm

i think i've found the root of this display issue:

in the function DescribeKeyCombo in file MQ2Main/MQ2Utilities.cpp around line number 2223. Changed code in red:

Code: Select all

	if (Combo.Data[0])
	{
		if (pos)
		{
			szDest[pos]='+';
			pos++;
		}

		strcpy(&szDest[pos],"alt");
		[color=red]pos+=3;[/color]
	}
Think this was a cut-n-paste error as it was incrementing the position counter by 4 (same as for control="ctrl" in the preceding if block).

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 15, 2004 4:21 pm

Yep that'll do it for the alt thing :)

I just finished up the cfg file thing. Here's some info for you that i'll also be posting elsewhere.

config files are files containing a linear set of commands (e.g. no code blocks, just a bunch of commands)

config files will be automatically loaded at the following times:

AutoExec.CFG - Executed on the first pulse
CharSelect.CFG - Executed when you are put at character select
<server>_<character>.CFG - Executed when this character enters the world
<mapshortname>.CFG - Executed when you zone into this zone
<pluginname>-AutoExec.CFG - Executed when this plugin is loaded (after its initialization is complete)

Examples of file names:
tallon_lordsoth.cfg - character
oot.cfg, soldungb.cfg, soldunga.cfg, take.cfg - maps
MQ2Map-AutoExec.CFG, MQ2ChatWnd-AutoExec.CFG - plugins

These files must contain commands the same way they would be used otherwise. For example...

kael.CFG

Code: Select all

/highlight king tormax
/highlight statue of rallos zek
/highlight derakor the vindicator
/maphide range 1-40
/mapfilter normallabels hide
/echo Kael.CFG completed
tallon_lordsoth.CFG

Code: Select all

/bind ranged n
/bind ~ranged clear
/bind forward e
/bind backward d
etc..

And of course if you dont like per-character you can manually load your own cfgs any time with /loadcfg
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

more tinkering

Post by dweomer » Mon Mar 15, 2004 4:43 pm

Okay, so I have been tinkering with this a bit more. It would seem that if a key is already bound by the normal EQ client it's keypress will not be processed by MQ2. I had hoped it would work in a similar fashion to the EQ client in that you can bind the move forward key to also hit a hotbutton (to auto forage or auto track etc) but in using MQ2's facilities the hotbutton intermediary wouldn't be needed as I can just bind a command to the same key. This would free up another slot on my hotbuttons bank (I ALWAYS have an auto-track or auto-forage going as I play druid and bard primarily), was really hoping for this to work this way!

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 15, 2004 5:19 pm

Yeah I had it like that at first but then had some issues because I am actually using the keypress handler's original function. I'll imitate the function instead. I was planning on it but was putting it off ;)

However, you CAN multibind like this...

clear the bind key for the EQ bind. I'll use NETSTAT in this example although this will work for anything.
make a custom MQ2 bind like so:

either like this:
down: /multiline ; /keypress netstat hold;do what you wanted to do
up: /multiline ; /keypress netstat;do what you wanted to do
or like this:
down: /multiline ; /keypress netstat;do what you wanted to do
up: do what you wanted to do

But I'll rewrite part of the bind system right now to handle it the "good" way
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

Woot

Post by dweomer » Mon Mar 15, 2004 5:23 pm

Lax wrote:But I'll rewrite part of the bind system right now to handle it the "good" way
Woot!

Thanks for all of your responsiveness on this issue Lax!

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 15, 2004 5:41 pm

Done, this will be in the zip i'll be putting up momentarily.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0