|
| Author |
Message |
Calum Not Yet a God

Joined: 21 Feb 2004 Posts: 373 Location: england
   
|
Posted: Mon Mar 08, 2004 10:17 pm Post subject: |
|
|
| 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

Joined: 12 Nov 2003 Posts: 624
    
|
Posted: Mon Mar 08, 2004 10:28 pm Post subject: |
|
|
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

Joined: 14 Feb 2004 Posts: 1138
 
|
Posted: Mon Mar 08, 2004 10:29 pm Post subject: |
|
|
| 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

Joined: 12 Jan 2004 Posts: 1375
   votes: 2
|
Posted: Mon Mar 08, 2004 10:30 pm Post subject: |
|
|
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

Joined: 14 Feb 2004 Posts: 1138
 
|
Posted: Mon Mar 08, 2004 10:35 pm Post subject: |
|
|
| Try matt commands it think mines wrong... |
|
| Back to top |
|
 |
|