mIRC Home    About    Download    Register    News    Help

Print Thread
Need Help With a Rank System #242691 21/08/13 03:20 AM
Joined: Aug 2013
Posts: 5
U
uhDetox Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
U
Joined: Aug 2013
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.

Re: Need Help With a Rank System [Re: uhDetox] #242712 23/08/13 04:49 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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
Re: Need Help With a Rank System [Re: Riamus2] #242713 23/08/13 04:57 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: Need Help With a Rank System [Re: Riamus2] #242716 23/08/13 11:46 PM
Joined: Aug 2013
Posts: 5
U
uhDetox Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
U
Joined: Aug 2013
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. }
}

Re: Need Help With a Rank System [Re: uhDetox] #242717 24/08/13 12:17 AM
Joined: Aug 2013
Posts: 2
P
potatgun Offline
Bowl of petunias
Offline
Bowl of petunias
P
Joined: Aug 2013
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?

Re: Need Help With a Rank System [Re: potatgun] #242718 24/08/13 12:54 AM
Joined: Aug 2013
Posts: 5
U
uhDetox Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
U
Joined: Aug 2013
Posts: 5
Yes I am referring to twitch channels.

Re: Need Help With a Rank System [Re: uhDetox] #242719 24/08/13 01:05 AM
Joined: Aug 2013
Posts: 2
P
potatgun Offline
Bowl of petunias
Offline
Bowl of petunias
P
Joined: Aug 2013
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.


Re: Need Help With a Rank System [Re: potatgun] #242720 24/08/13 01:11 AM
Joined: Aug 2013
Posts: 5
U
uhDetox Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
U
Joined: Aug 2013
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.

Re: Need Help With a Rank System [Re: uhDetox] #242798 03/09/13 10:22 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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
Re: Need Help With a Rank System [Re: potatgun] #242799 03/09/13 11:42 AM
Joined: May 2013
Posts: 25
R
razezar Offline
Ameglian cow
Offline
Ameglian cow
R
Joined: May 2013
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.