mIRC Home    About    Download    Register    News    Help

Topic Options
#124267 - 04/07/05 03:53 AM removing files script problem.
Navid Offline
Ameglian cow

Registered: 19/02/04
Posts: 45
Hello.
I already posted an topic about this but I dont know where did it go.
Anyways here is the problem. I cant remove some files from my mirc folder with this script:
Code:
 
on 4:TEXT:!delete *:#: {
  /delete $2
  msg $chan 12Deleted $upper($2) $+ 's stats!
}

and here is the alias for $delete
Code:
delete {
  /remini Members\ $+ $1 $+ .dgt
  /remini Moves\ $+ $1 $+ .moves
}

Top
#124268 - 04/07/05 04:02 AM Re: removing files script problem.
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
/remini is for removing sections/items from an ini file.

To remove a file from your computer use /remove [color:green]filename[/color].

Top
#124269 - 04/07/05 04:17 AM Re: removing files script problem.
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
If each user has their own file, then /remini isn't the command to use. You'd need /remove.

If you had all your users in one file like:
Members.ini contains..

[Members]
Andy=$true
Navid=$true

etc

You'd use:
/remini Members.ini Members Andy

So with the files as it is now use something like..

Code:
on 1:TEXT:!delete *:#: { 
  if ($isfile($+(Members\,$2,.dgt))) && ($isfile($+(Moves\,$2,.moves))) { 
    .remove $+(Members\,$2,.dgt) 
    .remove $+(Moves\,$2,.moves) 
    msg $chan 12Deleted $+($upper($2),'s) stats!
  }
  else { msg $chan $+($chr(3),12,$upper($2) does not have any stats!,$chr(3)) }
}


-Andy

Top
#124270 - 04/07/05 05:13 AM Re: removing files script problem.
Navid Offline
Ameglian cow

Registered: 19/02/04
Posts: 45
I tried remove before. for some reason it didnt work.
I'm gonna give it a try with the code you gave me smile

EDIT: Andy I tried yours and it didnt work.
Quote:
<@[D]Saiyan-Bot> -={ Deleted NAVID's stats! }=-
and the files were still there.


Edited by Navid (04/07/05 05:24 AM)

Top
#124271 - 04/07/05 05:30 AM Re: removing files script problem.
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
Check your status window for errors

Make sure the files aren't in use.
Make sure you have access to delete the files.
Make sure you got the right file name.

Top
#124272 - 04/07/05 06:00 AM Re: removing files script problem.
Navid Offline
Ameglian cow

Registered: 19/02/04
Posts: 45
I found out the problem. I had an alias remove with some other kind of information on it already from before. Sorry, but it worked, Thanks.
Just one more question
There is also another file called Memstats.dgt in the main mirc folder and one thats called registered.DGT and also in a file users.dgt (in this file its like a list, it has no topic. ex:
Navid
me
You
him
so do I use remove for them too?.
Sorry last question.


~Thanks

Top
#124273 - 04/07/05 06:02 AM Re: removing files script problem.
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
If it contains all the users, are you should you'd like to remove the file? But yes, it can be done with /remove.

-Andy

Top
#124274 - 04/07/05 06:18 AM Re: removing files script problem.
Navid Offline
Ameglian cow

Registered: 19/02/04
Posts: 45
okay I removed the users (with no extension file) to users.dgt no I dont want to delete everything from it I jsut wanna delete the $2. and $2 is not like a topic ie: [$2] its just a list. here is the code I use d to make the list:
Code:
/users {
  set %a 0
  :start
  inc %a 1
  set %b $read(Users.dgt,%a)
  if (%b == $null) { goto a }
  else { goto start }
  :a
  write Users.dgt $nick
}  


I just need to get rid of the line that $2 (user's nick) is in.

~Thanks

Top
#124275 - 04/07/05 06:39 AM Re: removing files script problem.
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Maybe something like:

write -dw $+("*,$2,*") file.txt

-Andy

Top
#124276 - 04/07/05 07:13 AM Re: removing files script problem.
Navid Offline
Ameglian cow

Registered: 19/02/04
Posts: 45
That did the job, thanks Sladekraven. Just one last question how do you remove a complete folder?
I tried

remove Folder\
remove Folder
remove $+(Folder)

they didnt work, can ya show me how its done smile

Top
#124277 - 04/07/05 07:21 AM Re: removing files script problem.
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
/rmdir Folder

This will only delete the folder, if it's empty.

-Andy

Top
#124278 - 04/07/05 09:40 AM Re: removing files script problem.
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
Bring back DELTREE i say!

Top