Jump to content

Does anyone know how to create a script that paste my bind every {x} time?


Mr.demon kraken

Recommended Posts

I am getting a bit tired of pressing my binds manually every 30sec on trade servers.

Does anyone know how to script that? 

 

Link to comment
Share on other sites

I just figured this out myself, here's a more robust solution:

 

alias advert "Your advertisement here!"

alias loop "advert;wait 10000;redirect"

alias stopAdvertLoop "alias redirect;alias loopKey startAdvertLoop"

alias startAdvertLoop "alias loopKey stopAdvertLoop;alias redirect loop;loop"

alias loopKey startAdvertLoop

bind / loopKey

 

you can bind whatever key you want to be your loopKey. In a nutshell, this will set you up with a toggleable bind script where hitting your bind once will kick off the script and keep adverting for you until you hit it again. Louisa's solution will work but it will keep looping forever, even after changing servers.

According to the tf2 wiki's page on scripting the number used during wait is either the number of frames or the number of game ticks. In my experience neither number makes sense for how long it actually waits but 10000 works for me for adverting often without being annoying.

 

Just stick this in your autoexec.cfg once you've changed your advert text and you should be good to go. Just remember that chat messages can only be 127 characters long, so if you have more than that to advert just create an advert2 alias and add "advert2;wait 10000; before the redirect in the loop alias.

 

Hope this helps!

 

Link to comment
Share on other sites

4 hours ago, Nickman said:

According to the tf2 wiki's page on scripting the number used during wait is either the number of frames or the number of game ticks. In my experience neither number makes sense for how long it actually waits but 10000 works for me for adverting often without being annoying.

It is rendered frame rate, it's very weird. Rendered frame being a frame your client registers, IE very few frames are rendered when switching servers and if you have a frame drop your wait will take longer, having uncapped FPS is not recommended if you want to be consistent.

Link to comment
Share on other sites

4 minutes ago, FP jh34ghu43gu said:

It is rendered frame rate, it's very weird. Rendered frame being a frame your client registers, IE very few frames are rendered when switching servers and if you have a frame drop your wait will take longer, having uncapped FPS is not recommended if you want to be consistent.

yea, that's very annoying. wish it was just number of milliseconds but oh well. What I've posted has worked fairly well for me for rotating through my adverts often without being too annoying.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...