Jump to content

Fire Control - "proper" Chain Fire For Mwo / Tag Toggle / Jump Jet Spam [Fc 3.0.7 - 30Th Jan 2017]


542 replies to this topic

#421 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 08 June 2016 - 10:52 AM

Received via email:

Quote


I set the program up for Mechwarrior Online but for some reason, the firing pattern is off.


Example:
I set 3 ac2s to groups 3,4 and 5. I set the bind to the fire hotkey to the right mouse button. When I fire it, it does not fire in the sequence, but start off firing in sequence then fires in groups even in chain fire mode.


Am i doing something wrong? I can copy the ini file and send it to you if you need to look at it.




All I need to know is:


What is your Fire Sequence set to?


What is the exact group config? All ACs in groups 3,4 and 5 or one in each? Chain fire on or off?


What are your weapon group bindings in MWO? ie are number keys 3,4 and 5 bound to groups 3,4 and 5?




Ideal setup would be:


ALL ACs in groups 3,4 and 5 with chain fire on for each group.




Fire Sequence of 3,4,5




3,4 and 5 bound to weapon group 3,4 and 5 in MWO. Right Mouse must not be bound to group 3,4 or 5


#422 Good_Cat

    Member

  • PipPipPip
  • Mercenary Rank 4
  • Mercenary Rank 4
  • 69 posts
  • LocationThe wrong side of enemy lines probably

Posted 11 June 2016 - 08:01 AM

Trying to create a Gauss / PPC sync fire macro, so the PPC's would fire as soon as the Gauss rifle charges (750ms) and goes green.
Mapped Gauss to AG1
Mapped PPC to AG2

Macros of 1,2stagger(1,750),reset
Not sure what im doing but the gauss rifle isn't charging??

#423 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 11 June 2016 - 10:55 AM

I am not sure FC can be made to support Gauss.
Normally when it hits a key, it presses it and releases it straight away.

Try {1 down},{1 up},2,stagger(1,1000)

You may have to adjust the 1000 figure to however long you need to hold the gauss button

You may need to put a "reset" command in there too

#424 Tarl Cabot

    Member

  • PipPipPipPipPipPipPipPipPipPip
  • Tai-sho
  • Tai-sho
  • 7,660 posts
  • LocationImperial City, Luthien - Draconis Combine

Posted 11 June 2016 - 08:08 PM

I would suggest using a standalone macro to single fire the GR then hit the button for the ERPPC, that way you can stop the GR macro by releasing the mouse button and not waste a shot or suffer the heat build up from firing off ERPPS.

http://darkjedi.org/...=2091&t=1371295

#425 Bananaphone117

    Rookie

  • Shredder
  • Shredder
  • 5 posts
  • LocationCanada

Posted 17 June 2016 - 09:46 PM

Quick Question. Why is it that sometimes (not all the time) that the program will start tapping my voip key (caps lock in this case). Not a serious issue per say, but me and some other clan mates have the problem and its really rather annoying.

#426 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 21 June 2016 - 03:33 AM

I take it you mean this is happening while FC is sending keys.

What keys is it sending (ie what is in your FireSequence ?)
If you are just sending number keys, then I don't really see why this would happen.

Does it maybe only happen when you are firing while holding Shift?

#427 Chojin Wolfblade

    Member

  • Pip
  • Bad Company
  • Bad Company
  • 10 posts
  • LocationBrisbane AU

Posted 23 June 2016 - 11:48 PM

Hey evilC, how does the debugging work? Is there a way of logging key presses and any errors? I've either a mouse thats on the fritz or its FC.

evilC said:




#428 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 24 June 2016 - 05:55 AM

I had a stab at implementing the basics of FC as a plugin for my new system - UCR.
As I have probably mentioned, I am trying to avoid working with "old" code that uses the ADHD system (Fire Control being one of those) so I need to start thinking about how to implement FC's functionality in UCR.

Here is a plugin for UCR that is a bare-bones implementation of what FC does at it's heart.
It's a lot simpler to understand than FC's code, so any of you out there who have considered tinkering with FC, this would serve as a good base to play with.

In order to run it, you would need to download and unzip the UCR zip from here, then create a text file called "FireControl.ahk" in plugins\User and paste in the text below.
Then double-click UCR.exe, and add a Fire Control plugin using the drop-down list at the top.
[Edit] MWO forums mangle the code layout quite bad, you can get an un-mangled version here.
/*
Fire Control is a plugin that allows you to configure rapid fire etc
*/
; All plugins must derive from the _Plugin class
class FireControl extends _Plugin {
Type := "Fire Control"
Description := "A Rapid Fire macro."

FireSequence := [] ; The sequence of keys to hit
SeqPos := 0   ; The current position in the sequence
SeqMax := 0   ; The number of items in the sequence
FireRate := 0  ; The rate at which to fire
FireState := 0  ; The state of the fire button

; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
Init(){
  ; Create the GUI
  Gui, Add, Text, y+10, % "Fire Button: "
  ; Add a hotkey, and give it the name "FireButton". All hotkey objects can be accessed via this.InputButtons[name]
  ; Have it call FireButtonChangedState when it changes state.
  this.AddInputButton("FireButton", 0, this.FireButtonChangedState.Bind(this), "x100 yp-2 w200")
 
  ; Set up the Fire Sequence and Fire Rate boxes
  Gui, Add, Text, xm, % "Fire Sequence: "
  this.AddControl("FireSequence", this.FireSequenceChangedValue.Bind(this), "Edit", "x100 yp-3 w300", "")
  Gui, Add, Text, x+10 yp+3, % "Fire Rate: "
  this.AddControl("FireRate", this.FireRateChangedValue.Bind(this), "Edit", "x+10 yp-3 w50", "")
 
  ; Store a pointer to the fire function
  this.FireFunc := this.Fire.Bind(this)
}

; Called when the hotkey changes state (key is pressed or released)
FireButtonChangedState(e){
  this.FireState := e  ; If set to 0, main loop in Fire() will end
  if (e && this.FireRate && this.SeqMax){
   ; Fire Key went down and we seem to have a valid Fire Seqence. FIRE WEAPONS!!!
   ; We must allow this function to "End", so that other inputs continue to work...
   ; ... So do the main Fire loop in another "Thread" by using SetTimer
   fn := this.FireFunc ; Get the pre-built pointer to the fire function
   SetTimer, % fn, -0 ; -0 means "Fire this straight after this function ends, and only once"
  }
}

; Runs while the fire button is held
Fire(){
  while (this.FireState){ ; this.FireState will get set to 0 in FireButtonChangedState() when the button is released
   SetKeyDelay, 0, 50 ; Keys need to be held for 50ms to work with some games (eg MWO). Cheap bodge to keep code simple.
   try { ; We did not validate the Fire Sequence, so use a "try" block in case it contains invalid key names.
    Send % "{Blind}" this.FireSequence[this.SeqPos] ; Use {blind} to stop ahk releasing modifiers (Ctrl, Alt etc) if they are held.
   }
   this.SeqPos++ ; Move to the next item in the sequence
   if (this.SeqPos > this.SeqMax)
    this.SeqPos := 1 ; Wrap around at the end
   Sleep % this.FireRate ; Sleep until next shot
  }
}

; The user changed the contents of the Fire Rate box
FireRateChangedValue(rate){
  if (rate is Number) {
   this.FireRate := rate
  } else {
   this.FireRate := 0
  }
}

; The user changed the contents of the Fire Sequence box
; Called as each letter is typed, so may be invalid until user finishes typing
FireSequenceChangedValue(fire_sequence){
  ; Split the sequence on commas
  fire_sequence := StrSplit(fire_sequence, ",")
  ; Did we get an array of at least one item back?
  if (fire_sequence.length()){
   ; Yes - set fire sequence
   this.FireSequence := fire_sequence
   this.SeqPos := 1
   this.SeqMax := this.FireSequence.length()
  } else {
   ; No - disable fire sequence
   this.FireSequence := []
   this.SeqPos := 0
   this.SeqMax := 0
  }
}
}

Edited by evilC, 24 June 2016 - 06:02 AM.


#429 Chojin Wolfblade

    Member

  • Pip
  • Bad Company
  • Bad Company
  • 10 posts
  • LocationBrisbane AU

Posted 25 June 2016 - 12:07 AM

View PostevilC, on 24 June 2016 - 05:55 AM, said:

I had a stab at implementing the basics of FC as a plugin for my new system - UCR.
As I have probably mentioned, I am trying to avoid working with "old" code that uses the ADHD system (Fire Control being one of those) so I need to start thinking about how to implement FC's functionality in UCR.

Here is a plugin for UCR that is a bare-bones implementation of what FC does at it's heart.
It's a lot simpler to understand than FC's code, so any of you out there who have considered tinkering with FC, this would serve as a good base to play with.

In order to run it, you would need to download and unzip the UCR zip from here, then create a text file called "FireControl.ahk" in plugins\User and paste in the text below.
Then double-click UCR.exe, and add a Fire Control plugin using the drop-down list at the top.
[Edit] MWO forums mangle the code layout quite bad, you can get an un-mangled version here.


Downloading now, looking forward to playing with this!
Any answer to my aforementioned question re debugging?
I know i can run it in notepad but i was hoping to catch any glitch in the timing, not just output keys.

Cheers

#430 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 25 June 2016 - 02:11 AM

Regarding debugging:
If you are looking to optimize the timing of the firing, then the best tool for the job would probably be logging.
Download and install DebugView from SysInternals.
Then, in AHK code, you can write stuff out to debugview like this:

outputdebug % "It is currently " A_TickCount " ms since script started"

A_TickCount is probably the most important variable you are going to want to log. It is the number of ms since the script started, so it can be used to easily work out how long elapsed. ie

last_gun_fire := A_TickCount
[.. some code ..]
time_since_last_fire := A_TickCount - last_gun_fire


You might get stuff appearing for other apps in debugview, but you can filter. I prefix all UCR debug output with "UCR|".
This is the filter I use in debugview:

DBGVIEWCLEAR;UCR|*

DBGVIEWCLEAR can be sent to debugview to tell it to clear the log. UCR does this at the start of each run.

If you wish to interactively debug a plugin (ie step through the code using breakpoints etc), then this is currently not possible with the latest release of UCR. However, I am working on a method of allowing this, I may well have it ready later today or tomorrow.

If you are interested in helping forge the next generation of FC, then please do have a play with the code I posted above - I am pretty sure it is far from perfect.

The main problem is that MWO requires keys to be held for 50ms in order to recognize them. At the moment, the way I enforce this is by executing a SetKeyDelay, 0, 50 command before each fire. However, I *think* (I have not tested) that this means that sending one key will take 50ms. I have not factored this into my calculations. Also, there is only one SetKeyDelay setting for all plugins - so messing around with it is probably not the best idea.

The problem is solvable, but to be honest a big part of the problem is the Fire Sequence box - you need to pre-process what the user types in and be able to work out which keys the user means.
For example, all the following should be valid:

1,2,3,4 = 1 then 2 then 3 then 4
1,2,{Space}, {Insert} = 1 then 2 then space
1,2,{3}{4} = 1 then 2 then 3 & 4 together

So I think that the best way forward is to write some code that pre-processes the Fire Sequence box and identify which key names are used for each step.
Then, once we have those, we can easily send down or up events for those keys at appropriate intervals, without having to use SetKeyDelay.

#431 BERJI

    Rookie

  • Philanthropist
  • 1 posts

Posted 01 July 2016 - 01:30 AM

Hi evilC,

FC does not seem to work for my comp! Have tried finding set-up guides and going thru the forum, but can't find an answer.

I'm on FC v3.0.6 (ADHD v3.2.1).

The problem is this: Whatever I do, FC runs in the background but does nothing to actual MWO in-game. In FC itself, I've set a 3,4,5,6 fire sequence, binding right-click as the fire button while leaving all in their default (no toggle selected, no check on 'limit to application' etc) - basically, just like how the video in OP is like. In MWO itself, I've tried setting my weapon groups for the AC2s as 2 AND 3, 4, 5 and 6, and also without 2.

Nothing happens when I right-click.

I've checked the keyboard settings in-game and nothing seems to be wrong (not that anyone or anywhere mentioned that something has to be done to it). Weapon group 1-6 are in their respective defaults: 1 and left-click fires Weapon Group 1, 2 and right-click fires Weapon Group 2 and so on.

Am I missing out something?

#432 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 01 July 2016 - 03:39 AM

Untick the "Limit to application" checkbox on the Bindings tab.

Posted Image

Then open Notepad and hold the fire button - do you see anything typed?
If so, tab into MWO, does it work?

Also try opening a chat box in MWO and hitting the fire button - do you see text typed?

#433 MeanMachinE

    Member

  • PipPipPip
  • The People's Hero
  • The People
  • 95 posts

Posted 05 July 2016 - 12:57 PM

Is this tool legal? Can you get a VAC ban for using this? Is MWO VAC controlled? :)

#434 Dee Eight

    Member

  • PipPipPipPipPipPipPipPipPipPip
  • Big Daddy
  • Big Daddy
  • 6,271 posts

Posted 18 July 2016 - 05:57 PM

View PostBananaphone117, on 17 June 2016 - 09:46 PM, said:

Quick Question. Why is it that sometimes (not all the time) that the program will start tapping my voip key (caps lock in this case). Not a serious issue per say, but me and some other clan mates have the problem and its really rather annoying.


I have this problem also...using the troll enforcer build with quad AC/2s... the binding is the right mouse button which is fire group 2... ACs are on fire groups 3,4,5,6m ROF is set to 165ms, and the guns fire fine but after the first burst is triggered it sends the capslock key also at the same time as the firing of each cannon, and then everyone on the team hears me shooting.

#435 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 22 July 2016 - 03:19 AM

View PostMeanMachinE, on 05 July 2016 - 12:57 PM, said:

Is this tool legal? Can you get a VAC ban for using this? Is MWO VAC controlled? Posted Image

FC has been cleared as OK by PGI, you will not get banned from MWO for using it.

#436 Leonidas the First

    Member

  • PipPip
  • Bad Company
  • Bad Company
  • 43 posts

Posted 22 July 2016 - 01:45 PM

Is it possible to run multiple instances at the same time? I would assume you would have to change the name if the AHS file and the GUI source to work with that file.

#437 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 24 July 2016 - 03:59 AM

You can run multiple copies of FC without changing settings file.
Just run it the first time, then when you run it the 2nd time, it will be on the same profile as the 1st copy. Simply change profile in the 2nd copy and it should all work fine with 2 profiles at the same time.

#438 Leonidas the First

    Member

  • PipPip
  • Bad Company
  • Bad Company
  • 43 posts

Posted 24 July 2016 - 05:32 PM

Thanks for a quick response.

I am running three instances and everything is working without a hitch. I ended up extracting into three separate folders so that I will not have such a long list of profiles to try to select from and that seems to work fine too.

I am having trouble either understanding what stagger is supposed to do or I am not setting it up correctly.

Since I have a crappy mouse and big hands I can only use one side button effectively, so for my BX-1X with 8 MLs I have the following:

I have a BJ-1X LEFT profile with a Fire Rate of 50 and the RESET option that fires Weapon Group 1 (the left arm) and then Weapon Group 3 (the left torso) so that I can use a single key to fire the arm with a quick click or the arm and torso by holding down the button briefly so that I can barely poke around a corner with my arm and fire without wasting heat on the torso if I do not want to over expose myself. I have another BJ-1X profile to do the same thing for the the right side. These work as expected.

I have a BJ-1X profile set up and I want to be able to fire the arms and then delay the torso weapons long enough to avoid the heat penalty. It just dawned on me that I could work around my problem by using Weapon Groups 5 and 6, but just in case I need this trick in the future and I can not spare the Weapon Groups I will continue :-) I currently have it set up with a Fire Rate of 10 and the following Fire Sequence string: 1,2,3,4,stagger(2,1000) assuming it would fire Weapon Group 1, fire Weapon Group 2 in 10 mils, fire Weapon Group 3 in 1010 mils and the fire Weapon Group 4 in another 10 mils, but instead all four groups fire 10 mils apart.

Can this be done? If so where am I going wrong.

#439 Srezr

    Rookie

  • 1 posts

Posted 03 August 2016 - 12:06 PM

For some reason I can't bind "0" anymore, can anyone help?

#440 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 05 August 2016 - 04:55 AM

View PostSrezr, on 03 August 2016 - 12:06 PM, said:

For some reason I can't bind "0" anymore, can anyone help?

What do you mean? In the Bindings tab, when you click Bind for an action, if you press the 0 key, nothing happens?





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users