mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
I just added this lines in the script:

elseif (($did == 9) && ($did($dname,2).sel != $null)) {
var %newaddress = $$input(Add address:, e, , $did($dname,2).seltext)
if (%newaddress == $null) { halt }
.auser 2 %newaddress
did -o $dname 2 $did($dname,2).sel %newaddress
}

It seems like the error is in the bold text. Please take a look in the end of the code below:

Code:
dialog ctcp.admin {
  title "CTCP Admin"
  size -1 -1 400 205
  option pixels
  text "Address List:", 1, 10 8 65 14
  list 2, 10 25 308 88, size
  check "Enable", 3, 10 163 80 17
  check "Away only", 4, 10 183 81 17
  button "Remove", 5, 323 55 65 25
  button "Edit", 6, 323 85 65 25
  button "OK", 7, 253 175 65 25, ok
  button "Cancel", 8, 323 175 65 25, cancel
  text "By giving people ctcp access they get full control over your client, and can use all commands. It's also possible to turn on the away only function, that allows access only when your away.", 10, 10 118 381 42
  button "Add", 9, 323 25 65 25
}

on *:dialog:ctcp.admin:init:*: {
  if (%ctcp.admin == on) did -c $dname 3
  if (%ctcp.admin.only == on) did -c $dname 4
  var %i = $ulist(*,2,0) 
  var %c = 1 
  while (%c <= %i) { 
    did -a $dname 2 $ulist(*,2,%c) 
    inc %c 
  } 
} 

on *:dialog:ctcp.admin:sclick:*: {
  if ($did(3).state == 1) { set %ctcp.admin on } | else { set %ctcp.admin off }
  if ($did(4).state == 1) { set %ctcp.admin.only on } | else { set %ctcp.admin.only off }
  if (($did == 5) && ($did($dname,2).sel != $null)) { 
    .ruser $did($dname,2).seltext 
    did -d $dname 2 $did($dname,2).sel 
  }
  elseif (($did == 6) && ($did($dname,2).sel != $null)) { 
    var %newaddress = $$input(Edit address:, e, , $did($dname,2).seltext)
    if (%newaddress == $null) { halt } 
    .ruser $did($dname,2).seltext 
    .auser 2 %newaddress 
    did -o $dname 2 $did($dname,2).sel %newaddress 
  }
  elseif (($did == 9) && ($did($dname,2).sel != $null)) { 
    var %newaddress = $$input(Add address:, e, , $did($dname,2).seltext)
    if (%newaddress == $null) { halt } 
    .auser 2 %newaddress 
    did -o $dname 2 $did($dname,2).sel %newaddress
  }
}


Whats wrong?

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
You ,should reference to your /help dialogs

did -o $dname ID = set on top of all other IDS

What it looks like your trying to do is add the info from add to the list in your dialog.

You need to use the format of did -a $dname ID the -a switch allows you to add info to a specific location has -r clears it

elseif (($did == 9) && ($did($dname,2).sel != $null)) {
var %newaddress = $$input(Add address:, e, , $did($dname,2).seltext)
if (%newaddress == $null) { halt }
.auser 2 %newaddress
did
-a $dname 2 $did($dname,2).sel %newaddress
}


also in the string of did -a etc.. that there why are you using $did($dname,2).sel ,instead of just %newaddress, if you wish not to have anything in your list before the address delete that string


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Thank you.

But there is a problem. When I type for example *!*@test.com it adds 0 *!*@test.com

Last edited by Deep3D; 01/04/08 01:44 PM.
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
That's why i said "also in the string of did -a etc.. that there why are you using $did($dname,2).sel ,instead of just %newaddress, if you wish not to have anything in your list before the address delete that string" in the last reply, you have to remove it

it should look like... did -a $dname 2 %newaddress


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Work perfect, thanks! cool


Link Copied to Clipboard