Hey there! I recently tried to create my own twitch bot. What I've got so far is a points system. You can check your points with !points. Mods can you !points add|remove [Number] depending if you want to grant or remove points. For every 5 minutes you stay in the chat you earn 1 point. Now I need help by someone that knows how to code a bot. I need to create a rank system were if you have for example 1-19 points you are rank private etc. If you could help me please send me a message on my stream: bambiifocus or send a msg here or comment :) I would be really grateful if you can help me and maybe help me implement more features if you have the time! :) The rank code downbelow doesnt work for me so yeah.. I really need help for this code and also new features. Lottery/auctions, Raffle with points ect ;)
alias -1 addPoints {
if {$1 !isnum) { echo 2 -st $1 is not a number. It need 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:!points:#:{
if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
set -u10 %floodpoints On
set -u30 %floodpoints. $+ $nick On
msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}
on $*:text:/!points (add|remove)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <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 points. }
}
else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -u10 %floodjoin On
set -u30 %floodjoin. $+ $nick On
msg $chan $nick has joined and is now earning points.
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
set -u10 %floodpart On
set -u30 %floodpart. $+ $nick On
msg $chan $nick has left the channel and is no longer earning points.
}
on *:text:!rank:#:{
if ($readini(Points.ini,$nick,Points) <= 9) { msg # $nick you are rank1 with $readini(Points.ini,$nick,Points) Points. Earn $calc(10 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank2 }
if ($readini(Points.ini,$nick,Points) > 9) && ($readini(Points.ini,$nick,Points) <= 19) { msg # $nick you are rank2 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 20 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank3 }
if ($readini(Points.ini,$nick,Points) > 19) && ($readini(Points.ini,$nick,Points) <= 29) { msg # $nick you are rank3 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 30 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank4 }
if ($readini(Points.ini,$nick,Points) > 29) && ($readini(Points.ini,$nick,Points) <= 39) { msg # $nick you are rank4 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 40 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank5 }
if ($readini(Points.ini,$nick,Points) > 39) && ($readini(Points.ini,$nick,Points) <= 49) { msg # $nick you are rank5 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 50 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank6 }
if ($readini(Points.ini,$nick,Points) > 49) && ($readini(Points.ini,$nick,Points) <= 59) { msg # $nick you are rank6 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 60 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank7 }
if ($readini(Points.ini,$nick,Points) > 59) && ($readini(Points.ini,$nick,Points) <= 69) { msg # $nick you are rank7 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 70 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank8 }
if ($readini(Points.ini,$nick,Points) > 69) && ($readini(Points.ini,$nick,Points) <= 79) { msg # $nick you are rank8 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 80 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank9 }
if ($readini(Points.ini,$nick,Points) > 79) && ($readini(Points.ini,$nick,Points) <= 89) { msg # $nick you are rank9 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 90 - $readini(Points.ini,$nick,Points)) More Points To Become a Rank10 }
if ($readini(Points.ini,$nick,Points) > 89) && ($readini(Points.ini,$nick,Points) <= 99) { msg # $nick you are rank10 with $readini(Points.ini,$nick,Points) Points. Earn $calc( 100 - $readini(Points.ini,$nick,Points)) More Points To Become a Ran11 }
}