Advertisement
kazmadan

saltybrett.mrc

Jan 2nd, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. set %clearing
  2. set %pot1 0
  3. set %pot2 0
  4. set %oddsDisplay
  5.  
  6. on *:START:{
  7.  
  8. hmake -s saltytable 200
  9.  
  10. }
  11.  
  12.  
  13.  
  14. on *:TEXT:!saltyhelp:#:{
  15.  
  16.  
  17. msg $chan Mod / Regulars Commands: !saltybrett <1p> <2p> / !lobbywin <1p/2p> / !saltybrett cancel
  18. msg $chan User commands: !bet <1p/2p> <amount> / !bank / !shame
  19. }
  20.  
  21. on *:TEXT:!bank:#:{
  22.  
  23. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  24. if ( $hget(ratingtable,$nick) == $null ) {
  25. ;msg $chan $nick <- You are not registered. Register with !register
  26. }
  27. else {
  28.  
  29.  
  30. msg $chan $nick <- You have $round($getelo($nick,saltybrett),2) dollars.
  31. }
  32. set %wait.ctime $calc($ctime + 1)
  33. }
  34.  
  35.  
  36.  
  37. }
  38.  
  39.  
  40. on *:TEXT:!saltybrett cancel:#:{
  41.  
  42.  
  43. if ($nick isop $chan) || ($regcheck($nick)) {
  44.  
  45.  
  46. /wipelobby
  47. /timer30 off
  48. /timer31 off
  49. /timer32 off
  50. /timer33 off
  51. /timer34 off
  52. /timer35 off
  53. /timer36 off
  54. msg # The current betting session has been cancelled
  55. .disable #saltybrett
  56. .enable #disable
  57.  
  58.  
  59. }
  60. }
  61.  
  62. on *:TEXT:!shame:#:{
  63.  
  64.  
  65. if ( $hget(ratingtable,$nick) == $null ) {
  66.  
  67. msg $chan You are not registered.
  68.  
  69. }
  70. elseif ($getelo($nick,saltybrett) >= 500 ) {
  71. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  72. set %wait.ctime $calc($ctime + 3)
  73. msg # $nick <- You have more than 500 dollars.
  74. }
  75. }
  76. else {
  77. /setelo $nick saltybrett 500
  78. incshame $nick
  79. var %shamecount = $getshame($nick)
  80.  
  81. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  82. set %wait.ctime $calc($ctime + 1)
  83.  
  84. if ( $right(%shamecount,1) == 1 ) {
  85.  
  86.  
  87. msg $chan $nick <- This is the %shamecount $+ st time FUNgineer.
  88.  
  89. }
  90.  
  91. elseif ( $right(%shamecount,1) == 2 ) {
  92.  
  93.  
  94. msg $chan $nick <- This is the %shamecount $+ nd time FUNgineer.
  95.  
  96. }
  97. elseif ( $right(%shamecount,1) == 3 ) {
  98.  
  99.  
  100. msg $chan $nick <- This is the %shamecount $+ rd time FUNgineer.
  101.  
  102. }
  103. else {
  104. msg $chan $nick <- This is the %shamecount $+ th time FUNgineer.
  105.  
  106.  
  107. }
  108.  
  109.  
  110. }
  111.  
  112. }
  113.  
  114.  
  115. }
  116.  
  117.  
  118. on *:TEXT:!saltybrett *:#: {
  119.  
  120. if ($nick isop $chan) || ($regcheck($nick)) {
  121.  
  122. if ($3 == $null) {
  123.  
  124. echo not enough parameters
  125. msg $chan $nick <- Incorrect syntax. Use !lobbyupdate <1p> <2p>
  126.  
  127. }
  128.  
  129. elseif ( $hget(ratingtable,$2) == $null ) {
  130.  
  131. msg $chan $nick <- $2 is not registered
  132.  
  133. }
  134.  
  135. elseif ( $hget(ratingtable,$3) == $null ) {
  136.  
  137. msg $chan $nick <- $3 is not registered
  138.  
  139. }
  140.  
  141. elseif ( %1p != $null) && (%2p != $null) {
  142.  
  143. msg # There is currently a match in progress.
  144. }
  145.  
  146. elseif ( %clearing == 1 ) {
  147.  
  148. /echo -a clearing detected
  149. /msg # $nick <- Currently in the middle of wiping previous scores
  150. }
  151.  
  152. else {
  153.  
  154. ;/msg #thebrett Salty Brett is now active for the next 60 seconds! Bet by typing !bet <1p / 2p> <amount> - $nick has earned 100 dollars for his contribution O u O
  155. set %1p $upper($left($2,1)) $+ $right($2,$calc($len($2)-1)))
  156. set %2p $upper($left($3,1)) $+ $right($3,$calc($len($3)-1)))
  157.  
  158. lobbyTitle %1p %2p
  159.  
  160. write -c saltyodds1.txt 0
  161. write -c saltyodds2.txt 0
  162.  
  163. write -l10 "D:\streamcontrol.xml" <pName1> $+ %1p RIP $getelo(%1p,%lobbygame) $+ </pName1>
  164. write -l11 "D:\streamcontrol.xml" <pName2> RIP $getelo(%2p,%lobbygame) %2p $+ </pName2>
  165. write -l12 "D:\streamcontrol.xml" <pScore1>500</pScore1>
  166. write -l13 "D:\streamcontrol.xml" <pScore2>500</pScore2>
  167. write -l3 "D:\streamcontrol.xml" <timestamp> $+ $ctime $+ </timestamp>
  168.  
  169.  
  170. if ($hget(saltyTable) == saltytable) {
  171.  
  172. hfree -s saltyTable
  173. }
  174.  
  175. inc %pot1 500
  176. inc %pot2 500
  177.  
  178. hmake -s saltyTable 200
  179. /describe #thebrett SaltyBrett is now active for the next 60 seconds! Bet by typing !bet <1p / 2p> < amount > - $nick has earned 100 dollars for his contribution O u O
  180.  
  181. incelo $nick SaltyBrett 100
  182. incWin $nick SaltyBrett
  183. .enable #saltybrett
  184. .disable #disable
  185. /timer36 1 60 .disable #saltybrett
  186. /timer35 1 60 .enable #disable
  187. /timer30 1 15 printOdds 45
  188. /timer31 1 30 printOdds 30
  189. /timer32 1 50 printOdds 10
  190. /timer33 1 60 printOdds 0
  191. ;/timer34 1 60 makeLeader saltyBrett
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. ;makes the leader board
  200. ;/timer 1 10 makeLeader %lobbygame
  201. ;msg $chan $nick <- Setting Lobby titles - %1p VS %2p
  202. timerWipeLobby off
  203. timerWipeLobby 1 1000 /wipeLobby
  204.  
  205. ;set %pot1 = 0
  206. ;set %pot2 = 0
  207. }
  208. }
  209. else {
  210.  
  211. msg $chan $nick <- You must be a regular or mod to use this command. Regulars can be added with !regulars add <nick>
  212. }
  213.  
  214. }
  215.  
  216. on *:TEXT:!odds:#: {
  217.  
  218. if ($nick isop thebrett) {
  219. /msg # $giveOdds()
  220. }
  221.  
  222. }
  223.  
  224. alias giveOdds {
  225.  
  226.  
  227. return The odds are $read(saltyodds1.txt,t) to $read(saltyodds2.txt,t)
  228.  
  229. }
  230.  
  231. alias printOdds {
  232. if ($1 == 0) {
  233. /describe #thebrett Betting is now closed! The pot is currently $round(%pot1,0) to $round(%pot2,0) $+.
  234.  
  235. }
  236. else {
  237. /describe #thebrett $1 seconds until close. The pot is $round(%pot1,0) to $round(%pot2,0) $+.
  238. }
  239. }
  240. alias makeOdds {
  241.  
  242.  
  243.  
  244. ;write -c saltyodds.txt 1 $chr(124) $round($calc(%pot1 / %pot2),2)
  245. ;write -c saltyodds1.txt $round(%pot1,0)
  246. ;write -c saltyodds2.txt $round(%pot2,0)
  247.  
  248. write -l12 "D:\streamcontrol.xml" <pScore1> $+ $round(%pot1,0) $+ </pScore1>
  249. write -l13 "D:\streamcontrol.xml" <pScore2> $+ $round(%pot2,0) $+ </pScore2>
  250. write -l3 "D:\streamcontrol.xml" <timestamp> $+ $ctime $+ </timestamp>
  251.  
  252.  
  253. if ( %pot1 == $null ) {
  254. write -c saltyodds1.txt 0
  255. }
  256.  
  257. if ( %pot2 == $null ) {
  258.  
  259. write -c saltyodds2.txt 0
  260.  
  261. }
  262.  
  263. return $calc(%pot1 / %pot2) to 1
  264.  
  265.  
  266.  
  267.  
  268. }
  269.  
  270. #disable on
  271.  
  272.  
  273. on *:TEXT:!bet *:#: {
  274. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  275. set %wait.ctime $calc($ctime + 1)
  276. if ( $hget(ratingtable,$nick) == $null ) {
  277.  
  278. ;msg # $nick <- Betting is disabled. Bets can be initiated with !saltybrett <1p> <2p>
  279. }
  280.  
  281.  
  282. }
  283. }
  284. #disable end
  285.  
  286. #saltybrett off
  287.  
  288. on *:TEXT:!bet *:#: {
  289.  
  290.  
  291. if (!$3) {
  292. msg # command is !bet 1p/2p <amount>
  293. }
  294.  
  295. elseif ($2 != 1p) && ($2 != 2p) {
  296. msg # command is !bet 1p/2p <amount>
  297. }
  298.  
  299. elseif ( $hget(ratingtable,$nick) == $null ) {
  300. if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
  301. set %wait.ctime $calc($ctime + 10)
  302.  
  303. msg $chan $nick <- You must be registered to use this command. Register with !register
  304. }
  305. }
  306. ;change this to checking hash table saltyTable
  307.  
  308. elseif ( $hget(saltytable, $nick) != $null ) {
  309. ;//echo exists already
  310. ;//echo likers is now %likers
  311. msg # $nick -> You have already placed a bet.
  312.  
  313. }
  314. elseif ( $getelo($nick,saltybrett) <= 0 ) {
  315.  
  316. msg # $nick <- You do not have enough money to bet. To the salt mines with ye.
  317.  
  318. }
  319. elseif ( $3 isnum ) && $3 > $getelo($nick,saltybrett) {
  320.  
  321. msg # You do not have enough to bet that amount. You currently have $getelo($nick,saltybrett) $+ .
  322. }
  323. elseif ( $3 isnum 1 - $getelo($nick,saltybrett) ) {
  324. ;//echo adding! likers is now %likers
  325.  
  326. echo adding to table
  327. hadd -sm saltytable $nick $3 $2
  328. hsave -os saltytable saltytable.txt
  329. ;msg # $nick has bet $3 on $2.
  330. if ($2 == 1p) {
  331. inc %pot1 $3
  332. write -l12 "D:\streamcontrol.xml" <pScore1> $+ %pot1 $+ </pScore1>
  333.  
  334. }
  335.  
  336.  
  337.  
  338. else {
  339. inc %pot2 $3
  340. write -l13 "D:\streamcontrol.xml" <pScore2> $+ %pot2 $+ </pScore2>
  341. }
  342.  
  343. /makeOdds
  344.  
  345.  
  346. ;$2 earned 1 point. Now has $getvar($2,score) points.
  347.  
  348. }
  349. elseif ( $3 == YOLO ) {
  350.  
  351.  
  352. hadd -sm saltytable $nick $getelo($nick,saltybrett) $2
  353. ;msg # $nick has gone ALL IN ( $+ $getelo($nick,saltybrett) $+ ) on $2 TriHard
  354.  
  355. if ($2 == 1p) {
  356. inc %pot1 $getelo($nick,saltybrett)
  357. write -l12 "D:\streamcontrol.xml" <pScore1> $+ %pot1 $+ </pScore1>
  358.  
  359.  
  360. }
  361.  
  362. else {
  363. inc %pot2 $getelo($nick,saltybrett)
  364. write -l13 "D:\streamcontrol.xml" <pScore2> $+ %pot2 $+ </pScore2>
  365.  
  366.  
  367. }
  368.  
  369. /makeOdds
  370.  
  371. }
  372. else {
  373.  
  374. ;msg $chan $nick <- You do not have enough money for that bet OR $3 is not a valid amount to bet.
  375.  
  376. }
  377.  
  378.  
  379. }
  380.  
  381.  
  382.  
  383.  
  384. #saltybrett end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement