User Control Panel
Advertisements

HELP US, HELP YOU!

Help with a commsnd

 
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: Mon Mar 08, 2004 10:17 pm    Post subject: Reply with quote

Code:
if ($msg =~  /^block (.*)/i) {<br /> $msn->block($1);<br /> $self->sendmsg("User $1 Has Been Blocked");<br /> open (Blocked, ">./Blocked.txt");<br /> print Blocked $1;<br /> close Blocked;<br />  goto end;<br />}


this command is supposed to block a user and print there email in a text file but it doesnt any ideas how i can get it to work
Back to top
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Mon Mar 08, 2004 10:28 pm    Post subject: Reply with quote

Well, for starters, you shouldn't use ">" to write to the file. Because that will delete all the names already listed & just print the new email address.

Use ">>" instead.

_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Mon Mar 08, 2004 10:29 pm    Post subject: Reply with quote

Code:
if ($msg =~  /^block (.*)/i) {<br />$msn->block($1);<br />$self->sendmsg("User $1 Has Been Blocked");<br />open (Blocked, ">./Blocked.txt");<br />print Blocked $1;<br />close Blocked;<br /> goto end;<br />}




i think the open (Blocked, ">./Blocked.txt"); should be


Code:
open (FILE, "./Blocked.txt");



but this will not work i think because you need a folder eg

Code:
open (FILE, "./Blocked/Blocked.txt");



so try this... dont forget to make a folder in the main bot foldeer called Blocked

Code:
if ($msg =~  /^block (.*)/i) {<br />$msn->block($1);<br />$self->sendmsg("User $1 Has Been Blocked");<br />open (FILE, "./Blocked/Blocked.txt");<br />print Blocked $1;<br />close Blocked;<br /> goto end;<br />}


iif it does not work... sorry i am a little bit noob in commands...
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Mon Mar 08, 2004 10:30 pm    Post subject: Reply with quote

Ok try this:

Code:
if ($msg =~  /^block (.*)/i) {<br />$msn->block($1);<br />$self->sendmsg("You have saved $1"); <br />open (DATA, ">>blocked.txt");<br />print DATA "User: $1 Blocked By: $username";<br />close(DATA);<br />goto end;<br />}


Should def work tried and tested
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Mon Mar 08, 2004 10:35 pm    Post subject: Reply with quote

Try matt commands it think mines wrong...
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