User Control Panel
Advertisements

HELP US, HELP YOU!

Where do i put commands?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Wed Dec 31, 2003 4:36 pm    Post subject: Reply with quote

Code:
sub invite {<br />$reply($self,"Inviting $1.. please wait", "$username");<br />$self->send('CAL', "$1");<br />$reply($self,"Try typing something..", "$username");<br />return;<br />}<br />1;<br />


This could work.
Back to top
eric256
The Keymaker
The Keymaker


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

PostPosted: Wed Dec 31, 2003 4:44 pm    Post subject: Reply with quote

That code wont work for many reasons MickyG.

First its not getting anything thats pasted to it so all the variables in there must be global to do anything, and global variables are not good.

Second its not using sendmsg or invite so its liable to break anytime the MSN protocol changes (often)

Third, its using $1 without an regex before it. $1 is not magic, it gets the first match of some previous regex (a match is something between parenthsis in the regex)

Something more like

Code:
<br />sub invite {<br />    my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />    $msg =~ s/\!invite //g;<br />    $self->sendmsg("Inviting $msg.. please wait");<br />    $self->invite("$msg");<br />    return "User $msg invited.";<br />}<br />1;<br />


this code assumes that you are calling the sub like

Code:
invite('eric256@rocketmail.com','!invite keenie@wherever.com',$self);

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 4:56 pm    Post subject: Reply with quote

Hm...I understand what you are saying. And I also tried out your code eric256, and I got this error, and it alos cut my bot offline again...

Code:
Can't call method "sendmsg" on a undefined value as commands/invite.pl.txt line 4, <GEN 2> line 12.
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Wed Dec 31, 2003 4:59 pm    Post subject: Reply with quote

http://www.bot-depot.com/forums/index.php?...findpost&p=1038

read that post
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 5:00 pm    Post subject: Reply with quote

QUOTE(Keenie @ Dec 31 2003, 08:59 AM)

That is just not for the !leave command right? But others?
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Wed Dec 31, 2003 5:00 pm    Post subject: Reply with quote

Ok the code works. But it says its inviting '/invite user@email.com' How do i get the /invite away?>
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Wed Dec 31, 2003 5:05 pm    Post subject: Reply with quote

@cheatsfp its for any command that needs $self, with using the wiredbots template, the leave was just an example command to show how it works, and to shut people up

@n00b

Code:
$msg =~ s/\/invite //ig;
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 5:11 pm    Post subject: Reply with quote

QUOTE(Keenie @ Dec 31 2003, 09:05 AM)
@cheatsfp its for any command that needs $self, with using the wiredbots template, the leave was just an example command to show how it works, and to shut people up

@n00b

Code:
$msg =~ s/\/invite //ig;

lol, okay. Thanks! I think I got it covered from here Wink
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Wed Dec 31, 2003 5:11 pm    Post subject: Reply with quote

gracias senorita! Razz
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 5:23 pm    Post subject: Reply with quote

Hm...

I did what you said, and everything else. I think I may of missed somthing...

When I use this, '/invite someone@hotmail.com' it says, 'Inviting someone@hotmail.com.. please wait' and then it says, '
User someone@hotmail.com invited.'

But it does not really invite them?
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Wed Dec 31, 2003 5:35 pm    Post subject: Reply with quote

Wink it does, you may have to wait a while thorugh.
Back to top
eric256
The Keymaker
The Keymaker


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

PostPosted: Wed Dec 31, 2003 5:39 pm    Post subject: Reply with quote

title changed to "Where do you put commands?"
The title of the topic should give people an idea what you are asking. Please refraim from using sensless titles in the future.

Thnks

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 5:43 pm    Post subject: Reply with quote

QUOTE(Micky G @ Dec 31 2003, 09:35 AM)
Wink it does, you may have to wait a while thorugh.

okay....lol, I guess i'll wait and see... :blink:
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Wed Dec 31, 2003 5:48 pm    Post subject: Reply with quote

if the person is offline, or the person has 'all others blocked' and dont have you in the allow list, they wont be added, or if theyve blocked you
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Wed Dec 31, 2003 6:13 pm    Post subject: Reply with quote

It finally worked. Thank you!

Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 



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