|
| Author |
Message |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 7:36 am Post subject: |
|
|
I have been building a block checker command. But it doesn't appear to work.
Here is waht i have so far:
| Quote: | if($1) {
$self->addContact($1);
sleep(1);
my $cs = $self->getContactStatus($1);
if($cs) { &send($self, "$1\'s Status is $cs !", $username); }
else {
&send($self, "Unsuccessful! Please check e-mail and try again.", $username); }
sleep(1);
$self->remContact($1);
}
else {
&send($self, "To retreive the users status please type %statcheck email \n\neg. %statcheck email\@hotmail.com", $username);
}
|
Any idea's? |
|
| Back to top |
|
 |
JTW God Like

Joined: 07 Mar 2004 Posts: 582 Location: Maidstone
  votes: 4
|
Posted: Tue Jan 25, 2005 7:46 am Post subject: |
|
|
Any errors? Template? _________________ "Help us, Help you" - BotDepot |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 7:49 am Post subject: |
|
|
| Maya template. no errors, it skips to saying: Unsuccessful! Please check e-mail and try again.", ie $cs is not true |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Tue Jan 25, 2005 8:04 am Post subject: |
|
|
This simply means "if $cs exists" or, has a value .
_________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 8:06 am Post subject: |
|
|
| if cs exists then the status has been returned? :huh: |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Tue Jan 25, 2005 8:08 am Post subject: |
|
|
It can be better written..what values does $self->getContactStatus($1); get? _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 8:11 am Post subject: |
|
|
$1 is the message parameter.
So $self->getContactStatus($1); should get the status of the email given as a parameter. I would have thought it was something like NLN or BSY. |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 8:15 am Post subject: |
|
|
I have thought a touch further.
Ths idea of mine can't work can it? As before it shows online on the bots list the other person must click 'ok' to add the bot to their list? |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Tue Jan 25, 2005 8:16 am Post subject: |
|
|
You'll need to find out what it's returning...do a print to see the value of $cs.
| Code: | | <br />my $cs = $self->getContactStatus($1);<br />print $cs; <br /> |
Will allow you to see what it is before it hits the IF. If the values are numbers, such as 1 for true or 0 for false, use this:
| Code: | | <br />my $cs = $self->getContactStatus($1);<br /><br />if($cs == 1) { <br /> |
If the values are strings, use this:
| Code: | | <br /><br />if ($cs eq "NLN") { <br /> |
Just checking if the variable has a value isn't always going to work if you usually expect to get SOMETHING back, make sense? _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Tue Jan 25, 2005 8:18 am Post subject: |
|
|
You can packet sniff so that you don't need to add them to your list. That's what the OSIs do, and so does ExtraBot (& probably other good ones ). _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 8:36 am Post subject: |
|
|
Packet sniff?
Anyone got any idea's for me? |
|
| Back to top |
|
 |
..::BIGmouth( )::.. God Like

Joined: 05 Feb 2004 Posts: 801
    
|
Posted: Tue Jan 25, 2005 11:51 am Post subject: |
|
|
lol, Alienz that would work but a dumb way, what if there status is AWY, ok can you tell us what happens? because I'm not sure if the sub "addContact" adds them to there FL list.. If it doesn't and just adds them by AL/RL then it wouldn't get the contacts status. Show me the addContact sub and i'll change it to that if you want, but it'll be annoying for that user..  |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Tue Jan 25, 2005 1:08 pm Post subject: |
|
|
In my experience, $1 is temporary and seems to disappear after its first use... for example, I was doing this code to make simple UBB code formatting.
I used code like this:
| Code: | | while ($msg =~ /\[(b|i|*lazy*)\](.*?)[\/(b|i|*lazy*)\]/i) {<br /> $msg =~ s~[$1]$2[/$3]~<$1>$2</$3>~i;<br />} |
But it would turn my codes into "<>>", because it lost $1, $2, and $3 after its first use.
So try turning $1 into another variable, like $a or something... and see if that helps. _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
draget Not Yet a God

Joined: 29 Dec 2004 Posts: 367 Location: Australia
   
|
Posted: Tue Jan 25, 2005 1:30 pm Post subject: |
|
|
The code above is not going to be any good.
I need a fresh idea.
Any? |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Tue Jan 25, 2005 3:34 pm Post subject: |
|
|
QUOTE(..::BIGmouth( )::.. @ Jan 25 2005, 06:51 AM) lol, Alienz that would work but a dumb way, what if there status is AWY, ok can you tell us what happens? | I dont use MSN, but there is nothing dumb about the help I gave him. He was using incorrect logic with the if ($cs) stuff. I also posted at the same time he said he thought it wouldn't work. Btw...for someone calling other people dumb, you should learn to spell things like "their". _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |