|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
like /write c:\mirc3\arena\%var.txt stuffthatswritten
how do you get it to write the file ______.txt whre ______ is whatever a variable is
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
D3m0nnet.com
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
/write $+(directory\goes\here,%variable,.txt) <text>
Red is directory, and green is variable
-KingTomato
|
|
|
|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
thanks, how do you CHECK for a file of a specific name that name being a varaible and get IF that file DOESNT exist for it to continue, basically if it does exist, STOP and say a message
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
if ( $isfile(%var) ) {
echo -a That file already exists!
halt
}
dostuff
|
|
|
|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
uh ya.. exactly except.. the var isnt a .txt file so.. how do i add the .txt if ( $isfile(%var .txt) ) {
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
|
|
|
|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
if $isfile($+(%create,.txt)) { if ( $isfile($+(%create,.txt)) ) { both dont work.. (cause it just ignores them
on 1:text:create*:#:{ if (%game == no) { /set %create $2 if $isfile($+(%create,.txt)) { /msg $chan 9,1 Charactor already exists! /halt } /msg $chan 9,1 Created /write $+(c:\mirc3\arena\,%create,.txt) sucess } }
it just says "created" and creates/writes in the file.. it doesnt stop if the files already there
Last edited by Rift; 25/04/03 10:50 PM.
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Well you've got a subdirectory in the /write, but not in the $isfile() check.. if $isfile($+(c:\mirc3\arena\,%create,.txt)) {
|
|
|
|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
|
|
|
|
Joined: Apr 2003
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Apr 2003
Posts: 9 |
ok.. hopefully this is the final one if (%pass != $read(c:\mirc3\arena\,%create,.txt, 2)) { doesnt work.. how do i make it work? (%pass is just $3, %create is just $2 which is a .txt file created earlier ) ( it needs to be from the 2nd line)
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
if (%pass != $read($+(c:\mirc3\arena\,%create,.txt), 2)) {
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
if (%pass != $read([color:red]$+([/color]c:\mirc3\arena\,%create,.txt[color:Red])[/color], 2)) {
-KingTomato
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Darnl, you beet me Nimue >:\
-KingTomato
|
|
|
|
|