mIRC Home    About    Download    Register    News    Help

Print Thread
W
whatsthedillio
whatsthedillio
W
i would like to know how i could do this:
i want to make a file like name.txt or name.in or something then on:*TEXT:!addop*:#: {
i would then like it to add $2 for example if i typed !adop joebloggs
it would add his name to the .txt or .ini
i dont really understand though can some one pls show me
and if possible show mw how to read from the file
for exampel the list would be an autoop list not chanserv
so it could read list every time someone joins then if they are on the list.
please help me with how to make write and read files from a script thanks for the help??
thankyou

C
Coolkill
Coolkill
C
Well, judging by the fact your using !addop, i'm going to guess your trying to make an auto-op script.. in which case you should probably look at: /help /aop - this is mIRC's built in one.

If you still want to write the 2nd parameter to a file then:

$1 - is !addop
$2 - is the nickname so..

/write "C:\store me\here\myfile.txt" $2

^ for example.

Eamonn.

W
whatsthedillio
whatsthedillio
W
yea thanks for the reply ,
i see writing files is sooo easy but what i dont know is
how i can search through the file E.G
on TEXT !me bla bla
it would add them to the file:
//write nicks.text $nick } }
then if they put !find <thier nick>
I NO ITS A POINTLESS SCRIPT JUST sO I KNOW HOW TO WRITE AND READ STUFF
on the !find nick it looked through the text file then messeged the sentence with $2 in it
thanks alot
thanks

C
Coolkill
Coolkill
C
okay, well, you read a file using $read the following are examples:

to read a random line: $read(C:\myfile\ishere\file.txt)

to read a specific line $read(C:\myfile\ishere\file.txt,LINENUMBER)

to search a line for a specific word/phrase: $read(C:\myfile\ishere\file.txt,w,*phrasehere*)

to search for a line that starts with a specific word use: $read(C:\myfile\ishere\file.txt,s, wordhere)

let me know if you need anymore examples.

Eamonn.

W
whatsthedillio
whatsthedillio
W
thanks for that reply but i cant seem to get it to work
for example i made this just for a quick test:-

on *:TEXT:!name*: { $read(C:\chan.txt,s,cloud)
ELSE msg $chan didnt work } }

and nothing happned in the channel
do i have to msg $1- or something

please can u tell me what im doing wrong thanx


Link Copied to Clipboard