mIRC Home    About    Download    Register    News    Help

Print Thread
#1808 15/12/02 04:15 AM
Joined: Dec 2002
Posts: 6
D
DeXoy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Dec 2002
Posts: 6
ok. i am trying to make a dialog that will list all the users in the active channel, and i would be able to op,deop,voice,kick,ban people from the dialog. How would i go about listing all the users, their modes, and their address in the dialog? i am not sure how i would do this.

#1809 15/12/02 04:22 AM
Joined: Dec 2002
Posts: 111
F
Vogon poet
Offline
Vogon poet
F
Joined: Dec 2002
Posts: 111
Have a while loop do something like this:

alias slist {
var %i 1
while (%i <= $nick(#,0)) {
did -a name id $nick(#,%i).pnick
inc %i
}
}

That's for their status.

For their hosts.. you'd have to use something like this:

alias hlist {
who $chan
var %i 1
while (%i <= $nick(#,0)) {
did -a name id $address($nick(#,%i),4)
inc %i
}
}

As that's for their hosts. Has the "who $chan" in it incase your IAL isnt filled.. so it gets their hosts. Just make the dialog, put those in the init event, and replace name, id, etc. with the dialog's name, and the id of the listbox, etc. you want the data in.


Experience The Void.. Are You Ready?
#1810 15/12/02 04:51 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
ok ive actually got that exact thing ive made into mine ......
heres what ive got and it all works ..... altho its a bit draining on the mirc itself and slows things down i think

dialog _nicklist {
title "Nick List"
size $calc($window(-1).w - 145) 94 145 610
option pixels
icon demon.ico, 0
icon 50, -30 -145 185 770, images/electricnick.bmp
icon 51, 6 376 133 46, images/D3m0nicN.png
list 1, 5 5 135 377, size extsel vsbar
button "Kick", 2, 5 418 65 18
button "Kick/Ban", 3, 75 418 65 18
button "Ban", 4, 5 442 65 20
button "Query", 5, 75 442 65 18
button "+ HelpOp", 6, 5 514 65 18
button "+ Op", 7, 5 466 65 18
button "- Op", 8, 75 466 65 18
button "+ Voice", 9, 5 490 65 18
button "- Voice", 10, 75 490 65 18
button "+ Exception", 11, 5 538 65 18
button "- HelpOp", 12, 75 514 65 18
button "- Exception", 13, 75 538 65 18
button "Whois", 14, 5 562 65 18
button "Ping", 15, 75 562 65 18
button "+ Protect", 16, 5 586 65 18
button "- Protect", 17, 75 586 65 18

ive added a bit more than just the standard things uve asked for if ur interested in the full mrc to it i could send ya it and u could use it for a base comparison as to urs ......



D3m0nnet.com
#1811 15/12/02 05:08 AM
Joined: Dec 2002
Posts: 6
D
DeXoy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Dec 2002
Posts: 6
Code:
  
dialog nicklist {
  title "Nicklist  [ /nicklist ]"
  size -1 -1 159 92
  option dbu
  list 1, 5 16 150 70, size
  box "", 4, 2 1 156 88
  edit "", 5, 5 5 72 10, read
  edit "", 6, 82 5 72 10, read
}
on *:dialog:nicklist:*:*:{
  if ($devent == init) {
    .slist
    dll $mdx SetMircVersion $version 
    dll $mdx MarkDialog $dname
    dll $mdx SetControlMDX $dname 1 ListView report single grid &gt; $views
    did -i $dname 1 1 headerdims 115
    did -i $dname 1 1 headertext Nicks
    did -a $dname 5 $server
    did -a $dname 6 Channel : $+ $active $+
    .readlist 1 $active nicks
  }
}

alias slist {
  var %i 1
  :start
  while (%i &lt;= $nick(#,0)) {
    .writeini nicklist.ini $active nicks $iif($readini(nicklist.ini,$active,nicks),$+($ifmatch,$chr(44),$nick(#,%i).pnick),$nick(#,%i).pnick))
    inc %i
    goto start
  }
}
alias  readlist {
  var %a = 1
  did -r $dname $1
  while ($gettok($readini(nicklist.ini,$2,$3),%a,44)) {
    did -az $dname $1 $ifmatch
    inc %a
  }
}


This is what i got so far.. but how do i make it clear the ini every time? because if someone leaves the channel.. it still shows them in the list.

#1812 15/12/02 05:18 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
ok well here is what ive got and its a bit long LoL:::::


menu menubar,channel,nicklist {
Nicklist: dialog -mdh _nicklist _nicklist
}

on *:DIALOG:_nicklist:init:0: {
%nicklist = On
%sn = 1
did -ra _nicklist 1 $nick($chan(1),%sn).pnick
%sn = 2
while ( $nick($chan(1),%sn,a) != $null ) {
did -a _nicklist 1 $nick($chan(1),%sn).pnick
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:close:0: {
%nicklist = Off
}
on *:ACTIVE:*: {
if ( #* !iswm $active ) && ( %nicklist == On ) {
dialog -i _nicklist _nicklist
}
elseif ( #* iswm $active ) && ( %nicklist == On ) {
dialog -e _nicklist _nicklist
%sn = 1
did -ra _nicklist 1 $nick($active,%sn).pnick
%sn = 2
while ( $nick($active,%sn,a) != $null ) {
did -a _nicklist 1 $nick($active,%sn).pnick
%sn = %sn + 1
}
}
}
on *:APPACTIVE: {
if ( $appactive == $true ) && ( %nicklist == On ) {
dialog -o _nicklist _nicklist
}
elseif ( $appactive == $false ) && ( %nicklist == On ) {
dialog -n _nicklist _nicklist
}
}
on *:DIALOG:_nicklist:sclick:2: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -o $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
kick $active $remove($did(1,$did(1,%sn).sel).text,.,@,+,%) One Click Kick!
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:3: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -o $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
mode $active +b $address($remove($did(1,$did(1,%sn).sel).text,.,@,+,%),3)
kick $active $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:4: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -o $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
mode $active +b $address($remove($did(1,$did(1,%sn).sel).text,.,@,+,%),3)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:5: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
query $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:7: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active +o $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:8: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -o $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:9: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active +v $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:10: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -v $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:6: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active +h $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:12: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -h $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:11: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active +e $address($remove($did(1,$did(1,%sn).sel).text,.,@,+,%),3)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:13: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -e $address($remove($did(1,$did(1,%sn).sel).text,.,@,+,%),3)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:14: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
whois $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:15: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
ctcp $remove($did(1,$did(1,%sn).sel).text,.,@,+,%) PING
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:16: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active +a $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:17: {
%sn = 1
while ( $did(1,$did(1,%sn).sel).text != $null ) {
mode $active -a $remove($did(1,$did(1,%sn).sel).text,.,@,+,%)
%sn = %sn + 1
}
}
on *:DIALOG:_nicklist:sclick:50: {
run http://www.cyber-chats.com/main/about.html
}
dialog _nicklist {
title "Nick List"
size $calc($window(-1).w - 145) 94 145 610
option pixels
icon demon.ico, 0
icon 50, -30 -145 185 770, images/electricnick.bmp
icon 51, 6 376 133 46, images/D3m0nicN.png
list 1, 5 5 135 377, size extsel vsbar
button "Kick", 2, 5 418 65 18
button "Kick/Ban", 3, 75 418 65 18
button "Ban", 4, 5 442 65 20
button "Query", 5, 75 442 65 18
button "+ HelpOp", 6, 5 514 65 18
button "+ Op", 7, 5 466 65 18
button "- Op", 8, 75 466 65 18
button "+ Voice", 9, 5 490 65 18
button "- Voice", 10, 75 490 65 18
button "+ Exception", 11, 5 538 65 18
button "- HelpOp", 12, 75 514 65 18
button "- Exception", 13, 75 538 65 18
button "Whois", 14, 5 562 65 18
button "Ping", 15, 75 562 65 18
button "+ Protect", 16, 5 586 65 18
button "- Protect", 17, 75 586 65 18


hope this helps ya and ur welcome to rip anything u want outta it lol


D3m0nnet.com
#1813 15/12/02 05:30 AM
Joined: Dec 2002
Posts: 6
D
DeXoy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Dec 2002
Posts: 6
alright cool, but do you know how i would delete or clear the nicks section of the ini i made, each time?

#1814 15/12/02 05:39 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
/remini <inifile> <section> [item]
Deletes whole sections or single items in an INI file.

that would be a simple way to do it ...... but ud also have to make it refresh the list everytime it changed the ini ....


D3m0nnet.com
#1815 15/12/02 05:48 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
realized i forgot to add an example since mines not using an ini id do mine like this using on part and on join

on *:JOIN:*: {
if ( #* !iswm $active ) && ( %nicklist == On ) {
dialog -i _nicklist _nicklist
}
elseif ( #* iswm $active ) && ( %nicklist == On ) {
dialog -e _nicklist _nicklist
%sn = 1
did -ra _nicklist 1 $nick($active,%sn).pnick
%sn = 2
while ( $nick($active,%sn,a) != $null ) {
did -a _nicklist 1 $nick($active,%sn).pnick
%sn = %sn + 1
}
}
}


something like that would refresh it on every join ..... but ud have to add something for each way someone would come or go from the channel ..... ive left it out in mine cause well i really have found out its more of a PITA than id cared for at the time ..... and stayed with the regular nicklist ..... ud have to add something similar for parts joins kicks quits and so on and so forth to make sure the list got refreshed each and everytime someone came left or was forced out


D3m0nnet.com

Link Copied to Clipboard