Skip to content

Instantly share code, notes, and snippets.

@guangrei
Created February 20, 2022 12:39
Show Gist options
  • Save guangrei/b8a745677ccf042e5f7a6257bd7d39f2 to your computer and use it in GitHub Desktop.
Save guangrei/b8a745677ccf042e5f7a6257bd7d39f2 to your computer and use it in GitHub Desktop.
Qlua Helper
--[[this is simple script to help interpreted .lua file directly, run luarocks and luarocks admin in Qlua.
author: guangrei
--]]
require "android"
c = android.dialogGetInput("Qlua Helper!", "Please Choice:\n1.interpreted .lua file directly\n2.run luarocks command\n3.run luarocks-admin command")
command = {"/data/data/com.quseit.qlua5pro2/files/bin/lua5","/data/data/com.quseit.qlua5pro2/files/bin/lua5 /data/data/com.quseit.qlua5pro2/files/bin/luarocks","/data/data/com.quseit.qlua5pro2/files/bin/lua5 /data/data/com.quseit.qlua5pro2/files/bin/luarocks-admin"}
if tonumber(c.result) == 1
then
i = android.dialogGetInput("Qlua Helper!", "please enter .lua file location")
else
i = android.dialogGetInput("Qlua Helper!", "please enter command, e.g: help")
end
os.execute(command[tonumber(c.result)].." "..i.result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment