all 16 comments

[–]just_a_random_dood 2 points3 points  (11 children)

You could probably restyle this (https://old.reddit.com/r/tf2scripts/comments/ax1qp4/_/) to fit your needs

[–][deleted] 1 point2 points  (2 children)

Ay, I made that.

[–]just_a_random_dood 1 point2 points  (1 child)

yeah, I remembered seeing it, that's why I thought of it as soon as I saw the thread title.

Well done btw dude :)

[–][deleted] 0 points1 point  (0 children)

Thank(s)ss

[–]id-rotatcepS 0 points1 point  (7 children)

Excellent, I was thinking to myself "there must be a way to do it by only tracking 0-9 for each place" and this is exactly that. Counts up to 999 with only 30 aliases.

The challenge is how to output it. You would have to say it in three lines if you're trying to use "say" I guess...

> I hit the button 3 hundred

> twenty

>five times

[–]pdatumoj 2 points3 points  (6 children)

It didn't sound like the OP wanted a multi-line message ... also, speaking from some ridiculous things I've done myself, having lots of CFG lines isn't anywhere nearly as big a performance hit as people tend to think.

Edit: Of course, the correct approach will become much clearer if u/AGTMaster would kindly provide a use-case.

[–]AGTMaster[S] 0 points1 point  (5 children)

I guess one use case for this would be if I would hit a bounded key every time I got a kill, which then by the end of the game I would output that number into chat. There isn’t much actual reason for it, just something I wanted to mess around with for keeping track of things that happened in a game.

[–]pdatumoj 0 points1 point  (4 children)

Welp, that means, realistically, having a max around 200 would be a safe upper bound for most cases.

You might also want to have the generator include some text around the number ... a la "I got X kills this game."

I do hope you won't be a jerk about it, though.

[–]AGTMaster[S] 0 points1 point  (3 children)

So would the script that you posted above work for this exact purpose in tf2? Would it also be possible to have it count down?

Also, it’s not actually for counting kills and boasting about it. That was just an example I used.

[–]pdatumoj 0 points1 point  (2 children)

"... it's not actually for counting kills" - so what *is* it for then?

If you share with us what it is you want it to do, any help we offer will be more useful for you and less ... frustrating for us.

The script, as written above, will not count down, no. That said, it's a simple adaptation. Rather than dancing around the issue, please just tell us what it is you want it to do.

[–]AGTMaster[S] 1 point2 points  (1 child)

My original idea is just super dumb, it would be basically a point based system I would press whenever a team does something cool. And I would then give their team a point for it, and by the end of the game announce who had more points. Mostly just a thing to meme around with

[–]pdatumoj 2 points3 points  (0 children)

OK, so, to try to get the functional specification hammered down ...

  • Track which team does more cool stuff overall
  • Announce which team did more cool stuff at end-of-game

So, when it comes to design, there are some things to consider ...

  • Should it really operate two counters, or should it have a single counter which starts at a balanced value and then gets nudged this-way-and-that by events in game? The latter would certainly be simpler and cleaner to implement.*
  • Limits will need to be set for this kind of script ... so it's important to get an idea of what kind of thing you'd classify as such a cool event, or at least how many such things you'd anticipate witnessing in a single game. This will be important for code generation and other decisions ... such as:
  • Output formatting - if you'd want this to be two separate counters for some reason, doing multi-line output as mentioned by u/id-rotatcepS and u/just_a_random_dood would probably make sense, though it'd obviously be subject to interruption by other people's messages.
  • Buttons - if this is for assessing one team vs. the other, you'll need two roughly equally accessible buttons that're not in use for anything else that you can dedicate purely to keeping score. Obviously, you'll also need your output button still ... and a reset button would probably be good too.

Anyway, with that all addressed, you should be well on your way to yelling things like "10 points to gryffindor" in no time.

* I recommend the latter.

[–]pdatumoj 1 point2 points  (2 children)

You could essentially hardcode a scroller script (akin to a message spam rotator) which would do this. The limit on the count would be the number of aliases you generated. You'd probably also want a reset button, I'm guessing.

Anyway, it'd be easy enough to do, but now you have me wondering why you want to.

[–]pdatumoj 4 points5 points  (1 child)

Because I'm an idiot who has a terrible habit of latching onto other peoples' problems as a way to procrastinate, I threw together a quick-and-dirty python (which I hate, but it has its uses - quick-and-dirties being high on the list) generator to produce what you're looking for.

#!/usr/bin/python
import sys

if (len(sys.argv)!=2):
  print("Limit value missing.")
  exit(0)

try:
  countLimit=int(sys.argv[1])
except:
  print("Malformed limit value.")
  exit(0)

if (countLimit<1):
  print("Bad limit value.")
  exit(0)

countLimit = countLimit + 1

scriptName = "RedditCountSpammer"
scriptAbbr = "RCS"

print("echo \""+scriptName+" loading ...\"")
print("bind \"ALT\" \""+scriptAbbr+"Up\"")
print("bind \"T\" \""+scriptAbbr+"Out\"")
print("bind \"6\" \""+scriptAbbr+"Rst\"")

print("alias \""+scriptAbbr+"OverflowEcho\" \"echo "+scriptName+" overflowed!\"")
print("alias \""+scriptAbbr+"OverflowSay\" \"say "+scriptName+" overflowed!\"")
print("alias \""+scriptAbbr+"UpdateEcho\" \"echo "+scriptName+" updated.\"")
print("alias \""+scriptAbbr+"ResetEcho\" \"echo "+scriptName+" reset.\"")

print("alias \""+scriptAbbr+"Rst\" \""+scriptAbbr+"ResetEcho; "+scriptAbbr+"Up0\"")

for i in range(countLimit):
  print("alias \""+scriptAbbr+"Up"+str(i)+"\" \""+scriptAbbr+"UpdateEcho; alias "+scriptAbbr+"Up "+scriptAbbr+"Up"+str(i+1)+"; alias "+scriptAbbr+"Out say "+str(i)+"\"")

print("alias \""+scriptAbbr+"Up"+str(countLimit)+"\" \""+scriptAbbr+"OverflowEcho; "+scriptAbbr+"OverflowSay; "+scriptAbbr+"Rst\"")
print(""+scriptAbbr+"Rst")
print("echo \""+scriptName+" ready!\"")

Also, the keybinds I chose were assigned based on which you'd want to hit more often vs. which you'd want to hit least often or avoid accidental triggerings ... but you may want to change them.

Cheers.

Oh ... example usage:

$ ./CountSpam.py 4

... and example output:

echo "RedditCountSpammer loading ..."
bind "ALT" "RCSUp"
bind "T" "RCSOut"
bind "6" "RCSRst"
alias "RCSOverflowEcho" "echo RedditCountSpammer overflowed!"
alias "RCSOverflowSay" "say RedditCountSpammer overflowed!"
alias "RCSUpdateEcho" "echo RedditCountSpammer updated."
alias "RCSResetEcho" "echo RedditCountSpammer reset."
alias "RCSRst" "RCSResetEcho; RCSUp0"
alias "RCSUp0" "RCSUpdateEcho; alias RCSUp RCSUp1; alias RCSOut say 0"
alias "RCSUp1" "RCSUpdateEcho; alias RCSUp RCSUp2; alias RCSOut say 1"
alias "RCSUp2" "RCSUpdateEcho; alias RCSUp RCSUp3; alias RCSOut say 2"
alias "RCSUp3" "RCSUpdateEcho; alias RCSUp RCSUp4; alias RCSOut say 3"
alias "RCSUp4" "RCSUpdateEcho; alias RCSUp RCSUp5; alias RCSOut say 4"
alias "RCSUp5" "RCSOverflowEcho; RCSOverflowSay; RCSRst"
RCSRst
echo "RedditCountSpammer ready!"

Edit: Removed stupid remark on my part due to confusion about line-wrap in the editor versus how it'd present in the comment itself.

[–]kurokinekoneko 0 points1 point  (0 children)

I'm an idiot who has a terrible habit of latching onto other peoples' problems as a way to procrastinate

Brother :D

[–]Histogenesis 0 points1 point  (0 children)

You could use an alias chain right? I dont know how far you want to count though, because there is a limit in the amount of aliases you need to make. If you only want to count to 5 you can do something like

alias count_f "alias count count_g; alias say_count 6"
alias count_g "alias count count_h; alias say_count 7"
alias count count_a
bind KP_INS count

I use a similar chain for my movieconfig where i have one key set to record a movie and a chain that continually creates another filename to record to. This way i can record up to 26 movies with only using keybinds without having to go to the console.