Skip to content

Examples

WhyIsEvery4thYearAlwaysBad edited this page Aug 4, 2021 · 9 revisions

Examples

Example CMenus that show the potential of this generator.

Spy Calls

CMenu Generator code:

predisplay_time = "0"
linger_time = "0"
"root" {
	"Spy Calls" {
		"Scout/Soldier/Pyro" {
			BIND "Scout" "say_team Spy Scout" |
			BIND "Soldier" "say_team Spy Soldier" |
			BIND "Pyro" "say_team Spy Pyro" |
		}
		"Demo/Heavy/Engi" {
			BIND "Demo" "say_team Spy Demo" |
			BIND "Heavy" "say_team Spy Heavy" |
			BIND "Engi" "say_team Spy Engi" |
		}
		"Medic/Sniper/Spy" {
			BIND "Medic" "say_team Spy Medic" |
			BIND "Sniper" "say_team Spy Sniper" |
			BIND "Spy" "say_team Spy Spy" |
		}
	}
}

CFG script code:

exec cmenu_initialize
bind <KEY> +menu
alias +menu1 "exec $cmenu_root"
alias -menu1 "alias -menu -menu2; alias +menu +menu2"
alias +menu2 "cmenu.exitmenu"
alias -menu2 "alias -menu -menu1; alias +menu +menu1"
-menu2

(Replace <KEY> with the key you want to use.)

Meme binds

CMenu Generator code:

"meme binds" {
	"[Crit jokes]" {
		BIND "Crit joke" "say Random crits are fair and balanced!" |
		BIND "Crit joke 2" "say Random crits are- ok this is getting old…" |
		BIND "Phlog 100% Crit" "say Man the TF team needs to add constant Critical Hit displays when attacking with a critted Phlog." |
	}
	BIND "Lmaobox joke" "say Git gud. Git LMAOBox!" |
	BIND "Aim Bad = Source Code Bad" "say I just completely missed a heavy. I blame TF2's Source spagetthi!" |
}

CFG script code:

exec cmenu_initialize
bind <KEY> +menu
alias +menu "exec $cmenu_meme_binds"
alias -menu "cmenu.exitmenu"

(Replace <KEY> with the key you want to use.)

Trade Binds

Note: The prices listed in the binds are not meant to reflect current prices of items, I don't actually sell any of these items, and the comments do not neccesarily reflect my actual opinions.

CMenu Generator code:

"trade_binds" {
	"[CS:GO]" {
		"[Snipers]" {
			"[AWP]" {
				BIND "(S) Snake Camo FT" "say Selling Field-Tested Snake Camo AWP for 64$ on csgo.backpack.tf!" |
				BIND "(B) Sun in Leo FT" "say Buying Field-Tested Sun in Leo AWP for 6.5$ on csgo.backpack.tf!" |
				BIND "(S) Gungir WW" "say Selling Well-Worn Gungnir AWP for $1.35k on csgo.backpack.tf!" |
			}
			"[SCAR-20]" {
				// Really want this one ;P
				BIND "(B) Storm MW" "say Buying MW Storm SCAR-20 on csgo.backpack.tf!" |
				// Looks cool but it's not my taste.
				BIND "(S) Bloodsport FN" "say Selling FN Bloodsport SCAR-20 on csgo.backpack.tf!" |
				// Who the hell would buy an emerald scar? Eh someone's gonna get it anyway.
				BIND "(S) Emerald FN" "say Selling FN Emerald SCAR-20 on csgo.backpack.tf!" |
				BIND "(S) Brass" "say Selling FT Brass SCAR-20 on csgo.backpack.tf!" |
			}
		}
		"[Knives]" {
			BIND "(S) Karambit" "say Selling Karambit | Forest DDPAT (Field-Tested) for 243$ on csgo.backpack.tf!" |
			BIND "(S) Bowie Knife" "say Selling ★ Bowie Knife for 95.67$ on csgo.backpack.tf!" |
			"[M9 Bayonet]" {
				BIND "(B) Safari Mesh" "say Buying MW Safari Mesh M9 for 196.1$ on csgo.backpack.tf!" |
				BIND "(S) Crimson Web" "say Selling MW Crimson Web M9 for 2k$, with a 10% discount on csgo.backpack.tf!" |
				BIND "(S) Case Hardened" "say Selling WW Case Hardened M9 for 200$ on csgo.backpack.tf! |
			}
		}
	}
	"[TF2]" {
		"[Unusuals]" {
			BIND "(S) Buckaroo's Hat" "say Selling Unusual Buckaroo's Hat for 7.1 keys on backpack.tf!" |
			BIND "(B) Napper's Respite" "say Buying Unusual Napper's Respite for 2-2.5 keys on backpack.tf!" |
			BIND "(B) Hat of Cards" "say Buying Unusual Hat of Cards for 20 keys on backpack.tf!" |
		}
		"[Killstreaks]" {
			BIND "(B) Ambassador" "say Buying KS Ambassador for 23 ref on backpack.tf!" |
			BIND "(B) Hitman" "say Buying KS Hitman's Heatmaker for 19 ref on backpack.tf!" |
			// For strange ubersaw named "meta op"
			BIND "(B) Killstreak Ubersaw Kit" "say Buying Ubersaw KS Kit for 40 ref on backpack.tf!" |
		}
		"[Stranges]" {
			// Why are Strange Kritzkriegs THAT expensive?
			BIND "(B) Strange Kritzkreig" "say Buying Strange Kritzkrieg for 43 keys on backpack.tf!" |
			"[Parts]" {
				// For my new crusader's crossbow skin.
				BIND "(B) Allied Healing Done" "say Buying Healing Done strange part for 1.5-1.8 keys on backpack.tf!" |
				// For my new knife ;)
				BIND "(B) Medics Killed" "say Buying medic-kills strange part for 1.6 keys on backpack.tf!" |
				// Just became a Headshot God after 2 years of MGE.
				BIND "(B) Headshot Kills" "say Buying Headshot Kills strange part for 2.7 keys on backpack.tf!" |
			}
		}
	}
}

CFG Code:

bind <KEY> +trade_menu
alias +trade_menu1 "exec $cmenu_trade_binds"
alias -trade_menu1 "alias -trade_menu -trade_menu_2; alias +trade_menu +trade_menu2"
alias +trade_menu2 "cmenu.exitmenu"
alias -trade_menu2 "alias -trade_menu -trade_menu1; alias +trade_menu +trade_menu1"
-trade_menu2

(Replace <KEY> with the key you want to use.)

Nav Mesh Editor

This is a CMenu meant to increase the convenience in making nav meshes, by allowing nav mesh creators to access common commands to one central place, so that they do not having to constantly rebind their keys.

CMenu Generator code:

format = "<clr:234,209,174><B>$(nkey). $(str)<B> <cr>"
predisplay_time = "0"
linger_time = "0"
"Nav Mesh editor" {
	TOGGLE BIND "Enable Nav Editing" "nav_edit 1; tf_show_mesh_decoration 1; tf_show_mesh_decoration_manual 1" "Disable Nav Editing" "nav_edit 0; tf_show_mesh_decoration 0; tf_show_mesh_decoration_manual 0" |
	"[Nav Mesh]" {
		"[Select]" {
			BIND "nav_mark" "nav_mark" |
			TOGGLE BIND "Start Area Select" "nav_begin_drag_selecting" "End Area Select" "nav_end_drag_selecting" |
			TOGGLE BIND "Start Area Deselect" "nav_begin_drag_deselecting" "End Area Select" "nav_end_drag_deselecting" |
			BIND "Flood Select" "nav_flood_select" |
		}
		"[Edit]" {
			TOGGLE BIND "(Begin) Create Mesh" "nav_begin_area" "(End) Create Mesh" "nav_end_area" |
			"[Operations]" {
				BIND "Split" "nav_split" |
				BIND "Merge" "nav_merge" |
				BIND "Splice" "nav_splice" |
			}
			"[Delete]" {
				BIND "Delete" "nav_delete" |
				BIND "Delete Marked area" "nav_delete_marked" |
			}
			"[(Dis)connect]" {
				BIND "Connect" "nav_connect" |
				BIND "Disconnect" "nav_disconnect" |
			}
		}
		"[Mark]" {
			"[Source]" {
				"[Section 1]" {
					BIND "nav_crouch" "nav_crouch" |
					BIND "nav_fog_mark" "nav_fog_mark" |
					BIND "nav_fog_pick" "nav_fog_pick" |
					BIND "nav_fog_select_place" "nav_fog_select_place" |
					BIND "nav_gen_cliffs_approx" "nav_gen_cliffs_approx" |
					BIND "nav_precise" "nav_precise" |
					BIND "nav_jump" "nav_jump" |
					BIND "nav_no_jump" "nav_no_jump" |
					BIND "nav_stop" "nav_stop" |
				}
				"[Section 2]" {
					BIND "nav_walk" "nav_walk" |
					BIND "nav_run" "nav_run" |
					BIND "nav_avoid" "nav_avoid" |
					BIND "nav_transient" "nav_transient" |
					BIND "nav_dont_hide" "nav_dont_hide" |
					BIND "nav_stand" "nav_stand" |
					BIND "nav_no_hostages" "nav_no_hostages" |
				}
			}
			"[Team Fortress 2]" {
				BIND "Sentry Spot" "tf_mark SENTRY_SPOT" |
				BIND "Sniper Spot" "tf_mark SNIPER_SPOT" |
			}
		}
		"[Place]" {
			BIND "Pick place" "nav_place_pick" |
			BIND "Mark unnamed place" "nav_mark_unnamed" |
		}
		"[Misc]" {
			BIND "Save generated nav mesh" "nav_save" |
			BIND "Analyze generated nav mesh" "nav_analyze" |
		}
	}
	"[Generation]" {
		BIND "Mark walkable" "nav_mark_walkable" |
		BIND "Clear walkables" "nav_clear_walkable_marks" |
		"[Generate]" {
			BIND "Fully Generate Nav Mesh" "nav_generate" |
			BIND "Incrementally Generate Nav Mesh" "nav_generate_incremental" |
		}
	}
	"[Place]" {
		BIND "Toggle Place mode" "nav_toggle_place_mode" |
		BIND "Toggle Place Planting mode" "nav_toggle_place_painting" |
		BIND "List places" "nav_place_list" |
	}
	BIND "toggle nb_blind" "toggle nb_blind" |
}

CFG script code:

exec cmenu_initialize
bind v +open_navmenu
alias +open_navmenu0 "exec $cmenu_nav_mesh_editor"
alias -open_navmenu0 "alias -open_navmenu -open_navmenu1; alias +open_navmenu +open_navmenu1"
alias +open_navmenu1 "cmenu.exitmenu"
alias -open_navmenu1 "alias -open_navmenu -open_navmenu0; alias +open_navmenu +open_navmenu0"
-open_navmenu1

You can take a look at my own CMenu that I use in-game for inspiration. However it is quite large, because of the amount of binds I use for calls. If you don't need the call binds, then look into the cmenus directory in the 420weedsmoker69 repo.

CFG script code:

bind X +open_mmenu
alias +open_mmenu0 "exec $cmenu_root"
alias -open_mmenu0 "alias -open_mmenu -open_mmenu1; alias +open_mmenu +open_mmenu1"
alias +open_mmenu1 "cmenu.exitmenu"
alias -open_mmenu1 "alias -open_mmenu -open_mmenu0; alias +open_mmenu +open_mmenu0"
-open_mmenu1
// Calls
bind C +open_callmenu
alias +open_callmenu0 "exec $cmenu_calls"
alias -open_callmenu0 "alias -open_callmenu -open_callmenu1; alias +open_callmenu +open_callmenu1"
alias +open_callmenu1 "cmenu.exitmenu"
alias -open_callmenu1 "alias -open_callmenu -open_callmenu0; alias +open_callmenu +open_callmenu0"
-open_callmenu1
// Nav Mesh Editor
bind z +open_navmenu
alias +open_navmenu0 "exec $cmenu_nav_mesh_editor"
alias -open_navmenu0 "alias -open_navmenu -open_navmenu1; alias +open_navmenu +open_navmenu1"
alias +open_navmenu1 "cmenu.exitmenu"
alias -open_navmenu1 "alias -open_navmenu -open_navmenu0; alias +open_navmenu +open_navmenu0"
-open_navmenu1