Advertisement
henry900326

Untitled

Oct 24th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1.  
  2.  
  3.  
  4. Function GetValue(uuid:text, n:text, sql:text) :: text:
  5. set {_result} to mysql result of query "SELECT * FROM %{_sql}% WHERE `uuid` = '%{_uuid}%'"
  6. set {_result::*} to mysql string "%{_n}%" in {_result}
  7. return "%{_result::*}%"
  8. Function UpdateValue(uuid:text, n:text, sql:text) :: text:
  9. mysql update "UPDATE %{_sql}% SET %{_n}% = '%{_time}%' WHERE `uuid` = '%{_uuid}%'"
  10. #mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','40','100')"
  11. #mysql update "TRUNCATE TABLE testsql"
  12.  
  13.  
  14. command /clearrr:
  15. trigger:
  16. mysql update "TRUNCATE TABLE testsql"
  17. command /444:
  18. trigger:
  19. set {_inv::*} to GetValue(uuid of player, "createtime", "testsql")
  20. send "%{_inv::*}%"
  21. set player's inventory to {_inv::*}
  22. command /555:
  23. trigger:
  24. set {_inv::*} to items in player's inventory
  25. send "%{_inv::*}%"
  26. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`, `testbackpack`) VALUES ('%uuid of player%','1','10','%{_inv::*}%')"
  27.  
  28. #command /555:
  29. # trigger:
  30. # set {_slot} to slot 0 of player's current inventory
  31. # loop 41 times:
  32. # set {_slot} to item of slot (-1+loop-number) of player's inventory
  33. # send "%{_slot}%"
  34. # send "%player's tool%"
  35. # set {_num} to "grid%-1+loop-number%"
  36. # send "%{_num}%"
  37. # mysql update "UPDATE itembackpack1 SET `%{_num}%` = '%{_slot}%' WHERE `uuid` = '%{_uuid}%'"
  38.  
  39. command /123456:
  40. trigger:
  41. set {_result} to mysql result of query "SELECT * FROM testsql"
  42. set {_testinsql::*} to mysql string "testinsql" in {_result}
  43. set {_testuuid::*} to mysql string "testuuid" in {_result}
  44. send "testinsql: %{_testinsql::*}%" to player
  45. send "testuuid: %{_testuuid::*}%" to player
  46.  
  47. command /test1:
  48. trigger:
  49. send GetValue(uuid of player, "testinsql", "testsql")
  50. send GetValue(uuid of player, "testuuid", "testsql")
  51. send GetValue(uuid of player, "createtime", "testsql")
  52.  
  53. command /test2:
  54. trigger:
  55. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
  56. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
  57. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "createtime", "testsql")
  58.  
  59. command /test3:
  60. trigger:
  61. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  62. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  63. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  64.  
  65. command /test4:
  66. trigger:
  67. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  68. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  69. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  70.  
  71. command /test5:
  72. trigger:
  73. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  74. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  75. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  76.  
  77. command /test6:
  78. trigger:
  79. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  80. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  81. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  82.  
  83. command /87:
  84. trigger:
  85. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','100')"
  86.  
  87. command /9487:
  88. trigger:
  89. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','40','100')"
  90.  
  91.  
  92. command /94871:
  93. trigger:
  94. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('5FA198F1-BFEC-4356-A41B-A9AC934900C4','50','3:15')"
  95. command /94872:
  96. trigger:
  97. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('6FA198F1-BFEC-4356-A41B-A9AC934900C4','12','3:15')"
  98. command /94873:
  99. trigger:
  100. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('8FA198F1-BFEC-4356-A41B-A9AC934900C4','50','4:15')"
  101. command /94874:
  102. trigger:
  103. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','中文')"
  104. command /94875:
  105. trigger:
  106. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','""中文""')"
  107.  
  108.  
  109. command /123:
  110. trigger:
  111. 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""%"
  112.  
  113. send "%{_time}%"
  114. mysql update "UPDATE testsql SET createtime = '%{_time}%' WHERE testuuid = '%uuid of player%'"
  115.  
  116. # update 資料表名稱 set 欄位1='值1',欄位2='值2',欄位3='值3',... 欄位N='值N'
  117. #where 條件式 (例如 sn='5' 或 name='塔司尼' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement