mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2004
Posts: 59
L
Babel fish
OP Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
I am making a bad nicks dialog I have eveything working but the Removal, what I am having trouble with is deleting the Selected nick from the Text file. I was going to use /write -d but cant figure out how to return the Line # for the selected text. can anyone Help.

Code:
dialog bad_nicks {
  title "Bad Nicks"
  size -1 -1 91 140
  option dbu
  combo 1, 8 22 75 84, size
  text "Bad Nick", 2, 9 10 25 8
  button "Add", 3, 8 109 37 12
  button "Remove", 4, 47 109 37 12
  button "Close", 5, 27 125 37 12, cancel
}


on *:dialog:bad_nicks:init:*: {
  /badnick.fill
}

on *:dialog:bad_nicks:*:*: {
  if ($devent == sclick) {  
    goto $did
    :1
    return
    :3
    write $mircdirbadnicks.txt $did(1)
    return
    :5
    return
    :4
    echo -a $did(1)
  }
}  
alias -l badnick.fill {
  var %badnick.total = $lines($mircdirbadnicks.txt)
  var %badnick.number = 1
  :next
  if (%badnick.number <= %badnick.total) {
    did -a bad_nicks 1 $read($mircdirbadnicks.txt,%badnick.number)
    inc %badnick.number 1
    goto next
  } 
  else { Return }
}

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
To use remove the nickname, you can use the /write -d command with the -w switch as well. I don't know how the text file is laid out, but if the only thing on each line is a nickname, you could use something like this:

/write -dw"nickname" yourfile.txt

-genius_at_work


Link Copied to Clipboard