User Control Panel
Advertisements

HELP US, HELP YOU!

Database commands....

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Wed Feb 18, 2004 8:21 pm    Post subject: Reply with quote

Hi,

sorry for asking again Razz i will make my own commands soon lol

Database command - Mods and above, can store everything that happens, eg. !database Blocked eg@eg.com for flooding.
Then supermods and above can view it, bla bla.
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: Wed Feb 18, 2004 8:38 pm    Post subject: Reply with quote

seen it Razz brave bot as it Razz
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Wed Feb 18, 2004 8:41 pm    Post subject: Reply with quote

yeah i know i need the command Razz
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: Wed Feb 18, 2004 9:00 pm    Post subject: Reply with quote

well *lazy* not ask braveheart then rofl
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Wed Feb 18, 2004 9:37 pm    Post subject: Reply with quote

Thats not a database realy. Just logging something for the admins.
_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
BraveHeart
Senior Member
Senior Member


Joined: 14 Jan 2004
Posts: 285

Reputation: 33.8Reputation: 33.8Reputation: 33.8

PostPosted: Thu Feb 19, 2004 7:38 am    Post subject: Reply with quote

Razz Yes, Exactly Razz
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: Thu Feb 19, 2004 11:21 am    Post subject: Reply with quote

weeeeeeeeeeeeeeeeeeeeeeeeeell same thing Razz
brave dude was your bot ok after lastnite? i saw a flooder tryin 2 take it down...
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Thu Feb 19, 2004 1:26 pm    Post subject: Reply with quote

got the command lol eric.
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Thu Feb 19, 2004 2:34 pm    Post subject: Reply with quote

Dont worry.
Done it Very Happy
Just edited the request command. Razz
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Thu Feb 19, 2004 2:59 pm    Post subject: Reply with quote

Right, Slight problem.
I don't know if ive edited this right, This is the record command for mods, supermods ok, I just changed some parts.

Code:
sub record<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /> <br /> if ($msg ne '')<br /> {<br />    use Storable;<br />    <br />    my $message = "$user: $msg";<br />    <br />    my $messages = retrieve('records.dat') if (-e 'records.dat');<br /><br />    my $num;<br />    my $records;<br /><br />    foreach my $key (sort (keys %{$messages}))<br />    {<br />       $num++;<br />       $records->{$num} = $messages->{$key};<br />    }<br />    <br />    $num = keys %{$records};<br />     <br />    $records->{$num + 1} = $message;<br />    <br />    store ($records, 'records.dat');<br />    <br />    return "Thanks :) You have now recorded what happened in the database for the owner to see.";<br /> }<br /> else<br /> {<br />    return "$bot->{settings}->{CommandChar}help usage request <-- for help";<br /> }<br />}<br /><br />{<br />  Category    => '(#)Mod Commands(#)',<br />  Usage       => 'record event',<br />  Description => 'Record what happened for the owner to see. Eg, !record Blocked so@so.com because...',<br />};


But when I view it by typing !viewrecords i edited the view command :
Code:
sub viewrecords<br />{<br />  my ($bot, $self, $user, $msg) = @_;<br />  <br />  if (-e 'records.dat')<br />  {<br />     use Storable;<br />     my $records = retrieve('records.dat');<br />     my $reply;<br />     <br />     foreach my $key (sort (keys %{$records}))<br />     {<br />       $reply .= $key . "-" . $records->{$key} . "\n";<br />     }<br />     chomp ($reply);<br />     return $reply;<br />  }<br />  else<br />  {<br />     return "There were no messages stored";<br />  }<br />}<br /><br />{<br />  Category    => '(ip)Admin Commands(ip)',<br />  Description => 'Retrieve event records',<br />};


It says there are no msgs. so I typed !view, Which is the one for the users help, and it was in there. Got any ideas how i could fix this?
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Thu Feb 19, 2004 5:39 pm    Post subject: Reply with quote

Anyone?
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: Thu Feb 19, 2004 7:56 pm    Post subject: Reply with quote

erm... lol, my bots already got 1 of these id 4got bout it tho Neutral
Back to top
Snolar
Young One
Young One


Joined: 24 Jan 2004
Posts: 82

Reputation: 29.4Reputation: 29.4Reputation: 29.4

PostPosted: Thu Feb 19, 2004 8:20 pm    Post subject: Reply with quote

doesnt really help lol
Back to top
Rameses
Senior Member
Senior Member


Joined: 02 Feb 2004
Posts: 182

Reputation: 31.1Reputation: 31.1Reputation: 31.1

PostPosted: Sun Feb 29, 2004 2:18 am    Post subject: Reply with quote

Hey Snolar... Sorry for replying so late, but it took me forever to find this forum. Well, I really don't work with MSN, so I can't help you a whole ton, but maybe you can take my AIM coding that I wrote up for you and try to convert it to MSN. K, here you go.. (By the way, I am using .txt files not .dat Razz I hope it doesn't make a huge difference)

record.pl
Code:
sub record {<br />$time = localtime();<br />$msg =~ s/\!record //ig;<br />open(FILE, ">>data.txt");<br />print(FILE "\[$user \($time\): $msg\] ");<br />close(FILE);<br />$reply = "Your message \(\"$msg\"\) was recorded for the owner to see!";<br />return $reply;<br />}<br />1;


So if sombody typed "!record I did something just now", it would send back: "Your message ("I did something just now") was recorded for the owner to see!" Here is viewrecords.pl.

viewrecords.pl
Code:
sub viewrecords {<br />if(-e "data.txt"){<br />open(FILE, "data.txt");<br />$records = <FILE>;<br />close(FILE);<br />$reply = "Here are all the records:\n\n$records";<br />}else{<br />$reply = "There are currently no records!";<br />}}<br />1;


So Maybe I type ".viewrecords". It might say the following:

Quote:
[agoodmod247 (Sat Feb 28 16:12:39 2004): I blocked badperson40 for using profanity] [abadmod4576 (Sun Feb 29 10:05:14 2004): yo i bloCKed this 1 freek caus it were funny] 


Anyway, um.. I hope it helps a little bit.
Back to top
Peter's MSN Bot
Young One
Young One


Joined: 24 Feb 2004
Posts: 86

Reputation: 28.5Reputation: 28.5Reputation: 28.5

PostPosted: Thu Mar 04, 2004 1:08 pm    Post subject: Reply with quote

*lazy* could use php!!!
Code:
<br />my $code = LWP::Simple::get( "LINK TO DATABASE.php" );

*lazy* could use a mysql database in the php file

im not sure about adding stuff but maybe sumthing like dis:
Quote:
User: !adddb
Bot:What Shall I Add?
User:Sum Stuff
Bot:Click Here : http://www.sum_url.com/databaseadd.php?ema...msg=Sum%20Stuff To Add "Sum Stuff" To The Database
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