mIRC Home    About    Download    Register    News    Help

Print Thread
#57965 27/10/03 04:22 PM
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
not sure how to word this,m but I need to have a script set a unuiqe variable, such as %idNick1 %idnick2 etc when particular nicks joins the channel. I've seen it in a few scripts but it doesn't make any sense to me.

Thanks smile

#57966 27/10/03 04:28 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
on *:JOIN:#:{
  set % $+ $nick 1
}
on *:PART:#:{
  unset % $+ $nick
}

Sets %nick to 1 when they join a channel and unsets it when they part.

#57967 27/10/03 04:32 PM
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
Thanks Collevtive & EVH. The solution was far to easy i see. but it helps ALOT

Last edited by Dingo; 27/10/03 04:33 PM.
#57968 27/10/03 04:33 PM
Joined: Oct 2003
Posts: 273
E
EVH Offline
Fjord artisan
Offline
Fjord artisan
E
Joined: Oct 2003
Posts: 273
Sorry man .. didn't mean to step on your toes smile

#57969 27/10/03 04:34 PM
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
I've found you can never have too much help wink

Last edited by Dingo; 27/10/03 04:36 PM.
#57970 27/10/03 04:49 PM
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
another question:

once the variable has been set ( /set %id +$nick ), is there a way to make the script know what the variable ends up as so something more can be done to its contents?

#57971 27/10/03 05:44 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
$var might be useful?


Code:
//if ( khaled isgod ) echo yes | else echo no
#57972 28/10/03 07:16 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
___ Dynamic Variables 101: ___

[Setting your dynamic variable]
mIRC 5.x: /set %MyVar. [ $+ [ $nick ] ] DATA
mIRC 5.x: /var % [ $+ [ $me ] $+ . $+ [ $ctime ] ] = DATA
mIRC 5.x: /set %MyArray. [ $+ [ %x ] $+ . $+ [ %y ] $+ . $+ [ %z ] ] DATA
mIRC 6.x: /var $+(%,MyVar.,$nick) = DATA
mIRC 6.x: /set $+(%,%xyzzy,.,%yatta,.,%zig) DATA
mIRC 6.1x: /var %MyVar. $+ $active = DATA
mIRC 6.1x: /set % $+ $network $+ . $+ $chan DATA

Those last two may also work in earlier versions of 6.x, though personally I prefer using $+(x,y,z)

[Reading your dynamic variable]
mIRC 5.x: /echo -a %MyVar. [ $+ [ $nick ] ]
mIRC 5.x: /echo -a % [ $+ [ $me ] $+ . $+ [ $ctime ] ]
mIRC 6.x: /echo -a $eval($+(%,MyVar.,$nick),2)
mIRC 6.x: /echo -a $($+(%,%xyzzy,.,%yatta,.,%zig),2)

Note that $(...,2) is short for $eval(...,2)
And $+(...) is the same as using many $+ 's

I'm sure there are other methods, but these are the most commonly applied.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#57973 28/10/03 10:14 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Actually the /set %blah $+ $ident <value> format works since as long as I can remember myself using dynamic variables (about 5.5 and later).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#57974 28/10/03 10:13 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Really? I've always found myself using brackets even though they do seem unnecessary for /setting a var. Some reason I was certain %blah tried evaluating prematurely if brackets weren't used.

* Raccoon learns something new.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard