Toggle techniques === The 'toggle' seems quite simple at first, it allows you to toggle between values: toggle cg_fov 60 90 120 Each time you run this statement, it checks the current value and if it finds it passed as an argument to the command, sets it to the next one. But it can do a lot more than that. "Toggle tech" --- You can toggle commands too: set text "" toggle text "say Cheat: ^2ON" "say Cheat: ^1OFF" If you then 'vstr text', it'll execute the command stored in it. "Advanced toggle tech" --- This is a technique I figured out a while ago, but haven't really made it super public yet. It takes advantage of the fact that 'toggle' keeps track of what the current value is, and sets it to the value next to it. Example: set myvar "a" toggle myvar 1 2 3 4 5 5 6 7 8 "a" 9 'toggle' will loop over the given arguments, checks if they match the current value of "myvar", and continues if they aren't. But if it does find a match, it sets it to the argument that comes after it, 9 in this case. This can be abused to create equality checks: set myvar "true" toggle myvar "true" "dosomething" "false" "dosomethingelse" Depending on the value of "myvar", the resulting value of "myvar" becomes "dosomething" or "dosomethingelse". You can chain this with the 'vstr' command to execute commands based on values. Here is a OR logic gate implemented using this technique: set OUT "" set OUT0 "set OUT \"say 0\"" set OUT1 "set OUT \"say 1\"" set A "" set B "" set TOGGLEA "toggle A \"1\" \"vstr OUT1\" \"0\" \"vstr TOGGLEB\"; vstr A; reset A" set TOGGLEB "toggle B \"0\" \"vstr OUT0\" \"1\" \"vstr OUT1\"; vstr B; reset B" // alias for readability set OR "vstr TOGGLEA" set ini "set A \"1\"; set B \"0\"; vstr OR; vstr OUT" vstr ini "A" and "B" are the inputs, "OUT" is the output. Tips & tricks --- * On CoD games that support the "setfromdvar" command, you can copy dangerous or read-only dvars to a temporary one before toggling. * If 'toggle' can't find the next value, it sets it to the first value. This can be used to create "else" statements: set mydvar "456" toggle mydvar "mydvar is not equal to 123" "123" "mydvar is equal to 123" * Put a 'wait' command between a large toggle statement and anything else, this fixes crashes with "lost reliable commands" as cause. * Large toggle statements can cause instability, it's best to create the dvar that does the toggle, clear it by setting it to "" and only using it when needed. Whenever you need it again, you do a 'reset' command, which resets the dvar back to its first state, doing the toggle, then setting it to "" again. Credits --- * Me, for figuring out the advanced toggle technique. * MayhemModding, for helping stabilize this technique for larger toggle statements. * iTrexk/UnboundUser, for figuring out the original toggle tech.