User Control Panel
Advertisements

HELP US, HELP YOU!

adding users?

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
Calum
Not Yet a God
Not Yet a God


Joined: 21 Feb 2004
Posts: 373
Location: england
Reputation: 34.7Reputation: 34.7Reputation: 34.7

PostPosted: Wed Apr 14, 2004 5:18 am    Post subject: Reply with quote

Code:
if ($msg =~ /^add (.*)/i) {<br />$msn->addcontact('$1');<br />&send($self,"I Have Added $1", "$username");<br />}<br />


that should work right??


trouble is it sends my bot offline but i get no errors

any ideas where im going wrong?
Back to top
eric256
The Keymaker
The Keymaker


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

PostPosted: Wed Apr 14, 2004 5:28 am    Post subject: Reply with quote

Single qoutes mean it will not turn $1 into the real value. So you are saying add user $1 not add a user whos name is stored in $1. To test the idea try makeing a small script and doing
Code:
my $test = "hello";<br />print '$test' . "\n";<br />print "$test\n";<br />

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Calum
Not Yet a God
Not Yet a God


Joined: 21 Feb 2004
Posts: 373
Location: england
Reputation: 34.7Reputation: 34.7Reputation: 34.7

PostPosted: Wed Apr 14, 2004 5:32 am    Post subject: Reply with quote

ok so im testing the difference between '' and "" ?

slightly strange way of learning

i didnt try it yet btw eric but i have now thanks for teaching me
Back to top
Calum
Not Yet a God
Not Yet a God


Joined: 21 Feb 2004
Posts: 373
Location: england
Reputation: 34.7Reputation: 34.7Reputation: 34.7

PostPosted: Wed Apr 14, 2004 5:35 am    Post subject: Reply with quote

ahh i see

Quote:
C:\Documents and Settings\calum\Desktop>perl test.pl
$test
hello


so "" allows it to be a real value where as '' does not

thanks Very Happy

so the code would need to be
Code:
 if ($msg =~ /^add (.*)/i) {<br />$msn->addcontact("$1");<br />&send($self,"I Have Added $1", "$username");<br />}
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