mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#246079 22/05/14 07:04 PM
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Using the same point system as pretty much everyone else on here. Using mIRC for a bot in my twitch channel. Looking at how to do like !reset to make the bot reset everyone's points. Also, how could I start and stop the bot? so that ppl can't get points for being in my channel while I'm not streaming. Without me having to make the bot leave and re-join every time I start streaming.


Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
Can't promise that i will be able to help after you do it, but even if you use a "popular script", just post it. It is always better for those who try to help you to know what exactly they are dealing with.

Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Code:

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 $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  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 *:TEXT:!calc*:#: {
  if ($3 == $null) /msg $chan $nick  $2 = $calc( $2 )
  if ($3 != $null) /msg $chan 7Please dont use the space bar for the !calc7 trigger. Do it like this:  5+5 7for example.
}
on *:TEXT:!c:#: {
  /msg $chan To use this channel calculator, you should know this:
  /msg $chan The Calculator Buttons Are: [+] [-] [^] [*
  ] [/]
  /msg $chan Here are some examples: 
  /msg $chan 3^2 = 9
  /msg $chan 3*2 = 6
  /msg $chan 3/2 = 1,5
  /msg $chan 3+2 = 5
  /msg $chan 3-2 = 1
}




on *:text:!points:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}

on $*:text:/!points (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}





on *:text:!startuptime:#: {
  msg # Starting uptime.
  set -e %uptime. [ $+ [ # ] ] $ctime
}

on *:text:!uptime:#: { msg # I have been online for $duration($calc($ctime - %uptime. [ $+ [ # ] ] )) }

on *:text:!stopuptime:#: { 
  msg # Stopping uptime.
  unset %uptime. [ $+ [ # ] ] 
}

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
Alright, i did some research and testing for the second problem, the turn on/off script. I used this thread as the basic, so credit goes to blessing.

1) replace your whole "alias -l addPoints" with this one:

Code:
alias -l add.pts {
  if %point.off { return }
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}


This should turn off the point-calculation, whenever the variable %point.off is not set.

2) I changed the other script in the thread a bit, to fit my own personal taste:

Code:
on $*:text:/^!points (on|off)/:#:{
  if $nick isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}


With that, any moderator should be able to use the turn on/off script. If you don't like that, change the isop line to your prefered method.

3) I had to remove the line that gives 1 point when somebody joins the channel, to make the script work even if it starts after somebody is already in. Same thread, a few posts before:

Code:
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 900 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick) <-- Erase that
}


So far, those modifications work for me. I am still new to scripting tho, so i wouldn't mind if somebody would look over my solution, to make sure that i don't have any errors.

Last edited by Ahramanyu; 22/05/14 10:44 PM.
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Originally Posted By: Ahramanyu
Alright, i did some research and testing for the second problem, the turn on/off script. I used this thread as the basic, so credit goes to blessing.

1) replace your whole "alias -l addPoints" with this one:

Code:
alias -l add.pts {
  if %point.off { return }
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}


This should turn off the point-calculation, whenever the variable %point.off is not set.

2) I changed the other script in the thread a bit, to fit my own personal taste:

Code:
on $*:text:/^!points (on|off)/:#:{
  if $nick isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}


With that, any moderator should be able to use the turn on/off script. If you don't like that, change the isop line to your prefered method.

3) I had to remove the line that gives 1 point when somebody joins the channel, to make the script work even if it starts after somebody is already in. Same thread, a few posts before:

Code:
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 900 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick) <-- Erase that
}


So far, those modifications work for me. I am still new to scripting tho, so i wouldn't mind if somebody would look over my solution, to make sure that i don't have any errors.



The !points on and off doesn't work when added

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
It worked when i tested it. Did you adjust all the changes? Show me your new script.

Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Originally Posted By: Ahramanyu
It worked when i tested it. Did you adjust all the changes? Show me your new script.



Here is my new code

Code:

on *:TEXT:!calc*:#: {
  if ($3 == $null) /msg $chan $nick  $2 = $calc( $2 )
  if ($3 != $null) /msg $chan 7Please dont use the space bar for the !calc7 trigger. Do it like this:  5+5 7for example.
}
on *:TEXT:!c:#: {
  /msg $chan To use this channel calculator, you should know this:
  /msg $chan The Calculator Buttons Are: [+] [-] [^] [*
  ] [/]
  /msg $chan Here are some examples: 
  /msg $chan 3^2 = 9
  /msg $chan 3*2 = 6
  /msg $chan 3/2 = 1,5
  /msg $chan 3+2 = 5
  /msg $chan 3-2 = 1
}




on *:text:!points:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}

on $*:text:/!points (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to moderators. }
}

on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

on *:text:!points reset:#:{
  { msg $chan All points are now erased }
  write -c points.ini.
}





on $*:text:/^!point (on|off)/:#:{
  if $nick isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}







on *:text:!startuptime:#: {
  msg # Starting uptime.
  set -e %uptime. [ $+ [ # ] ] $ctime
}

on *:text:!uptime:#: { msg # I have been online for $duration($calc($ctime - %uptime. [ $+ [ # ] ] )) }

on *:text:!stopuptime:#: { 
  msg # Stopping uptime.
  unset %uptime. [ $+ [ # ] ] 
}




on *:TEXT:!giveaway enter:#:{
  if (%giveaway == on) {
    if (!$read(giveaway.txt,nw,$nick)) {
      write giveaway.txt $nick
      msg $chan $nick - you have been entered into the giveaway! 
    }
  }
  elseif (%giveaway == off) {
    msg $chan There is no active giveaway
  }
}

on *:TEXT:!giveaway start:#:{
  if ($nick isop #) {
    set -e %giveaway on
    msg $chan giveaway started. please do "!giveaway enter" to enter. To clear all names, please do "!giveaway done" 
  }
  else { msg $chan This command is only available to moderators. }
}


on *:TEXT:!giveaway end:#:{

  set -e %giveaway off
  { msg $chan Giveaway has ended. please do !draw to pick a winner!" }
}
on *:text:!giveaway done:#:{

  -e %giveaway = off
  { msg $chan giveaway is complete. erasing all names from the giveaway }
  write -c giveaway.txt.
}
on *:text:!draw:#:{ 

  if (%giveaway == off) { msg $chan The winner is $read(giveaway.txt) $+ !! If you would like to pick another winner draw again. }
  elseif (%giveaway == on) { msg $chan The giveaway is still on! please do "!giveaway end" }
}



Here is my new Alias

Code:
alias -l add.pts {
  if %point.off { return }
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}
alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  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
}



I have nothing under variables except something about #Giveaway off

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
Where are the lines which start giving you points on joining the channel? You took out several segments from your original file.

Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
to make it easier to read, I borrowed his idea.

My REMOTE window reads:

Code:
on *:text:!tokens:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total tokens.
}

on $*:text:/!tokens (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total tokens. }
  }
  else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 900 add.pts $+(#,.,$nick)

}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}


on $*:text:/^!points (on|off)/:#:{
  if $nick isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}



My ALIASES window reads:

Code:
/op /mode # +ooo $$1 $2 $3
/dop /mode # -ooo $$1 $2 $3
/j /join #$$1 $2-
/p /part #
/n /names #$$1
/w /whois $$1
/k /kick # $$1 $2-
/q /query $$1
/send /dcc send $1 $2
/chat /dcc chat $1
/ping /ctcp $$1 ping
/s /server $$1-



alias -l add.pts {
  if %point.off { return }
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}
alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  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
}

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
Edit: Nevermind, i take a look again.

Last edited by Ahramanyu; 22/05/14 11:46 PM.
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
no idea, seems like there needs to be a var determined like var %point.off

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
I think i got my problem.

Code:
on $*:text:/^!points (on|off)/:#:{
  if $nick !isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}

I told the script to return, if the nick is a operator. Need to change that into "is not an operator". At least i hope that's that. As an alternative, if you don't care wether your other mods can use this command or not, use the original " if $nick != YOURNICKHERE { return | halt } " .

Last edited by Ahramanyu; 23/05/14 01:07 AM.
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Does it work in your channel? i always if if $nick isop # and that works

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
I am using it right now, yes. Like i said, change the command into "if nick is not an operator", like in my example above.

Edit: After restarting my script, it seems like the turn on/off script suddenly dosn't work anymore. I am really not sure where i screwed up, but i will try to figure it out. Sorry if i wasted your time in any regard, i was pretty sure that i had it.

Edit 2: I just realized that you did put your aliases into the alias-window. The scripts you have there though are made for the remote-window itself.

Code:
alias -l add.pts {
  if %point.off { return }
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}

alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  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 *:text:!tokens:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total tokens.
}

on $*:text:/!tokens (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total tokens. }
  }
  else { msg $chan This command is only available to moderators. }
}

on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 10 add.pts $+(#,.,$nick)
}

on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

on $*:text:/^!points (on|off)/:#:{
  if $nick !isop # { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # Not collecting points anymore.
  }
  if $2 == on { 
    unset %point.off 
    msg # Collecting points now.
  }
}

Last edited by Ahramanyu; 23/05/14 01:40 AM.
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
So nothing goes in the alias window?

Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
Really appreciate it, it works now. When I do !reset points and then type !points. It says you have total points. How can I make it say you have 0 points.

Also, on the on join part where it says 300, which means every 5 minutes. I typed in 3600 for 3,600 seconds which is 1 hour it gives a point. That isn't working right. it gives like 1 point every few seconds instead of an hour.

Last edited by Echosyp; 23/05/14 02:42 AM.
Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
I would probably create a command that says

read points.ini
if points < 1, then give out msg ( you have zero points ).
if points > 1, then post the value for the nick

On a side.note, this is your current erase-script, right?

Code:
on *:text:!points reset:#:{
  { msg $chan All points are now erased }
  write -c points.ini.
}


You should probably give that some limitation, because at the moment, ANYBODY can erase the data in your points.ini by typing this command into the chat.

Code:
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 10 add.pts $+(#,.,$nick)
}


Change the 10 into the amount your prefered amount of seconds.

Last edited by Ahramanyu; 23/05/14 02:50 AM.
Joined: May 2014
Posts: 27
E
Echosyp Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: May 2014
Posts: 27
yea I gotta done some tuning on it to make it moderators only, just trying to figure out some stuff at the moment.

Kinda new to all of this, been a long time since I tried it.

I changed it to 3600 but when I start the bot we still get points every 10 seconds. Do we need to leave and rejoin or do we need to make the bot leave and rejoin? just currently testing everyting out.

Also,

Code:
on *:text:!points:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u10 %floodpoints On
  set -u5 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}


trying to figure out how to write the you have 0 points correctly.

Cause when I do the !points reset, it deletes their name from the points.ini file

Last edited by Echosyp; 23/05/14 03:17 AM.
Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Code:
alias -l add.pts {
  if %point.off return {
    writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  }
}
alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}
alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  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 $*:text:/^!points (on|off)/:#:{
  if $nick !== YOURNICKHERE { return }
  if $2 == off { 
    set -e %point.off 1 
    msg # The ability to earn points is no longer available! 
  }
  else { 
    unset %point.off 
    msg # Points are now available to earn! 
  }
}

on *:text:!points:#:{
  if ((%floodcoins) || ($($+(%,floodcoins.,$nick),2))) { return }
  set -u10 %floodcoins On
  set -u300 %floodcoins. $+ $nick On
  msg # $nick - ( $+ $readini(Points.ini,$+(#,.,$nick),Points) $+ )
}

on $*:text:/!points (add|remove)/Si:#:{
  if ($nick == YOURNICKHERE) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to the owner of this channel. }
}
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick) 
} 

on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}



Remove all that old code.
Copy this entire code.
Place it in your remote file.
Change "YOURNICKHERE" with what ever your username on twitch is (all lowercase) to make sure only YOU can turn on/off points or add/remove points... That way you don't have mods giving points away or turning on the system without you knowing it.

Under the " on !*:join:#: " portion, you'll see there is a timer. It has " 0 600 "

Change that to however long you want it to be before people get their point.

under this part...

Code:
alias -l add.pts {
  if %point.off return {
    writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  }
}


you'll notice a +1 at the end. That's the amount of points they're gaining.

Focus on making sure the script works, before you worry about adding to it. As long as you don't change anything but the message and pointgain (ie amount/time) parts of the code you should be okay. Just make sure you're careful when doing so and do a bracket check before you hit ok :P


EDIT:
Please note that I copy pasted this from my remote file. And I don't have points on for when they join the chat (that makes it easy to "farm" points by simply leaving and rejoining)

Last edited by Bramzee; 23/05/14 12:28 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
alias -l add.pts {
  if %point.off return {
    writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  }
}

on $*:text:/!points (add|remove)/Si:#:{
  if ($nick == YOURNICKHERE) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to the owner of this channel. }
}


I don't know where you're all picking up code like this, but please stop spreading it around. The first alias is nonsense, and you don't surround arbitrary lines with braces. Aside from syntax, it's good to give meaningful names to variables instead of using $3, $4, $5 directly throughout your code.

Code:
alias -l add.pts {
  if (%point.off) return
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

on $*:text:/!points (add|remove)/Si:#:{
  if ($nick == YOURNICKHERE) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points.ini,n,$+(#,.,$3),Points) total points.
  }
  else { msg $chan This command is only available to the owner of this channel. }
}


And if the channel owner's name matches the channel you can avoid hard coding it as so:
Code:
if ($mid(#,2-) != $nick) return

Page 1 of 2 1 2

Link Copied to Clipboard