Jump to content

Mouse Macro, Help!


12 replies to this topic

#1 Mech Wrench

    Member

  • PipPipPipPipPipPip
  • Philanthropist
  • Philanthropist
  • 222 posts
  • LocationAlaska

Posted 06 September 2013 - 09:21 PM

So I know how to set up a basic Macro like need for a trip UAC. But in trying to get a handle on the new gauss rifle system I want to try a macro I can't figue out how to set up. I want my PPC's to fire when I release my gauss fire button. Can anyone help? I am using the steel series software that came with my steel series mouse it's a 7 button, COD 2 edition something or another.

I want to be clear, this thread is not about the ethics of macros in the game. It's about how one can use techniques and technology to better deal with gauss in a high alpha fire support role. I tried using the gauss as is, I found it daunting.

#2 evilC

    Member

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

Posted 07 September 2013 - 03:45 AM

From memory, untested, but you should get the idea:
(Using the autohotkey scripting language, set the RMB to charge gauss on press, fire gauss and PPC on release)
SendMode, Event
SetKeyDelay, 0, 50
 
charge_time := 0
 
#IfWinActive, ahk_class CryENGINE
*~RButton::
   send {5 down}
   charge_time := A_TickCount
   return
 
*~RButton up::
   send {5 up}
   if ((A_TickCount <= (charge_time + 2000)) && (A_TickCount >= (charge_time + 750))){
	  send {6}
   }
   return
#IfWinActive

Gauss in group 5, PPCs in 6.
Will only fire PPCs if there is less than 2000ms (Is this correct figure for gauss max charge time?) between the key down and the key up.

Edited by evilC, 08 September 2013 - 01:49 PM.


#3 Mech Wrench

    Member

  • PipPipPipPipPipPip
  • Philanthropist
  • Philanthropist
  • 222 posts
  • LocationAlaska

Posted 07 September 2013 - 11:09 AM

everything you have written there is making some sense, but i cant get the scripting right, could you paste what you have?

#4 Mech Wrench

    Member

  • PipPipPipPipPipPip
  • Philanthropist
  • Philanthropist
  • 222 posts
  • LocationAlaska

Posted 07 September 2013 - 12:14 PM

Works now, thanks evilC

#5 evilC

    Member

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

Posted 07 September 2013 - 01:05 PM

Corrected minor typo, script now 100% functional.

#6 Catamount

    Member

  • PipPipPipPipPipPipPipPipPip
  • LIEUTENANT, JUNIOR GRADE
  • 3,305 posts
  • LocationBoone, NC

Posted 07 September 2013 - 02:09 PM

Huh, I might have to give this a try myself. Thanks

#7 evilC

    Member

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

Posted 08 September 2013 - 05:12 AM

I realised of course that the script does not take into account the gauss charge-up.
ie with this script as it stands, if you release the button before the gauss is charged, the PPCs will still fire.

#8 Catamount

    Member

  • PipPipPipPipPipPipPipPipPip
  • LIEUTENANT, JUNIOR GRADE
  • 3,305 posts
  • LocationBoone, NC

Posted 08 September 2013 - 05:41 AM

Okay, maybe I'm reading this script wrong (I don't really know this language, and I'm programming stupid anyways), but doesn't that conditional in there serve to only fire the PPCs if the mouse button has been held down for a certain time (whatever "2000" is)?

Am I just misunderstanding how this is written, or is the time written in simply not sufficient?

Edited by Catamount, 08 September 2013 - 05:45 AM.


#9 evilC

    Member

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

Posted 08 September 2013 - 10:51 AM

as it stands, when you hit RMB it holds 5 down, charging the gauss.
When you release the RMB, it checks to see if the gauss have lost charge (time since button held is greater than 2 secs)

if over 2 secs, it only releases the 5 key - nothing happens.
If under 2 secs, it releases 5 at the same time as hitting 6 - releasing 5 fires the gauss and hitting (and releasing) 6 fires the PPCs.

The gauss needs time to charge up also (ie it cannot fire until the green bar fills), so the < 2000 check should probably be more like > 1000 and < 2000 (ie the gauss finished charging, and did not lose it's charge)

#10 Catamount

    Member

  • PipPipPipPipPipPipPipPipPip
  • LIEUTENANT, JUNIOR GRADE
  • 3,305 posts
  • LocationBoone, NC

Posted 08 September 2013 - 11:17 AM

Okay, now I have a better idea of what this is doing (like I said, programming stupid; I stick to hardware for a reason :)). Yeah, simply making the firing of 6 conditional on a range of times instead of anything "under 2000ms" would solve that.

Thanks for the explanation.

Edited by Catamount, 08 September 2013 - 11:19 AM.


#11 evilC

    Member

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

Posted 08 September 2013 - 11:33 AM

I wouldn't say you are programming stupid - you clearly have an open mind and a desire to learn, so just have patience - it will come :)
Also, AHK is a quirky language at the best of times so don't let that discourage you.

#12 Catamount

    Member

  • PipPipPipPipPipPipPipPipPip
  • LIEUTENANT, JUNIOR GRADE
  • 3,305 posts
  • LocationBoone, NC

Posted 08 September 2013 - 12:33 PM

Yeah it does seem like that.

The chargeup is 0.75s iirc (don't use gauss much since the changes), but Is getting the charge-up accounted for really just as simple as something like this?

if (A_TickCount <= (charge_time + 2000) and A_TickCount >= (charge_time + 750))

or this?

if ((charge_time + 750) <= A_TickCount <= (charge_time + 2000))

I'd just test it myself, but I'm not in a position to play today :/

Edited by Catamount, 08 September 2013 - 12:34 PM.


#13 evilC

    Member

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

Posted 08 September 2013 - 01:47 PM

&& is code for logical AND.
Changed code to incorporate 0.75s rule
now it will only fire if you release between 0.75s and 2s

Edited by evilC, 08 September 2013 - 01:50 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users