mIRC Home    About    Download    Register    News    Help

Print Thread
#79855 18/04/04 09:24 PM
Joined: Dec 2003
Posts: 199
K
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2003
Posts: 199
on *:open:?:/window -h $nick | .msg $nick $talker1(Please wait for my verification of the PM...) | if ($dialog(Query) != $null) { did -a Query 4 $nick } | else { dialog -dm Query Query | did -a Query 4 $nick }
dialog Query {
size -1 -1 127 108
title "PM Blocker"
button "Accept",1,8 77 52 24
button "Decline",2,65 77 52 24
box "Nicks",3,6 2 118 71
list 4,10 16 105 51,hsbar size sort
}
on *:dialog:QUERY:init:*:{
mdx SetMircVersion $version
mdx MarkDialog $dname
mdx SetDialog $dname bgcolor $rgb(0,0,0)
mdx SetColor $dname 3,4 background $rgb(0,0,0)
mdx SetColor $dname 3,4 textbg $rgb(0,0,0)
mdx SetColor $dname 3,4 text $rgb(255,255,255)
}
on *:dialog:Query:sclick:*:{ if ($did == 2) { if ($didwm(Query,4,$did(Query,4).seltext) != $null) { window -c $did(Query,4).seltext | .msg $did(Query,4).seltext $talker1($me has declined your query...) | did -d Query 4 $didwm(Query,4,$did(Query,4).seltext) } }
if ($did == 1) { if ($didwm(Query,4,$did(Query,4).seltext) != $null) { window -rw $did(Query,4).seltext | .msg $did(Query,4).seltext $talker1($me has accepted your query...) | did -d Query 4 $didwm(Query,4,$did(Query,4).seltext) } }
}

:: The Code Works, But Say Im on 2 servers (I usually am) andddd:
We're call Server #1 A and #2 B.
So Im on Server A and I type "/dialog -dm Query Query" and it opens... Say I get a PM from Server A It'll show the nick and I can click accept/decline - it'll work.
But, If I was on Server A and I opened the dialog on Server A and got a PM From Server B, It'd try to Open the Window on "Server A" and it'd get a error: /Windows something something because Its not the right server... How can I fix this? smile


Want to Link Servers? PM Me
- EliteIRC.dyndns.org -
#79856 19/04/04 02:49 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
You need to learn about the multiserver stuff (/help /scon, /help /scid)

TIP: when pasting code, paste each commandline on its own line in the message. The way you posted your code makes it virtually impossible to read.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#79857 24/04/04 02:16 PM
Joined: Feb 2004
Posts: 14
L
Pikka bird
Offline
Pikka bird
L
Joined: Feb 2004
Posts: 14
I have read the mIRC help files on this subject and still am Lost. Yes I am a newb but I have also been using mIRC for over 8 yrs and have made several scripts that function just the way they are intended but I am just not grasping this multi server stuff. Anyone know of any turorials out there that give more info or examples then the mIRC help files?


Thanks
LJ

#79858 28/04/04 03:37 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
This should work, I haven't actually tested tho.. laugh
Code:
on *:open:?:{
  window -h $nick
  .msg $nick $talker1(Please wait for my verification of the PM...)
  if !$dialog(Query) { dialog -dm Query Query }
  did -a Query 4 $nick $cid
  ; ^^ Added CID to the list entry
}
dialog Query {
  size -1 -1 127 108
  title "PM Blocker"
  button "Accept",1,8 77 52 24
  button "Decline",2,65 77 52 24
  box "Nicks",3,6 2 118 71
  list 4,10 16 105 51,hsbar size sort
}
on *:dialog:QUERY:init:*:{
  mdx SetMircVersion $version
  mdx MarkDialog $dname
  mdx SetDialog $dname bgcolor $rgb(0,0,0)
  mdx SetColor $dname 3,4 background $rgb(0,0,0)
  mdx SetColor $dname 3,4 textbg $rgb(0,0,0)
  mdx SetColor $dname 3,4 text $rgb(255,255,255)
}
on *:dialog:Query:sclick:*:{
  if $did == 2 && $did(Query,4).seltext {
    tokenize 32 $ifmatch
    ; now NICK is $1; CID is $2
    ; switch to the correct connection ($2)
    scon $2
    ; perform actions
    window -c $1
    .msg $1 $talker1($me has declined your query...)
    did -d Query 4 $did(4).sel
  }
  if ($did == 1) && $did(Query,4).seltext {
    tokenize 32 $ifmatch
    ; now NICK is $1; CID is $2
    ; switch to the correct connection ($2)
    scon $2
    ; perform actions
    window -rw $1
    .msg $1 $talker1($me has accepted your query...)
    did -d Query 4 $did(4).sel
  }
}

#79859 05/05/04 03:15 AM
Joined: Dec 2003
Posts: 199
K
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2003
Posts: 199
on *:open:?:{ window -h $nick
.msg $nick $talker1(Please wait for my verification of the PM...)
if !$dialog(Query) { dialog -dm Query Query }
did -a Query 4 $nick $cid
}
dialog Query {
size -1 -1 127 108
title "PM Blocker"
button "Accept",1,8 77 52 24
button "Decline",2,65 77 52 24
box "Nicks",3,6 2 118 71
list 4,10 16 105 51,hsbar size sort
}
on *:dialog:QUERY:init:*:{
mdx SetMircVersion $version
mdx MarkDialog $dname
mdx SetDialog $dname bgcolor $rgb(0,0,0)
mdx SetColor $dname 3,4 background $rgb(0,0,0)
mdx SetColor $dname 3,4 textbg $rgb(0,0,0)
mdx SetColor $dname 3,4 text $rgb(255,255,255)
}
on *:dialog:Query:sclick:*:{
if ($did == 2) && ($did(Query,4).seltext) { tokenize 32 $ifmatch
window -c $1
.msg $1 $talker1($me has declined your query...)
did -d Query 4 $did(4).sel
}
if ($did == 1) && ($did(Query,4).seltext) { tokenize 32 $ifmatch
window -rw $1
msg $1 $talker1($me has accepted your query...)
did -d Query 4 $did(4).sel }
}
is what I was trying and I get an error:
* /window: invalid parameters (line 29, script16)
Line 29 is: window -rw $1
So if there's an error with opening a multi-servered Pm theres probably a prob with closing it (BTW it worked on 1 server)
:P


Want to Link Servers? PM Me
- EliteIRC.dyndns.org -
#79860 05/05/04 03:17 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Did you even try what I posted before hacking bits out of it? :tongue:
You have removed the two lines used to swap to the correct connection(CID) for the /window* part of the script.
Code:
on *:dialog:Query:sclick:*:{
  if ($did == 2) && ($did(Query,4).seltext) {
    tokenize 32 $ifmatch
[color:red]    scid $2[/color]
    window -c $1
    .msg $1 $!talker1($me has declined your query...)
    did -d Query 4 $did(4).sel
  }
  if ($did == 1) && ($did(Query,4).seltext) {
    tokenize 32 $ifmatch
[color:red]    scid $2[/color]
    window -rw $1
    msg $1 $!talker1($me has accepted your query...)
  did -d Query 4 $did(4).sel }
}

Edit: A slight change from 'scon' to 'scid'

Last edited by Iori; 05/05/04 03:18 PM.
#79861 06/05/04 01:31 AM
Joined: Dec 2003
Posts: 199
K
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2003
Posts: 199
Works. :-P
I probably missed a line or so because I copied and pasted and everything was bunched on one line when I pasted it into my remotes~


Want to Link Servers? PM Me
- EliteIRC.dyndns.org -

Link Copied to Clipboard