mIRC Home    About    Download    Register    News    Help

Print Thread
mesaging a variable #58000 27/10/03 08:40 PM
Joined: Dec 2002
Posts: 79
F
Fantas Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Dec 2002
Posts: 79
it messages the persons nick but not the # of times visited, it does count it right in variables, in variables %numjoe 3
but in channel has been here joe times
on *:join:#: {
{ who $nick }
}
raw 315:*:{
if (%num $+ $2 == $null) { set %num $+ $2 1 }
else { inc %num $+ $2 } { /msg %room $2 has been here %num $+ $2 times this week }
}
raw 352:*:{
if (lala isin $2) { set %room $2 }
}

Re: mesaging a variable #58001 27/10/03 09:31 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Need some evaluation brackets:

Code:
[color:green]; feel free to let this event in, but if your IAL is on, this is done automatically[/color]
[color:green]; so this line is totally obsolete.[/color]
on *:join:#: who $nick
[color:blue] [/color]
raw 315:*:{
  [color:green]; couldn't resist improving this bit a bit - I hate obsolete if statements[/color]
  inc %num [ $+ [ $2 ] ]
  if (%num [ $+ [ $2 ] ] > 1) msg %room $2 has been here %num [ $+ [ $2 ] ] times this week
} 
[color:blue] [/color]
raw 352:*: if (lala isin $2) set %room $2



DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: mesaging a variable #58002 27/10/03 09:39 PM
Joined: Dec 2002
Posts: 79
F
Fantas Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Dec 2002
Posts: 79
That did it thanks

Re: mesaging a variable #58003 28/10/03 12:02 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Code:
  inc %num [ $+ [ $2 ] ]
  if (%num [ $+ [ $2 ] ] > 1) msg %room $2 has been here %num [ $+ [ $2 ] ] times this week

You don't need evaluation brackets with /set, /inc and /dec. It's ok if you changed Fantas' /inc because of personal preference, I just want to clear up that his way was equally correct (and slightly faster). And a little detail (call me picky), it'd be slightly faster if you used
Code:
if (%num [ $+ [ $2 ] ] > 1) msg %room $2 has been here [color:blue]$ifmatch[/color] times this week



/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: mesaging a variable #58004 28/10/03 03:07 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Being consistent actually. If you use %num $+ $nick one time and %num [ $+ [ $nick ] ] the next, people tend to lose sight of them being the same.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius