I have this very simple working point system (not all my own work) The msg's will flood, kept it like that for testing will change to notice nick eventually.
Would like some help with these issues:
Most wanted:
I have alias and routine to subtract points for swear word. Would like to add to that to award points for say friendly words like
alias -l good.words { RETURN morning.welcome.wb.hb }

Then the on quit is not working I think maybe because the user has already left.

What I've got is this
Quote:
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(Point.ini,%topic,Points) + $1)
writeini -n Point.ini %topic Points %points
return %points
}
alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Point.ini,%topic,Points)
return %points
}
on 1:text:!bonus:#:{
var %points $lookUpPoints
notice $nick Congrats? You accumelated %points Bonus points in $chan
}

;==Top 10 users===================
on 1:text:!bonus10:#:{ run_top10 # }
alias run_top10 {
window -h @. | var %i 1
while $ini(point.ini,%i) {
var %n $v1
if ($+(*,$1,*) iswm %n) {
aline @. $gettok($remove(%n,[,]),2,46) $readini(point.ini,%n,points)
}
inc %i
}
filter -cetuww 2 32 @. @.
var %i 1 | while %i <= 10 {
var %list $addtok(%list,$line(@.,%i),44)
inc %i
}
msg $1 Top 10 users are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
window -c @.
}

on !*:join:#:{
if (Sybian iswm $nick) { //msg # is a bot } return
if (services iswm $nick) { //msg # is services } return
if (Chat27* iswm $nick) { //msg # chat27* please select another nick } return
var %points $addPoints(+3)
msg # adds 3 points to $nick $+ , total points %points $+ :Join Channel
}

;==on part===NOT WORKING=======
on !*:PART:#:{
if (Sybian iswm $nick) { //msg # is sybian } return
if (services iswm $nick) { //msg # is services } return
if (Chat27* iswm $nick) { //msg # chat27 has left } return
var %points $addPoints(-1)
msg # removes 1 points from $nick $- , total points %points $- :Quiting
}

;==nickchange===maybe not the best way but works==========
on 1:text:*is now known as*:#:{
if (Sybian iswm $nick) { //msg # is a bot } return
if (services iswm $nick) { //msg # is services } return
if (Chat27* iswm $nick) { //msg # was chat27 } return
var %points $addPoints(-2)
msg # Bot removes 2 points from $nick $- , total points %points $+ :Nickcgange
halt
}

;==swear words====removed some bad words===========
alias -l swear.words { RETURN bitch.horny.cock.shit }

on 1*:text:*:#:{
if (Sybian iswm $nick) { //msg # is a bot } return
if (services iswm $nick) { //msg # is services } return
if (Chat27* iswm $nick) { //msg # chat27* please select nick } return
VAR %x = $strip($1-) , %i = $numtok($swear.words,46)
WHILE (%i) {
if ($istok(%x,$gettok($swear.words,%i,46),32)) {
var %points $addPoints(-5)
msg # removes 5 points from $nick $- , total points %points $- :Badwords
RETURN
}
DEC %i
}
else
var %points $addPoints(2)
msg # Bot awards 2 points to $nick $+ , total points %points $+ :Talking
}
:

Last edited by raycomp; 15/02/15 06:43 PM.