mIRC Home    About    Download    Register    News    Help

Print Thread
#198330 26/04/08 07:30 AM
Joined: Apr 2008
Posts: 10
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Apr 2008
Posts: 10
Hi, i got a bit of a brain tickler. I have not been able to figure out:

Code:
 on *:TEXT:*:%self.joinchannels: {
  .set %user. $+ $nick $+ .pastline $+([%user. $+ $nick $+ .thisline])
  .set %user. $+ $nick $+ .thisline $1-
}


here i can set %user.<NICKNAME>.thisline with the current text, but to set %user.<NICKNAME>.pastline with %user.<NICKNAME>.thisline how ever i have tried doesnt set it with "thisline"'s text at all, current above sets the text as %user.<NICKNAME>.pastline [%user.<NICKNAME>.thisline]

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:text:*:%sefl.joinchannels:{
  set $+(%,user.,$nick,.pastline) $($+(%,user.,$nick,.thisline),2)
  set $+(%,user.,$nick,.thisline) $1-
}


I honestly don't remember where I learned that, but it is correct.
Note: If you want to use local variables (ie: one's that unset when the script is done), use /set -l not /var

In another topic I was shown that dynamic variables set in this method can not be done properly using /var

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
//var %x. $+ $time t | echo -a %x. [ $+ [ $time ] ]


Works fine.

The only difference seems to be that the '=' in /var is treated as text if the variable name is dynamic.

Code:
//var %x. $+ $time = t | echo -a %x. [ $+ [ $time ] ]

hixxy #198344 26/04/08 05:59 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yes, I agree that doing it that way works, but
Code:
//var $+(%x.,$time) t | echo -a $($+(%x.,$time),2)
just returns the same as $time. The difference is in the formation of the dynamic variable.

Joined: Apr 2008
Posts: 10
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Apr 2008
Posts: 10
Originally Posted By: RusselB
Code:
on *:text:*:%sefl.joinchannels:{
  set $+(%,user.,$nick,.pastline) $($+(%,user.,$nick,.thisline),2)
  set $+(%,user.,$nick,.thisline) $1-
}


I honestly don't remember where I learned that, but it is correct.
Note: If you want to use local variables (ie: one's that unset when the script is done), use /set -l not /var

In another topic I was shown that dynamic variables set in this method can not be done properly using /var


OMG! Thank you, that soooo worked! thanks a million^10!


Link Copied to Clipboard