Here is a snippet i wrote. To make it work type:
/hmake -s greet 1000
The functions are as follows:
@!.setgreet
@!.greet check
@!.del greet
@!.greets on
@!.greets off
on $*:TEXT:/^[.!@]g(reet(s)?)? on/Si:#:{
set %greet = on
if ($nick isop #) && ($nick ishop #) {
var %return = $iif($left($1,1) == @, msg $chan, .notice $nick)
hload -s greet greet.txt
msg # Join Greets have now been enabled in $chan
}
}
on $*:TEXT:/^[.!@]g(reet(s)?)? off/Si:#:{
unset %greet
if ($nick isop #) && ($nick ishop #) {
var %return = $iif($left($1,1) == @, msg $chan, .notice $nick)
//msg # Join Greets have now been disabled in $chan
}
}
on $*:TEXT:/^[!@]setg(reet)?/Si:#:{
var %return = $iif($left($1,1) == @, msg $chan, .notice $nick)
if (%greet == $null) { %return Greets are currently disabled| halt }
else {
if ($2 == $null) { %return Please specify a greet }
else if ($2 != $null) { %return Your Greet is Set as: $2- }
hadd -s greet $address($nick,2) $2-
}
}
on $*:TEXT:/^[.!@]g(reet)?( )?c(heck)?/Si:#:{
var %return = $iif($left($1,1) == @, msg $chan, .notice $nick)
if (%greet == $null) { %return Greets are currently disabled| halt }
else {
%return Your current Greet is: $hget(greet,$address($nick,2))
}
}
on *:JOIN:#:{
if (%greet == $null) { halt }
else {
if ($hget(greet,$address($nick,2)) == $null) { halt }
else { msg $chan [ $+ $nick $+ ] $hget(greet,$address($nick,2)) }
}
}
on $*:TEXT:/^[!@]del(ete)?( )?g(reet)?/Si:#:{
if (%greet == $null) { Greets are currently disabled| halt }
else {
var %return = $iif($left($1,1) == @, msg $chan, .notice $nick)
hdel -s greet $address($nick,2)
%return Your Greet has been Deleted
}
}
Code shouldn't require the user to manually make the hash table each time.
Also, while there is a /hload command, there's no /hsave anywhere in the code (that I could see)
Thus, imo, this code is incomplete, making a 2/10 rating valid.
Also, the -s switches for the /hload, /hadd, and /hdel commands are, imo, a waste once it's been confirmed that the script is working.
Bullet_Dodger said:
To much unnessarsary coding
Sorry But My Rating Is A Small 2/10 But i will test
a rate of 2 = incomplete
um the code works and is not incomplete.
as for the
" To much unnecessary coding "
if they clean it up and do the checks in the right way it will be fine, but then again everyone has their own style of coding.
my score still stands of 4/10