Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set %clearing
- set %pot1 0
- set %pot2 0
- set %oddsDisplay
- on *:START:{
- hmake -s saltytable 200
- }
- on *:TEXT:!saltyhelp:#:{
- msg $chan Mod / Regulars Commands: !saltybrett <1p> <2p> / !lobbywin <1p/2p> / !saltybrett cancel
- msg $chan User commands: !bet <1p/2p> <amount> / !bank / !shame
- }
- on *:TEXT:!bank:#:{
- if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
- if ( $hget(ratingtable,$nick) == $null ) {
- ;msg $chan $nick <- You are not registered. Register with !register
- }
- else {
- msg $chan $nick <- You have $round($getelo($nick,saltybrett),2) dollars.
- }
- set %wait.ctime $calc($ctime + 1)
- }
- }
- on *:TEXT:!saltybrett cancel:#:{
- if ($nick isop $chan) || ($regcheck($nick)) {
- /wipelobby
- /timer30 off
- /timer31 off
- /timer32 off
- /timer33 off
- /timer34 off
- /timer35 off
- /timer36 off
- msg # The current betting session has been cancelled
- .disable #saltybrett
- .enable #disable
- }
- }
- on *:TEXT:!shame:#:{
- if ( $hget(ratingtable,$nick) == $null ) {
- msg $chan You are not registered.
- }
- elseif ($getelo($nick,saltybrett) >= 500 ) {
- if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
- set %wait.ctime $calc($ctime + 3)
- msg # $nick <- You have more than 500 dollars.
- }
- }
- else {
- /setelo $nick saltybrett 500
- incshame $nick
- var %shamecount = $getshame($nick)
- if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
- set %wait.ctime $calc($ctime + 1)
- if ( $right(%shamecount,1) == 1 ) {
- msg $chan $nick <- This is the %shamecount $+ st time FUNgineer.
- }
- elseif ( $right(%shamecount,1) == 2 ) {
- msg $chan $nick <- This is the %shamecount $+ nd time FUNgineer.
- }
- elseif ( $right(%shamecount,1) == 3 ) {
- msg $chan $nick <- This is the %shamecount $+ rd time FUNgineer.
- }
- else {
- msg $chan $nick <- This is the %shamecount $+ th time FUNgineer.
- }
- }
- }
- }
- on *:TEXT:!saltybrett *:#: {
- if ($nick isop $chan) || ($regcheck($nick)) {
- if ($3 == $null) {
- echo not enough parameters
- msg $chan $nick <- Incorrect syntax. Use !lobbyupdate <1p> <2p>
- }
- elseif ( $hget(ratingtable,$2) == $null ) {
- msg $chan $nick <- $2 is not registered
- }
- elseif ( $hget(ratingtable,$3) == $null ) {
- msg $chan $nick <- $3 is not registered
- }
- elseif ( %1p != $null) && (%2p != $null) {
- msg # There is currently a match in progress.
- }
- elseif ( %clearing == 1 ) {
- /echo -a clearing detected
- /msg # $nick <- Currently in the middle of wiping previous scores
- }
- else {
- ;/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
- set %1p $upper($left($2,1)) $+ $right($2,$calc($len($2)-1)))
- set %2p $upper($left($3,1)) $+ $right($3,$calc($len($3)-1)))
- lobbyTitle %1p %2p
- write -c saltyodds1.txt 0
- write -c saltyodds2.txt 0
- write -l10 "D:\streamcontrol.xml" <pName1> $+ %1p RIP $getelo(%1p,%lobbygame) $+ </pName1>
- write -l11 "D:\streamcontrol.xml" <pName2> RIP $getelo(%2p,%lobbygame) %2p $+ </pName2>
- write -l12 "D:\streamcontrol.xml" <pScore1>500</pScore1>
- write -l13 "D:\streamcontrol.xml" <pScore2>500</pScore2>
- write -l3 "D:\streamcontrol.xml" <timestamp> $+ $ctime $+ </timestamp>
- if ($hget(saltyTable) == saltytable) {
- hfree -s saltyTable
- }
- inc %pot1 500
- inc %pot2 500
- hmake -s saltyTable 200
- /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
- incelo $nick SaltyBrett 100
- incWin $nick SaltyBrett
- .enable #saltybrett
- .disable #disable
- /timer36 1 60 .disable #saltybrett
- /timer35 1 60 .enable #disable
- /timer30 1 15 printOdds 45
- /timer31 1 30 printOdds 30
- /timer32 1 50 printOdds 10
- /timer33 1 60 printOdds 0
- ;/timer34 1 60 makeLeader saltyBrett
- ;makes the leader board
- ;/timer 1 10 makeLeader %lobbygame
- ;msg $chan $nick <- Setting Lobby titles - %1p VS %2p
- timerWipeLobby off
- timerWipeLobby 1 1000 /wipeLobby
- ;set %pot1 = 0
- ;set %pot2 = 0
- }
- }
- else {
- msg $chan $nick <- You must be a regular or mod to use this command. Regulars can be added with !regulars add <nick>
- }
- }
- on *:TEXT:!odds:#: {
- if ($nick isop thebrett) {
- /msg # $giveOdds()
- }
- }
- alias giveOdds {
- return The odds are $read(saltyodds1.txt,t) to $read(saltyodds2.txt,t)
- }
- alias printOdds {
- if ($1 == 0) {
- /describe #thebrett Betting is now closed! The pot is currently $round(%pot1,0) to $round(%pot2,0) $+.
- }
- else {
- /describe #thebrett $1 seconds until close. The pot is $round(%pot1,0) to $round(%pot2,0) $+.
- }
- }
- alias makeOdds {
- ;write -c saltyodds.txt 1 $chr(124) $round($calc(%pot1 / %pot2),2)
- ;write -c saltyodds1.txt $round(%pot1,0)
- ;write -c saltyodds2.txt $round(%pot2,0)
- write -l12 "D:\streamcontrol.xml" <pScore1> $+ $round(%pot1,0) $+ </pScore1>
- write -l13 "D:\streamcontrol.xml" <pScore2> $+ $round(%pot2,0) $+ </pScore2>
- write -l3 "D:\streamcontrol.xml" <timestamp> $+ $ctime $+ </timestamp>
- if ( %pot1 == $null ) {
- write -c saltyodds1.txt 0
- }
- if ( %pot2 == $null ) {
- write -c saltyodds2.txt 0
- }
- return $calc(%pot1 / %pot2) to 1
- }
- #disable on
- on *:TEXT:!bet *:#: {
- if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
- set %wait.ctime $calc($ctime + 1)
- if ( $hget(ratingtable,$nick) == $null ) {
- ;msg # $nick <- Betting is disabled. Bets can be initiated with !saltybrett <1p> <2p>
- }
- }
- }
- #disable end
- #saltybrett off
- on *:TEXT:!bet *:#: {
- if (!$3) {
- msg # command is !bet 1p/2p <amount>
- }
- elseif ($2 != 1p) && ($2 != 2p) {
- msg # command is !bet 1p/2p <amount>
- }
- elseif ( $hget(ratingtable,$nick) == $null ) {
- if ((%wait.ctime !isnum) || ((%wait.ctime isnum) && (%wait.ctime < $ctime))) {
- set %wait.ctime $calc($ctime + 10)
- msg $chan $nick <- You must be registered to use this command. Register with !register
- }
- }
- ;change this to checking hash table saltyTable
- elseif ( $hget(saltytable, $nick) != $null ) {
- ;//echo exists already
- ;//echo likers is now %likers
- msg # $nick -> You have already placed a bet.
- }
- elseif ( $getelo($nick,saltybrett) <= 0 ) {
- msg # $nick <- You do not have enough money to bet. To the salt mines with ye.
- }
- elseif ( $3 isnum ) && $3 > $getelo($nick,saltybrett) {
- msg # You do not have enough to bet that amount. You currently have $getelo($nick,saltybrett) $+ .
- }
- elseif ( $3 isnum 1 - $getelo($nick,saltybrett) ) {
- ;//echo adding! likers is now %likers
- echo adding to table
- hadd -sm saltytable $nick $3 $2
- hsave -os saltytable saltytable.txt
- ;msg # $nick has bet $3 on $2.
- if ($2 == 1p) {
- inc %pot1 $3
- write -l12 "D:\streamcontrol.xml" <pScore1> $+ %pot1 $+ </pScore1>
- }
- else {
- inc %pot2 $3
- write -l13 "D:\streamcontrol.xml" <pScore2> $+ %pot2 $+ </pScore2>
- }
- /makeOdds
- ;$2 earned 1 point. Now has $getvar($2,score) points.
- }
- elseif ( $3 == YOLO ) {
- hadd -sm saltytable $nick $getelo($nick,saltybrett) $2
- ;msg # $nick has gone ALL IN ( $+ $getelo($nick,saltybrett) $+ ) on $2 TriHard
- if ($2 == 1p) {
- inc %pot1 $getelo($nick,saltybrett)
- write -l12 "D:\streamcontrol.xml" <pScore1> $+ %pot1 $+ </pScore1>
- }
- else {
- inc %pot2 $getelo($nick,saltybrett)
- write -l13 "D:\streamcontrol.xml" <pScore2> $+ %pot2 $+ </pScore2>
- }
- /makeOdds
- }
- else {
- ;msg $chan $nick <- You do not have enough money for that bet OR $3 is not a valid amount to bet.
- }
- }
- #saltybrett end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement