Can someone help me i have seen this scipt in another thread and can not get it to work i am new to Mirc. and this script will be used in linked with twitch chat. can someone explain and help me please.
; #### SETUP START ####
; channel(s) to trigger the !rank !promote !remote and !add commands at (separate multiple channels by comma)
alias -l rankchan { return #yourchan }
; file to store ranking in. will be created if not existing. if not located in your main mirc directory, put a full path
alias -l rankini { return ranks.ini }
alias -l rank {
; possible ranks, lowest to highest. separate by comma
var %ranks = 1:Private,2:Lance Corporal,3:Corporal,4:Sergeant,5:Staff/Colour Sergeant,6:Squadron Sergeant Major,7:Officer Cadet,8:Second Lieutenant,9:Lieutenant,10:Captain,12:Major,13:Lieutenant Colonel,14:Colonel,15:Brigadier,16:Major General,17:Lieutenant General,18:General,19:Field Marshal
if ($findtok(%ranks,$1,1,44)) { return $v1 }
elseif ($gettok(%ranks,$1,44) !isnum) { return $qt($v1) }
elseif ($1 == 0) { return $numtok(%ranks,44)) }
}
alias -l rankdate {
if ($readini(ranks.ini,n,$1,date)) {
tokenize 32 $v1
; output format ($1 is "added/promoted/demoted", $2 is $ctime of $1)
return $chr(91) $+ $1 $+ : $date($2) $+ $chr(93)
}
}
; number of votes required for promotion/demotion
alias -l rankvotes { return 5 }
; #### SETUP END ####
on *:text:!rank:$($rankchan): {
MSG $chan Please choose a player with !rank PLAYERSNAME
}
on *:text:!rank &:$($rankchan): {
if ($readini($rankini,n,$2,rank)) { MSG $chan $2 holds the rank of $rank($v1) $rankdate($2) }
else { MSG $chan $2 does not have a rank, yet. }
}
on *:text:!addplayer &:$($rankchan): {
if ($readini($rankini,n,$2,rank)) { MSG $chan $2 already holds the rank of $rank($v1) $+ . $rankdate($2) }
elseif ($2 !isnum) {
writeini $qt($rankini) $2 rank 1
writeini $qt($rankini) $2 date added $ctime
MSG $chan $2 has been granted the rank of $rank(1) $+ .
}
}
on *:text:!promote &:$($rankchan): { rankchange promote $2 }
on *:text:!demote &:$($rankchan): { rankchange demote $2 }
alias -l rankchange {
var %r = $readini($rankini,n,$2,rank)
; no rank at all
if (!%r) { MSG $chan $2 does not hold any rank. }
; self-vote
elseif ($2 == $nick) { MSG $chan voting for yourself? Nah! }
; beyond limits
elseif (($1 == promote) && (%r >= $rank(0))) { MSG $chan $2 already holds the highest possible rank of $rank(%r) $rankdate($2) }
elseif (($1 == demote) && (%r == 1)) { MSG $chan $2 already holds the lowest possible rank of $rank(%r) $rankdate($2) }
else {
var %votes = $readini($rankini,n,$2,$1), %action = $replace($1,mote,motion)
; double vote
if ($istok(%votes,$nick,32)) { MSG $chan $nick $+ , you already voted for the %action of $2 $+ . }
else {
MSG $chan $nick votes for the %action of $2 $+ .
; not enough votes yet
if ($calc($rankvotes - $numtok(%votes,32)) > 1) { writeini $qt($rankini) $2 $1 %votes $nick }
; enough votes: promote/demote
else {
var %newrank = $iif(($1 == promote),$calc(%r +1),$calc(%r -1))
writeini $qt($rankini) $2 rank %newrank
writeini $qt($rankini) $2 date $1 $+ d $ctime
remini $qt($rankini) $2 promote | remini $qt($rankini) $2 demote
MSG $chan $2 has been $1 $+ d to the rank of $rank(%newrank) $+ .
}
}
}
}