Welcome msg on first join only help (not every join)

By kassquatch on May 06, 2015

I am looking to add to a points script I found on here (from jally511, which is from darkestginge and afterburn1000)

What I want to do is add it so it only welcomes people on first join, if they have never joined the channel before. not on every join which it currently does.

I figured you could simply read from the points.ini file, and see if they are on the list or not, and if not, do welcome message.

But, my problem is, I know nothing about reading .ini files. Ive tried to read up on the help/tutorials etc, but I just cant grasp it. I figured all you need is before the msg $chan is an if statement reading the points.ini and checking for a name. which is why I posted the top10 script below this join script. because I was trying to learn from that.

here is the on join part of the script. (slightly modified for me).

ON !*:join:#:{
  if ($nick != kassquatch) {
    $+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
    add.pts $+(#,.,$nick)
    if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
    set -u10 %floodjoin On
    set -u30 %floodjoin. $+ $nick On
    msg $chan /ME Welcomes $nick to the stream. Feel free to chat or lurk around! Just remember, to win give-a-ways, you have to be a follower! Type !commands for a list of commands!
  }
}
ON !*:part:#:$+(.timerpoints.,#,.,$nick) off 
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 10)
}

Or, if someone can point me to a script that is already out there (ive searched the internet and back and couldnt find it) that would be great.

Here is my top10 script (once again, from somewhere here, dont know this source sorry) that I thought I could learn from since it already reads from the points.ini to try and get the names, but i just seemed to mess things up more. and out of rage, i deleted my work.

on *:TEXT:!top10:#:{
  top10 # 
}

alias -l top10 {
  window -h @. | var %i 1
  while $gettok($remove($read(points.ini,w,$+(*,$1,*),%i),[,]),2,46) {
    var %n $v1, %p $gettok($read(points.ini,$calc($readn + 1)),2,61)
    aline @. %n %p
    var %i $calc($readn + 1)
  }
  filter -cetuww 2 32 @. @.
  var %i 1 | while %i <= 10 {
    var %list $addtok(%list,$line(@.,%i),44)
    inc %i
  }
  msg $1 Top 10 point are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
  window -c @.
}

help please?

Comments

Sign in to comment.
Dankirk   -  May 06, 2015

Well, I can see why you are having trouble understanding this, it took me a while too. There is a $readini() alias you should use instead of $read() to make things a lot more understandable. The top10 script also seems to use a hidden window to do the actual sorting, which is a bit obscure.

For your actual problem, the function below should return the number of points a nick has:
$readini(points.ini, n, $+(#,.,$nick), Points)

If it returns nothing (or 0) you can message your welcome message. You should do this before add.pts though.

If you later want to edit the top10 script to use $readini() aswell, use $ini(points.ini, %i) to go through nicks instead of searching for lines with "#".

kassquatch  -  May 06, 2015

awesome thanks i shall try that!

kassquatch  -  May 06, 2015

thanks for the help, I got it to work. though, it may be ugly :p Im a code manipulator, not a code creator :) Also, dont know how to format this post here. so its all split up. this is all in one "on join {}"
edit: pastebin for those who care. This will only work if you use the points system i have from jally (i think) http://pastebin.com/0Q6b6CWM

ON !*:join:#:{
if ($nick != kassquatch && $readini(points.ini, n, $+(#,.,$nick), Points) > 0) {
$+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -u10 %floodjoin On
set -u30 %floodjoin. $+ $nick On
msg $chan /ME Welcomes $nick back to the stream.
}
elseif ($nick != kassquatch) {
$+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -u10 %floodjoin On
set -u30 %floodjoin. $+ $nick On
msg $chan /ME Welcomes $nick to the stream. Feel free to chat or lurk around! Just remember, to win give-a-ways, you have to be a follower! Type !commands for a list of commands!.
}
}

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.