随笔分类 - Lua
Realate for my work, this is the robot language.
摘要:1、时间戳转换成时间 local t = 1412753621000 function getTimeStamp(t) return os.date("%Y%m%d%H",t/1000) end print(getTimeStamp(t)) 2、得时间戳 os.time() -- 当前时间戳 os.
阅读全文
摘要:string.gsub 函数有三个参数:目标串,模式串,替换串。基本作用是用来查找匹配模式的串,并将使用替换串其替换掉: s = string.gsub("Lua is good", "good", "bad?") print(s) --> Lua is badstring.gsub 的第二个返回值
阅读全文
摘要:从菜单 View - Show Console 或者 ctrl + ~ 快捷键,调出 console。将以下 Python 代码粘贴进去并 enter 执行,不出意外即完成安装。以下提供 ST3 和 ST2 的安装代码: Sublime Text 3: Sublime Text 2: 命令执行完成
阅读全文
摘要:1. 抛异常“lua: LuaInterface: cannot instantiate interpreter”,如图: 目前,重新生成dll之后,会多生成一个lua51.dll到\Lua\5.1\clibs目录中,删除了即可(好像LuaInterface.dll版本不对,也会有这种类似的问题)。
阅读全文
摘要:os.date("%Y%m%d%H%M%S", os.time()) <== 20160405141211 yyyyMMddHHmmss os.time() <== 返回当前系统的日历时间os.date() <== 返回本地化的时间字符串,这里是"11/28/08 17:23:37"os.date(
阅读全文
摘要:1.三元表达式 a?b:c => a and b or c2.循环数组1 local keys = args.kvs:get_keys()2 local arr = xstring.split(keys,',')3 for i,v in pairs(arr) do4 print(i..v)...
阅读全文
摘要:充值机器人以后就拷***.**.*.186下面的那个RechargeRobotV2_18PT充值机器人闪退的原因之一: manager.ini中的网络端口不能重复 [;管理服务器所使用的网络端口 nTCPPort= 8017]设置启用的脚本个数: [StartScript] scriptCntr =1设置启用的顺序: [StartScript0]从数据库中找到要执行的script的字段: [script_index=5]更新机器人只需要更新4个东西: [Bin/Flower.exe、Bin/pay.exe、Bin/clibs/Lib4Net4.Core.dll、Bin/clibs/Lib4Ne
阅读全文