mIRC Home    About    Download    Register    News    Help

Print Thread
#158524 05/09/06 02:54 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have troubles with my blacklist
it loads from ini info(hosts) in listcontrol
but when i try to modify it it screws up smirk

ini format is:
[blackmark]
host.domain=reason for ban


Code:
  
alias blist {
  if ($dialog(blist) == $null) { dialog -mn blist blist }
  else { dialog -c blist blist }
}

dialog blist {
  title "blist"
  size -1 -1 171 152
  option dbu
  list 1, 8 8 154 110, vsbar size
  button "Add", 2, 79 126 33 12
  button "Remove", 3, 124 126 32 13
}

on *:dialog:blist:init:0:{
  load-blist
}


on *:dialog:blist:dclick:*:{
  ;LIST MODIFY
 [color:green]; This one doesnt work proper, dunno what to change [/color] 
  if ($did = 1) { 
    if ( $did(1).sel ) { 
      var %m = $input(Modify the text?,ye,blist Modify,$did(blist, 1,$1))
      did -o $dname 1 $did(1).sel %m
      ;if ( $did(1).sel ) .timer_blist_modif 1 0 _modif_blist $v1
      ;how to write ini new changed stuff and remove old one?
    }
  }
}

on *:dialog:blist:sclick:*:{
  ;ADD
  if ($did = 2) {
    ;this doesnt work at all....
    var %blist_input = $input(Host:,de,Input Request)
    if (%blist_input == $null) { halt }
    else { writeini blacklist.ini blackmark $v1 blacklisted }
    load-blist
  }
}


alias -l _modif_blist {
  ;modifies list
  var %m = $input(Modify the text?,ye,blist Modify,$did(blist, 1,$1))
}


alias -l load-blist {
  ;reloads list
  did -r $dname 1
  var %i = $ini(blacklist.ini,blackmark,0)
  while (%i) {  
    did -a $dname 1 $ini(blacklist.ini,blackmark,%i)
    dec %i
  }
}

Last edited by raZOR; 05/09/06 04:27 PM.

IceCapped
#158525 05/09/06 06:48 PM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
not really the sollution you were looking for but:

why not use hash tables which you save to ini file format?


If it ain't broken, don't fix it!
#158526 05/09/06 07:24 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
1. i dont understand them :P
2. it ok now, friend helped me in this so its solved
3. no help needed anymore =)


IceCapped

Link Copied to Clipboard