User Control Panel
Advertisements

HELP US, HELP YOU!

View All Things In Sub-Hash

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


Joined: 24 Feb 2004
Posts: 86

Reputation: 28.5Reputation: 28.5Reputation: 28.5

PostPosted: Mon Mar 08, 2004 7:53 pm    Post subject: Reply with quote

I Have See Sumwhere A Command That Use Sumthing That Does This:
$bot->{settings}->{sum}->{thing}->{$user}
$bot->{settings}->{sum}->{thing}->{$user}->{thing1}
$bot->{settings}->{sum}->{thing}->{$user}->{thing2}
$bot->{settings}->{sum}->{thing}->{$user}->{thing3}
I Would Like A Command PLZ That Shows Every Thing In The Hash:
$bot->{settings}->{sum}->{thing}
Would List:
$user : $thing1, $thing2, $thing3
like:
Owner : Beer, Fags, Dope


Help PLZ
Back to top
eric256
The Keymaker
The Keymaker


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

PostPosted: Mon Mar 08, 2004 8:12 pm    Post subject: Reply with quote

You have many options. One is to store the data in a different way. Like a hash of lists. $bot->{settings}->{sum}->{thing}->{$user} = ['thing1','thing2','thing3']; If you need to know more about the things than just that they are there then you could use the sub keys to get a list of all keys.

Code:
<br />#just to simplify<br />my $*lazy* = $bot->{settings}->{sum}->{thing}->{$user};<br /><br />$*lazy*->{Beer} = 1;<br />$*lazy*->{Morons} = 1;<br />$*lazy*->{Dope} = 1;<br /><br />my @things = keys %$*lazy*;<br />print "$user: " . join (",", @things);<br />


Hope that gives you some idea whats going on.

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
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