mIRC Home    About    Download    Register    News    Help

Print Thread
removing files script problem. #124267 04/07/05 02:53 AM
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
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
}

Re: removing files script problem. #124268 04/07/05 03:02 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/remini is for removing sections/items from an ini file.

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

Re: removing files script problem. #124269 04/07/05 03:17 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: removing files script problem. #124270 04/07/05 04:13 AM
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
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.

Last edited by Navid; 04/07/05 04:24 AM.
Re: removing files script problem. #124271 04/07/05 04:30 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Re: removing files script problem. #124272 04/07/05 05:00 AM
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
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

Re: removing files script problem. #124273 04/07/05 05:02 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: removing files script problem. #124274 04/07/05 05:18 AM
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
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

Re: removing files script problem. #124275 04/07/05 05:39 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Maybe something like:

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

-Andy

Re: removing files script problem. #124276 04/07/05 06:13 AM
Joined: Feb 2004
Posts: 45
N
Navid Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Feb 2004
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

Re: removing files script problem. #124277 04/07/05 06:21 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
/rmdir Folder

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

-Andy

Re: removing files script problem. #124278 04/07/05 08:40 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Bring back DELTREE i say!