Tabletop Simulator

Tabletop Simulator

评价数不足
Universal Blackjack Card Counter
   
奖励
收藏
已收藏
取消收藏
Game Category: Card Games
Assets: Scripting
标签: Misc
文件大小
发表于
58.015 KB
2016 年 10 月 1 日 下午 7:53
1 项改动说明 ( 查看 )

订阅以下载
Universal Blackjack Card Counter

描述
This is a script that counts the value of cards for blackjack, displaying each player's (and the dealer's) hand value. It is made in such a way so that anyone, even someone who has no idea how Lua works, should be able to get it to work on their own blackjack table. VERY detailed instructions on how to do so are included.

Features:
  • Counts Only Face Up Cards: Face-down cards, like the dealer's, do not display on the counter.
  • Color Coded Counters: Counters are black, unless you hit 21, then it will turn green. If you bust, it will turn red. The dealer's counter does this too, but also turns yellow on 17-20.
  • Automatic Blackjack Check: When the dealer has 1 face-down card and 1 face-up card, the script will automatically check if the dealer has blackjack. If they do, it announces it to everyone and flips over the dealer's face-down card.
  • Error Protection: This counter will not spam errors if you hit Undo. Hitting undo DOES cause a single timer error for the host, but the script will still be working at 100%.
  • Counts Cards That Are Accidently Stacked: As long as the stacked cards are face up, the tool will still display their count.
  • Low Impact: I designed this code to have as little impact on load time/performance as possible.
  • Commented Code: For scripters, I commented out the code to explain what each step is doing.

If anyone does use this script on their table, I do appreciate a credit for it somewhere. But that is exactly what this script is for. I hope you enjoy.

If you follow the instructions closely, but are still having trouble, put your code into a pastebin ( pastebin.com ) and post a comment for help.





5 条留言
Kagenokami 2016 年 10 月 31 日 下午 7:09 
*Has swirly eyes* So...confused. Sadly though I have attempted to learn scripting many times, I have so far failed. XD But I can at least understand the basic problem despite not understanding your solution. It is fine the way it is. Was merely curious is all :) Thank you so much for the response! ^.^
MrStump  [作者] 2016 年 10 月 31 日 下午 6:40 
The issue is that it checks for blackjack constantly, so there is no simple way. If you know scripting, you could add a bool variable which triggers when it is checking that there are 2 cards for blackjack and that the bool is false. Then set the bool to true so it is only checking once. Then have the "deal" button reset the bool to false again to allow that bit of code to run again.
Kagenokami 2016 年 10 月 31 日 下午 4:37 
Omg this is great! One question though, how would I add in a function to make the counter broadcast that the dealer does NOT have blackjack if the checker finds that the dealer does not in fact have blackjack?
Corsaka 2016 年 10 月 16 日 上午 3:37 
THANKS SO MUCH
lelelelelelelelelelelelelelele 2016 年 10 月 3 日 上午 3:29 
As always, an extremely useful little script by MrStump.
Usable in various situations, not only BlackJack!
Thanks a lot, MrStump! :)