Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

6 Multi-box for Everquest - key press for non active windows


  • Please log in to reply
11 replies to this topic
civenge
  • Members
  • 6 posts
  • Last active: Jul 11 2012 04:42 PM
  • Joined: 11 Jul 2012
http://www.autohotke...t=72620&start=0

Going off this thread, I think I could modify the code to work for 6 boxing in eq. However, I am new at this and could use a push in the right direction. Basically, what I want to do is push the numpad keys 1-9 and have it do the same key push in the 5 non-active windows. I would then bind those keys to do an in game command with a hotkey for each character. The key press can go to all 5 windows, and I'll just leave the hotkeys blank when I want nothing to happen.

It seems like that shouldn't be too hard to code, but again I don't know coding. Can anyone please help?

kalik
  • Members
  • 53 posts
  • Last active: Sep 04 2015 07:56 AM
  • Joined: 09 Jun 2012
Imo for something as simple as that, just download HotkeyNet. It's an app specificaly aimed at handling multiple boxes in games and whatnot.

civenge
  • Members
  • 6 posts
  • Last active: Jul 11 2012 04:42 PM
  • Joined: 11 Jul 2012

Imo for something as simple as that, just download HotkeyNet. It's an app specificaly aimed at handling multiple boxes in games and whatnot.


I tried hotkeynet, but there are a few issues with it. First, it can't distinguish between the windows, unless you rename each window, but every time you zone the window names reset, so you have to manually rename them a lot.

But the bigger problem is the key press doesn't always go through. Granted, I only tried it as a 2 box, so I am thinking 6 box would be worse. Having a heal only start some of the time is a problem. So that brought me here.

So, anyone able to help?

Edit: just to further explain why I came here. Hotkeynet has trouble sending to non-active windows on the same PC. The sendwinx command is the only one that works but is unreliable. That program works great for multiple PC's with 1 acccount per, which I am all on a single PC.

<!-- m -->Http://hotkeynet.com/phpBB3/viewtopic.php?f=18&t=1199<!-- m -->

kalik
  • Members
  • 53 posts
  • Last active: Sep 04 2015 07:56 AM
  • Joined: 09 Jun 2012
WinGet, eqid, List, Everquest

~Num1::
KeyWait Num1
IfWinActive, EverQuest
{
ControlSend,, Num1, ahk_id %eqid1%
ControlSend,, Num1, ahk_id %eqid2%
ControlSend,, Num1, ahk_id %eqid3%
ControlSend,, Num1, ahk_id %eqid4%
ControlSend,, Num1, ahk_id %eqid5%
ControlSend,, Num1, ahk_id %eqid6%
Return
}

~Num2::
KeyWait Num2
IfWinActive, EverQuest
{
ControlSend,, Num2, ahk_id %eqid1%
ControlSend,, Num2, ahk_id %eqid2%
ControlSend,, Num2, ahk_id %eqid3%
ControlSend,, Num2, ahk_id %eqid4%
ControlSend,, Num2, ahk_id %eqid5%
ControlSend,, Num2, ahk_id %eqid6%
Return
}

etc
?

civenge
  • Members
  • 6 posts
  • Last active: Jul 11 2012 04:42 PM
  • Joined: 11 Jul 2012
Thank you, I'll give it a shot!

civenge
  • Members
  • 6 posts
  • Last active: Jul 11 2012 04:42 PM
  • Joined: 11 Jul 2012
So I tried it with just 2 windows, only using the num1 portion of the code, and got the following error:

Note: The hotkey ~Num1:: will not be active because it does not exist in the current keyboard layout.


So I then looked up the key for numpad1, and found it to be {Numpad1}.

I tried putting that in the place of where the Num1 was, and it ran, but did nothing. I think the reason is the name of the application window isn't everquest, it is EQW beta 2.32. So i fired up Window spy to try to figure out what the ahk_class was, and got EQWND. Not knowing exactly the right way to fix this, I tried substituting EQWND into the code so now the code looks like this:

WinGet, eqid, List, EQWND

~Numpad1::
KeyWait Numpad1
IfWinActive, EQWND
{
ControlSend,, {Numpad1}, ahk_id %eqid1%
ControlSend,, {Numpad1}, ahk_id %eqid2%
ControlSend,, {Numpad1}, ahk_id %eqid3%
ControlSend,, {Numpad1}, ahk_id %eqid4%
ControlSend,, {Numpad1}, ahk_id %eqid5%
ControlSend,, {Numpad1}, ahk_id %eqid6%
Return
}

But still, nothing happens in the 2nd window. It should activate my hotkey to sit/stand on that character. Any thoughts?

kalik
  • Members
  • 53 posts
  • Last active: Sep 04 2015 07:56 AM
  • Joined: 09 Jun 2012
Yea, made an error there as well, trolololo. Try this.
WinGet, eqid, List, EQ

~Numpad1::
KeyWait Numpad1
IfWinActive, EQ
{
ControlSend,, {Numpad1}, ahk_id %eqid1%
ControlSend,, {Numpad1}, ahk_id %eqid2%
ControlSend,, {Numpad1}, ahk_id %eqid3%
ControlSend,, {Numpad1}, ahk_id %eqid4%
ControlSend,, {Numpad1}, ahk_id %eqid5%
ControlSend,, {Numpad1}, ahk_id %eqid6%

}
Return


civenge
  • Members
  • 6 posts
  • Last active: Jul 11 2012 04:42 PM
  • Joined: 11 Jul 2012
For some reason it still doesn't work. I press it and nothing happens. No errors, just nothing on the other windows. I am thinking there is no way to send it to the background window, it has to be a active window.

If you have any more ideas, I'm open to them. Darn Everquest.

Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
I'd suspect the line
IfWinActive, EQ
If I recall correctly it should be
IfWinActive, EverQuest
It's caps sensitive.
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

girlgamer
  • Moderators
  • 3263 posts
  • Last active: Feb 01 2015 09:49 AM
  • Joined: 04 Jun 2010
Windows titles are case-sensitive. You might also want to make sure you have
SetTitleMatchMode, 2
at the top of your script so you don't have to use the full title to make it work

The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ‚óŹ
MMO Fighter   KeyLooperDemo   Key Spammer   TinyClickRecorder  GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
Rock-on%20kitten.gif


blackhawk86
  • Guests
  • Last active:
  • Joined: --
Hey there. So I've been doing tests with this on my own, and have found a few things.
EQ1 does not seem to like receiving key events while not being the active window. It seems the internal input processing is only done when it is the active window.

Because of that, the following code works and has a few additional features. If you tab out of EQ, I disable certain keys. I am a WSAD person, EQ internally binds these to up, down, left, right, respectively. I have had to disable them as well, using the send command.

I also disable keys after you hit 'r', '/' and 'return' so you are able to type in game.

You could easily reduce the code to be as simple as you like, if this is too much for you.

It will loop through and send key commands to every window (after making them active), then re-set the primary original window to be the active window.

It is not perfect at the moment, I just started messing around with this last night - let me know if it helps.

The methodology/theory of this script is:
1) Switch to all EQ windows through loop(set active win, wait for active to complete, send keystroke in question).
2) Switch back to main window.

Note: This is using autohotkey
Note: I have had to decouple a lot of 'click' events and 'down' events. Thus the huge amount of key entries in this script. They are necessary as the behavior required needs this information.

;Grab unique window ID's
WinGet, eqid, List, EverQuest

; Does this even do anything for this method? Probably not. Kk.
#UseHook On

blockVar := 0

$return::
{
  if( checkActive() == true )
  {
      blockVar := 1
  }
  Send {Return down}
  return
}

$return up::
{
  if( checkActive() == true )
  {
      blockVar := 0
  }
  Send {Return up}
  return
}

$r::
{
  if( checkActive() == true )
  {
    if( blockVar == 0 )
      blockVar := 1
  }
  Send {r 1}
  return
}


$/::
{
  if( checkActive() == true )
  {
    if( blockVar == 0 )
      blockVar := 1
  }
  Send {/ 1}
  return
}

checkActive()
{
  WinGet, eqid, List, EverQuest  

  Loop, %eqid%
  {
    this_id := eqid%A_Index%

    IfWinActive ahk_id %this_id%
    {
	return true
    }
  }  
  return false
}

forwardKey( key )
{
  global eqid
  ; Block repeat key functions.
  BlockInput On

  WinGet, active_id, ID, EverQuest  

  ; Clear arrow keys for current windows.
  Send {Up up}
  Send {Down up}
  Send {Left up}
  Send {Right up}

  Loop, %eqid%
  {
    this_id := eqid%A_Index%
    ; Activate EQ window.
	
	WinActivate, ahk_id %this_id%
	WinWaitActive, ahk_id %this_id%

	; Send Keys
	Send {%key% 1}
	Send {Up up}
	Send {Down up}
	Send {Left up}
	Send {Right up}
  }  
  
  ; Activate origional EQ window
  WinActivate, ahk_id %active_id%
  WinWaitActive, ahk_id %active_id%

  ; Clear Keys
  Send {Up up}
  Send {Down up}
  Send {Left up}
  Send {Right up}

  BlockInput, Off
}

$1::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {1 1}
	return
  }
  forwardKey(1)
  return 
}

$2::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {2 1}
	return
  }
  forwardKey(2)
  return 
}

$3::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {3 1}
	return
  }
  forwardKey(3)
  return 
}

$4::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {4 1}
	return
  }
  forwardKey(4)
  return  
}

$5::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {5 1}
	return
  }
  forwardKey(5)
  return  
}

$6::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {6 1}
	return
  }
  forwardKey(6)
  return  
}

$7::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {7 1}
	return
  }
  forwardKey(7)
  return  
}

$8::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {8 1}
	return
  }
  forwardKey(8)
  return  
}

$9::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {9 1}
	return
  }
  forwardKey(9)
  return  
}

$0::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {0 1}
	return
  }
  forwardKey(0)
  return  
}


$w::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {w 1}
	return
  }
  Send {Up down}
  return
}

$w Up::
{
  Send {Up up}
  return
}

$a::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {a 1}
	return
  }
  Send {Left down}
  return
}

$a up::
{
  Send {Left up}
  return
}

$s::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {s 1}
	return
  }
  Send {Down down}
  return
}

$s up::
{
  Send {Down up}
  return
}

$d::
{
  if( blockVar == 1 || checkActive() == false )
  {
        Send {d 1}
	return
  }
  Send {Right down}
  return
}

$d up::
{
  Send {Right up}
  return
}

$Up::
{
  Send {Up down}
  return
}

$Up up::
{
  Send {Up up}
  return
}

$Down::
{
  Send {Down down}
  return
}

$Down up::
{
  Send {Down up}
  return
}


$Left::
{
  Send {Left down}
  return
}

$Left up::
{
  Send {Left up}
  return
}


$Right::
{
  Send {Right down}
  return
}

$Right up::
{
  Send {Right up}
  return
}

$\::Reload

Pause::Suspend


Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
You need to do a ControlSend if you expect keys to be passed to an inactive window.
<!-- m -->http://l.autohotkey....ControlSend.htm<!-- m -->
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj