r/Tf2Scripts • u/AGTMaster • Feb 19 '20
Satisfied Counting Style Script?
Is there any way possible to create a script that could count?
Say I hit a bounded key 5 times, I could then hit another key to output : “5” into the chat.
I know part of the “limits of scripting” said that you can’t read or add to values in cVar, but I wondered if there was any sort of loophole.
Probably a dumb question
6
Upvotes
View all comments
Show parent comment
5
u/pdatumoj Feb 20 '20 edited Feb 20 '20
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.
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:
... and example output:
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.