mIRC Home    About    Download    Register    News    Help

Print Thread
#142249 17/02/06 07:34 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The following is a bit of code from a dialog that I'm making.
This section of code works fine, if the network that I've got selected in ID 3 matches the network that the dialog was started on.
If I select a different network, the channels (ID 6) get generated no problem, but the nicks for the selected channel aren't being generated (almost as if there was no one in the room, but that can't be since I have to be in the room for the channel name to be generated)

Any ideas/hints/solutions?
Code:
 on *:dialog:Channel_Control:init:*:{
  .scon -at1 did -va $dname 3 $!network
}
on *:dialog:Channel_Control:sclick:3:{
  did -vr $dname 6
  did -hr $dname 9
  var %a = 1,%b = $chan(0)
  .scon $did(3).sel
  while %a <= %b {
    did -va $dname 6 $chan(%a)
    inc %a
  }
}
on *:dialog:Channel_Control:sclick:6:{
  did -vr $dname 9
  var %a = 1,%b = $nick($did(6).seltext,0)
  .scon $did(3).sel
  while %a <= %b {
    did -a $dname 9 $nick($did(6).seltext,%a)
    inc %a
  }
}
 

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You should be setting %b after the /scon (in both cases).

Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks. I moved the /scon line to the other side of the variable settings, and it works fine now.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
There's no point in prefixing scon with a dot btw, as scon doesn't print anything to the screen.


Gone.
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
habit, and it doesn't hurt. I'll worry about the single character that it takes up when (and if) I need to.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You shouldn't worry about that one byte, nor the fact that it doesn't hurt, it simply looks stupid is all.

It is generally a thing that unexperienced scripters do, as they are uncertain about whether a dot will have an effect or not, so they add it just to be certain. In other words it gives an unexperienced/newbie look to your code. But hey, you code entirely as you want of course, I mean, it's not up to me to say how you should code, although I'd find it a shame if people would copy your habit and start prefixing commands with dots where it serves no purpose whatsoever. Looks incredibly newbish. Btw if it's a habit why don't any of the other commands have the dot prefix then o.O?

EDIT: removed some rambling


Gone.

Link Copied to Clipboard