User Control Panel
Advertisements

HELP US, HELP YOU!

delete records

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
LEEDSTREV
Newbie
Newbie


Joined: 01 Feb 2004
Posts: 48

Reputation: 28.5Reputation: 28.5Reputation: 28.5

PostPosted: Tue Apr 06, 2004 12:39 am    Post subject: Reply with quote

Does any one know the delete records command that works for andromeda
Back to top
night
Not Yet a God
Not Yet a God


Joined: 06 Jan 2004
Posts: 498

Reputation: 38.4Reputation: 38.4Reputation: 38.4Reputation: 38.4

PostPosted: Tue Apr 06, 2004 12:51 am    Post subject: Reply with quote

well wot add record command *lazy* using?
Back to top
LEEDSTREV
Newbie
Newbie


Joined: 01 Feb 2004
Posts: 48

Reputation: 28.5Reputation: 28.5Reputation: 28.5

PostPosted: Tue Apr 06, 2004 12:53 am    Post subject: Reply with quote

i am using:

Code:
<br />sub error<br />{<br />my ($bot, $self, $user, $msg) = @_;<br /><br />if ($msg ne '')<br />{<br />   use Storable;<br />   <br />   my $message = "4$user:12 $msg";<br />   <br />   my $messages = retrieve('error.dat') if (-e 'error.dat');<br /><br />   my $num;<br />   my $requests;<br /><br />   foreach my $key (sort (keys %{$messages}))<br />   {<br />      $num++;<br />      $requests->{$num} = $messages->{$key};<br />   }<br />   <br />   $num = keys %{$requests};<br />    <br />   $requests->{$num + 1} = $message;<br />   <br />   store ($requests, 'error.dat');<br />   <br />   return "i'll put that in the job application folder straigh  away for you!:D";<br />}<br />else<br />{<br />   return "$bot->{settings}->{CommandChar}help usage request <-- for help";<br />}<br />}<br /><br />{<br /> Category    => '(8)System(8)',<br /> Usage       => 'request reason',<br /> Description => 'if you find an error put in to here',<br />};<br />
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Tue Apr 06, 2004 1:58 am    Post subject: Reply with quote

To delete a error it would be:

Code:
<br />sub delete<br />{<br />  my ($bot, $self, $user, $msg) = @_;<br />  <br />  if (-e 'error.dat')<br />  {<br />    use Storable;<br />    my $error = retrieve('error.dat');<br />          <br />    if (defined $error->{$msg})<br />    {<br />        delete $error->{$msg};<br />          <br />        if (keys %{$error} == 0)<br />        {<br />          unlink "error.dat";<br />        }<br />        else<br />        {<br />          store ($error,'error.dat');<br />        }<br />        return "[ $user ]<br />[ error: \#$msg was removed ]<br />[ successfuly ]";<br />    }<br />    else<br />    {<br />        return "[ $user ]<br />[ That error doesnt exist ]";<br />    }<br />  }<br />  else<br />  {<br />    return "[ $user ]<br />[ No errors exist ]";<br />  }<br />}<br /><br />{<br />  Category    => ':P Mod Commands',<br />  Description => 'delete records',<br />};<br />
Back to top
LEEDSTREV
Newbie
Newbie


Joined: 01 Feb 2004
Posts: 48

Reputation: 28.5Reputation: 28.5Reputation: 28.5

PostPosted: Tue Apr 06, 2004 8:51 am    Post subject: Reply with quote

Thanks it works
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group