Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function GetValue(uuid:text, n:text, sql:text) :: text:
- set {_result::*} to mysql objects in column "%{_n}%" from result of query "SELECT %{_n}% FROM %{_sql}% WHERE `testuuid` = '%{_uuid}%'"
- return "%{_result::*}%"
- Function GetValue2(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 /clearrr:
- trigger:
- mysql update "TRUNCATE TABLE testsql"
- 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 GetValue(uuid of player, "testinsql", "testsql")
- send GetValue(uuid of player, "testuuid", "testsql")
- send GetValue(uuid of player, "createtime", "testsql")
- command /test2:
- trigger:
- send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
- send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
- send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "createtime", "testsql")
- command /test3:
- trigger:
- send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
- send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
- send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
- command /test4:
- trigger:
- send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
- send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
- send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
- command /87:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','100')"
- command /9487:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','40','100')"
- command /94871:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('5FA198F1-BFEC-4356-A41B-A9AC934900C4','50','3:15')"
- command /94872:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('6FA198F1-BFEC-4356-A41B-A9AC934900C4','12','3:15')"
- command /123:
- trigger:
- set {_time} to "%now formatted with ""yyyy""%/%now formatted with ""MM""%/%now formatted with ""dd""% %now formatted with ""HH""%:%now formatted with ""mm""%:%now formatted with ""ss""%"
- send "%{_time}%"
- mysql update "UPDATE testsql SET createtime = '%{_time}%' WHERE testuuid = '%uuid of player%'"
- # update 資料表名稱 set 欄位1='值1',欄位2='值2',欄位3='值3',... 欄位N='值N'
- #where 條件式 (例如 sn='5' 或 name='塔司尼' );
Advertisement
Add Comment
Please, Sign In to add comment