|
Joined: Feb 2004
Posts: 45
Ameglian cow
|
OP
Ameglian cow
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:
on 4:TEXT:!delete *:#: {
/delete $2
msg $chan 12Deleted $upper($2) $+ 's stats!
}
and here is the alias for $delete
delete {
/remini Members\ $+ $1 $+ .dgt
/remini Moves\ $+ $1 $+ .moves
}
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
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].
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
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..
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
|
|
|
|
Joined: Feb 2004
Posts: 45
Ameglian cow
|
OP
Ameglian cow
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 EDIT: Andy I tried yours and it didnt work. <@[D]Saiyan-Bot> -={ Deleted NAVID's stats! }=- and the files were still there.
Last edited by Navid; 04/07/05 04:24 AM.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: Feb 2004
Posts: 45
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Feb 2004
Posts: 45
Ameglian cow
|
OP
Ameglian cow
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: /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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Maybe something like:
write -dw $+("*,$2,*") file.txt
-Andy
|
|
|
|
Joined: Feb 2004
Posts: 45
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
/rmdir Folder
This will only delete the folder, if it's empty.
-Andy
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Bring back DELTREE i say!
|
|
|
|
|