# ezQuake Manual: Macros

Macros allow you to read and use some game specific data, like your health, status of your connection, your mp3 player volume, console width and other info you can then use for example in your scripts.

There are two types of macros: protected and unprotected.
Protected macros can be used only to format you (team)messages. That means you can only use them in combination with say/say_team/echo/if and some other commands. Macros from that group contain some of your game status.
Unprotected macros can be used in combination with any command you like.

Example of use:

    if $conwidth < 640 health scale 3 else health scale 1
    if $matchtype = 4on4 exec 4on4 else exec mix
    set volume $mp3_volume

### List of macros

$ammo
  Amount of ammo for the current weapon
$armor
$armortype
$bestammo
  Amount of ammo for the best weapon you carry
$bestweapon
  Best weapon you have according to tp_weapon_order settings
$cam_angles
  Camera looking direction
$cam_angles_pitch
$cam_angles_roll
$cam_angles_yaw
$cam_pos
  Camera position
$cam_pos_x
$cam_pos_y
$cam_pos_z
$cells
$colored_armor
Displays your armor in its respective color (red/yellow/green).
$colored_powerups
Displays the powerups you have in color.
$colored_short_powerups
Displays the powerups you have in color, but displays them in "qrp" format instead of "quad ring pent".
$conheight
$connectiontype
  player/spectator
$conwidth
$date
$deathloc
$demoplayback
  0/qwdplayback/mvdplayback
$demotime
  Position in currently played demo
$droploc
$droptime
$health
$lastip
  Last IP address seen in console. Useful for `connect $lastip` when someone pastes an IP.
$latency
  Your ping time
$ledpoint
$ledstatus
$location
$matchname
  See Match Tools
$matchstatus
  normal/standby/disconnected
$matchtype
  1on1/2on2/ffa/duel/ctf/...
$mp3_volume
  Volume of your media player
$mp3info
  Status of your media player, usualy contains name of the song it's playing
$nails
  Ammount of nail you carry
$need
$point
$pointatloc
$pointloc
$powerups
$qt
$rand
  Random number in range <0,...1) (0 inclusive, 1 exclusive)
$rockets
$serverip
  Address of the server you are connected to.
$shells
$tf_skin
$time
$took
$tookatloc
$tookloc
$triggermatch
$weapon
$weaponnum
$weapons

Last update: 27.10.2007 11:26 PDT, made by JohnNy_cz | ezQDocs