Guest User

Untitled

a guest
Nov 24th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 KB | None | 0 0
  1. script options:
  2. $ db url jdbc:mysql://127.0.0.1:3306/satoshicraft
  3. $ db username root
  4. $ db password fHbR3S9TMjFSXgNe62ap
  5.  
  6. on join:
  7. updatecarteira(player)
  8. updateBTC(player)
  9.  
  10. command /carteira:
  11. aliases: saldo, wallet, money, cash, satoshi
  12. trigger:
  13. updateBTC(player)
  14. json("%player%", "")
  15. json("%player%", "Sua carteira Bitcoin:")
  16. json("%player%", "&6%{wallet::%player%::address}%||url:https://blockchain.info/address/%{wallet::%player%::address}%||ttp:&f Clique aqui para ver sua%newline%carteira na &6Blockchain.info")
  17. json("%player%", "Saldo: ||&6%{wallet::%player%::saldo}% &r| Satoshis: &6%player's balance%")
  18. json("%player%", "")
  19. json("%player%", "Comprar Bitcoins? &6foxbit.com.br||url:https://foxbit.com.br||ttp:&fClique aqui para comprar%newline% bitcoins na &6FoxBit")
  20. json("%player%", "Preço do bitcoin: &6R$%{bitcoin.preco}%||url:https://foxbit.com.br||ttp:&fClique aqui para comprar%newline% bitcoins na &6FoxBit")
  21. json("%player%", "")
  22.  
  23. command /exchange [<text>] [<text>]:
  24. trigger:
  25. if arg 1 is "satoshicoin" or "sc" or "satoshi":
  26. if arg 2 parsed as number is more than or equal to 10000:
  27. update "REPLACE `temp_data_trans` (`data1`,`data2`,`data3`) VALUES ('%player%', '15dAhMbL8ak2ZnNApFwCaTUfTXegDGQPzw', '%arg 2%')"
  28. $ thread
  29. set {_result} to text from url "http://127.0.0.1/api/v2/transferir.php?username=%player%"
  30. if {_result} is "true":
  31. add arg 2 parsed as number to player's balance
  32. send "Você comprou %arg 2% satoshis!"
  33. else:
  34. send "Você não conseguiu comprar satoshis! Verifique se você tem BTC suficiente! Se tiver tente novamente daqui a algumas horas"
  35. updateBTC(player)
  36. else:
  37. send "Coloque um valor em satoshis maior que 10000!"
  38. if arg 1 is "bitcoin":
  39. if arg 2 parsed as number is more than or equal to 10000:
  40. update "REPLACE INTO `temp_data_withdraw` (`data1`,`data2`,`data3`) VALUES ('%player%', '%{wallet::%player%::address}%', '%arg 2%')"
  41. $ thread
  42. set {_result} to text from url "http://127.0.0.1/api/v2/withdraw.php?username=%player%"
  43. if {_result} is "true":
  44. remove arg 2 parsed as number from player's balance
  45. send "Você retirou %arg 2% satoshis para sua carteira!"
  46. else:
  47. send "Erro temporario! Aguarde! Em breve sera resolvido!"
  48. updateBTC(player)
  49. else:
  50. send "Coloque um valor em satoshis maior que 10000!"
  51.  
  52. every 3 minutes:
  53. loop all players:
  54. updateBTC(loop-player)
  55.  
  56. command /bitcointransferir <text> <number>:
  57. trigger:
  58. if arg 2 is less than or equal to {wallet::saldosatoshi::%player%} parsed as number:
  59. set {_valuesatoshi} to arg 2*100000000
  60. update "REPLACE INTO `temp_data_trans` (`data1`,`data2`,`data3`) VALUES ('%player%', '%arg 1%', '%arg 2%')"
  61. $ thread
  62. set {_result} to text from url "http://127.0.0.1/api/v2/transferir.php?username=%player%"
  63. if {_transf} is "true":
  64. send "Transferencia de %arg 2% para a carteira %arg 1% efetuada com sucesso!"
  65. updateBTC(player)
  66. else:
  67. send "Não efetuada, erro inesperado!"
  68. else:
  69. send "Saldo: %{wallet::saldosatoshi::%player%}%"
  70. send "Você nao tem BTC suficiente!"
  71. send "Problemas com a BlockChain e com nossa API nos forçaram a desativar o /bitcointransferir temporariamente, desculpe!"
  72.  
  73.  
  74. command /satoshisend [<offline player>] [<number>]:
  75. trigger:
  76. if arg 1 is set:
  77. if arg 2 is set:
  78. if arg 2 is less than or equal to player's balance:
  79. remove arg 2 from player's balance
  80. add arg 2 to arg 1's balance
  81. send "Você recebeu %arg 2% satoshi do %player%" to arg 1
  82. send "Você enviou %arg 2% satoshi para %arg 1%!"
  83.  
  84. command /bitcoin [<text>] [<text>]:
  85. trigger:
  86. if arg 1 is not set:
  87. make player execute "/carteira"
  88.  
  89. command /moneytop [<number>]:
  90. aliases: satoshitop
  91. trigger:
  92. if arg 1 is not set:
  93. set {pagenumber} to 1
  94. set {_tmpvalue} to 0
  95. else:
  96. set {pagenumber} to arg 1
  97. set {_tmpvalue} to (arg 1-1)*5
  98. set {_result} to result of query "SELECT username, balance FROM usuarios ORDER BY balance DESC;"
  99. set {_volume} to result of query "SELECT SUM(balance) AS volume FROM usuarios"
  100. set {_volume::*} to objects in column "volume" from {_volume}
  101. set {_username::*} to objects in column "username" from {_result}
  102. set {_balance::*} to objects in column "balance" from {_result}
  103. set {_tmpvalue2} to {_tmpvalue}+6
  104. json("%player%", "&fRanking de Money:")
  105. loop {_username::*}:
  106. if loop-value is set:
  107. if loop-index parsed as number is more than {_tmpvalue}:
  108. if loop-index parsed as number is less than {_tmpvalue2}:
  109. add 1 to {_tmpvalue}
  110. json("%player%", "%loop-index%. &6%loop-value% &r- %{_balance::%loop-index%}% &6satoshis")
  111. json("%player%", "&6Volume do Servidor: &r%{_volume::1}% &6satoshis")
  112. json("%player%", "&7Você está na página %{pagenumber}%. Digite /moneytop <pagina>")
  113.  
  114. on command "/baltop":
  115. cancel event
  116. if arguments is set:
  117. make player execute command "/moneytop %arguments%"
  118. else:
  119. make player execute command "/moneytop"
  120.  
  121. function updateBTC(p: player):
  122. $ thread
  123. set {_saldotemp} to text from url "https://blockchain.info/q/addressbalance/%{wallet::%{_p}%::address}%"
  124. set {wallet::saldosatoshi::%{_p}%} to {_saldotemp}
  125. set {_saldotemp} to {_saldotemp} parsed as number
  126. set {_saldotemp} to {_saldotemp}/100000000
  127. execute console command "/apiinttotext %{_saldotemp}%"
  128. set {_saldosplit::*} to {intxt.tmp} split at "."
  129. if {_saldosplit::2} is set:
  130. execute console command "/apilenght %{_saldosplit::2}%"
  131. set {_fzeros} to 8-{lenght.tmp}
  132. loop {_fzeros} times:
  133. if {_zeros} is not set:
  134. set {_zeros} to "0"
  135. else:
  136. set {_zeros} to "%{_zeros}%0"
  137. if {_zeros} is set:
  138. set {_saldo} to "%{_saldosplit::1}%.%{_saldosplit::2}%%{_zeros}%"
  139. else:
  140. set {_saldo} to "%{_saldosplit::1}%.%{_saldosplit::2}%"
  141. else:
  142. set {_saldo} to "%{_saldosplit::1}%.00000000"
  143. set {wallet::%{_p}%::saldo} to {_saldo}
  144.  
  145. command /apiinttotext <string>:
  146. executable by: console
  147. trigger:
  148. set {intxt.tmp} to arg
  149. command /apilenght <string>:
  150. executable by: console
  151. trigger:
  152. set {lenght.tmp} to arg's length
  153.  
  154. function updatecarteira(p: player):
  155. set {_address::*} to objects in column "btc_address" from result of query "SELECT * FROM usuarios WHERE username = '%{_p}%'"
  156. set {wallet::%{_p}%::address} to {_address::1}
Add Comment
Please, Sign In to add comment