Advertisement
henry900326

Untitled

Oct 20th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. Function GetTextValue(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 /123456:
  14. trigger:
  15. set {_result} to mysql result of query "SELECT * FROM testsql"
  16. set {_testinsql::*} to mysql string "testinsql" in {_result}
  17. set {_testuuid::*} to mysql string "testuuid" in {_result}
  18. send "testinsql: %{_testinsql::*}%" to player
  19. send "testuuid: %{_testuuid::*}%" to player
  20.  
  21. command /test1:
  22. trigger:
  23. send GetTextValue(uuid of player, "testinsql", "testsql")
  24. send GetTextValue(uuid of player, "testuuid", "testsql")
  25.  
  26. command /test2:
  27. trigger:
  28. send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
  29. send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
  30.  
  31. command /87:
  32. trigger:
  33. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('%uuid of player%','100')"
  34.  
  35. command /9487:
  36. trigger:
  37. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','50')"
  38.  
  39. command /111:
  40. trigger:
  41. set {_now} to "%now%"
  42. replace all "上午" and "下午" with "" in {_now}
  43. send "%{_now}%"
  44. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','%{_now}%')"
  45. command /222:
  46. trigger:
  47. set {_now} to "麻糬好吃"
  48. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`, `createtime`) VALUES ('%uuid of player%','100','%{_now}%')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement