MCPcopy Index your code
hub / github.com/NetHack/NetHack / nhl_pushkey

Function nhl_pushkey

src/nhlua.c:1423–1438  ·  view source on GitHub ↗

push a key into command queue */ nh.pushkey("i"); */

Source from the content-addressed store, hash-verified

1421/* push a key into command queue */
1422/* nh.pushkey("i"); */
1423staticfn int
1424nhl_pushkey(lua_State *L)
1425{
1426 int argc = lua_gettop(L);
1427
1428 if (argc == 1) {
1429 const char *key = luaL_checkstring(L, 1);
1430
1431 while (*key) {
1432 cmdq_add_key(CQ_CANNED, *key);
1433 key++;
1434 }
1435 }
1436
1437 return 0;
1438}
1439
1440/* do a turn of moveloop, or until gm.multi is done if param is true. */
1441/* nh.doturn(); nh.doturn(true); */

Callers

nothing calls this directly

Calls 1

cmdq_add_keyFunction · 0.85

Tested by

no test coverage detected