mIRC Home    About    Download    Register    News    Help

Print Thread
#140438 25/01/06 06:16 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Strange topic i know grin
Question is: if i do
Code:
menu nicklist {
. Chanop functions
.. grant Ops:/mode # +o $$1
}

it works... but when i want this to happen in a dialog like
Code:
on *:dialog Opsmenu:sclick:*: {
if ($did == 100) { /mode $active +o $snick }
}

de code fails. what do i wrong confused

Greetz
Aaron


Deridio fatum
#140439 25/01/06 06:34 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You need to set the nick as a variable or something, same with the channel, the code dosent know where to op whom right now.. im not shure how you should add the info in the best way tho..

but $active = the dialog you have open, $1 return nothing..

how ever, if you right klick on a nick and bring up the dialog, then i can help a bit..

set %nick $nick or $1
set %chan $chan

then you do: /mode %chan +o %nick in the dialog..
you dont need to set $$, one $ sign is enuff.. smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#140440 25/01/06 07:50 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
try this(untested)
Code:
 on *:dialog:Opsmenu:sclick:100: { /mode $active +o $snick } 

#140441 25/01/06 08:29 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
$snick(#chan,1)


What do you do at the end of the world? Are you busy? Will you save us?
#140442 26/01/06 09:22 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
nope, still not working.

i now get the message: -o no such nick/channel
i did try the %opsroom = $active and %OpsNaam is $snick
but still a error message. also the $snick($chan,1) won't do the job.. confused

greetz
Aaron


Deridio fatum
#140443 26/01/06 09:31 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
/help $did

im still a little puzzled with what you are trying to do
are you wanting the highlight the name in the nicklist and then call a dialog for some ungodly reason
or do you have a listbox in your dialog that you fill with all the names from the channel the dialog was called from



Last edited by NeUtRoN_StaR; 26/01/06 09:37 AM.
#140444 26/01/06 09:39 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Could you show us the entire code? We could probably sort this if it was tested in our own mIRC.

A minor note though $chan wont work in a dialog event. smile

-Andy

#140445 26/01/06 10:09 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
no but passing $active to a variable works fine

lets assume you have a listbox in the dialog that you populate
Code:
on *:dialog:opsmenu:init:*:{
  set %chan $active  
  set %nicknum 1
  while ($nick(%chan,0) >= %nicknum) {
    did -a opsmenu N $nick(%chan,%nicknum)
    inc %nicknum
  }
}
on *:dialog:opsmenu:sclick:N:{
  if ($did(opsmenu,N).sel != $null) {
    mode %chan +o $did(opsmenu,N).seltext
  }
}

if you doing it from a highlighted name on the nicklist
Code:
on *:dialog:opsmenu:init:*:{
  set %chan $active  
  set %nick $snick($active,1)
}
on *:dialog:opsmenu:sclick:N:{
  mode %chan +o %nick
}

take not of the fact i didnt bother myself with making either of them multiname compatible as you didnt have it as such in you example
N = the appropriate number

both worked for me
if neither fit you then provide more details

#140446 26/01/06 01:31 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
alas it won't.

so i'll show what i have sofar.
Don't mind the size smirk
Code:
dialog opsmenu {
  title "Chanop Functions"
  size 100 75 160 630
  button "Give Ops"
}
on *:dialog:opsmenu:init:*:{
  set %chan $active
  set %nick $snick($active,1)
}
  on *:dialog:opsmenu:sclick:118:{  
    mode %chan +o %nick
  }


Keep in mind that the dialog is always visible at START and i need it to work if i select someone and press the button.


Aaron


Deridio fatum
#140447 26/01/06 07:07 PM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Code:
dialog opsmenu {
  title "Chanop functions"
  size -1 -1 190 105
  button "Ok", 1, 5 75 90 25, ok
  button "Cancel", 2, 95 75 90 25, cancel
}
on *:dialog:opsmenu:sclick:1:{
  if ($snick($active,1)) {  
    mode $active +o $snick($active,1)
  }
}

the dialog is just an example
you have to give your buttons an identity just like everything else
dialogs tutorial

Last edited by NeUtRoN_StaR; 26/01/06 07:37 PM.
#140448 26/01/06 08:20 PM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
hi NeUtRoN_StaR

the button i showed was just for an example, so i put it there without the x-y pos etc.. sorry about that.

I used your code in the script en it works great now.
most appreciated, so thank you for your effort.

Greetz
Aaron


Deridio fatum

Link Copied to Clipboard