mIRC Homepage
Posted By: uhDetox Need Help With a Rank System - 21/08/13 03:20 AM
I have a point system through my mIRC bot so that the longer the viewer stays in my twitch chat the more points he gains, I have a !points command to allow the viewer to see how many points he has, but I was wondering instead of a number if it was possible to put a word? For example if they had 50 points they would be the rank Sergeant, and when they hit 75 points they would be promoted to another rank. I have seen it in other channels through their own custom mIRC bots and would love to know how to do it myself, thanks.
Posted By: Riamus2 Re: Need Help With a Rank System - 23/08/13 04:49 PM
An easy way is to just check the total and convert it...

Code:
if (%points >= 50 && %points < 75) { msg $chan You are a Sergeant. }


Of course, there are a variety of ways to implement that, but that's just an easy example that would work.
Posted By: Wims Re: Need Help With a Rank System - 23/08/13 04:57 PM
A typical situation for the isnum operator!

if (%points isnum 50-74)

Also ensuring a fail if %points is not a number somehow.
Posted By: uhDetox Re: Need Help With a Rank System - 23/08/13 11:46 PM
Ok but where would I implement that into my system? My current code is this.

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:!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. }
}
Posted By: potatgun Re: Need Help With a Rank System - 24/08/13 12:17 AM
Indeed:
Quote:
I have seen it in other channels through their own custom mIRC bots and would love to know how to do it myself, thanks.


You aren't referring to twitch channels, are you?
Posted By: uhDetox Re: Need Help With a Rank System - 24/08/13 12:54 AM
Yes I am referring to twitch channels.
Posted By: potatgun Re: Need Help With a Rank System - 24/08/13 01:05 AM
Yeah, I know what channels you are talking about (Athene, etc). I'll suggest you contact the owners of the channels first before you plagiarize their ideas. Plainly put, big streamers with corporate sponsors, tens of thousands of fans (or hundreds of thousands, I'm not sure what) typically have legal protection over their branding and businesses, and the money to back up legal disputes. You should probably be more conscientious before taking other people's ideas if they use those ideas to run a company.

Posted By: uhDetox Re: Need Help With a Rank System - 24/08/13 01:11 AM
Pretty sure you arnt understanding what im trying to do. Its just in-chat ranks. I developed the system myself from scratch, so that wouldnt be stealing anything, im just trying to find out how to mask the points with a rank instead of a number. That wouldn't be a brand or a buisness, nor would it be copyright-able.
Posted By: Riamus2 Re: Need Help With a Rank System - 03/09/13 10:22 AM
You use it wherever you have a message with the total points...

Example:

Code:
msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points.


Becomes (using isnum as Wims pointed out):

Code:
var %points = $readini(Points.ini,$+(#,.,$3),Points)
if (%points isnum 1-49) { %points = Rank1 }
elseif (%points isnum 50-99) { %points = Rank2 }
elseif (%points isnum 100-) { %points = MaxRank }
msg $chan $3 is now rank %points $+ .
Posted By: razezar Re: Need Help With a Rank System - 03/09/13 11:42 AM
Originally Posted By: potatgun
Yeah, I know what channels you are talking about (Athene, etc). I'll suggest you contact the owners of the channels first before you plagiarize their ideas. Plainly put, big streamers with corporate sponsors, tens of thousands of fans (or hundreds of thousands, I'm not sure what) typically have legal protection over their branding and businesses, and the money to back up legal disputes. You should probably be more conscientious before taking other people's ideas if they use those ideas to run a company.


Nice try but ideas are not copyrightable.
© mIRC Discussion Forums