mIRC Home    About    Download    Register    News    Help

Print Thread
Yet another points system need some help please #251317 15/02/15 05:56 PM
Joined: May 2013
Posts: 121
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 121
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.
Re: Yet another points system need some help please [Re: raycomp] #251361 16/02/15 03:11 PM
Joined: May 2013
Posts: 121
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 121
After 240 views nobody with any ideas or help?
Then I take it there is no answer to be found in this forum for my particular request! Or is my problem one of those that people are not bothered with? Or to many newbies like me with stupid request for help?

Last edited by raycomp; 16/02/15 03:15 PM.
Re: Yet another points system need some help please [Re: raycomp] #251364 16/02/15 03:37 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
No, you can ask as silly/noobish questions as you can imagine and people will help. I think the problem is it's really hard to understand what you're asking. The wall of code doesn't help either.. ^_^

If I'm understading it right, you want people to get points for saying certain words? Can't you just do the same you did for the bad words, except add points instead of subtracting them?



Last edited by Sakana; 16/02/15 03:46 PM.
Re: Yet another points system need some help please [Re: Sakana] #251365 16/02/15 04:00 PM
Joined: May 2013
Posts: 121
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 121
Sorry for my previous post. Thanks for pointing it our to me.

I can change that portion of script to either subtract points or to add points. I don't know how to mange both in the same script

Quote:
alias -l swear.words { RETURN bitch.horny.cock.shit }

on 1*:text:*:#:{
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
}
}


I want to have another alias like

alias -l good.words { RETURN hallo.morning.wb.hb }

so that if one of those are uses I can add points in stead of subtracting points

Does this make sense

Last edited by raycomp; 16/02/15 04:03 PM.
Re: Yet another points system need some help please [Re: raycomp] #251366 16/02/15 04:47 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
I would just copy paste that into a new script file and change the names of aliases, etc.

When you have multiple ON TEXT events that trigger on everything (on *:text:*:#:), it's generally best to keep them in different files to avoid conflict, unless you want the first one to inhibit the other

It would be better to just write it inside the same ON TEXT as the one for bad words, but I don't see a good way of doing that since you have a return inside the while loop. I guess you could still do that, it would just mean that people won't get points for saying goods things if they also said something bad.


Last edited by Sakana; 16/02/15 04:52 PM.
Re: Yet another points system need some help please [Re: Sakana] #251368 16/02/15 05:33 PM
Joined: May 2013
Posts: 121
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 121
Thank you will give that a try, Files? Do you mean in two different remotes?

Last edited by raycomp; 16/02/15 05:39 PM.
Re: Yet another points system need some help please [Re: raycomp] #251369 16/02/15 05:43 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Yeah, in a new remote. It will create a new file in your scripts folder

Re: Yet another points system need some help please [Re: Sakana] #251375 16/02/15 07:10 PM
Joined: May 2013
Posts: 121
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 121
Thank you, done that and it worked like that

Last edited by raycomp; 16/02/15 07:11 PM.