|
| Author |
Message |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Mon Jul 25, 2005 12:13 pm Post subject: mirrors and msn instances |
|
|
I've been setting up mirrors such that i have a $mirrors hasref with 3 mirrors sotred n it, eg $mirrors->{'bot@draget.net'}, I need the handlers to pass the partcular MSN for logging etc, how can I do this?
thanks! |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Mon Jul 25, 2005 3:48 pm Post subject: |
|
|
| Code: | foreach my $mirrors (@mirrors){
my $msn->{$mirrors} = new MSN($mirrors);
} | *guesses*
Mojave has made a mirror module - could use that, I think it's on http://botwork.com. |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Mon Jul 25, 2005 5:04 pm Post subject: |
|
|
Ian, that would work for an array, but not a hashref:
| Code: | $number = 0;
foreach (keys %{$mirrors})
{
$msn->{$number++} = new MSN(Handle => $_, Password => 'pass');
}
|
The new MSN is of course incorrect, but you get the idea. $_ is the variable for the username.
As a side note, I am currently testing my new Bot template, which connects mirrors to both AIM and MSN. If you are interested in using it prior to release, just ask me [PM, MSN, email, etc]. This offer is not open to others, so don't get ideas, anyone else. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Rob150 Newbie

Joined: 27 Jun 2005 Posts: 26 Location: Machester, England
 
|
Posted: Mon Jul 25, 2005 5:25 pm Post subject: |
|
|
I wonder how long it took you all to learn perl as incredible as this. sorry for off-topic post _________________ Rob150.
Bot-Depot lives again!!! |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Mon Jul 25, 2005 5:51 pm Post subject: |
|
|
You can never stop learning Perl. (Unless your Larry Wall).
It took me about a year to learn Perl. |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Mon Jul 25, 2005 6:03 pm Post subject: |
|
|
I started on the 23rd April, 2004. Work it out   _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Rob150 Newbie

Joined: 27 Jun 2005 Posts: 26 Location: Machester, England
 
|
Posted: Mon Jul 25, 2005 6:26 pm Post subject: |
|
|
1 year 2 months! I'm interested in learning, but I have no idea where to start  _________________ Rob150.
Bot-Depot lives again!!! |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Mon Jul 25, 2005 7:07 pm Post subject: |
|
|
| The best place to start to learn something is Google or a book (Perl Cookbook ($77 Canadian)). Also, Perl Doc would be a good place to start. |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
|
| Back to top |
|
 |
Rob150 Newbie

Joined: 27 Jun 2005 Posts: 26 Location: Machester, England
 
|
Posted: Mon Jul 25, 2005 8:57 pm Post subject: |
|
|
Thankyou very much but I really don't have so much time to learn, I have a basic school day 7am til 4.30pm...is there a crash course?
Also I bought a book when i wanted to learn HTML, and that didn't help whatsoever, because i already knew HTML  _________________ Rob150.
Bot-Depot lives again!!! |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jul 26, 2005 8:46 am Post subject: |
|
|
ah, thats not what i meant, i have it set up using the foreach exactaly as demonstrated, but I need the handler called subs to "know" which mirror is being delt with, ie that status sub has access to knowing what its handle is.
thanks! |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Tue Jul 26, 2005 8:48 am Post subject: |
|
|
Well, in my example:
$msn->{1}->sendMessage, etc. You'd just set $msn->{1}->{handle} to your bot's email, so it can find itself. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Tue Jul 26, 2005 11:00 pm Post subject: |
|
|
There's another way to get the bot's own handle and/or MSN reference.
When you have a switchboard or notification object ($self), just use:
$self->{Msn}
as your $msn object.....
$self->{Msn}->call ('soandso@hotmail.com','Hello!');
And to get your handle......
$self->{Msn}->{Handle} if you have $self, or
$msn->{Handle} if you have $msn.
Either way works fine.  _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Thu Jul 28, 2005 4:24 am Post subject: |
|
|
Thanks Cer!
that will fit perfectly into my existing code! |
|
| Back to top |
|
 |
|