This is a extremely simple script that can be used if you have a bot on a network. People can rate your bot on a scale of 1-10.
How Other people can use it:
!rate - Gives Instructions
!rate <#1-10> - Rate bot 1-10 (ten being highest in this case)
!botavg - Shows the average of your bot
Fixed it up a tad since I've excelled a bit since 2 years ago in MSL. Changed it to work with INI's which are faster and more organized. The script is now easier to read and more appealing to look at. Enjoy the 'improved' version of this.
on $*:TEXT:/^[@!.]rate/Si:#:{
var %t = $iif($left($1,1) = @,msg $chan,notice $nick)
if (!$2) { %t Give my bot a rating 1-10 : 10 being the highest. To do so type !rate [1-10] }
if ($2 !isnum 1-10) { %t Give me a rating between 1 and 10 please.
halt
}
if ($readini(rate.ini,People,$address($nick,2)))
%t Sorry $nick but you have already rated my bot.
halt
}
else {
%t Thanks for ratinig my bot $+($nick,.) This information has been stored.
writeini rate.ini People $address($nick,2) $+($nick,:,$2)
var %x = $readini(rate.ini,Rating,Total)
var %y = $readini(rate.ini,Rating,Voters)
writeini rate.ini Rating Total $calc($2 + %x)
writeini rate.ini Rating Voters $calc(%y + 1)
}
}
}
on $*:TEXT:/^[@!.]botavg$/Si:#:{
var %t = $iif($left($1,1) = @,msg $chan,notice $nick)
%t The average rating for me is: $round($calc($readini(rate.ini,Rating,Total) / $readini(rate.ini,Rating,Voters)),2)
}
a little advide:
for comments in a script, do
/*
the comments
that you
write in
the script
*/
OR
;The commants
;that you
;write in
;the script
also, when u do
/if (!$2) { msg $chan Give my bot a rating 1-10 : 10 being the highest. To do so type !rate ə-10> }
/elseif ($2) {
no need for elseif ($2), just else {
u also dont need the if !$read, jsut else
and u can use isnum to see if its a num 1-10
if ($2 isnum 1-10) {
also, as acid said, u should consider doing a hash table or an ini, but nice idea