mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Hey,

I've decided it would be good to write a script that pops up an input box and sends the text as a notice to the person I selected. I can figure out how to do that much, but ideally what I want is for the box to stay open so I can have a conversation in notices with the person. both of our notices will still show up in the chat window, but I'm trying to eliminate the problem of forgetting the first / and sending the text to the channel. I'd like to have this as a popup, so I'd right click the person's name on the nicklist and select my notice popup and it would open an input box. Thanks for any help.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
This should do it for you. You can have notice windows for multiple nicks at once. Feel free to change the size of the dialog box and the edit box to suit your needs.

Code:
dialog Notice {
  title "Notice"
  size -1 -1 200 40
  option dbu

  text "",1,5 5 100 8
  edit "",2,5 14 190 10,autohs

  button "Hidden",3,210 50 1 1
  button "Close",4,90 27 20 8,ok
}

on *:dialog:Notice:init:*: {
  did -a $dname 1 Notice %nnick $+ :
  did -ht $dname 3
}

on *:dialog:Notice:sclick:*: {
  if ($did == 3 && $did(2) != $null) {
    .notice $left($gettok($did(1),2,32),-1) $did(2)
    did -r $dname 2
  }
}

menu nick {
  -
  Notice: set %nnick $snick | dialog -m Notice Notice
}


Invision Support
#Invision on irc.irchighway.net
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Hey,

Thanks for that code. It's not working though, and I don't know why. I have this in remotes:

dialog Notice {
title "Notice"
size -1 -1 200 40
option dbu
text "",1,5 5 100 8
edit "",2,5 14 190 10,autohs
button "Hidden",3,210 50 1 1
button "Close",4,90 27 20 8,ok
}
on *:dialog:Notice:init:*: {
did -a $dname 1 Notice %nnick $+ :
; did -ht $dname 3
}
on *:dialog:Notice:sclick:*: {
if ($did == 3 && $did(2) != $null) {
.notice $left($gettok($did(1),2,32),-1) $did(2)
did -r $dname 2
}
}

And I have this in my nicklist popups:

menu nick {
Notice: set %nnick $snick | dialog -m Notice Notice
}

I'm getting this in my status window: NOTICE: Unknown command. Also, what do I hit to send the notice? I'm assuming it's enter. I only have a close button. Thanks.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
When do you get the error, and does it give a line number?

And, yes, you hit enter to send. It uses a hidden button that trigger when hitting enter to send the data. I thought that would be easier than clicking a button all the time.


Invision Support
#Invision on irc.irchighway.net
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Hey,

Yes, actually I get another error too. I was working with someone and they had me comment out a line. When I have it exactly your way, I also get * /notice: insufficient parameters (line 148, script1.ini). Line 148 is:

.notice $left($gettok($did(1),2,32),-1) $did(2)

Thanks.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Sorry for the delay getting back to you. The problem was a mistake I made with how to use $snick. I forgot that you need to have $snick($chan,1) instead of just $snick. Here...
Code:
dialog Notice {
  title "Notice"
  size -1 -1 200 40
  option dbu

  text "",1,5 5 100 8
  edit "",2,5 14 190 10,autohs

  button "Hidden",3,210 50 1 1
  button "Close",4,90 27 20 8,ok
}

on *:dialog:Notice:init:*: {
  did -a $dname 1 Notice %nnick $+ :
  did -ht $dname 3
}

on *:dialog:Notice:sclick:*: {
  if ($did == 3 && $did(2) != $null) {
    .notice $left($gettok($did(1),2,32),-1) $did(2)
    did -r $dname 2
  }
}

menu nick {
  -
  Notice: set %nnick $snick($chan,1) | dialog -m Notice Notice
}


You should now see "Notice nick:" in the notice box instead of just "Notice :" ... and that will mean that the .notice part will work properly.

Let me know if it works.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
mostly because I was bored, I played with this and made a few changes so it worked on my copy of mIRC
Code:

dialog Notice {
  title "Notice"
  size -1 -1 200 40
  option dbu
  text "",1,5 5 100 8
  edit "",2,5 14 190 10,autohs
  button "Hidden",3,210 50 1 1
  button "Close",4, 90 27 20 8, cancel
}
on *:dialog:Notice:init:*: {
  did -a $dname 1 MultiNotice $replace(%nnick,$chr(44),$chr(32)) $+ :
  did -ht $dname 3
}
on *:dialog:Notice:sclick:3: {
  if ($did(2) != $null) {
    notice %nnick $did(notice,2).text To: $replace(%nnick,$chr(44),$chr(32))
    did -r $dname 2
  }
}
on *:dialog:Notice:sclick:4: {
  unset %nnick
}
menu nicklist {
  Notice Box: set %nnick $snicks | dialog -m Notice Notice
}

Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Riamus,

I still got NOTICE: Unknown command in my status window. I'll try Mike's version of this too. Do I put all of that into remotes, or does the nicklist part of the code have to be in popups? Thanks.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
the whole thing I posted goes in remotes, preferably in its own file, but can be added in another remote file if you prefer.
In either case make sure the original code is replaced/removed when adding in my post.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It almost sounds like you have a bracket mismatch in your script. Click the bracket checker button and see.

Also, try putting it like this:

echo -a $left($gettok($did(1),2,32),-1) $did(2)
.notice $left($gettok($did(1),2,32),-1) $did(2)

See if it echoes the nick and the text. If not, let me know. Also, let me know if your heading on the notice box says "Notice nick:" or if it says "Notice :"


Invision Support
#Invision on irc.irchighway.net
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
LOL,

When I put the whole thing in remotes, including this:
menu nicklist {
Notice Box: set %nnick $snicks | dialog -m Notice Notice
}

there's no option for it when I right click a name. It was semi working when I put that in popups. What's the syntax to enter in that box when I send a notice? I right clicked my own name and typed "hi" and it appears to be trying to send notices to "Box", and a notice to "hi" with the message "To:". LOL, I hate debugging. I'm sorry I'm new to this. Thanks for all the help though. (PS, this is using Mike's version now)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It should be menu nick, not menu nicklist.

If it's trying to do "box"... then you definitely do have a bracket problem (in both scripts). It's having the error in the menu section.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
MikeChat, the only thing with how you changed it...

If multiple nicks are selected, I'm not sure that /notice works with multiple nicks. Maybe it does. I can't test that right now. If so, great. Though, normally you don't want to keep noticing a bunch of people. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
dialog Notice {
  title "Notice"
  size -1 -1 200 40
  option dbu

  text "",1,5 5 100 8
  edit "",2,5 14 190 10,autohs

  button "Hidden",3,210 50 1 1
  button "Close",4,90 27 20 8,ok
}

on *:dialog:Notice*:init:*: {
  did -a $dname 1 Notice %nnick $+ :
  did -ht $dname 3
}

on *:dialog:Notice*:sclick:*: {
  if ($did == 3 && $did(2) != $null) {
    .notice $left($gettok($did(1),2,32),-1) $did(2)
    did -r $dname 2
  }
}

menu nick {
  -
  Notice: set %nnick $snick($chan,1) | dialog -m $+(Notice.,%nnick) Notice
}


Btw, I made a change to it to allow multiple notice windows at once. I thought I had it set for that originally, but forgot. This will allow you to notice different people different things without conflict. (once you have it working) wink

Anyhow, like i said, check for a bracket problem before the menu section.

Last edited by Riamus2; 13/10/05 04:56 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
/me clubs himself with a large trout in frustration! lol

I did find a bracket mismatch and I fixed it. However, it is still trying to send a notice to "hi" with the text "To:" and a notice to "Box:" with the text "set Blake" (I was trying to send a notice to myself). Any ideas?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Try my copy again.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
When I change the menu to "menu nick {" it does not work.

ckecking the help file I see it as nicklist there still.
< snip >
You can also specify channel, query, nicklist, and menubar as the menu name, and this will add menuitems to your current popup menus for each of these windows.

menu nicklist {
Slap
.Haddock:/me prods $1 with a haddock
}
< /snip >

Is this a version thing? ( I use 6.16) or maybe an Invision thing? (I don't use a scripted mIRC)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, maybe it is nicklist. If so, change mine to say nicklist. Though, if he had the menu item with nick and not nicklist, I'm not sure why...

I am not online here, so I can't test with the nick list. And, I'm not using Invision here. smile

Whichever menu way works, use that.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Oh, and btw... when you fixed your bracket mismatch, I think you put the bracket in the wrong spot. Look at how it's formatted here (the spacing). Compare it to yours and make sure it is exactly the same.

Note that if you're copying/pasting the code and it's going on one line and you're trying to fix it from that, you can instead just click Quote as if you're going to reply to the message with a quote and then just copy everything between the [code[b][/b]] tags and paste that into your remote.


Invision Support
#Invision on irc.irchighway.net
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thanks, Riamus...that way to copy worked. This is looking better except it's echoing the nick and the message in the active window instead of sending a notice. I'm not sure, but I think this is the problem line:

echo -a $left($gettok($did(1),2,32),-1) $did(2)

How do I change that to notice instead of echo. If I send myself a notice saying "hi", it echoes "Blake hi". Thanks.

Page 1 of 2 1 2

Link Copied to Clipboard