PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: pHaTTy on 11 November, 2003, 23:35:01

Title: FileNames
Post by: pHaTTy on 11 November, 2003, 23:35:01
ok please i know im stupid lol,

no really what i want is someone to helpppppppppp

make a script that will check a directory and if there is any files in the directory, i wud liek it to send the names of them files to ops in pm, but i have tried for days, i give up yesterday, and now, i scrapped and come ask here he he he

plzzzzzzzzz help :o)

honestly dunno if possible, but wud be the greatest if someone help meeeeeeeeee :o)
Title:
Post by: Optimus on 12 November, 2003, 00:53:19
Well i got this code from RabidWombat once, duno but maybe it's wath you looking for...

The first problem is getting the files inside of the folder. To do this we use:

execute("dir /a-d /b > files.txt");

This will write all of the files in the current folder in bare format into "files.txt":

filename1.txt
filename2.txt
etc...

Now you parse that file and grab the names.

L8trz
Title:
Post by: pHaTTy on 12 November, 2003, 14:22:16
Hmmm, what i want is, so when you move a txt file to a particalar folder, the script checks this folder and if there are any files, it checks the files and returns the names

this is all because i have a big plan that may just help out with all the scripters with big bots :o)

Gekko, Robocop, CB, Meanmachine, Brutus, DarkMind

and many others...... :o)

but...... until i find away i cant show you the great idea ;)

but its so hard to find away
Title:
Post by: plop on 12 November, 2003, 16:04:04
take a look @ guibs database script, i can remember he was talking about something like that when he made it.

plop
Title:
Post by: pHaTTy on 12 November, 2003, 16:18:46
hmmm ok will do thx
Title:
Post by: pHaTTy on 13 November, 2003, 04:49:38
GUIBS!!!!!!!!!!!! HELP PLEASE!!!!!!!!!!!!!! :D:D:D:D

he he he
Title:
Post by: plop on 13 November, 2003, 06:03:00
QuoteOriginally posted by (uk-kingdom)pH?tt?
GUIBS!!!!!!!!!!!! HELP PLEASE!!!!!!!!!!!!!! :D:D:D:D
shout louder.  lol

plop
Title:
Post by: pHaTTy on 13 November, 2003, 13:27:19
ahhhhhhhh lol i cant my throad nacked up now he he he

*cough* *cough*

lol :o)
Title:
Post by: pHaTTy on 13 November, 2003, 13:34:23
QuoteOriginally posted by Optimus
Well i got this code from RabidWombat once, duno but maybe it's wath you looking for...

The first problem is getting the files inside of the folder. To do this we use:

execute("dir /a-d /b > files.txt");

This will write all of the files in the current folder in bare format into "files.txt":

filename1.txt
filename2.txt
etc...

Now you parse that file and grab the names.

L8trz

ive just been chatting with pur, and and looks like you are right, seems pur, just woke me up properly lol, and told me about the writing of all files, so thanx a bunch m8 :o)

aprreciated, now i will start trying top get my idea to work, if i get it to work you wil know ;)
Title:
Post by: Optimus on 13 November, 2003, 13:36:27
sure no prob m8

I'm getting curious lol... :))
Title:
Post by: pHaTTy on 13 November, 2003, 14:11:40
so from that how wud i check another folder such as

files/folders/
Title:
Post by: plop on 13 November, 2003, 14:36:23
maby this can help you, it's a bat file wich does the trick.
@echo off
dir tricky %1 /-p /o:gn > "%temp%\Listing"
start /w notepad "%temp%\Listing"
tricky is a folder, the result is send 2 notepad.
i believe i found this stuff on the M$ site.
you can just execute the bat from the script.

plop
Title:
Post by: pHaTTy on 13 November, 2003, 14:42:25
ahhh great idea plop thanx
Title:
Post by: Tuben on 13 November, 2003, 15:04:41
What is this ;))

I mean what is it suposed too do ..
Seams like fun.
Title:
Post by: c h i l l a on 19 November, 2003, 16:09:17
I have a question can one
execute this

execute("dir /a-d /b > files.txt")

without haveing the command prompt popping up ??

other question has somebody got a timer for LUA, like the Ptokax one?
Title:
Post by: plop on 19 November, 2003, 17:55:27
QuoteOriginally posted by c h i l l a
I have a question can one
execute this

execute("dir /a-d /b > files.txt")

without haveing the command prompt popping up ??

other question has somebody got a timer for LUA, like the Ptokax one?

no  dir needs the command prompt 2 run in.
it's a lua timer not ptokax.
if it would be ptokax you could have only 1 timer over all the scripts, but as you know you have 1 timer in every script (yes ok with tricks you can have more).
every script is launched in it's own virtual machine.

plop
Title:
Post by: c h i l l a on 19 November, 2003, 21:02:40
okey,  thanks :)...   I thaught maybe one could hide the command promt...

btw  do you have the function  of the timer, cause I have problems to get it to work in LUA.

too bad that there is no dir function in luas itsself actually or?