mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
A typical situation for the isnum operator!

if (%points isnum 50-74)

Also ensuring a fail if %points is not a number somehow.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
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. }
}

Joined: Aug 2013
Posts: 2
P
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?

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.

Joined: Aug 2013
Posts: 2
P
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.


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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: May 2013
Posts: 25
R
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.


Link Copied to Clipboard