henry900326

Untitled

Oct 23rd, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. Function GetValue(uuid:text, n:text, sql:text) :: text:
  2. set {_result} to mysql result of query "SELECT * FROM %{_sql}% WHERE `testuuid` = '%{_uuid}%'"
  3. set {_result::*} to mysql string "%{_n}%" in {_result}
  4. return "%{_result::*}%"
  5.  
  6.  
  7. #SELECT `欄位` FROM `資料表` WHERE `特定欄位` LIKE 字串 ;
  8.  
  9. #一般用法: SELECT `id`,`name` FROM `table` WHERE `name` LIKE 'admin' ;
  10. #Function GetNumberValue(p:player, n:text) :: number:
  11.  
  12.  
  13. command /clearrr:
  14. trigger:
  15. mysql update "TRUNCATE TABLE testsql"
  16. command /123456:
  17. trigger:
  18. set {_result} to mysql result of query "SELECT * FROM testsql"
  19. set {_testinsql::*} to mysql string "testinsql" in {_result}
  20. set {_testuuid::*} to mysql string "testuuid" in {_result}
  21. send "testinsql: %{_testinsql::*}%" to player
  22. send "testuuid: %{_testuuid::*}%" to player
  23.  
  24. command /test1:
  25. trigger:
  26. send GetValue(uuid of player, "testinsql", "testsql")
  27. send GetValue(uuid of player, "testuuid", "testsql")
  28. send GetValue(uuid of player, "createtime", "testsql")
  29.  
  30. command /test2:
  31. trigger:
  32. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
  33. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
  34. send GetValue("72361866-212A-40B7-B2E7-55EB057FF01E", "createtime", "testsql")
  35.  
  36. command /test3:
  37. trigger:
  38. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  39. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  40. send GetValue("5FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  41.  
  42. command /test4:
  43. trigger:
  44. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  45. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  46. send GetValue("6FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  47.  
  48. command /test5:
  49. trigger:
  50. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  51. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  52. send GetValue("8FA198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  53.  
  54. command /test6:
  55. trigger:
  56. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testinsql", "testsql")
  57. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "testuuid", "testsql")
  58. send GetValue("91A198F1-BFEC-4356-A41B-A9AC934900C4", "createtime", "testsql")
  59.  
  60. command /87:
  61. trigger:
  62. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','100')"
  63.  
  64. command /9487:
  65. trigger:
  66. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','40','100')"
  67.  
  68.  
  69. command /94871:
  70. trigger:
  71. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('5FA198F1-BFEC-4356-A41B-A9AC934900C4','50','3:15')"
  72. command /94872:
  73. trigger:
  74. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('6FA198F1-BFEC-4356-A41B-A9AC934900C4','12','3:15')"
  75. command /94873:
  76. trigger:
  77. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('8FA198F1-BFEC-4356-A41B-A9AC934900C4','50','4:15')"
  78. command /94874:
  79. trigger:
  80. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','中文')"
  81. command /94875:
  82. trigger:
  83. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('91A198F1-BFEC-4356-A41B-A9AC934900C4','50','""中文""')"
  84.  
  85.  
  86. command /123:
  87. trigger:
  88. 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""%"
  89.  
  90. send "%{_time}%"
  91. mysql update "UPDATE testsql SET createtime = '%{_time}%' WHERE testuuid = '%uuid of player%'"
  92.  
  93. # update 資料表名稱 set 欄位1='值1',欄位2='值2',欄位3='值3',... 欄位N='值N'
  94. #where 條件式 (例如 sn='5' 或 name='塔司尼' );
Advertisement
Add Comment
Please, Sign In to add comment