Engine:CCMD bind: Difference between revisions

201 bytes removed ,  15 October 2023
No edit summary
Line 17: Line 17:
== Examples ==
== Examples ==
=== Default values ===
=== Default values ===
* Check alias 'bob' for script value. No alias exists named 'bob'.
* Check bind 'Z' for script value. No bind exists for key 'Z'.
<kua>
<kua>
> bind Z
> bind Z
Unknown: bob
Unknown: Z
</kua>
</kua>
* Call 'bob'. No command, variable or alias named 'bob' exist.
* Create a bind for Z key to echo 'fred'.
<kua>
<kua>
> bob
> bind Z "echo fred"
Unknown: bob
</kua>
</kua>
* Create an alias 'bob' and set to 'echo fred'.  
* Close console and press 'Z' key. Prints 'fred'.
<kua>
<kua>
> alias bob "echo fred"
</kua>
* Same as the second example, but now alias 'bob' exists. The 'echo' command in the 'bob' alias script runs, and prints 'fred'.
<kua>
> bob
fred
fred
</kua>
</kua>
* Same as the first example, but now alias 'bob' exists and shows the value of the alias 'bob'
* Same as the first example, but now bind 'Z' exists and shows the value of the bind 'Z'
<kua>
<kua>
> alias bob
> alias bob