mIRC Home    About    Download    Register    News    Help

Topic Options
#242691 - 21/08/13 04:20 AM Need Help With a Rank System
uhDetox Offline
Nutrimatic drinks dispenser

Registered: 21/08/13
Posts: 5
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.

Top
#242712 - 23/08/13 05:49 PM Re: Need Help With a Rank System [Re: uhDetox]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#242713 - 23/08/13 05:57 PM Re: Need Help With a Rank System [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3506
Loc: France
A typical situation for the isnum operator!

if (%points isnum 50-74)

Also ensuring a fail if %points is not a number somehow.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#242716 - 24/08/13 12:46 AM Re: Need Help With a Rank System [Re: Riamus2]
uhDetox Offline
Nutrimatic drinks dispenser

Registered: 21/08/13
Posts: 5
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. }
}

Top
#242717 - 24/08/13 01:17 AM Re: Need Help With a Rank System [Re: uhDetox]
potatgun Offline
Bowl of petunias

Registered: 24/08/13
Posts: 2
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?

Top
#242718 - 24/08/13 01:54 AM Re: Need Help With a Rank System [Re: potatgun]
uhDetox Offline
Nutrimatic drinks dispenser

Registered: 21/08/13
Posts: 5
Yes I am referring to twitch channels.

Top
#242719 - 24/08/13 02:05 AM Re: Need Help With a Rank System [Re: uhDetox]
potatgun Offline
Bowl of petunias

Registered: 24/08/13
Posts: 2
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.


Top
#242720 - 24/08/13 02:11 AM Re: Need Help With a Rank System [Re: potatgun]
uhDetox Offline
Nutrimatic drinks dispenser

Registered: 21/08/13
Posts: 5
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.

Top
#242798 - 03/09/13 11:22 AM Re: Need Help With a Rank System [Re: uhDetox]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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 $+ .
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#242799 - 03/09/13 12:42 PM Re: Need Help With a Rank System [Re: potatgun]
razezar Offline
Ameglian cow

Registered: 03/05/13
Posts: 25
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.

Top