Welcome Back Greeter

By MaxEvans on Mar 20, 2009

This is an idea me and my brother had to greet nicks when they join your channel, then welcome them back when they come back. It writes their nick to an ini file when they leave or quit, so when they come back it'll welcome them back.

on !*:JOIN:#: {
  if ($readini(wb.ini,$chan,$nick) == yes) {
    .notice $nick Welcome back to $chan $+ , $nick $+ . Glad to see you here again! =]
  }
  else {
    .notice $nick Welcome to $chan $+ , $nick $+ . We hope you make this your new hangout spot.
  }
}

on !*:PART:#: {
  writeini wb.ini $chan $nick yes
}
on !*:QUIT:#: {
  writeini wb.ini $chan $nick yes
}

Comments

Sign in to comment.
TheImrac   -  Mar 22, 2009

Not sure why you even have quit and part events, wouldn't it be easier just to add them when they join and are not in the list?

 Respond  
Jethro   -  Mar 20, 2009

Ouch! Good point, PunkTured...I totally overlooked this. Thanks for the reminder. So I figure this should do the trick:

on !*:QUIT: {
    var %x = $comchan($nick,0)
  while (%x) {
    writeini wb.ini $comchan($nick,%x) $nick yes
    dec %x
  }
}
 Respond  
PuNkTuReD   -  Mar 20, 2009

why is everyone putting a # in their quit events?

a quit event has no #

and $chan return $null

 Respond  
Tamaki   -  Mar 20, 2009

like, the dond script says, saving hash table or something and says can't save file or something like that
so i can't save any scores :'(

 Respond  
Jethro   -  Mar 20, 2009

What do you mean by disappearing? Hash tables can be saved and loaded for later reference.

 Respond  
MaxEvans   -  Mar 20, 2009

I agree, hash tables are confusing to me. Interesting, but confusing. But I fixed it.

 Respond  
Tamaki   -  Mar 20, 2009

i don't really like hash tables that much...too confussing
plus, they disappear at the most in-oprotune time

 Respond  
Jethro   -  Mar 20, 2009

Hash table version:

on !*:JOIN:#: {
  if ($istok($hget(nicknames,$chan),$nick,32)) { .notice $nick Welcome back to $chan $+ , $nick $+ . Glad to see you here again! =] }
  else { .notice $nick Welcome to $chan $+ , $nick $+ . We hope you make this your new hangout spot. }
}
on !*:PART:#: { hadd -m nicknames $chan $addtok($hget(nicknames,$chan),$nick,32) }
on !*:QUIT: {
  var %x = $comchan($nick,0)
  while (%x) {
    hadd -m nicknames $comchan($nick,%x) $addtok($hget(nicknames,$comchan($nick,%x),$nick,32))
    dec %x
  }
}
on *:CONNECT: {
  if (!$hget(nicknames)) { hmake nicknames 100 }
  if ($isfile(nicknames.hsh)) { hload nicknames nicknames.hsh }
}
on me:*:PART:#: { hsave -o nicknames nicknames.hsh }
on *:DISCONNECT: { hsave -o nicknames nicknames.hsh }
on *:EXIT: { hsave -o nicknames nicknames.hsh }
 Respond  
Tamaki   -  Mar 20, 2009

try this:

on *:PART:#: {
  writeini wb.ini $chan $nick yes
}
on *:QUIT:#: {
  writeini wb.ini $chan $nick yes
}

on *:JOIN:#: {
  If ($readini(wb.ini,$chan,$nick) == yes ) {
    .notice $nick Welcome back....
  }
  Else {
    .notice $nick welcome to....
  }
}
 Respond  
Aucun50   -  Mar 20, 2009

Not sure if that the right way to write to a ini i think it need to be under a category like "writeini nicknames.ini (Category) (What to put).

 Respond  
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.