Project Zomboid

Project Zomboid

Không đủ lượt đánh giá
PhunLib
   
Giải thưởng
Yêu thích
Đã yêu thích
Bỏ thích
Kích cỡ file
Đã đăng
Đã cập nhật
1.412 MB
21 Thg01 @ 12:23am
20 Thg09 @ 5:46am
11 ghi chú thay đổi ( xem )

Đăng ký để tải xuống
PhunLib

Trong 1 bộ sưu tập tạo bởi UburGeek
PhunZoid S10
339 vật phẩm
Mô tả
Shared functions for Phun mods
File tools
  • PhunLib.table.tableToString(table) - returns a string representation of a lua table
  • PhunLib.table.saveTable(filename, data) - saves a table to Lua\{filename}.lua
  • PhunLib.file.loadTable(filename, createIfNotExists*) - returns a table loaded from Lua\{filename}.lua
  • PhunLib.table.log(...) - appends the values passed to lua\Phun.log
Table tools
  • PhunLib.table.shallowCopy(original, excludeKeys*) - returns a shallow copy of original table. Optionally include an ArrayList of keys to exclude
  • PhunLib.table.deepCopy(original, excludeKeys*) - returns a deep copy of original table. Optionally include ArrayList of keys to exclude
  • PhunLib.table.merge(tableA, tableB, excludeKeys*) - returns a merged copy of 2 tables where tableA is merged into tableA. Optionally include an ArrayList of keys to exclude
String tools
  • PhunLib.string.formatWholeNumber(number) - takes a number and returns thousands separated string without any decimals (eg 2432.3 returns "2,432")
  • PhunLib.string.timeDifference(time1, time2*) - returns the number of years, months, hours, minutes and seconds as a number between 2 timestamps. time2 defaults to now
  • PhunLib.string.timeAgo(time1, time2*, defaultText*) - returns friendly text of time difference as string between timestamps. time2 defaults to now, defaultText defaults to "Just Now"
Events
  • PhunLib.events.OnDawn - triggered when its morning (configured via settings)
  • PhunLib.events.OnDusk - triggered when its evening (configured via settings)
  • PhunLib.events.OnReady - triggered when PhunLib is loaded
  • PhunLib.events.OnEmptyServer - triggered when PhunLib detects the server is empty (runs once per empty)
Misc tools
  • PhunLib.debug(...) - takes strings, numbers and/or tables and prints each out into readable format
  • PhunLib.printTable(...) - prints contents of table to console
  • PhunLib.onlinePlayers(...) - returns ArrayList of players regardless of if its single player. If called by client, returns only isLocalPlayers

Made for B41 and B42
[discord.gg]
Coded with love for our awesome PhunZoid[discord.gg] community. Repo and more info[github.com]

Workshop ID: 3411695932
Mod ID: phunlib