mIRC Home    About    Download    Register    News    Help

Print Thread
#82279 07/05/04 04:03 PM
Joined: Sep 2003
Posts: 19
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2003
Posts: 19
I'm tinkering around with the /Dialog and such, and to help quiet a few of my friends, im working on making a dialog that will make it easier for setting the lesser know, but still useful channel modes. Only problem is, i need a way to associate the dialog to the channel window it was opened from.

for example, i open the dialog from a channel popup in #bob, the use $chan(<channame>).mode to determine what modes are currently set on that channel, along with a set of if/thens to set the checkboxes (checked if the mode is on, not checked if the mode is off) i thought i could use $chan($chan).mode in thinking that the dialog init event wuold recoginise #bob as the 'parent' but that doesn't work. any help?
Code:
dialog sample {
  title "ChanMode+"
  size -1 -1 200 460
  option pixels

  check "Admin Only Chan (A)",1,12 6 180 13
  check "Color Ban (c)",2,12 24 180 13
  check "No CTCP (C)",3,12 42 180 13
  check "G-rated (G)",4, 12 60 180 13
  check "Reged name to talk (M)",5,12 78 180 13
  check "Invite Required (i)",6,12 96 180 13
  check "/knock not allowed (K)",7,12 114 180 13
  check "Moderated (m)",8,12 132 180 13

  check "No Nick Changes (N)",9,12 150 180 13
  check "No msgs from outside the chan (n)",10,12 168 190 13
  check "Only IRCops can join(O)",11,12 186 180 13
  check "Private Chan (p)",12,12 204 180 13
  check "U:Lined can only kick (Q)",13,12 222 180 13
  check "Reged Nick to Join (R)",14,12 240 180 13
  check "Strip incomming colors (S)",15,12 258 180 13
  check "Secret Chan (s)",16,12 276 180 13
  check "OPs only set Topic (t)",17,12 294 180 13
  check "No /notice in chan (T)",18,12 312 180 13
  check "Auditorium (u)",19,12 330 180 13
  check "/invite not allowed (V)",20,12 348 180 13
  check "Only SSL clients may join (z)",21,12 366 180 13

  text "Please note that some modes",400,12 382 190 13
  text "can ONLY be set by ChanOPs or",401,12 396 190 13
  text "IRCOps.",402,12 412 190 13

  button "Apply",100,12 436 80 20,ok
  button "Cancel",101,108 436 80 20,cancel
}
on 1:dialog:sample:init:* {
  if (A isincs $chan($chan).mode) { /did -c sample 1 }
  if (c isincs $chan($chan).mode) { /did -c sample 2 }
  if (C isincs $chan($chan).mode) { /did -c sample 3 }
  if (G isincs $chan($chan).mode) { /did -c sample 4 }
  if (M isincs $chan($chan).mode) { /did -c sample 5 }
  if (i isincs $chan($chan).mode) { /did -c sample 6 }
  if (K isincs $chan($chan).mode) { /did -c sample 7 }
  if (m isincs $chan($chan).mode) { /did -c sample 8 }
  if (N isincs $chan($chan).mode) { /did -c sample 9 }
  if (n isincs $chan($chan).mode) { /did -c sample 10 }
  if (O isincs $chan($chan).mode) { /did -c sample 11 }
  if (p isincs $chan($chan).mode) { /did -c sample 12 }
  if (Q isincs $chan($chan).mode) { /did -c sample 13 }
  if (R isincs $chan($chan).mode) { /did -c sample 14 }
  if (S isincs $chan($chan).mode) { /did -c sample 15 }
  if (s isincs $chan($chan).mode) { /did -c sample 16 }
  if (t isincs $chan($chan).mode) { /did -c sample 17 }
  if (T isincs $chan($chan).mode) { /did -c sample 18 }
  if (u isincs $chan($chan).mode) { /did -c sample 19 }
  if (V isincs $chan($chan).mode) { /did -c sample 20 }
  if (z isincs $chan($chan).mode) { /did -c sample 21 }
}
 

thats what i have so far. if i replace $chan($chan).mode with an actualy channel name i am on, it will work as i want it to. I'm jsut looking to get the $chan to refer to the channel the dialog was called from and im having problems figuring out how to do it.


w00f!
#82280 07/05/04 04:11 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
$iif($chan(0),$chan($iif($active ischan,$active,$chan(1))).mode)

In future, please post scripting questions in "scripts and popups", thanks. smile


New username: hixxy

Link Copied to Clipboard