mIRC Home    About    Download    Register    News    Help

Print Thread
#239629 11/11/12 10:27 AM
Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
hi all,

I am writing an Access List Dialog for my mirc, i would like a small amount of help.....

i have the dialog and it looks how i want it too look but i cant get the data from the server to fill the list box.

if i type /cs accss # list * it shows the data required in the status window of mirc, i would like to know how to get this data to show in my list box

My Dialog..

Code:
DIALOG AccessList {
  title "Access List"
  size -1 -1 500 330

  list 1, 10 10 480 250, vsbar
  button "Add Owner" 2, 10 265 150 25
  button "Add Host"3, 175 265 150 25
  button "Add Half Host" 4, 340 265 150 25
  button "Remove Selected", 5, 10 295 150 25
  button "Refresh List", 6, 175 295 150 25
  button "Exit", 7, 340 295 150 25, ok

}


i know it needs to be an ON init event that is as far as i can go, i used to do mirc scripting years ago but have since become very rusty

this is what i tried..

Code:
on *:dialog:AccessList:init:0: {
  did -a AccessList 1 CSAccessList
}

alias CSAccessList { CHANSERV ACCESS $chan($active) LIST * }


but ofcause the list box just prints CSAccessList

thankyou in advance for any and all help.

also if you like my dialog layout feel free to use it smile

Last edited by TerryG; 11/11/12 10:29 AM.
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You need to send the LIST command to ChanServ on init, yes.
But then you need (to enable) an on NOTICE event to catch what ChanServ sends to you and fill the dialog list with the replies.

5618 #239633 11/11/12 01:11 PM
Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
Originally Posted By: 5618

But then you need (to enable) an on NOTICE event to catch what ChanServ sends to you and fill the dialog list with the replies.


this is where i am having an issue then, so would you be able to give me a simple example of how to do this

My Output In Status..
Code:
-ChanServ- Access list for #ChanName:
-
-ChanServ-   Num   Lev  Nick
-
-ChanServ-     1  9999  ChatNick1
-
-ChanServ-     2  5  ChatNick2
-
-ChanServ-     3  4  ChatNick3
-
-ChanServ- End of access list.
-


Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
Ok i have got the data i needed after a bit of playing with on notice.... so my access list now displays user name and level, now is it possiable to split the list into sections ie...

Code:
|  Chat Nick   |     Mask     |  Access Level |
|              |              |               |
| ChanNick1    | *@*          | Founder       |
| ChatNick2    | *@*          | OP            |
| ChatNick3    | *@*          | Half OP       |
|              |              |               |


if so how do i go about doing it, im keen to learn so a good example should put me in the right direction.

also i have changed the level numbers to words whilst getting the data from on notice event so 9999 = founder 5 = op 4 = half op

Once again thanx for any and all help.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: TerryG
also i have changed the level numbers to words whilst getting the data from on notice event so 9999 = founder 5 = op 4 = half op
That's only true if no one touched default levels. If they had been changed, it'd be mighty misleading smile

Originally Posted By: ANOPE chanserv help: "access levels"
Founder Full access to ChanServ functions; automatic opping upon entering channel.
10 Access to AKICK command; automatic opping.
5 Automatic opping.
4 Automatic halfopping.
3 Automatic voicing.
0 No special privileges; can be opped by other ops (unless secure-ops is set).
<0 May not be opped.
These levels may be changed, or new ones added, using the LEVELS command; type /msg ChanServ HELP LEVELS for information.


Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
Its My Own IRC server and the option to change them is disabled.

Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
Ok so after a bit of a comprimise i have somthing that works but i had to use 2 list boxes, i would like it in 1 clean list, is there any way to fix what i have done to allow only 1 list

Code:
DIALOG AccessList {
  title "Access List"
  size -1 -1 500 350

  list 1, 10 30 240 250, vsbar
  list 2, 250 30 240 250, vsbar
  button "Add Owner" 3, 10 285 150 25
  button "Add Host"4, 175 285 150 25
  button "Add Half Host" 5, 340 285 150 25
  button "Remove Selected", 6, 10 315 150 25
  button "Refresh List", 7, 175 315 150 25
  button "Exit", 8, 340 315 150 25, ok
  text "", 9, 10 10 480 15, center
}

ON *:NOTICE:*:*: { 
  if ($nick == ChanServ) {
    if ($2 == 5) {
      var %lvl Host
      did -a AccessList 1 $3
      did -a AccessList 2 %lvl
    }
    elseif ($2 == 4) {
      var %lvl Half Host
      did -a AccessList 1 $3
      did -a AccessList 2 %lvl
    }
    elseif ($2 == 3) {
      var %lvl Voice
      did -a AccessList 1 $3
      did -a AccessList 2 %lvl
    }
    elseif ($2 == 9999) {
      var %lvl Owner
      did -a AccessList 1 $3
      did -a AccessList 2 %lvl
    }
  }
}

on *:dialog:AccessList:init:0: {
  did -a AccessList 9 Channel Access List For $chan($active)
  CSAccessList
}

ON *:DIALOG:AccessList:SCLICK:3: { CHANSERV ACCESS $chan($active) ADD $$?="Enter A Chat Nick" 9999 } / { RefreshList }
ON *:DIALOG:AccessList:SCLICK:4: { CHANSERV ACCESS $chan($active) ADD $$?="Enter A Chat Nick" 5 } / { RefreshList }
ON *:DIALOG:AccessList:SCLICK:5: { CHANSERV ACCESS $chan($active) ADD $$?="Enter A Chat Nick" 4 } / { RefreshList }
ON *:DIALOG:AccessList:SCLICK:6: { CHANSERV ACCESS $chan($active) DEL $did(1).SELTEXT } / { RefreshList }
ON *:DIALOG:AccessList:SCLICK:7: { RefreshList }


alias RefreshList {
  did -r AccessList 1
  did -r AccessList 2
  CSAccessList
}

alias AccessList { dialog -m AccessList AccessList }
alias CSAccessList { CHANSERV ACCESS $chan($active) LIST }



Thanx

Joined: Nov 2012
Posts: 7
T
TerryG Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Nov 2012
Posts: 7
Bump!


Link Copied to Clipboard