mIRC Home    About    Download    Register    News    Help

Print Thread
#211878 03/05/09 01:21 PM
Joined: Feb 2009
Posts: 8
A
ahbb Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2009
Posts: 8
HI,

I just wanted to get some help extra help on hash table that is have for a channel.

Here are the coding:

Code:
on 500:text:!addhitlist *:#ops_only: {
  /hadd -m hit.hsh $2 $2- ( added by $nick on $- $day $time  $- $date )
  /hsave hit.hsh shit.hsh
  /msg #ops_only Ok $nick
}

on 500:text:!hitlist:#ops_only:{
  .hsave hit.hsh hit.hsh.tmp
  .play #ops_only hit.hsh.tmp
}
on *:playend:{
  if $filename == hit.hsh.tmp {
    .remove hit.hsh.tmp
  }
}

on 600:text:!delhitlist *:#ops_only:{
  /hdel -sw hit.hsh $2
  /hsave hit.hsh hit.hsh
  /msg #ops_only $nick , as request $2 have been del of my sexy database
}


The one thing that I cant get right is, say a person do the command !hitlist and the DB are empty I want the bot to tell that user that it's empty as at the moment it just then don't reply.

Are there a way that if a person dont have the right access level 500 or level 600 and the user try to use that command that it gets loged and that the user get a msg from the bot to say it dont have access and it been loged.

Thanks for all your help.

Andrew

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Code:
on 500:text:!hitlist:#ops_only:{
  .hsave hit.hsh hit.hsh.tmp
  if ($lines(hit.hsh.tmp)) { .play #ops_only hit.hsh.tmp }
  else { msg $chan DB is empty }
}

As for the logging... maybe you should simply use * as access level and then first perform a check on the nick who triggered the event, with $ulevel. If level is 500 or 600 proceed, else log.


Link Copied to Clipboard