Greet System

By StaticX__ on Aug 31, 2008

I made a greet system for mirc with 1000 slots, i hope you enjoy it
Oh, and the commands:
Add greet:
/addgreet Nick Message

Delete Greet:
/delgreet Nick

List all greets:
/greets

And yes. hash tables are hitting again :P

alias addgreet {
  if ($hget(greets) != greets) { hmake greets }
  hadd greets $1 $2-
  echo -a Greet Added for $1
}

alias delgreet {
  var %i = 1
  while (%i <= $hget(greets,0).item) {
    if ($hget(greets,%i).item == $1) {
      hdel greets $1
      echo -a Greet Deleted for $1
    }
    inc %i
  }
}

alias greets {
  var %i = 1
  if ($hget(greets)) {
    while (%i <= $hget(greets,0).item) {
      echo -a 4,1[0 $+ $hget(greets,%i).item $+ 4,1] 4,1(7 $+ $hget(greets,$hget(greets,%i).item) $+ 4)
      inc %i
    }
  }
}

on *:EXIT:{ hsave greets greetsystem.txt }
on *:START:{ hmake greets | hload greets greetsystem.txt }

on *:JOIN:#:{
  var %i = 1
  while (%i <= $hget(greets,0).item) {
    if ($nick == $hget(greets,%i).item) {
      msg $chan 4,1[0 $+ $nick $+ 4,1] 4,1(7 $+ $hget(greets,$nick) $+ 4)
    }
    inc %i
  }
}

Comments

Sign in to comment.
napalm`   -  Jan 22, 2011

A hash table can store an unlimited number of items regardless of the N you choose, however the bigger N is, the faster it will work, depending on the number of items stored.

 Respond  
newtonlol   -  Jan 20, 2011
 Respond  
Jethro   -  Jan 20, 2011

The hash table default is 100 slots, and 100 is quite sufficient.

 Respond  
newtonlol   -  Jan 20, 2011
 Respond  
HatebreedeR   -  May 31, 2009

why the does the greet appear underlined when you set it? >.< how can you take the underline away? Good job btw i like it :P

 Respond  
fire_wizard1   -  Dec 07, 2008

it does need some work, like i dont see any reason to have all those h's in there. just my insight on it

 Respond  
napalm`   -  Sep 01, 2008

Butt Hurt.

 Respond  
StaticX__   -  Sep 01, 2008

napalm` this is hawkee only. I don't need other links.. thx

 Respond  
irchainscriptz   -  Aug 31, 2008

yeah but a lot of people make these codes, so there quite familiar :P

 Respond  
napalm`   -  Aug 31, 2008

Yeah this is REALLL weird. Made this same thing a few days ago for a guy that knows ZIP about mIRC. I have no use for these kinds of scriplets.

We used the same add/del aliases even. Kind of spooky.

http://www.evolutionscriptz.com/modules.php?name=Forums&file=viewtopic&t=881

 Respond  
StaticX__   -  Aug 31, 2008

nobody really understands? YOU don't understand.

 Respond  
Yoast   -  Aug 31, 2008

Why use hash tables which nobody really understands while you can also use ini's for this purpose?

 Respond  
StaticX__   -  Aug 31, 2008

oh yes.. fixed

 Respond  
guest598594   -  Aug 31, 2008

You should save and load the hash table.

 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.