mIRC Home    About    Download    Register    News    Help

Print Thread
#3568 26/12/02 05:18 PM
Joined: Dec 2002
Posts: 12
G
Gravity Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
what is wrong? :

alias whois_De /dialog -m whois_de whois_De
dialog Whois_De {
title "Whois"
size -1 -1 54 102
option dbu
icon $mircexe, 18
button "ok", 17, 0 0 0 0, ok
box "Info", 1, 0 1 54 35
button "Whois", 2, 2 9 24 10
button "Info", 3, 28 9 24 10
button "Query", 4, 2 21 24 10
button "Query2", 5, 28 21 24 10
box "ctcp", 7, 0 37 54 42
button "Ping", 8, 2 44 24 10
button "Version", 9, 28 44 24 10
button "Time", 10, 27 55 24 10
button "clientinfo", 11, 27 66 24 10
button "Userinfo", 12, 2 66 24 10
button "Finger", 13, 2 55 24 10
box "DCC", 14, 0 80 54 21
button "Send", 15, 2 88 24 10
button "Chat", 16, 28 88 24 10
}

on 1:dialog:whois_de:sclick:*:{
if ( $did = 3 ) .uwho $$1
if ( $did = 2 ) .whois $$1
if ( $did = 4 ) .query $$1
if ( $did = 8 ) .ctcp $$1 ping
if ( $did = 9 ) .ctcp $$1 Version
if ( $did = 10 ) .ctcp $$1 Time
if ( $did = 11 ) .ctcp $$1 clientinfo
if ( $did = 12 ) .ctcp $$1 userinfo
if ( $did = 13 ) .ctcp $$1 FInger
if ( $did = 15 ) .dcc send $$1
if ( $did = 16 ) .dcc chat $$1
}

it does not work what is error ? help !

#3569 26/12/02 05:49 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
$$1 has no value. If you meant to perform those actions on the nickname you selected, try $snick($active,1) instead.

#3570 26/12/02 06:37 PM
Joined: Dec 2002
Posts: 12
G
Gravity Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
also:

on 1:dialog:whois_de:sclick:*:{
if ( $did = 3 ) .uwho $snick($active,1)
if ( $did = 2 ) .whois $snick($active,1)
if ( $did = 4 ) .query $snick($active,1)
if ( $did = 8 ) .ctcp $snick($active,1) ping
if ( $did = 9 ) .ctcp $snick($active,1) Version
if ( $did = 10 ) .ctcp $snick($active,1) Time
if ( $did = 11 ) .ctcp $snick($active,1) clientinfo
if ( $did = 12 ) .ctcp $snick($active,1) userinfo
if ( $did = 13 ) .ctcp $snick($active,1) FInger
if ( $did = 15 ) .dcc send $snick($active,1)
if ( $did = 16 ) .dcc chat $snick($active,1)
}
or ?

#3571 26/12/02 06:50 PM
Joined: Dec 2002
Posts: 12
G
Gravity Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
This dialog are to work in query please help !!!!!!

#3572 26/12/02 06:59 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Instead of $$1, try using $active


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#3573 26/12/02 07:00 PM
Joined: Dec 2002
Posts: 12
G
Gravity Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
yeha thx it is working !

#3574 26/12/02 09:21 PM
Joined: Dec 2002
Posts: 12
G
Gravity Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2002
Posts: 12
need help on WHOIS the whois is on the status window
I want the whois on query

what is wrong?

on 1:dialog:whois_de:sclick:*:{
if ( $did = 3 ) .uwho $active
if ( $did = 2 ) .whois $active
if ( $did = 4 ) .query $active
if ( $did = 8 ) .ctcp $active ping
if ( $did = 9 ) .ctcp $active Version
if ( $did = 10 ) .ctcp $active Time
if ( $did = 11 ) .ctcp $active clientinfo
if ( $did = 12 ) .ctcp $active userinfo
if ( $did = 13 ) .ctcp $active FInger
if ( $did = 15 ) .dcc send $active
if ( $did = 16 ) .dcc chat $active
}


#3575 27/12/02 03:52 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
First, all of your ( $did = # ) should use ==, since = means "is assigned the value" rather than "is equal to."

Also, only the first line should be If (condition); each line thereafter should be ElseIf (condition). This causes control to drop to out of the event once a $did has been matched and not have to keep on comparing $did to another number all the way down.

Then you will have to redirect all the raw numeric events to their query window yourself, either by setting a variable to check before you whois them, by enabling a #group, or by deciding that you always want their whois information to go to their query window, if there's one open. (The code that follows combines the last two ideas, in case you decide that you always want their whois info in their query window, if available, perhaps for logging reasons. In such a case, you need only remove the 2 group lines, the disabling command in the 318 event and the enabling command in the on DIALOG event.) This is a design decision you must make.

Incidentally, if this dialog is being triggered in a query window, your ($did == 4) makes no sense. You're already in the query window with them, and the query window is not only open, but you have launched this dialog from that query window.

In this example script, I have included a #group so that the additional script code only runs when you have doing this /whois from the dialog control. It turns itself on and off through the script.
Code:

on *:DIALOG:whois_de:sclick:*:{
  IF ($did == 2) {
    .ENABLE #WHOIS_DE
    .WHOIS $active $active
  }
  ELSEIF ($did == 3) .UWHO $active
  ELSEIF ($did == 4) .QUERY $active
  ELSEIF ($did == 8) .CTCP $active PING
  ELSEIF ($did == 9) .CTCP $active VERSION
  ELSEIF ($did == 10) .CTCP $active TIME
  ELSEIF ($did == 11) .CTCP $active CLIENTINFO
  ELSEIF ($did == 12) .CTCP $active USERINFO
  ELSEIF ($did == 13) .CTCP $active FINGER
  ELSEIF ($did == 15) .DCC SEND $active
  ELSEIF ($did == 16) .DCC CHAT $active
}
  
#WHOIS_DE off
  
;  User info
raw 311:*:{
  IF ($query($2)) {
    ECHO $color(whois) -ti2 $2 $2 is $+($3,@,$4-)
    HALT
  }
}
;  Channels list
raw 319:*:{
  IF ($query($2)) {
    ECHO $color(whois) -ti2 $2 $2 on $3-
    HALT
  }
}
;  Server info
raw 312:*:{
  IF ($query($2)) {
    ECHO $color(whois) -ti2 $2 $2 using $3-
    HALT
  }
}
;  (DALnet/bahamut) has identified for nick (+r)
raw 307:*:{
  IF ($query($2)) {
    ECHO $color(whois) -ti2 $2 $2-
    HALT
  }
}
;  IRC Operator info
raw 313:*:{
  IF ($query($2)) {
    ECHO $color(whois) -ti2 $2 $2-
    HALT
  }
}
;  Away message
raw 301:*:{
  IF ($query($2)) {
    ECHO $color(whoIs) -ti2 $2 $2 is away: $3-
    HALT
  }
}
;  Idle duration and Sign-On time
raw 317:*:{
  IF ($query($2)) {
    ECHO $color(whoIs) -ti2 $2 $2 has been idle $duration($3) $+ , signed on $asctime($4,ddd mmm d H:nn:ss)
    HALT
  }
}
;  End of /WHOIS list.
raw 318:*:{
  IF ($query($2)) {
    ECHO $color(whoIs) -ti2 $2 $2-
    .DISABLE #WHOIS_DE
    HALT
  }
}
  
#WHOIS_DE end

Normally, I prefer to use all lower case for everything in scripts except where I want something to stand out or in a displayed message which should have caps in it. mIRC ignores case unless you specifically tell it not to. Judicious use of caps can make things stand out better, such as in the #group name in the preceeding example; overuse of caps lessens their impact, making you, in effect, caps-blind. In this particular case, I have capitalized all the commands to make the IF-ELSEIF-ELSE structures show up better, as well as pointing out the logic in each of the raw events.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard