Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function GetTextValue(uuid:text, n:text, sql:text) :: text:
- set {_result} to mysql result of query "SELECT * FROM %{_sql}% WHERE `testuuid` = '%{_uuid}%'"
- set {_result::*} to mysql string "%{_n}%" in {_result}
- return "%{_result::*}%"
- #SELECT `欄位` FROM `資料表` WHERE `特定欄位` LIKE 字串 ;
- #一般用法: SELECT `id`,`name` FROM `table` WHERE `name` LIKE 'admin' ;
- #Function GetNumberValue(p:player, n:text) :: number:
- command /123456:
- trigger:
- set {_result} to mysql result of query "SELECT * FROM testsql"
- set {_testinsql::*} to mysql string "testinsql" in {_result}
- set {_testuuid::*} to mysql string "testuuid" in {_result}
- send "testinsql: %{_testinsql::*}%" to player
- send "testuuid: %{_testuuid::*}%" to player
- command /test1:
- trigger:
- send GetTextValue(uuid of player, "testinsql", "testsql")
- send GetTextValue(uuid of player, "testuuid", "testsql")
- command /test2:
- trigger:
- send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
- send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
- command /87:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('%uuid of player%','100')"
- command /9487:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','50')"
- command /111:
- trigger:
- set {_now} to "%now%"
- replace all "上午" and "下午" with "" in {_now}
- send "%{_now}%"
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','%{_now}%')"
- command /222:
- trigger:
- set {_now} to "麻糬好吃"
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','%{_now}%')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement