henry900326

Untitled

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