mIRC Home    About    Download    Register    News    Help

Print Thread
#244915 05/04/14 09:39 AM
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
I am Making a Twitch Chat bot for me and other streamers. One of the streamer wants a !points command. He wants it so Every 10 Mins You get 2 Points and when you sub you get Added 100 Points and Mods an Extra 1000 Or so. Also If anyone Knows How to get the bot to time-out people for spamming links,caps and say when It timed someone out. If anyone Knows Please Post script in The Forum and I will Give you a command for helping or whatever you want.

Thanks :P

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I suggest you watch this tutorial: https://www.youtube.com/watch?v=OMpJLw3SQkQ
I think everything you need is in here. Points system starts on episode 4, Link block system starts on episode 8 and you can just make a curse system yourself based off of the link block.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
That didnt work for me. it says <username> Has total points

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
it shouldn't say <username> in the code, it should say $nick


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Make sure that you have a points.ini file in your mircdir. - If I recall correctly he apologizes for providing false code by using "alias -1" instead of "alias -l" seeing as these look alike. You should continue his videos until he mentions this and look into his code.

If my memory is correct, this would be in either episode 8 or 9.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
That was an example..

Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
How do I do that?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Here, I went through his videos and I just copied what he posted in his pastebin.

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:!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 600 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) + 2)
}


Your mircdir is located at C:\Users\Username\AppData\Roaming\mIRC by default.



Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
When someone joins the channel, it should start a timer giving you 2 points per 10 minutes.

Go to your mircdir and look for a file called points.ini
Inside the file, there should be something like this.


If you do not have a file, try making one and see then. What your script is failing to do is to read the file for the value.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Cheers

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: Nillen
When someone joins the channel, it should start a timer giving you 2 points per 10 minutes.

Go to your mircdir and look for a file called points.ini
Inside the file, there should be something like this.


If you do not have a file, try making one and see then. What your script is failing to do is to read the file for the value.

I just watched the points system videos and i see this:
Code:
on !*:join:#:{
  $+(.timerPoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,+,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -1 add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

add.pts is there, there is no alias i see add.pts.
Is this supposed to be the alias addPoints?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I literally have no idea what you're talking about.



You have alias -1 instead of alias -l however, that's not going to work.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I was copying his points script by hand and didn't watch the next one to hear he updated it for add.Pts.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 72
A
Babel fish
OP Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
please reply to my message

Joined: Mar 2014
Posts: 52
P
Babel fish
Offline
Babel fish
P
Joined: Mar 2014
Posts: 52
because he is not on the list probably smile i need more info to help you


Link Copied to Clipboard