mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-15 09:43:00 -07:00
mfkeys.lua: Remove the user input helpers (now in lualibs/utils.lua)
This commit is contained in:
parent
4e002980af
commit
392301aaab
1 changed files with 4 additions and 38 deletions
|
@ -14,49 +14,15 @@ local cmds = require('commands')
|
||||||
local keys = require('mf_default_keys')
|
local keys = require('mf_default_keys')
|
||||||
-- Ability to read what card is there
|
-- Ability to read what card is there
|
||||||
local reader = require('read14a')
|
local reader = require('read14a')
|
||||||
|
-- Asks the user for input
|
||||||
|
local utils = require('utils')
|
||||||
|
|
||||||
|
|
||||||
local desc =
|
local desc = ("This script implements check keys. \
|
||||||
("This script implements check keys. It utilises a large list of default keys (currently %d keys).\
|
It utilises a large list of default keys (currently %d keys).\
|
||||||
If you want to add more, just put them inside mf_default_keys.lua. "):format(#keys)
|
If you want to add more, just put them inside mf_default_keys.lua. "):format(#keys)
|
||||||
|
|
||||||
local TIMEOUT = 10000 -- 10 seconds
|
local TIMEOUT = 10000 -- 10 seconds
|
||||||
|
|
||||||
--[[This may be moved to a separate library at some point]]
|
|
||||||
local utils =
|
|
||||||
{
|
|
||||||
---
|
|
||||||
-- Asks the user for Yes or No
|
|
||||||
confirm = function(message, ...)
|
|
||||||
local answer
|
|
||||||
message = message .. " [y]/[n] ?"
|
|
||||||
repeat
|
|
||||||
io.write(message)
|
|
||||||
io.flush()
|
|
||||||
answer=io.read()
|
|
||||||
if answer == 'Y' or answer == "y" then
|
|
||||||
return true
|
|
||||||
elseif answer == 'N' or answer == 'n' then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
until false
|
|
||||||
end,
|
|
||||||
---
|
|
||||||
-- Asks the user for input
|
|
||||||
input = function (message , default)
|
|
||||||
local answer
|
|
||||||
if default ~= nil then
|
|
||||||
message = message .. " (default: ".. default.. " )"
|
|
||||||
end
|
|
||||||
message = message .." \n > "
|
|
||||||
io.write(message)
|
|
||||||
io.flush()
|
|
||||||
answer=io.read()
|
|
||||||
if answer == '' then answer = default end
|
|
||||||
|
|
||||||
return answer
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
local function checkCommand(command)
|
local function checkCommand(command)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue