mIRC Home    About    Download    Register    News    Help

Print Thread
on *:DIALOG:away:sclick:33: { #16973 26/03/03 11:06 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
this script has been driving me nuts it wont set the proper vars when ever i click the button it sets it as 0 and i dont know wtf is with it -_-
Code:
on *:DIALOG:away:sclick:33: {
  if ($did(away,22).sel == 1) { .set %away.lcolors 1 }
  elseif ($did(away,22).sel == 2) { .set %away.lcolors 2 }
  elseif ($did(away,22).sel == 3) { .set %away.lcolors 3 }
  elseif ($did(away,22).sel == Red) { .set %away.lcolors 4 }
  elseif ($did(away,22).sel == Dark Red) { .set %away.lcolors 5 }
  elseif ($did(away,22).sel == Purple) { .set %away.lcolors 6 }
  elseif ($did(away,22).sel == Orange) { .set %away.lcolors 7 }
  elseif ($did(away,22).sel == Yellow) { .set %away.lcolors 8 }
  elseif ($did(away,22).sel == Neon Green) { .set %away.lcolors 9 }
  elseif ($did(away,22).sel == Ocean Blue) { .set %away.lcolors 10 }
  elseif ($did(away,22).sel == Turquoise) { .set %away.lcolors 11 }
  elseif ($did(away,22).sel == Blue) { .set %away.lcolors 12 }
  elseif ($did(away,22).sel == Light Purple) { .set %away.lcolors 13 }
  elseif ($did(away,22).sel == Dark Grey) { .set %away.lcolors 14 }
  elseif ($did(away,22).sel == Light Grey) { .set %away.lcolors 15 }
  elseif ($did(away,22).sel == White) { .set %away.lcolors 0 }
}


Need amazing web design for low price: http://www.matrixn3t.net
Re: on *:DIALOG:away:sclick:33: { #16974 26/03/03 01:59 PM
Joined: Dec 2002
Posts: 143
A
Aubs Offline
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
From the help file:
Quote:
If used in the on dialog event, name is optional.


Also, try replacing the .sel to .text (this is the text that is stored in the combo, not it's item value

e.g. combo:
1 -Select Colour
2 -1
3 -2
4 -3
5 -Red
6 -Dark Red
7 -Purple
8 -Orange
9 -Yellow
10 -Neon Green
...etc

if you did if ($did(22).sel == 1) then it would return the Select Colour item
if you did if ($did(22).sel == 2) then it would return the 1 item
if you did if ($did(22).sel == 5) then it would return the Red item
something like that anyways!


Try this and see if it makes any difference:



Code:
on *:DIALOG:away:sclick:33: {
  if ($did(22).text == 1) { set %away.lcolors 1 }
  if ($did(22).text == 2) { set %away.lcolors 2 }
  if ($did(22).text == 3) { set %away.lcolors 3 }
  if ($did(22).text == Red) { set %away.lcolors 4 }
  if ($did(22).text == Dark Red) { set %away.lcolors 5 }
  if ($did(22).text == Purple) { set %away.lcolors 6 }
  if ($did(22).text == Orange) { set %away.lcolors 7 }
  if ($did(22).text == Yellow) { set %away.lcolors 8 }
  if ($did(22).text == Neon Green) { set %away.lcolors 9 }
  if ($did(22).text == Ocean Blue) { set %away.lcolors 10 }
  if ($did(22).text == Turquoise) { set %away.lcolors 11 }
  if ($did(22).text == Blue) { set %away.lcolors 12 }
  if ($did(22).text == Light Purple) { set %away.lcolors 13 }
  if ($did(22).text == Dark Grey) { set %away.lcolors 14 }
  if ($did(22).text == Light Grey) { set %away.lcolors 15 }
  if ($did(22).text == White) { set %away.lcolors 0 }
}



Aubs.
cool

Re: on *:DIALOG:away:sclick:33: { #16975 26/03/03 02:28 PM
Joined: Mar 2003
Posts: 31
G
GBX Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Mar 2003
Posts: 31
i am not sure if .text is the right choice for a list box
if it is not working, try .seltext instead of .text

Re: on *:DIALOG:away:sclick:33: { #16976 26/03/03 03:16 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
The solution below assumes that:

(1) control 22 is a combo or a listbox.
(2) your colors are listed in the same order as they appear in the ctrl+k box.
(3) 'white' is the first item, then black, dark blue, green etc.
Code:

on *:DIALOG:away:sclick:33: { set %away.lcolors $calc($did(22).sel - 1) }

Re: on *:DIALOG:away:sclick:33: { #16977 26/03/03 11:25 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
thx that helped alot the .text is right and yes it is a drop down box


Need amazing web design for low price: http://www.matrixn3t.net
Re: on *:DIALOG:away:sclick:33: { #16978 26/03/03 11:50 PM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
omfg no it wont work right wtf??? it dont work and sometimes it will sometimes it wont


Need amazing web design for low price: http://www.matrixn3t.net