mIRC Homepage

Combo box fill/add/remove etc.

Posted By: The_Only

Combo box fill/add/remove etc. - 08/03/05 03:20 PM

Hi guys... I may sound really stupid, but I have challenged much things while making a script, but I have never tried things with combo boxes. Well... not in the case below at least.

Okay, so I made this dialog:
Code:
dialog notify.manager {
  title "Vampire Script Notify Manager"
  size -1 -1 273 289
  option pixels
  icon icon.ico, 0
  box "Nicknames", 1, 8 2 126 174
  box "Details", 2, 143 2 123 174
  list 3, 12 17 118 154, sort size vsbar
  box "Operations", 4, 7 186 259 64
  button "Modify Selected", 5, 11 202 86 20
  button "Remove", 6, 104 202 58 20
  button "Add/Update", 7, 168 149 74 20
  text "Nickname:", 8, 150 17 50 16
  edit "", 9, 148 32 109 21
  button "Whois", 10, 168 202 75 20
  text "Notify Note:", 11, 150 56 60 16
  edit "", 12, 148 72 109 21
  button "Query", 13, 11 224 86 20
  button "Done", 14, 103 257 75 25, ok
  text "Vampire Script", 15, 201 270 69 16, disable
}

So... I want when I fill the boxes of "Nickname" and "Note" and press "Add/Update" the nickname and the note to be added in /notify. I know how to do that. But I also want the nickname to be added to the combo list so I think all the nicknames added should be stored to a variable. This is what I cannot do. The next thing I want to do is the Note to be stored in a .txt file and each line of the txt file to be the note for the coresponding user in the variable (added as a notify) since the note may include all characters and it would not be possible to make it as a variable. Now the third thing i want is when I click an existing nickname in the list, the Nickname and Note edit boxes to be filled wit hthe information stored. And when "Add/update" is pressed not to add the nick for a second time with the new info, but to update it. And when I press Remove the selected nick and it's notify note to be deleted. I saw such thing but not quite the same (not for notify) in a mirc script but I couldn't find the codes in remote.
Oh yeah and when Whois is pressed to perform /whois of the nickname selected.

I guess I want too much smile
Maybe somethings may not be possible, I don't know.
Thanks a lot.
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 08/03/05 03:51 PM

Code:
On 1:Dialog:notify.manager:init:0: {
  var %x = $notify(0)
  while (%x) {
    did -a $dname 3 $notify(%x)
    dec %x
  }
}

On 1:Dialog:notify.manager:sclick:7: {
  if ($did($dname,9).text && $did($dname,12).text) { 
    notify $did($dname,9).text $did($dname,12).text
    did -a $dname 3 $did($dname,9).text
  } 
}
Posted By: MikeChat

Re: Combo box fill/add/remove etc. - 08/03/05 08:58 PM

I think I have a solution that prevents duplication
Code:
alias noteman { dialog -m notify.manager notify.manager }
dialog notify.manager {
  title "Vampire Script Notify Manager"
  size -1 -1 273 289
  option pixels
  icon icon.ico, 0
  box "Nicknames", 1, 8 2 126 174
  box "Details", 2, 143 2 123 174
  list 3, 12 17 118 154, sort size vsbar
  box "Operations", 4, 7 186 259 64
  button "Modify Selected", 5, 11 202 86 20
  button "Remove", 6, 104 202 58 20
  button "Add/Update", 7, 168 149 74 20
  text "Nickname:", 8, 150 17 50 16
  edit "", 9, 148 32 109 21
  button "Whois", 10, 168 202 75 20
  text "Notify Note:", 11, 150 56 60 16
  edit "", 12, 148 72 109 21
  button "Query", 13, 11 224 86 20
  button "Done", 14, 103 257 75 25, ok
  text "Vampire Script", 15, 201 270 69 16, disable
}
on *:dialog:notify.manager:init:0:{
  var %nickdat.N = $ini(Vampire.nick.dat,Nicks,0)
  while (%nickdat.N) {
    did -a notify.manager 3 $ini(Vampire.nick.dat,Nicks,%nickdat.N)
    dec %nickdat.N
  }
}
on *:dialog:notify.manager:sclick:3:{
  did -ra notify.manager 9 $did(notify.manager,3).seltext
  did -ra notify.manager 12 $readini(vampire-nicknote.dat,nicks,$did(notify.manager,3).seltext)

}
on *:dialog:notify.manager:sclick:7:{
  did -a notify.manager 3 $did(notify.manager,9)
  writeini vampire.nick.dat Nicks $did(notify.manager,9) $did(notify.manager,9)
  writeini vampire-nicknote.dat Nicks $did(notify.manager,9) $did(notify.manager,12)
  notify $did(notify.manager,9) $did(notify.manager,12)
  did -r notify.manager 3,9,12
  var %nickdat.N = $ini(Vampire.nick.dat,Nicks,0)
  while (%nickdat.N) {
    did -a notify.manager 3 $ini(Vampire.nick.dat,Nicks,%nickdat.N)
    dec %nickdat.N
  }
}
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 09/03/05 12:21 PM

THANKS A LOT!
It works great smile
I'll exmamine the code so that I can be familiar with those things in future smile
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 09/03/05 12:23 PM

Oops... actually it doesn't smile "Remove" doesnt remove the nick neither from notify nor from the list
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 09/03/05 05:13 PM

I wrote a similar script here you're welcome to take what you need from there if you would like. smile
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 09/03/05 07:58 PM

I could do that if I was able to quite understand the combo boxes, but as I said in the first post... I've never done such a thing before, so I'm quit dum with the combo boxes...
But thanks anyway smile

The one from Mike is perfect but it needs the "Remove" button to work smile
Posted By: MikeChat

Re: Combo box fill/add/remove etc. - 09/03/05 08:46 PM

I didnt do an alias for every function. I thought you just wanted a bit of help getting it going.
By looking at how I got the nick from the listbox you should be able to get the whois, query buttons going, and read the help files on readini and writeini to make the remove bit go.
Posted By: Iori

Re: Combo box fill/add/remove etc. - 09/03/05 08:53 PM

Add this
Code:
on *:dialog:notify.manager:sclick:6:{
  if $did(3).sel {
    remini vampire.nick.dat Nicks $did(notify.manager,9)
    remini vampire-nicknote.dat Nicks $did(notify.manager,9)
    did -r $dname 9
    did -r $dname 12
    notify -r $did(3).seltext 
    did -d $dname 3 $v1
  }
}
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 10/03/05 05:03 PM

* /did: insufficient parameters (line 1931, dlgs.dss)

Line 1931 is this:
did -d $dname 3 $v1

I tried to find something about $dname in the Help file, so that I can fix it, but i didn't have luck frown

P.S. Using mIRC v6.15
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 10/03/05 05:12 PM

I'm not sure whether or not $V1 was actually used in v6.15 or not as I made a huge leap from 6.03 and 6.16.

Try changing $v1 to: $did(3).sel
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 10/03/05 05:20 PM

Perfect! smile 10x pal.

By the way, I was about to upgrade from 6.14 to 6.16 for my script, but in 6.16 over 50% of my remotes didn't work, so I tried 6.15 and everything was fine. Don't know why... 6.16 may be bugged or something...
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 10/03/05 05:28 PM

You're welcome.

Ah right, well lets hope the next version of mIRC works for your remotes. grin

All the best,

Andy.
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 10/03/05 08:08 PM

Oh yeah and only one last silly question...
How can I make the note display as an echo along with the other text:
Code:
on 1:NOTIFY: {
  if (%echo.notify == on) { echo -a $timestamp %logo Your friend $nick is on IRC. [color:blue]<the note here>[/color] }
    if (%sounds == on) {
      if (%s.notify.on == on) {
        splay sounds\12.notify.wav
      }
    }
  }
}
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 10/03/05 11:14 PM

You had one too many braces in the above code you showed me. ^^ I've modified it slightly.

You was after $notify($nick).note

Hope this helps.

Code:
on 1:NOTIFY: { 
  if (%echo.notify == on) { 
    echo -a $timestamp %logo Your friend $nick is on IRC. $+($chr(40),$notify($nick).note,$chr(41))
  }
  if (%sounds == on) {      
    if (%s.notify.on == on) {    
      splay sounds\12.notify.wav   
    }    
  } 
}


All the best,

Andy.
Posted By: The_Only

Re: Combo box fill/add/remove etc. - 10/03/05 11:54 PM

Yeah I saw my mistake smile
Thanks. And yet i have modified it a but.
It was no use adding "$chr(40)" and "$chr(41)", so this is what I have:
Code:
on 1:NOTIFY: {
  if (%echo.notify == on) {
    echo -a $timestamp %logo Your friend $nick is on IRC (Note Attached: $notify($nick).note $+ )
  }
  if (%sounds == on) {
    if (%s.notify.on == on) {
      splay sounds\12.notify.wav
    }
  }
}

And works as good as with the "$chr"s, but more simple grin

Thanks.
Posted By: SladeKraven

Re: Combo box fill/add/remove etc. - 10/03/05 11:57 PM

Heh, you're welcome.
© 2021 mIRC Discussion Forums