Advertisement
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 result of query "SELECT * FROM %{_sql}% WHERE `uuid` = '%{_uuid}%'"
- set {_result::*} to mysql string "%{_n}%" in {_result}
- return "%{_result::*}%"
- Function UpdateValue(uuid:text, n:text, sql:text) :: text:
- mysql update "UPDATE %{_sql}% SET %{_n}% = '%{_time}%' WHERE `uuid` = '%{_uuid}%'"
- #mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','40','100')"
- #mysql update "TRUNCATE TABLE testsql"
- command /clearrr:
- trigger:
- mysql update "TRUNCATE TABLE testsql"
- command /444:
- trigger:
- set {_inv::*} to GetValue(uuid of player, "createtime", "testsql")
- send "%{_inv::*}%"
- set player's inventory to {_inv::*}
- command /555:
- trigger:
- set {_inv::*} to items in player's inventory
- send "%{_inv::*}%"
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`, `testbackpack`) VALUES ('%uuid of player%','1','10','%{_inv::*}%')"
- #command /555:
- # trigger:
- # set {_slot} to slot 0 of player's current inventory
- # loop 41 times:
- # set {_slot} to item of slot (-1+loop-number) of player's inventory
- # send "%{_slot}%"
- # send "%player's tool%"
- # set {_num} to "grid%-1+loop-number%"
- # send "%{_num}%"
- # mysql update "UPDATE itembackpack1 SET `%{_num}%` = '%{_slot}%' WHERE `uuid` = '%{_uuid}%'"
- 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 /test5:
- trigger:
- send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
- send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
- send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
- command /test6:
- trigger:
- send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
- send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
- send GetValue("91A198F1-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 /94873:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('8FA198F1-BFEC-4356-A41B-A9AC934900C4','50','4:15')"
- command /94874:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','中文')"
- command /94875:
- trigger:
- mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','""中文""')"
- 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
Advertisement