mIRC Homepage
I currently have:
Code:
on 1:text:*:#: {
  if ( $nick == seanturner70 ) {
    if ($me == no-nick) {
      if ($1 == !enable) && ($2 == beta) { write enabled.txt $chan | msg $chan $chan has been added to the list for my Beta features }
      elseif ($1 == !disable) && ($2 == beta) { ******* enabled.txt $chan | msg $chan $chan has been deleted from the beta fetures }
    }
  }
}


I don't know how to delete the channel from the list... (*******)

I had a look at /help but it doesn't really help.

The reason I want this is becuase I was testing a feature, and it failed pretty misrably, someone when sugested that I do an "opt-in" thing, then I can do:
Code:
[...]
if ( $chan ison enabled.txt) [...]


Is that correct?

thanks.
Posted By: 5618 Re: How do delete something from a write file - 14/12/08 06:12 PM
Try this:

Code:
on 1:TEXT:*:#:{
  if ($nick == seanturner70) && ($me == no-nick) && ($2 == beta) {
    if ($1 == !enable) && (!$read(enabled.txt,s,$chan)) { write enabled.txt $chan | msg $chan $chan has been added to the list for my Beta features }
    elseif ($1 == !disable) && ($read(enabled.txt,s,$chan)) { write -dl $+ $readn enabled.txt | msg $chan $chan has been deleted from the beta fetures }
  }
}
Alternatively you could use
Code:
/write -ds $+ $chan enabled.txt
ok, I am unsure now...

I added a line to a script ( if ( $chan ison enabled.txt ) { )

and it doesn't seam to work.
Code:
on 1:text:!!bar:#: {
  if ($me == no-nick) {
    if ( $chan ison enabled.txt ) {
      msg $chan 4 Hello $nick Welcome To Bullets Bar! <text..>
    }
  }
}


I don't know why it isn't working.
Posted By: 5618 Re: How do delete something from a write file - 14/12/08 08:57 PM
Code:
$chan ison enabled.txt

is an invalid statement. You need to use...
Code:
if ($read(enabled.txt,s,$chan))

...as mentioned above.

See /help $read for more info.
oh, thanks smile
ok... I tried that, and it still doesn't seem to work
Code:
on 1:text:!!bar:#: {
  if ($me == no-nick) && ($read(enabled.txt,s,$chan)) {
    msg $chan 4 Hello $nick W...
  }
}


When you wrote the channel name to the text file, did you use something like
Code:
/write enabled.txt $chan more text here

or
Code:
/write enabled.txt $chan


If the first, then I don't see why it's not working.
If the second, then change the s switch in the $read to a w
Thanks, changing it to w worked...

If you don't mind, what is the difference between w,s, etc?
From the help file
Quote:
//echo $read(info.txt, s, mirc)
Scans the file info.txt for a line beginning with the word mirc and returns the text following the match value.
//echo $read(help.txt, w, *help*)
Scans the file help.txt for a line matching the wildcard text *help*.

The w switch returns the full line, not just the text following, so by using the w with a non-wildcarded search term, it will return the first line that has the search term.
ok thanks smile
© mIRC Discussion Forums