|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
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: 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 Maybe somethings may not be possible, I don't know. Thanks a lot.
Last edited by The_Only; 08/03/05 03:20 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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
}
}
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I think I have a solution that prevents duplication
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
}
}
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
THANKS A LOT! It works great I'll exmamine the code so that I can be familiar with those things in future
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
Oops... actually it doesn't "Remove" doesnt remove the nick neither from notify nor from the list
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
I wrote a similar script here you're welcome to take what you need from there if you would like.
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
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 The one from Mike is perfect but it needs the "Remove" button to work
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
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.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Add this 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
}
}
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
* /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 P.S. Using mIRC v6.15
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
Perfect! 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...
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You're welcome. Ah right, well lets hope the next version of mIRC works for your remotes. All the best, Andy.
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
Oh yeah and only one last silly question... How can I make the note display as an echo along with the other text: 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
}
}
}
}
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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.
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.
|
|
|
|
Joined: Aug 2004
Posts: 42
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 42 |
Yeah I saw my mistake 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: 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 Thanks.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
|
|
|
|
|