Prompt <BadgeClient/>
A library to manage prompts in the game.
:::tip
The list of the input HashName for keys is available in the rdr3 discoveries github
:::
JO Functions > jo.prompt.create()
<!-- @include: ./slots/headers.md#client|jo.prompt.create -->
A function to create a new prompt. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.create -->
JO Functions > jo.prompt.create() > Syntax
jo.prompt.create(group, str, key, holdTime, page)
JO Functions > jo.prompt.create() > Parameters
group : string
The name of the group. Use "interaction" to display the prompt without need to call jo.prompt.displayGroup every frame
str : string
The label of the key
key : string|table
Input (string or list of strings) <br> The input of the key
holdTime : integer <BadgeOptional />
Duration to complete the prompt in ms <br> Use
falsefor classic prompt without holding timer <br> default: false
page : integer <BadgeOptional />
The page of the prompt <br> default: 0
JO Functions > jo.prompt.create() > Return Value
Type : integer
The prompt ID
<!-- @include: ./slots/examples.md#client|jo.prompt.create -->
<!-- @include: ./slots/footers.md#client|jo.prompt.create -->
JO Functions > jo.prompt.delete()
<!-- @include: ./slots/headers.md#client|jo.prompt.delete -->
A function to delete a prompt. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.delete -->
JO Functions > jo.prompt.delete() > Syntax
jo.prompt.delete(group, key, page)
JO Functions > jo.prompt.delete() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
<!-- @include: ./slots/examples.md#client|jo.prompt.delete -->
<!-- @include: ./slots/footers.md#client|jo.prompt.delete -->
JO Functions > jo.prompt.deleteAllGroups()
<!-- @include: ./slots/headers.md#client|jo.prompt.deleteAllGroups -->
A function to delete all prompts created <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.deleteAllGroups -->
JO Functions > jo.prompt.deleteAllGroups() > Syntax
jo.prompt.deleteAllGroups()
<!-- @include: ./slots/examples.md#client|jo.prompt.deleteAllGroups -->
<!-- @include: ./slots/footers.md#client|jo.prompt.deleteAllGroups -->
JO Functions > jo.prompt.deleteGroup()
<!-- @include: ./slots/headers.md#client|jo.prompt.deleteGroup -->
A function to delete a group and all its prompts. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.deleteGroup -->
JO Functions > jo.prompt.deleteGroup() > Syntax
jo.prompt.deleteGroup(group)
JO Functions > jo.prompt.deleteGroup() > Parameters
group : string
The name of the group
<!-- @include: ./slots/examples.md#client|jo.prompt.deleteGroup -->
<!-- @include: ./slots/footers.md#client|jo.prompt.deleteGroup -->
JO Functions > jo.prompt.displayGroup()
<!-- @include: ./slots/headers.md#client|jo.prompt.displayGroup -->
A function to display a prompt group during this frame. <br> Needs to be called each frame. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.displayGroup -->
JO Functions > jo.prompt.displayGroup() > Syntax
jo.prompt.displayGroup(group, title)
JO Functions > jo.prompt.displayGroup() > Parameters
group : string
The name of the prompt group to display this frame
title : string
The title to display for this prompt group
<!-- @include: ./slots/examples.md#client|jo.prompt.displayGroup -->
<!-- @include: ./slots/footers.md#client|jo.prompt.displayGroup -->
JO Functions > jo.prompt.doesLastCompletedIs()
<!-- @include: ./slots/headers.md#client|jo.prompt.doesLastCompletedIs -->
A function that returns if it's the last prompt completed. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.doesLastCompletedIs -->
JO Functions > jo.prompt.doesLastCompletedIs() > Syntax
jo.prompt.doesLastCompletedIs(group, key, page)
JO Functions > jo.prompt.doesLastCompletedIs() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.doesLastCompletedIs() > Return Value
Type : boolean
Return
trueif key is the last input completed
<!-- @include: ./slots/examples.md#client|jo.prompt.doesLastCompletedIs -->
<!-- @include: ./slots/footers.md#client|jo.prompt.doesLastCompletedIs -->
JO Functions > jo.prompt.editKeyLabel()
<!-- @include: ./slots/headers.md#client|jo.prompt.editKeyLabel -->
A function to edit the label of a key. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.editKeyLabel -->
JO Functions > jo.prompt.editKeyLabel() > Syntax
jo.prompt.editKeyLabel(group, key, label, page)
JO Functions > jo.prompt.editKeyLabel() > Parameters
group : string
The name of the group
key : string
The input of the key
label : string
The label of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
<!-- @include: ./slots/examples.md#client|jo.prompt.editKeyLabel -->
<!-- @include: ./slots/footers.md#client|jo.prompt.editKeyLabel -->
JO Functions > jo.prompt.get()
<!-- @include: ./slots/headers.md#client|jo.prompt.get -->
A function to get the prompt ID. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.get -->
JO Functions > jo.prompt.get() > Syntax
jo.prompt.get(group, key, page)
JO Functions > jo.prompt.get() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.get() > Return Value
Type : integer|boolean
The prompt ID or
false
<!-- @include: ./slots/examples.md#client|jo.prompt.get -->
<!-- @include: ./slots/footers.md#client|jo.prompt.get -->
JO Functions > jo.prompt.getAll()
<!-- @include: ./slots/headers.md#client|jo.prompt.getAll -->
A function to get all registered prompts. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.getAll -->
JO Functions > jo.prompt.getAll() > Syntax
jo.prompt.getAll()
JO Functions > jo.prompt.getAll() > Return Value
Type : table
All prompt registered
<!-- @include: ./slots/examples.md#client|jo.prompt.getAll -->
<!-- @include: ./slots/footers.md#client|jo.prompt.getAll -->
JO Functions > jo.prompt.getGroup()
<!-- @include: ./slots/headers.md#client|jo.prompt.getGroup -->
A function to get the group ID. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.getGroup -->
JO Functions > jo.prompt.getGroup() > Syntax
jo.prompt.getGroup(group)
JO Functions > jo.prompt.getGroup() > Parameters
group : string
The name of the group
JO Functions > jo.prompt.getGroup() > Return Value
Type : integer|boolean
The group ID or
false
<!-- @include: ./slots/examples.md#client|jo.prompt.getGroup -->
<!-- @include: ./slots/footers.md#client|jo.prompt.getGroup -->
JO Functions > jo.prompt.getKeyLabel()
<!-- @include: ./slots/headers.md#client|jo.prompt.getKeyLabel -->
<!-- @include: ./slots/descriptions.md#client|jo.prompt.getKeyLabel -->
JO Functions > jo.prompt.getKeyLabel() > Syntax
jo.prompt.getKeyLabel(group, key, page)
<!-- @include: ./slots/examples.md#client|jo.prompt.getKeyLabel -->
<!-- @include: ./slots/footers.md#client|jo.prompt.getKeyLabel -->
JO Functions > jo.prompt.getPage()
<!-- @include: ./slots/headers.md#client|jo.prompt.getPage -->
A function to get the current page ID for a group. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.getPage -->
JO Functions > jo.prompt.getPage() > Syntax
jo.prompt.getPage(group)
JO Functions > jo.prompt.getPage() > Parameters
group : string
The name of the group
JO Functions > jo.prompt.getPage() > Return Value
Type : integer
The page ID
<!-- @include: ./slots/examples.md#client|jo.prompt.getPage -->
<!-- @include: ./slots/footers.md#client|jo.prompt.getPage -->
JO Functions > jo.prompt.getProgress()
<!-- @include: ./slots/headers.md#client|jo.prompt.getProgress -->
A function to return the progress of a prompt. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.getProgress -->
JO Functions > jo.prompt.getProgress() > Syntax
jo.prompt.getProgress(group, key, page)
JO Functions > jo.prompt.getProgress() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.getProgress() > Return Value
Type : number
Return the percent of the prompt progress
<!-- @include: ./slots/examples.md#client|jo.prompt.getProgress -->
<!-- @include: ./slots/footers.md#client|jo.prompt.getProgress -->
JO Functions > jo.prompt.isActive()
<!-- @include: ./slots/headers.md#client|jo.prompt.isActive -->
A function to know if a prompt is active or not. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isActive -->
JO Functions > jo.prompt.isActive() > Syntax
jo.prompt.isActive(group, key, page)
JO Functions > jo.prompt.isActive() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.isActive() > Return Value
Type : boolean
Return
trueif the prompt is active
<!-- @include: ./slots/examples.md#client|jo.prompt.isActive -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isActive -->
JO Functions > jo.prompt.isCompleted()
<!-- @include: ./slots/headers.md#client|jo.prompt.isCompleted -->
A function to test if the prompt is pressed and completed. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isCompleted -->
JO Functions > jo.prompt.isCompleted() > Syntax
jo.prompt.isCompleted(group, key, fireMultipleTimes, page)
JO Functions > jo.prompt.isCompleted() > Parameters
group : string
The name of the group
key : string
The input of the key
fireMultipleTimes : boolean <BadgeOptional />
Fire true if the prompt is completed and until another prompt is completed <br> default: false
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.isCompleted() > Return Value
Type : boolean
Return
trueif the key is pressed and completed
<!-- @include: ./slots/examples.md#client|jo.prompt.isCompleted -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isCompleted -->
JO Functions > jo.prompt.isEnabled()
<!-- @include: ./slots/headers.md#client|jo.prompt.isEnabled -->
A function to know if the prompt is enabled. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isEnabled -->
JO Functions > jo.prompt.isEnabled() > Syntax
jo.prompt.isEnabled(group, key, page)
JO Functions > jo.prompt.isEnabled() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.isEnabled() > Return Value
Type : boolean
Return
trueif the prompt is enabled
<!-- @include: ./slots/examples.md#client|jo.prompt.isEnabled -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isEnabled -->
JO Functions > jo.prompt.isExist()
<!-- @include: ./slots/headers.md#client|jo.prompt.isExist -->
A function to know if a prompt exists. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isExist -->
JO Functions > jo.prompt.isExist() > Syntax
jo.prompt.isExist(group, key, page)
JO Functions > jo.prompt.isExist() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.isExist() > Return Value
Type : boolean
Return
trueif the prompt exists
<!-- @include: ./slots/examples.md#client|jo.prompt.isExist -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isExist -->
JO Functions > jo.prompt.isGroupExist()
<!-- @include: ./slots/headers.md#client|jo.prompt.isGroupExist -->
A function to know if a prompt group exists. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isGroupExist -->
JO Functions > jo.prompt.isGroupExist() > Syntax
jo.prompt.isGroupExist(group)
JO Functions > jo.prompt.isGroupExist() > Parameters
group : string
The name of the group
JO Functions > jo.prompt.isGroupExist() > Return Value
Type : boolean
Return
trueif the group exists
<!-- @include: ./slots/examples.md#client|jo.prompt.isGroupExist -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isGroupExist -->
JO Functions > jo.prompt.isPressed()
<!-- @include: ./slots/headers.md#client|jo.prompt.isPressed -->
A function to know if a key is pressed. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isPressed -->
JO Functions > jo.prompt.isPressed() > Syntax
jo.prompt.isPressed(key)
JO Functions > jo.prompt.isPressed() > Parameters
key : string
The input of the key
JO Functions > jo.prompt.isPressed() > Return Value
Type : boolean
Return
trueif the key is pressed
<!-- @include: ./slots/examples.md#client|jo.prompt.isPressed -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isPressed -->
JO Functions > jo.prompt.isVisible()
<!-- @include: ./slots/headers.md#client|jo.prompt.isVisible -->
A function to check if a prompt is visible. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.isVisible -->
JO Functions > jo.prompt.isVisible() > Syntax
jo.prompt.isVisible(group, key, page)
JO Functions > jo.prompt.isVisible() > Parameters
group : string
The name of the group
key : string
The input of the key
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
JO Functions > jo.prompt.isVisible() > Return Value
Type : boolean
Return
trueif the prompt is visible
<!-- @include: ./slots/examples.md#client|jo.prompt.isVisible -->
<!-- @include: ./slots/footers.md#client|jo.prompt.isVisible -->
JO Functions > jo.prompt.setEnabled()
<!-- @include: ./slots/headers.md#client|jo.prompt.setEnabled -->
A function to define if the prompt is enabled or not. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.setEnabled -->
JO Functions > jo.prompt.setEnabled() > Syntax
jo.prompt.setEnabled(group, key, value, page)
JO Functions > jo.prompt.setEnabled() > Parameters
group : string
The name of the group
key : string
The input of the key
value : boolean
If the prompt is enabled or not
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
<!-- @include: ./slots/examples.md#client|jo.prompt.setEnabled -->
<!-- @include: ./slots/footers.md#client|jo.prompt.setEnabled -->
JO Functions > jo.prompt.setGroups()
<!-- @include: ./slots/headers.md#client|jo.prompt.setGroups -->
A function to overwrite the prompt groups value. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.setGroups -->
JO Functions > jo.prompt.setGroups() > Syntax
jo.prompt.setGroups(groups)
JO Functions > jo.prompt.setGroups() > Parameters
groups : table
The prompt group value from other script get with jo.prompt.getAll()
<!-- @include: ./slots/examples.md#client|jo.prompt.setGroups -->
<!-- @include: ./slots/footers.md#client|jo.prompt.setGroups -->
JO Functions > jo.prompt.setVisible()
<!-- @include: ./slots/headers.md#client|jo.prompt.setVisible -->
Turn on/off a prompt. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.setVisible -->
JO Functions > jo.prompt.setVisible() > Syntax
jo.prompt.setVisible(group, key, value, page)
JO Functions > jo.prompt.setVisible() > Parameters
group : string
The name of the group
key : string
The input of the key
value : boolean
If the prompt is visible or not
page : integer <BadgeOptional />
The page of the prompt <br> default: current page
<!-- @include: ./slots/examples.md#client|jo.prompt.setVisible -->
<!-- @include: ./slots/footers.md#client|jo.prompt.setVisible -->
JO Functions > jo.prompt.waitRelease()
<!-- @include: ./slots/headers.md#client|jo.prompt.waitRelease -->
A function to wait for the release of pressed key. <br>
<!-- @include: ./slots/descriptions.md#client|jo.prompt.waitRelease -->
JO Functions > jo.prompt.waitRelease() > Syntax
jo.prompt.waitRelease(key)
JO Functions > jo.prompt.waitRelease() > Parameters
key : string
The input of the key
<!-- @include: ./slots/examples.md#client|jo.prompt.waitRelease -->
<!-- @include: ./slots/footers.md#client|jo.prompt.waitRelease -->