Upvote Upvoted 0 Downvote Downvoted
1 2
How do I order commands in scripts?
posted in Customization
1
#1
-1 Frags +

An issue I often face when making scripts is that I have no idea how to order the commands. I typically order ±aliases like this:

alias +posalias <stuff>
alias -posalias <stuff>
<cmds>

and in timed sequences of commands it's easy to order them.

However when it comes to less timing-based commands (like the closecaption cvars ), I have no idea how to order them (as in how I order the commands are inconsistent). As is the case with mat_savechanges and other material cvars, the order does make a difference sometimes.

An issue I often face when making scripts is that I have no idea how to order the commands. I typically order ±aliases like this:
[code]
alias +posalias <stuff>
alias -posalias <stuff>
<cmds>[/code]

and in timed sequences of commands it's easy to order them.

However when it comes to less timing-based commands (like the closecaption cvars ), I have no idea how to order them (as in how I order the commands are inconsistent). As is the case with mat_savechanges and other material cvars, the order does make a difference sometimes.
2
#2
5 Frags +

This is forbidden knowledge

This is forbidden knowledge
3
#3
34 Frags +

For starters what is your TF2 environment (mods, hardware, OS, etc.)? Have you tried a clean install?

For starters what is your TF2 environment (mods, hardware, OS, etc.)? Have you tried a clean install?
4
#4
19 Frags +

Order doesn't matter since at usage time, everything you set will be there. For aliases, aliases are looked up when the alias is executed, so you can bind even before defining an alias. The cmdline is just strings when you assign values, aliases, binds, etc. For convars, an exec will run synchronously to the main thread of the game, so there is no race condition when changing multiple values.

If you are concerned about material system convars with the material system thread, those are "uploaded" to the material system after an exec in complete, so same thing there. And keep in mind that at initialization, TF2 runs the material system synchronously anyway, so autoexecs are safe either way. The threaded material system is only started after you join a game (or the frame after you set mat_queue_mode 2).

As for commands, they will obviously execute in order as you put them, but there is no general practice for ordering these, since there are possibly hundreds of commands with their own functionality, and you will have to determine the correct ordering for your intention on a case by case basis.

Order doesn't matter since at usage time, everything you set will be there. For aliases, aliases are looked up when the alias is executed, so you can bind even before defining an alias. The cmdline is just strings when you assign values, aliases, binds, etc. For convars, an exec will run synchronously to the main thread of the game, so there is no race condition when changing multiple values.

If you are concerned about material system convars with the material system thread, those are "uploaded" to the material system after an exec in complete, so same thing there. And keep in mind that at initialization, TF2 runs the material system synchronously anyway, so autoexecs are safe either way. The threaded material system is only started after you join a game (or the frame after you set mat_queue_mode 2).

As for commands, they will obviously execute in order as you put them, but there is no general practice for ordering these, since there are possibly hundreds of commands with their own functionality, and you will have to determine the correct ordering for your intention on a case by case basis.
5
#5
-17 Frags +

It's just as I feared the answer would be: The order of commands is up to preference. I'm just not good at personal preference decisions, and can't decide on any of them. Still this is a nice question to ask, as I couldn't find any other posts here or on r/tf2scripts asking the same question.

RockzFor starters what is your TF2 environment (mods, hardware, OS, etc.)? Have you tried a clean install?

My Mods.
OS: Dualboot (Primarily) Linux Mint and Windows 10
CPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.
I haven't done a clean install.

It's just as I feared the answer would be: The order of commands is up to preference. I'm just not good at personal preference decisions, and can't decide on any of them. Still this is a nice question to ask, as I couldn't find any other posts here or on r/tf2scripts asking the same question.

[quote=Rockz]For starters what is your TF2 environment (mods, hardware, OS, etc.)? Have you tried a clean install?[/quote]

[url=https://github.com/WhyIsEvery4thYearAlwaysBad/420weedsmoker69]My Mods.[/url]
OS: Dualboot (Primarily) Linux Mint and Windows 10
CPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.
I haven't done a clean install.
6
#6
payload.tf
2 Frags +
AimIsADick

Order doesn't matter as long as it doesn't break your game

[quote=AimIsADick][/quote]
Order doesn't matter as long as it doesn't break your game
7
#7
34 Frags +
AimIsADickCPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.

Ah yes, the famed Intel integrated CPU

[quote=AimIsADick]
CPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.
[/quote]

Ah yes, the famed Intel integrated CPU
8
#8
11 Frags +
_flacAimIsADickCPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.

Ah yes, the famed Intel integrated CPU

Mans playing on a pointing stick

[quote=_flac][quote=AimIsADick]
CPU: Intel Integrated CPU @ 2.2GHz
GPU: Intel Integrated Graphics.
[/quote]

Ah yes, the famed Intel integrated CPU[/quote]
Mans playing on a pointing stick
9
#9
17 Frags +
AimIsADick

LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago

[quote=AimIsADick][/quote]
LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago
10
#10
14 Frags +

Reddit University Class Of 3012

Reddit University Class Of 3012
11
#11
-15 Frags +
RockzLMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago

Well it's an important part of troubleshooting after all.

[quote=Rockz]LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago[/quote]

Well it's an important part of troubleshooting after all.
12
#12
8 Frags +
AimIsADickWell it's an important part of troubleshooting after all.

Thanks for the precise reply, super helpful!

[quote=AimIsADick]
Well it's an important part of troubleshooting after all.[/quote]
Thanks for the precise reply, super helpful!
13
#13
8 Frags +
AimIsADickIt's just as I feared the answer would be: The order of commands is up to preference. I'm just not good at personal preference decisions, and can't decide on any of them. Still this is a nice question to ask, as I couldn't find any other posts here or on r/tf2scripts asking the same question.

You can randomly order your scripts. Let fate decide.

[quote=AimIsADick]It's just as I feared the answer would be: The order of commands is up to preference. I'm just not good at personal preference decisions, and can't decide on any of them. Still this is a nice question to ask, as I couldn't find any other posts here or on r/tf2scripts asking the same question.[/quote]

You can randomly order your scripts. Let fate decide.
14
#14
-13 Frags +
mastercomsYou can randomly order your scripts. Let fate decide.

That can work for files. I just don't know how to do this for commands too.

Also gonna test out my system info hotstring real quick:
OS: Dualboot
Primary: Linux Mint (MATE)
Secondary: Windows 10 Home
CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.6GHz (x64)
capacity: 4200MHz
clock: 100MHz
threads: 8
GPU: Intel UHD Graphics
Memory: 8GiB SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
Network: RTL8821CE 802.11ac PCIe Wireless Network Adapter
Battery: 41926mWh @ 11.6V

[quote=mastercoms]You can randomly order your scripts. Let fate decide.[/quote]

That can work for files. I just don't know how to do this for commands too.

Also gonna test out my system info hotstring real quick:
OS: Dualboot
Primary: Linux Mint (MATE)
Secondary: Windows 10 Home
CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.6GHz (x64)
capacity: 4200MHz
clock: 100MHz
threads: 8
GPU: Intel UHD Graphics
Memory: 8GiB SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
Network: RTL8821CE 802.11ac PCIe Wireless Network Adapter
Battery: 41926mWh @ 11.6V
15
#15
7 Frags +
AimIsADickmastercomsYou can randomly order your scripts. Let fate decide.
That can work for files. I just don't know how to do this for commands too.

Also gonna test out my system info hotstring real quick:
OS: Dualboot
Primary: Linux Mint (MATE)
Secondary: Windows 10 Home
CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.6GHz (x64)
capacity: 4200MHz
clock: 100MHz
threads: 8
GPU: Intel UHD Graphics
Memory: 8GiB SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
Network: RTL8821CE 802.11ac PCIe Wireless Network Adapter
Battery: 41926mWh @ 11.6V

It surprises me that you would use linux

[quote=AimIsADick][quote=mastercoms]You can randomly order your scripts. Let fate decide.[/quote]

That can work for files. I just don't know how to do this for commands too.

Also gonna test out my system info hotstring real quick:
OS: Dualboot
Primary: Linux Mint (MATE)
Secondary: Windows 10 Home
CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.6GHz (x64)
capacity: 4200MHz
clock: 100MHz
threads: 8
GPU: Intel UHD Graphics
Memory: 8GiB SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
Network: RTL8821CE 802.11ac PCIe Wireless Network Adapter
Battery: 41926mWh @ 11.6V[/quote]
It surprises me that you would use linux
16
#16
13 Frags +
DesonatorIt surprises me that you could use linux
[quote=Desonator]
It surprises me that you [b]could [/b]use linux[/quote]
17
#17
3 Frags +

this guy definitely has the most fucked up install

this guy definitely has the most fucked up install
18
#18
1 Frags +

www.reddit.com

www.reddit.com
19
#19
-8 Frags +
RockzAimIsADickLMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago

you’re so mentally retarded just take care of your hamster

[quote=Rockz][quote=AimIsADick][/quote]
LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago[/quote]
you’re so mentally retarded just take care of your hamster
20
#20
8 Frags +

ok thats just rude ^

ok thats just rude ^
21
#21
5 Frags +
carnaticumRockzAimIsADickLMFAO i cant believe you actually answered that, i just copied a post you posted like a day agoyou’re so mentally retarded just take care of your hamster

got something against pet rodents bud? we'll fuck u up

Show Content
[quote=carnaticum][quote=Rockz][quote=AimIsADick][/quote]
LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago[/quote]
you’re so mentally retarded just take care of your hamster[/quote]

got something against pet rodents bud? we'll fuck u up
[spoiler]
[img]https://cdn.discordapp.com/attachments/820295056748969994/853095319474798602/PXL_20210612_021533279.jpg[/img][/spoiler]
22
#22
-4 Frags +

Sir, this is a wendy's.

Alright fr tho, in context of the sequential order of commands; the question should not be how, but rather when:

Show Content
deez nuts get slapped across your face lmao
Sir, this is a wendy's.

Alright fr tho, in context of the sequential order of commands; the question should not be how, but rather when:

[spoiler]deez nuts get slapped across your face lmao[/spoiler]
23
#23
-6 Frags +
_flacDesonatorIt surprises me that you could use linux

?

carnaticumRockzAimIsADickLMFAO i cant believe you actually answered that, i just copied a post you posted like a day agoyou’re so mentally retarded just take care of your hamster

I hate pets and don't have any. Also I answered the question because it's good practice to give system info for troubleshooting.

[quote=_flac][quote=Desonator]
It surprises me that you [b]could [/b]use linux[/quote][/quote]
?[quote=carnaticum][quote=Rockz][quote=AimIsADick][/quote]
LMFAO i cant believe you actually answered that, i just copied a post you posted like a day ago[/quote]
you’re so mentally retarded just take care of your hamster[/quote]
I hate pets and don't have any. Also I answered the question because it's good practice to give system info for troubleshooting.
24
#24
0 Frags +
AimIsADick?

heres a command thatll help you see which commands are executed in what order:
sudo rm -rf /

[quote=AimIsADick]
?[/quote]
heres a command thatll help you see which commands are executed in what order:
sudo rm -rf /
25
#25
-11 Frags +
_flacheres a command thatll help you see which commands are executed in what order:
sudo rm -rf /

I was asking what do you mean?

(If you're unaware, that command just deletes ALL files on the current partition in linux. Dick.)

[quote=_flac]
heres a command thatll help you see which commands are executed in what order:
sudo rm -rf /[/quote]
I was asking what do you mean?

(If you're unaware, that command just deletes ALL files on the current partition in linux. Dick.)
26
#26
6 Frags +
AimIsADick_flacheres a command thatll help you see which commands are executed in what order:
sudo rm -rf /
I was asking what do you mean?

(If you're unaware, that command just deletes ALL files on the current partition in linux. Dick.)

dumb

[quote=AimIsADick][quote=_flac]
heres a command thatll help you see which commands are executed in what order:
sudo rm -rf /[/quote]
I was asking what do you mean?

(If you're unaware, that command just deletes ALL files on the current partition in linux. Dick.)[/quote]
dumb
27
#27
13 Frags +

AimIsADick you have made 255 posts on this website and all of them are tragic

AimIsADick you have made 255 posts on this website and all of them are tragic
28
#28
-4 Frags +
MakemakeAimIsADick you have made 255 posts on this website and all of them are tragic

How exactly?

[quote=Makemake]AimIsADick you have made 255 posts on this website and all of them are tragic[/quote]
How exactly?
29
#29
1 Frags +
AimIsADickMakemakeAimIsADick you have made 255 posts on this website and all of them are tragicHow exactly?

I'm still not sure if you are one of the most immaculate baiters that I have ever seen, or the least self-aware person on the internet. Either way, keep it up

[quote=AimIsADick][quote=Makemake]AimIsADick you have made 255 posts on this website and all of them are tragic[/quote]
How exactly?[/quote]
I'm still not sure if you are one of the most immaculate baiters that I have ever seen, or the least self-aware person on the internet. Either way, keep it up
30
#30
-1 Frags +
AbsoluteZeroI'm still not sure if you are one of the most immaculate baiters that I have ever seen, or the least self-aware person on the internet. Either way, keep it up

I'm not trying to bait any one so it's the latter. I can't even pickup on social cues anyway; I'm autistic after all.

[quote=AbsoluteZero]I'm still not sure if you are one of the most immaculate baiters that I have ever seen, or the least self-aware person on the internet. Either way, keep it up[/quote]

I'm not trying to bait any one so it's the latter. I can't even pickup on social cues anyway; I'm autistic after all.
1 2
Please sign in through STEAM to post a comment.