Giter Site home page Giter Site logo

luamiraiforandroid's Introduction

Welcome to my GitHub!

Anurag's github stats

luamiraiforandroid's People

Contributors

only52607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

luamiraiforandroid's Issues

在线程内使用Bot相关代码闪退

Describe the bug
未知原因,在thread使用Bot相关代码会导致整个软件层的闪退
包括但不限于
①直接使用Bot(QQ号)
②变量赋值Bot对象并调用

To Reproduce
①编写对应代码(thread代码套Bot代码)

thread(function()--线程
  --原本有while,后来用了sleep也不好使
  --因此删除了while true do,但不影响闪退
  g=Bot(qq):getGroup(群号)
end)

②导入脚本并(在有Bot在线时)执行
③恭喜,闪退了

Expected behavior
没有症状,直接闪退,且没有错误日志

Screenshots
由于前面是线程执行loadstring/loadfile内包含Bot指令(脚本前面给mybot赋值了自动获取的Bot对象,因此此截图仍然适用)
Screenshot_20220823_121510(注:前面有调用过变量执行Bot命令,读取文件执行会闪退,而图片问题虽不与更改后的Issues内容相关,但也可能是在线程中使用loadstring出现的部分代码无法执行的问题)
Screenshot_20220823_121344
Screenshot_20220823_121641
(注:没有执行os.exit)

Desktop (please complete the following information):

  • OS: 无
  • Browser 无
  • Version 无

Smartphone (please complete the following information):

  • Device: HUAWEI EMUI10
  • OS: Android 10
  • Browser: Via
  • Version 4.4.0

Additional context

脚本方面的建议

Is your feature request related to a problem? Please describe.
我在做脚本的时候经常需要reload,但是需要回去手动开关,而且脚本位置在内置数据目录("/data/data/com.ooooonly.lma/flies/scripts"),需要root权限才能编辑,而且以数字命名,不易分辨

Describe the solution you'd like
①重载脚本
实时检测(不太现实)
②脚本位置以及编辑
可以尝试转移外置存储(如"/sdcard/LuaMirai/scripts/"),并不使用随机数字命名(建议在添加脚本时让用户自行为文件取名)

Describe alternatives you've considered
①为脚本提供新代码:reload()--重新载入脚本
②内置脚本代码编辑器

Additional context

脚本内无法使用io库,require、loadfile和dofile等函数加载外部文件

使用的是最新版LuaMirai的apk包
问题一:io库的读写无法使用
导入脚本时,已授予一个储存权限,但脚本内无法使用io库的写入文件功能。需要自己去AndroidManifest.xml中添加<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />权限,添加完成后手动授权可使用io库。
该问题出现时无报错日志。
问题二:require、loadfile和dofile等函数加载外部文件
1.脚本内容
共两个脚本,分别为“测试.lua”和“mod.lua”,存放在/sdcard/RotoGame/scripts/目录下,“测试.lua”作为主文件导入软件内加载。
“测试.lua”内容如下:

-- LuaMiraiScript --
-- name: 测试
-- author: DM
-- version: 1.0
-- description: 测试
-- /LuaMiraiScript --

print(package.path)
--[[local a = "/sdcard/RobotGame/?.lua;/sdcard/RobotGame/scripts/?.lua;/sdcard/RobotGame/scripts/components/?.lua;"
a = a.."/sdcard/RobotGame/scripts/entities/?.lua;/sdcard/RobotGame/cache/?.lua;"
package.path = a
print(package.path)]]
require("mod")

“mod.lua”的内容如下:

M = {}
function M:P(arg)
  print(arg)
end

return M

使用require导入执行时报错内容如图:
Screenshot_20220603_141857_com ooooonly lma
使用loadfile导入执行时报错如图:
Screenshot_20220603_142905_com ooooonly lma
使用dofile导入执行时报错如图:
Screenshot_20220603_143110_com ooooonly lma

使用package.path 或者将文件拷贝到/data/user/0/com.ooooonly.lma/files/scripts/目录也无济于事。

问题推断:不知道是你项目对接LuaJ出的问题,这里比较推荐是参考GameGuardian中对LuaJ的更改,这是比较成功的案例。

期待你对本次情况的优化

某些情况下无法调用中文函数

Describe the bug
无法调用已定义的(中文名)函数?

To Reproduce
Steps to reproduce the behavior:
①在脚本任意位置编写(function xxx() end , xxx={["xx"]=function() end}(这个有时候不行) 或 xxx=function() end 形式)
②调用
③在绝大多数情况下都会出错:attempt to index ? (a nil value)

我已将错误信息在必应搜索,但未能找到原因

Expected behavior
只能构造,无法调用(大多数情况,使用table构造的可以调用,在某些情况(未知)也会失效)

Screenshots
IMG20220625214413
IMG20220625214236
IMG20220625214604

Desktop (please complete the following information):

  • OS: null
  • Browser null
  • Version null

Smartphone (please complete the following information):

  • Device: Android
  • OS: Android 9
  • Browser via
  • Version 1.0-alpha5

Additional context
建议还是修一下吧,我这边写脚本需要,为了方便我使用中文,如果修不了那也罢了,谢谢作者

某些方法无法调用

Describe the bug
以下均为java.lang.reflect.InvocationTargetException异常
执行已存在的方法出错

event.group:setName("测试")--修改群名称?

在执行下面的代码时出现异常

local mb=event.group:get(tonumber(任意在群里的QQ号))--转换成Member以执行
event.group:sendMessage("尝试执行中...")
local time=60*60*60*24*29--简易计算

mb:mute(time)--禁言(异常处)

To Reproduce
Steps to reproduce the behavior:
对任意Member调用方法mute即可,而且不局限于禁言,部分方法都会出现此异常(比如代码中出现但未在文档中出现的Group:setName(String)也无法调用)

Expected behavior
出现java.lang.reflect.InvocationTargetException错误,无法执行

Screenshots
image
image
image
image
image

Desktop (please complete the following information):

  • OS: null
  • Browser null
  • Version null

Smartphone (please complete the following information):

  • Device: Android
  • OS: Android 9
  • Browser via
  • Version 1.0-alpha5

Additional context
为什么存在的方法也无法调用啊?
image
image

Http模块不执行

bug类型
Http模块不执行,测试了一言和我自己写的

截图说明
QQ图片20210829153605

QQ图片20210829153601

QQ图片20210829153556

post模块有问题

放function里无报错 还以为是我写错了 拿出来才有报错

文档有3个参数 url body config

全写上还提示 method POST must have a request body.

换了多个api测试一下午 应该能确定不是我的问题 发起issue

Http.post("http://api.tianapi.com/hotreview/index","key=key")

改了好几次 github没办法换行 凑合看吧 已测试mirai最新版pc安卓都此情况

脚本列表页面无法上滑

问题描述:
脚本列表页面无法上下滑动,上滑会调出选项栏
导致无法操作下侧超出屏幕范围的脚本

Screenshot_20210903093613

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.