Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script options:
- $ db url jdbc:mysql://127.0.0.1:3306/satoshicraft
- $ db username root
- $ db password fHbR3S9TMjFSXgNe62ap
- on join:
- updatecarteira(player)
- updateBTC(player)
- command /carteira:
- aliases: saldo, wallet, money, cash, satoshi
- trigger:
- updateBTC(player)
- json("%player%", "")
- json("%player%", "Sua carteira Bitcoin:")
- 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")
- json("%player%", "Saldo: ||&6%{wallet::%player%::saldo}% &r| Satoshis: &6%player's balance%")
- json("%player%", "")
- json("%player%", "Comprar Bitcoins? &6foxbit.com.br||url:https://foxbit.com.br||ttp:&fClique aqui para comprar%newline% bitcoins na &6FoxBit")
- json("%player%", "Preço do bitcoin: &6R$%{bitcoin.preco}%||url:https://foxbit.com.br||ttp:&fClique aqui para comprar%newline% bitcoins na &6FoxBit")
- json("%player%", "")
- command /exchange [<text>] [<text>]:
- trigger:
- if arg 1 is "satoshicoin" or "sc" or "satoshi":
- if arg 2 parsed as number is more than or equal to 10000:
- update "REPLACE `temp_data_trans` (`data1`,`data2`,`data3`) VALUES ('%player%', '15dAhMbL8ak2ZnNApFwCaTUfTXegDGQPzw', '%arg 2%')"
- $ thread
- set {_result} to text from url "http://127.0.0.1/api/v2/transferir.php?username=%player%"
- if {_result} is "true":
- add arg 2 parsed as number to player's balance
- send "Você comprou %arg 2% satoshis!"
- else:
- send "Você não conseguiu comprar satoshis! Verifique se você tem BTC suficiente! Se tiver tente novamente daqui a algumas horas"
- updateBTC(player)
- else:
- send "Coloque um valor em satoshis maior que 10000!"
- if arg 1 is "bitcoin":
- if arg 2 parsed as number is more than or equal to 10000:
- update "REPLACE INTO `temp_data_withdraw` (`data1`,`data2`,`data3`) VALUES ('%player%', '%{wallet::%player%::address}%', '%arg 2%')"
- $ thread
- set {_result} to text from url "http://127.0.0.1/api/v2/withdraw.php?username=%player%"
- if {_result} is "true":
- remove arg 2 parsed as number from player's balance
- send "Você retirou %arg 2% satoshis para sua carteira!"
- else:
- send "Erro temporario! Aguarde! Em breve sera resolvido!"
- updateBTC(player)
- else:
- send "Coloque um valor em satoshis maior que 10000!"
- every 3 minutes:
- loop all players:
- updateBTC(loop-player)
- command /bitcointransferir <text> <number>:
- trigger:
- if arg 2 is less than or equal to {wallet::saldosatoshi::%player%} parsed as number:
- set {_valuesatoshi} to arg 2*100000000
- update "REPLACE INTO `temp_data_trans` (`data1`,`data2`,`data3`) VALUES ('%player%', '%arg 1%', '%arg 2%')"
- $ thread
- set {_result} to text from url "http://127.0.0.1/api/v2/transferir.php?username=%player%"
- if {_transf} is "true":
- send "Transferencia de %arg 2% para a carteira %arg 1% efetuada com sucesso!"
- updateBTC(player)
- else:
- send "Não efetuada, erro inesperado!"
- else:
- send "Saldo: %{wallet::saldosatoshi::%player%}%"
- send "Você nao tem BTC suficiente!"
- send "Problemas com a BlockChain e com nossa API nos forçaram a desativar o /bitcointransferir temporariamente, desculpe!"
- command /satoshisend [<offline player>] [<number>]:
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if arg 2 is less than or equal to player's balance:
- remove arg 2 from player's balance
- add arg 2 to arg 1's balance
- send "Você recebeu %arg 2% satoshi do %player%" to arg 1
- send "Você enviou %arg 2% satoshi para %arg 1%!"
- command /bitcoin [<text>] [<text>]:
- trigger:
- if arg 1 is not set:
- make player execute "/carteira"
- command /moneytop [<number>]:
- aliases: satoshitop
- trigger:
- if arg 1 is not set:
- set {pagenumber} to 1
- set {_tmpvalue} to 0
- else:
- set {pagenumber} to arg 1
- set {_tmpvalue} to (arg 1-1)*5
- set {_result} to result of query "SELECT username, balance FROM usuarios ORDER BY balance DESC;"
- set {_volume} to result of query "SELECT SUM(balance) AS volume FROM usuarios"
- set {_volume::*} to objects in column "volume" from {_volume}
- set {_username::*} to objects in column "username" from {_result}
- set {_balance::*} to objects in column "balance" from {_result}
- set {_tmpvalue2} to {_tmpvalue}+6
- json("%player%", "&fRanking de Money:")
- loop {_username::*}:
- if loop-value is set:
- if loop-index parsed as number is more than {_tmpvalue}:
- if loop-index parsed as number is less than {_tmpvalue2}:
- add 1 to {_tmpvalue}
- json("%player%", "%loop-index%. &6%loop-value% &r- %{_balance::%loop-index%}% &6satoshis")
- json("%player%", "&6Volume do Servidor: &r%{_volume::1}% &6satoshis")
- json("%player%", "&7Você está na página %{pagenumber}%. Digite /moneytop <pagina>")
- on command "/baltop":
- cancel event
- if arguments is set:
- make player execute command "/moneytop %arguments%"
- else:
- make player execute command "/moneytop"
- function updateBTC(p: player):
- $ thread
- set {_saldotemp} to text from url "https://blockchain.info/q/addressbalance/%{wallet::%{_p}%::address}%"
- set {wallet::saldosatoshi::%{_p}%} to {_saldotemp}
- set {_saldotemp} to {_saldotemp} parsed as number
- set {_saldotemp} to {_saldotemp}/100000000
- execute console command "/apiinttotext %{_saldotemp}%"
- set {_saldosplit::*} to {intxt.tmp} split at "."
- if {_saldosplit::2} is set:
- execute console command "/apilenght %{_saldosplit::2}%"
- set {_fzeros} to 8-{lenght.tmp}
- loop {_fzeros} times:
- if {_zeros} is not set:
- set {_zeros} to "0"
- else:
- set {_zeros} to "%{_zeros}%0"
- if {_zeros} is set:
- set {_saldo} to "%{_saldosplit::1}%.%{_saldosplit::2}%%{_zeros}%"
- else:
- set {_saldo} to "%{_saldosplit::1}%.%{_saldosplit::2}%"
- else:
- set {_saldo} to "%{_saldosplit::1}%.00000000"
- set {wallet::%{_p}%::saldo} to {_saldo}
- command /apiinttotext <string>:
- executable by: console
- trigger:
- set {intxt.tmp} to arg
- command /apilenght <string>:
- executable by: console
- trigger:
- set {lenght.tmp} to arg's length
- function updatecarteira(p: player):
- set {_address::*} to objects in column "btc_address" from result of query "SELECT * FROM usuarios WHERE username = '%{_p}%'"
- set {wallet::%{_p}%::address} to {_address::1}
Add Comment
Please, Sign In to add comment