Lua Utilities Snippets
1.0.0
LUA有用的實用程序!
這個文件首先是為我自己製作的,但後來我想與人分享,所以就在這裡!
string.random(count,min,max)不需要“計數,min,max”,此功能返回一個隨機字符串string.split(str,split)此功能將字符串拆分到表string.mix(str)請參閱mixstring.startswith(str,pattern)驗證字符串是否從模式開始string.endswith(str,pattern)與上面相同,但對於字符串的末端string.encode編碼的詞彙表string.decode表用於解碼string.encode.hex(str)將字符串編碼為十六進制string.decode.hex(str)將字符串解碼為十六進制string.encode.b64(str)將字符串編碼為base64string.decode.b64(str)將字符串解碼為base64string.totable將字符串轉換為表io.readfile(path/to/file.txt)讀取文件io.store(file,content,true)將數據存儲到文件中,“ true”意味著我們在文件末尾進行新行,以供將來存儲math.mix見mixmath.calc計算器沙盒(您無法注入代碼) os.find("file","dir")在目錄中搜索文件os.clear()清除終端,與所有OS一起使用os.getOS()返回當前OSos.getArch()如果拱形為64位或32位os.outputexecos.splitpath(path)拆分路徑table.merge(t1,t2)合併兩個表table.to2D(str)返回您發送的字符串的2D表版本table.tostring(tbl)返回您發送的表table.list(tbl)在字符串中返回表的元素列表,也返回計數table.head(tbl)返回第一個值table.tail(tbl)返回表的尾巴table.find(tbl)在表中找到一個值table.reverse(tbl)逆轉表。警告:僅適用於普通鍵(1,2,3 ..) console.log(str)與時間和日期記錄一些東西console.slowPrint(str)慢慢打印一些東西console.slowWrite(str)慢慢寫入一些(使用io.write)console.error(error type, error message, additional infos)高級錯誤console.update(bool,str...)將更新控制台,bool:文本是慢慢出現的。 sleep(t)將等待給定的時間operator員,總是有用的morse帶有char的桌子上的莫爾斯(Morse)chars一個帶有所有字符的字符串,用於string.encode.b64(str)mix混合字符串或intsdostring for lua 5.3的舊負載串重製 - 將字符串作為一塊代碼執行isType Short for Type(OBJ)==“ OBJ”