This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
-
cache
- Master
- Posts: 306
- Joined: Tue Jan 10, 2006 4:59 am
- Location: Mass
Post
by cache »
Trying to make a script to delete a stats file so I can easly reset it.
I tried making this but no luck:
Code: Select all
bind pub - !deletestats remstats
proc remstats {nick uhost hand chan arg} {
if {[file exist scripts/dbase/statistics.dat]} {
file delete "scripts/dbase/statistics.dat"
putserv "PRIVMSG $nick :You have deleted stats"
} else {
putserv "PRIVMSG $nick :There are no stats."
}
}
I don't get any error, just keeps saying There are no stats, even tho there is..
Last edited by
cache on Thu Sep 27, 2007 3:18 pm, edited 1 time in total.
-
rosc2112
- Revered One
- Posts: 1454
- Joined: Sun Feb 19, 2006 8:36 pm
- Location: Northeast Pennsylvania
Post
by rosc2112 »
Try using the full path, eg, /home/bot/whatever/scripts/etc/filename.dat
-
cache
- Master
- Posts: 306
- Joined: Tue Jan 10, 2006 4:59 am
- Location: Mass
Post
by cache »
hi rosc,
I have tried the full path as well and a few other ways with no luck.
-
nml375
- Revered One
- Posts: 2860
- Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 »
Have you made sure the file was not in use (opened or such) when you deleted it?
NML_375
-
cache
- Master
- Posts: 306
- Joined: Tue Jan 10, 2006 4:59 am
- Location: Mass
Post
by cache »
it isn't opened or in use, do you know of another sample delete script i can try?
-
nml375
- Revered One
- Posts: 2860
- Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 »
Well, your script is pretty much the way to go, unless you'd like to depend on external binaries.
I assume the file is generated by some stats-script. I take it you've double-checked that there is no way it could've held the file opened?
NML_375
-
cache
- Master
- Posts: 306
- Joined: Tue Jan 10, 2006 4:59 am
- Location: Mass
Post
by cache »
yeah I chanset -stat to turn it off, still says theres no stats.. I willing to give other ways a try...
Just trying to make an easy delete script since some games/scripts don't come with a delete option
-
cache
- Master
- Posts: 306
- Joined: Tue Jan 10, 2006 4:59 am
- Location: Mass
Post
by cache »
i changed file ext now it works, thanks all