mIRC Home    About    Download    Register    News    Help

Print Thread
#246825 04/07/14 03:43 PM
Joined: Jul 2014
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2014
Posts: 4
Hi there. So I have put a point script on for a bot on twitch. Now I want to change the amount of points it gives and how often it gives them but can't figure out where to do it properly.

Here is the script
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 *:join:#:{
  var %points $addPoints(1)
  timer $+ $nick 0 5 doaddpoints $chan $nick 1
}

on *:part:#:{
  timer $+ $nick off
}

on *:text:!points:#:{
  var %points $lookUpPoints
  msg $chan $nick has %points total point(s).
  if ($2 == add) { doaddpoints $chan $3 1 }
  if ($2 == remove) { dorempoints $chan $3 }
}

on *:text:!points *:#:{
  if ($2 == add) { doaddpoints $chan $3 1 }
  if ($2 == remove) { dorempoints $chan $3 }
}


Any help would be greatly appreciated.

Last edited by LeRay0409; 04/07/14 03:45 PM.
Joined: Dec 2002
Posts: 5,427
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,427
A quick look at the script indicates that it gives points in the on JOIN event (when a user joins the channel) by calling "addPoints" and in the on TEXT events when the script receives "!points" messages.

The amount of points added seem to be the number in $addPoints(1) in the on JOIN event and "doaddpoints $chan $3 1". Both are adding 1 point with each call, so you could try changing the "1" to another value.

If you are just starting out with scripting, you should keep a safe copy of the current script somewhere in case you need to revert to it, and experiment by changing the values mentioned above to see what happens.

Joined: Jul 2014
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Jul 2014
Posts: 4
Originally Posted By: Khaled
A quick look at the script indicates that it gives points in the on JOIN event (when a user joins the channel) by calling "addPoints" and in the on TEXT events when the script receives "!points" messages.

The amount of points added seem to be the number in $addPoints(1) in the on JOIN event and "doaddpoints $chan $3 1". Both are adding 1 point with each call, so you could try changing the "1" to another value.

If you are just starting out with scripting, you should keep a safe copy of the current script somewhere in case you need to revert to it, and experiment by changing the values mentioned above to see what happens.


I am just starting out. Thank you for the help. Don't fully understand this but I am a quick learner.


Link Copied to Clipboard