mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 9
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
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
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
/help /write


D3m0nnet.com
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
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
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
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
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
  if ( $isfile(%var) ) {
    echo -a That file already exists!
    halt
  }
  dostuff

Joined: Apr 2003
Posts: 9
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
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
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
$isfile($+(%var,.txt))

Joined: Apr 2003
Posts: 9
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
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
N
Fjord artisan
Offline
Fjord artisan
N
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
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Apr 2003
Posts: 9
thanks, works fine

Joined: Apr 2003
Posts: 9
R
Rift Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Apr 2003
Posts: 9
ok.. hopefully this is the final one smile
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
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
if (%pass != $read($+(c:\mirc3\arena\,%create,.txt), 2)) {

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
if (%pass != $read([color:red]$+([/color]c:\mirc3\arena\,%create,.txt[color:Red])[/color], 2)) {


-KingTomato
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Darnl, you beet me Nimue >:\ smirk


-KingTomato

Link Copied to Clipboard