如何设置一键批量绑定 [英] How do I set a key binding in batch

查看:112
本文介绍了如何设置一键批量绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在做一个蝙蝠的冒险游戏,我想它,以便当玩家presses - 它带他到地图框架,当他presses =玩家进入到日记。我已经摸索出一个方法返回框架玩家本来是的,但我需要知道如何设置键绑定。结果
键绑定是一个关键,你preSS在任何时候,当你preSS它有事,就像你去一个地图或瞬移。

So I'm making a adventure game in .bat, and I want it so that when the player presses - it takes him to the Map frame and when he presses = the player goes to the Journal. I already worked out a way to return to the frame that the player was originally in, but I need to know how to set up key bindings.
Key bindings are a key that you press at anytime, and when you press it something happens, like you go to a map or teleport.

推荐答案

正如评论说您最好的选择是使用的选择。可供选择的主要设置是:

As stated in the comments your best bet is to use choice. The main setup for choice is:

@choice [/ C:] [/ N] [/吨/天] [/ M<文本>]

@choice [/c:] [/n] [/t /d ] [/m <"Text">]

在/ C属性列出了所有可用的选项(即/ C:123)。将允许1,2或3为pressed

The /c attribute lists all the available choices (i.e /c:123) would allow 1, 2 or 3 to be pressed.

在/ n指定不显示输入选择。对于[123](即的选择123将在控制台为[123]显示)?要显示离开了/ N

The /n specifies not to display the inputted choices. (i.e the choices "123" would show up in console as [123]?) For [123]? to be shown leave out the /n

/吨设置时间默认选择是由前

/t sets the time before a default choice is made

/ D套/ t秒后要进行的默认选择

/d sets the default choice to be made after /t seconds

/ M组文本要显示在控制台窗口

/m sets text to be displayed in the console window

例如:

    @ECHO off
    @CHOICE /c:123 /n /t 100 /d 1 /m "TextGoesHere"
    if ERRORLEVEL 3 GOTO three
    if ERRORLEVEL 2 GOTO two
    if ERRORLEVEL 1 GOTO one
    goto end
    :one
    echo You pressed 1!
    echo This is also the default choice after 100 seconds
    goto end
    :two
    echo You pressed 2!
    goto end
    :three
    echo You pressed 3!
    :end
    pause

将显示:

TextGoesHere [1,2,3]?

如果2 pressed:

And if 2 was pressed:

TextGoesHere [1,2,3]?
You have pressed "2"!
press any key to continue...

当然,你可以添加code到这些部分,而不是只显示文本。

And of course you could add code to these sections instead of just displaying text.

有关选择的更多信息点击这里

这篇关于如何设置一键批量绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆