mIRC Home    About    Download    Register    News    Help

Print Thread
Gambling System Code Request [Twitch] #251596 25/02/15 05:33 AM
Joined: Feb 2015
Posts: 12
S
Scootycoolguy Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Feb 2015
Posts: 12
Hey, let me just start by saying I have tried to search for a topic about this but mainly only get results for just a basic points/raffle system (which I already have). What I wanted was a betting system to use for where a user will bet to win/lose with x points (or rice which is the points this channel uses).

Use what you feel comfortable with the commands as I can easily change those. smile

If it helps, this is what I use for the points:
Code:
on !*:join:#:{
  msg $chan Welcome $nick
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}
alias -l addPoints {
  if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  var %topic $+($chan,.,$nick)
  var %points $calc($readini(Points.ini,%topic,Points) + $1)
  writeini -n Points.ini %topic Points %points
  return %points
}
alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}
alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  writeini -n Points.ini %topic Points %points
  echo -a Added points for %topic
}
alias dorempoints {
  var %topic $+($1,.,$2)
  remini -n Points.ini %topic Points
  echo -a Removed points for %topic
}
on *:text:!rice:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  if ($readini(Points.ini,$+(#,.,$nick),Points) > 0) {
    msg # $nick has a total of $readini(Points.ini,$+(#,.,$nick),Points) grains of rice!
  }
  else { msg # Sorry but the bot could not find you any rice grains on file! }
}
on $*:text:/!rice (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !rice <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total grains of rice! }
  }
  else { msg $chan This command is only available to moderators. }
}


Re: Gambling System Code Request [Twitch] [Re: Scootycoolguy] #251597 25/02/15 06:14 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That's odd, cause I could've sworn I saw at least 5 betting scripts when searching for "betting".

You should look into those for inspiration for your own scripts, we're not gonna make them for you. We can offer help when you try to create them however.

If you feel like getting started with such a script, go search for "betting", choose one that seems comprehendable and try to understand it. Post here with any questions you have and your own solutions as to how to change it to work for you.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Gambling System Code Request [Twitch] [Re: Scootycoolguy] #251608 25/02/15 10:11 PM
Joined: Feb 2015
Posts: 12
S
Scootycoolguy Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Feb 2015
Posts: 12
As far as code ideas, I have tried quite a few but can never seem to get them working and most were scrapped so I dont have any of that previous code.

The only thing I do have was written by westor here: http://hawkee.com/snippet/16209/

Code:
ON !*:TEXT:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($1 == !bet) {
    if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, You are NOT an channel moderator! | return }
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Try again and enter the correct value, more info at !bethelp | return }
    if ($2 == open) || ($2 == start) || ($2 == on) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (%bet) { .msg $chan ( $+ $nick $+ ): Error, There is already an BET running try again later or use !bet stop to stop the bet! | return }
      set -e %bet $nick $chan
      .msg $chan ( $+ $nick $+ ): The BET has been started, use now !win or !lose to enter the bet.
    }
    if ($2 == stop) || ($2 == end) || ($2 == off) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
      unset %bet_win %bet_lose %bet %bet_pause
      .msg $chan ( $+ $nick $+ ): The BET has been stopped.
    }
    if ($2 == resume) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
      if (!%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any bet paused since now! | return }
      unset %bet_pause
      .msg $chan ( $+ $nick $+ ): The BET has been resumed.
    }
    if ($2 == pause) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
      if (%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, The BET is already paused! | return }
      set -e %bet_pause $nick
      .msg $chan ( $+ $nick $+ ): The BET has been paused.
    }
    if ($2 == result) || ($2 == results) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
      if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Try again and enter the result win or lose . | return }
      if ($3 == win) || ($3 == won) {
        if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
        .msg $chan ( $+ $nick $+ ) The BET has been stopped to win..
        if (!%bet_win) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet at win. }
        elseif (%bet_win) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_win - (Total: $numtok(%bet_win,44) $+ ) }
        bet_addpoints $chan %bet_win
        if (%bet_lose) { bet_delpoints $chan %bet_lose }
        unset %bet_win %bet_lose %bet %bet_pause
      }
      if ($3 == lose) || ($3 == lost) {
        if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
        .msg $chan ( $+ $nick $+ ) The BET has been stopped to lose..
        if (!%bet_lose) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet at lose. }
        elseif (%bet_lose) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_lose - (Total: $numtok(%bet_lose,44) $+ ) }
        bet_delpoints $chan %bet_lose
        if (%bet_win) { bet_addpoints $chan %bet_win }
        unset %bet_win %bet_lose %bet %bet_pause
      }
    }
  }
  if ($1 == !win) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    var %fix = $chan $+ . $+ $nick
    var %p = $readini(Points.ini,n,%fix,Points)
    if (!%p) { .msg $chan ( $+ $nick $+ ): Error, You have NOT any points award yet, you must have at least 25 points to enter the bet! | return }
    if (%p < 25) { .msg $chan ( $+ $nick $+ ): Error, You have %p points but you must have at least 25 points to enter the bet! | return }
    if ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at win! | return }
    if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | var %ch = 1 }
    set -e %bet_win $addtok(%bet_win,$nick,44)
    .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet at win. - Good luck!
  }
  if ($1 == !lose) || ($1 == !lost) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    var %fix = $chan $+ . $+ $nick
    var %p = $readini(Points.ini,n,%fix,Points)
    if (!%p) { .msg $chan ( $+ $nick $+ ): Error, You have NOT any points award yet, you must have at least 25 points to enter the bet! | return }
    if (%p < 25) { .msg $chan ( $+ $nick $+ ): Error, You have %p points but you must have at lease 25 points to enter the bet! | return }
    if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at lose! | return }
    if ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | var %ch = 1 }
    set -e %bet_lose $addtok(%bet_lose,$nick,44)
    .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet at lose. - Good luck!
  }
  if ($1 == !remove) { 
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet at lose! }
    elseif ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet at win! }
    else { .msg $chan ( $+ $nick $+ ): Error, You have NOT bet yet! }
  }
  if ($1 == !results) || ($1 == !stats) { 
    if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, You are NOT an channel moderator! | return }
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    .msg $chan ( $+ $nick $+ ): Bet(s) at win: $iif(%bet_win,$numtok(%bet_win,44),0)
    .msg $chan ( $+ $nick $+ ): Bet(s) at lose: $iif(%bet_lose,$numtok(%bet_lose,44),0)
    .msg $chan ( $+ $nick $+ ): Total Bet(s): $calc($iif(%bet_win,$numtok(%bet_win,44),0) + $iif(%bet_lose,$numtok(%bet_lose,44),0))
  }
  if ($1 == !mybet) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at lose! }
    elseif ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at win! }
    else { .msg $chan ( $+ $nick $+ ): Error, You have NOT bet yet! }
  }
  if ($1 == !bethelp) { .msg $chan ( $+ $nick $+ ): BET Commands are: !Bet open - !Bet stop - !Bet pause - !Bet resume - !Bet result win/lose - !win - !lose - !remove - !results - !mybet }
}

alias check_mod {
  if (!$1) { return }
  if (!$2) { return }
  if ($me !ison $2) { return 0 }
  if ($1 !ison $2) { return 0 }
  var %f = mods.txt
  if (!$isfile(%f)) { return 0 }
  if (!$lines(%f)) { return 0 }
  var %r = $read(%f,nw,$1)
  if (%r) { return 1 }
  elseif (!%r) { return 0 }
}

alias bet_addpoints {
  if (!$1) { return }
  if (!%bet) { return }
  var %GIVE_POINTS = 25
  var %c = $1
  var %l = $2
  var %t = $numtok(%l,44)
  var %i = 1
  while (%i <= %t) {
    var %n = $gettok(%l,%i,44)
    var %fix = %c $+ . $+ %n
    var %p = $calc($readini(Points.ini,%fix,Points) + %give_points)
    if (%n) { writeini -n $qt(Points.ini) %fix Points %p }
    inc %i
  }
}

alias bet_delpoints {
  if (!$1) { return }
  if (!%bet) { return }
  var %TAKE_POINTS = 25
  var %c = $1
  var %l = $2
  var %t = $numtok(%l,44)
  var %i = 1
  while (%i <= %t) {
    var %n = $gettok(%l,%i,44)
    var %fix = %c $+ . $+ %n
    var %p = $calc($readini(Points.ini,%fix,Points) - %take_points)
    if (%n) { writeini -n $qt(Points.ini) %fix Points %p }
    inc %i
  }
}


The problem I had with this one is that when I do !win, but make the result !bet result lose, the people who voted !win (and were wrong) still gain the points and the people who voted for !lose (even though they were correct) still lost. I had attempted to contact him through his contact thingy, but I never saw a reply so I'll just ask here.

So, requesting not only a fix, but if possible, instead of it being only 25 point bets at a time, if the user can bet their own custom amount points and win/lose what they bet.

I'm not very familiar enough with mirc to do this myself sorry smirk

Re: Gambling System Code Request [Twitch] [Re: Scootycoolguy] #251757 02/03/15 06:47 PM
Joined: Feb 2015
Posts: 12
S
Scootycoolguy Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Feb 2015
Posts: 12
I did end up contacting westor and he fixed the code he had written to get it to work. It is still in increments of 25 points per bet, but thats fine. I just helped a little with some grammar mistakes (I may of missed some, but oh well)

For anyone interested for later readers, here it is.

Code:
ON !*:TEXT:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($1 == !bet) {
    if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, you are NOT a channel moderator! | return }
    if (!$2) { .msg $chan ( $+ $nick $+ ): Error, try again and enter the correct value, more info at !bethelp | return }
    if ($2 == open) || ($2 == start) || ($2 == on) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (%bet) { .msg $chan ( $+ $nick $+ ): Error, there is already a bet running. Try again later or use !bet stop to stop the bet! | return }
      set -e %bet $nick $chan
      .msg $chan ( $+ $nick $+ ): The BET has been started. Use !win or !lose to enter the bet and wager 25 of your points.
    }
    if ($2 == stop) || ($2 == end) || ($2 == off) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
      unset %bet_win %bet_lose %bet %bet_pause
      .msg $chan ( $+ $nick $+ ): The BET has been stopped.
    }
    if ($2 == resume) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
      if (!%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet paused right now! | return }
      unset %bet_pause
      .msg $chan ( $+ $nick $+ ): The BET has been resumed.
    }
    if ($2 == pause) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
      if (%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, the BET is already paused! | return }
      set -e %bet_pause $nick
      .msg $chan ( $+ $nick $+ ): The BET has been paused.
    }
    if ($2 == result) || ($2 == results) {
      if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
      if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
      if (!$3) { .msg $chan ( $+ $nick $+ ): Error, try again and enter the result win or lose . | return }
      if ($3 == win) || ($3 == won) {
        if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
        .msg $chan ( $+ $nick $+ ) The BET has been stopped to result in a win..
        if (!%bet_win) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet for win. }
        elseif (%bet_win) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_win - (Total: $numtok(%bet_win,44) $+ ) }
        if (%bet_lose) { bet_delpoints $chan %bet_lose }
        if (%bet_win) { bet_addpoints $chan %bet_win }
        unset %bet_win %bet_lose %bet %bet_pause
      }
      if ($3 == lose) || ($3 == lost) {
        if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
        .msg $chan ( $+ $nick $+ ) The BET has been stopped to result in a loss..
        if (!%bet_lose) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet for lose. }
        elseif (%bet_lose) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_lose - (Total: $numtok(%bet_lose,44) $+ ) }
        if (%bet_lose) { bet_addpoints $chan %bet_lose }
        if (%bet_win) { bet_delpoints $chan %bet_win }
        unset %bet_win %bet_lose %bet %bet_pause
      }
    }
  }
  if ($1 == !win) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    var %fix = $chan $+ . $+ $nick
    var %p = $readini(Points.ini,n,%fix,Points)
    if (!%p) { .msg $chan ( $+ $nick $+ ): Error, you don't have any points yet. You must have at least 25 points to enter the bet! | return }
    if (%p < 25) { .msg $chan ( $+ $nick $+ ): Error, you have %p points but you must have at least 25 points to enter the bet! | return }
    if ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at win! | return }
    if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | var %ch = 1 }
    set -e %bet_win $addtok(%bet_win,$nick,44)
    .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet for a win. - Good luck!
  }
  if ($1 == !lose) || ($1 == !lost) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    var %fix = $chan $+ . $+ $nick
    var %p = $readini(Points.ini,n,%fix,Points)
    if (!%p) { .msg $chan ( $+ $nick $+ ): Error, you don't have any points yet. You must have at least 25 points to enter the bet! | return }
    if (%p < 25) { .msg $chan ( $+ $nick $+ ): Error, you have %p points but you must have at lease 25 points to enter the bet! | return }
    if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at lose! | return }
    if ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | var %ch = 1 }
    set -e %bet_lose $addtok(%bet_lose,$nick,44)
    .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet for a loss. - Good luck!
  }
  if ($1 == !remove) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet for lose! }
    elseif ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet for win! }
    else { .msg $chan ( $+ $nick $+ ): Error, you have NOT bet yet! }
  }
  if ($1 == !results) || ($1 == !stats) {
    if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, you are NOT a channel moderator! | return }
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    .msg $chan ( $+ $nick $+ ): Bet(s) at win: $iif(%bet_win,$numtok(%bet_win,44),0)
    .msg $chan ( $+ $nick $+ ): Bet(s) at lose: $iif(%bet_lose,$numtok(%bet_lose,44),0)
    .msg $chan ( $+ $nick $+ ): Total Bet(s): $calc($iif(%bet_win,$numtok(%bet_win,44),0) + $iif(%bet_lose,$numtok(%bet_lose,44),0))
  }
  if ($1 == !mybet) {
    if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
    if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, there is NOT any bet running. Try again later or use !bet open to start a new bet! | return }
    if (%bet_pause) { return }
    if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at lose! }
    elseif ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at win! }
    else { .msg $chan ( $+ $nick $+ ): Error, you have NOT bet yet! }
  }
  if ($1 == !bethelp) { .msg $chan ( $+ $nick $+ ): BET Commands are: !bet open - !bet stop - !bet pause - !bet resume - !bet result win/lose - !win - !lose - !remove - !results - !mybet }
}

alias check_mod {
  if (!$1) { return }
  if (!$2) { return }
  if ($me !ison $2) { return 0 }
  if ($1 !ison $2) { return 0 }
  var %f = mods.txt
  if (!$isfile(%f)) { return 0 }
  if (!$lines(%f)) { return 0 }
  var %r = $read(%f,nw,$1)
  if (%r) { return 1 }
  elseif (!%r) { return 0 }
}

alias bet_addpoints {
  if (!$1) { return }
  if (!%bet) { return }
  var %GIVE_POINTS = 25
  var %c = $1
  var %l = $2
  var %t = $numtok(%l,44)
  var %i = 1
  while (%i <= %t) {
    var %n = $gettok(%l,%i,44)
    var %fix = %c $+ . $+ %n
    var %p = $calc($readini(Points.ini,%fix,Points) + %give_points)
    if (%n) { writeini -n $qt(Points.ini) %fix Points %p }
    inc %i
  }
}

alias bet_delpoints {
  if (!$1) { return }
  if (!%bet) { return }
  var %TAKE_POINTS = 25
  var %c = $1
  var %l = $2
  var %t = $numtok(%l,44)
  var %i = 1
  while (%i <= %t) {
    var %n = $gettok(%l,%i,44)
    var %fix = %c $+ . $+ %n
    var %p = $calc($readini(Points.ini,%fix,Points) - %take_points)
    if (%n) { writeini -n $qt(Points.ini) %fix Points %p }
    inc %i
  }
}