Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 $4 is not a number. It needs to be a number. | halt }
- var %topic $+($1,.,$2)
- var %points $calc($readini(Points.ini,%topic,Points) + $4)
- 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 *:join:#:{
- var %points $addPoints(1)
- timer $+ $nick 0 60 doaddpoints $chan $nick $1
- msg $chan $nick has joined the room and is earning points now.
- }
- on *:part:#:{
- timer $+ $nick off
- msg $chan $nick has left the room and has stopped earning points.
- }
- on *:text:!points:#:{
- var %points $lookUpPoints
- msg $chan $nick has total of %points points.
- if ($nick isop #) {
- if ($2 == add) { doaddpoints $chan $3 $4 | msg $chan Added $4 points to $3 | halt }
- if ($2 == remove) { dorempoints $chan $3 $4 | msg $chan Removed $4 points to $3 | halt }
- if ($2 == help) { msg $chan To add: !points add username amount. To remove: !points remove username amount. | halt }
- }
- }
- on *:text:!points *:#:{
- if ($nick isop #) {
- if ($2 == add) { doaddpoints $chan $3 $4 | msg $chan Added $3 points to $4 | halt }
- if ($2 == remove) { dorempoints $chan $3 $4 | msg $chan Removed $3 points to $4 | halt }
- if ($2 == help) { msg $chan To add: !points add username amount. To remove: !points remove username amount. | halt }
- }
- }
- on *:text:!cleardb:#:{
- if ($nick isop #) {
- remini Points.ini
- msg $nick You have cleared the database.
- echo -a Cleared Database (Deleted Points.ini file)
- }
- }
- on *:text:!check:#:{
- if ($nick isop #) {
- var %check $+($chan,.,$2)
- var %checkpoints $readini(Points.ini,%check,Points)
- msg $chan $2 has total of %checkpoints points.
- }
- }
- on *:text:!check *:#:{
- if ($nick isop #) {
- var %check $+($chan,.,$2)
- var %checkpoints $readini(Points.ini,%check,Points)
- msg $chan $2 has total of %checkpoints points.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement