mIRC Home    About    Download    Register    News    Help

Print Thread
#214019 14/07/09 02:36 AM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
I'm using xDaeMoN's snippet http://www.hawkee.com/snippet/841/
Code:

on *:START: { 
  hmake jcount 100 
  if ($isfile(jcount.dat)) hload jcount jcount.dat 
} 
 
on *:EXIT: hsave -o jcount jcount.dat 
 
on !*:JOIN:#: {
  if ( $hget(jcount,$+($network,.,$chan,.,$nick)) ) {
    tokenize 32 $v1
    var %t = $calc($1 + 1)
    .msg $chan Welcome Back $nick $+ . Last time you joined $chan was on $2 $+ , $duration($calc($ctime - $3)) ago $+ . (Your total visits: %t $+ )
    hadd -m jcount $+($network,.,$chan,.,$nick) %t $asctime(mm/dd/yyyy) $ctime
  }
  else { 
    hinc -m jcount $+($network,.,$chan,.,total.count)
    .msg $chan Welcome $nick $+ ! You're visitor $chr(35) $+ $hget(jcount,$+($network,.,$chan,.,total.count)) to join $chan $+ .
    hadd -m jcount $+($network,.,$chan,.,$nick) 1 $asctime(mm/dd/yyyy) $ctime
  }
}
 

The output is:

Welcome Back booth. Last time you joined #channelname was on 07/11/2009, 22min 12secs ago. (Your total visits: 6)

I would like it to be:

Welcome Back booth. Last time you joined #channelname was 5 days, 5 hours, 36 minutes, 57 seconds (Your total visits: 6)

booth #214021 14/07/09 03:28 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Replace
Code:
.msg $chan Welcome Back $nick $+ . Last time you joined $chan was on $2 $+ , $duration($calc($ctime - $3)) ago $+ . (Your total visits: %t $+ )
with
Code:
.msg $chan Welcome Back $nick $+ . Last time you joined $chan was $asctime($calc($ctime - $3)) ago. (Your total visits: %t $+ )


RusselB #214050 15/07/09 03:13 AM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
Thanks, but it didn't work. I now get:

Welcome Back booth. Last time you joined #channelname was Wed Dec 31 16:00:07 1969 ago. (Your total visits: 2)

I started with a new jcount.dat also.


booth #214053 15/07/09 06:25 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
The fact that you started with a new data file explains the reason for the odd time return, as the script needs a $ctime value from the data.
Since the data file is new, then the value the script is using, apparently, is 0.

Try with the older data file, as I can see no reason for it to not work, and have used a similar script myself for years.

You'll probably want to edit the $asctime to include formatting preferences to get the display in the order you want.
See /help $asctime for details.

booth #214334 29/07/09 11:10 AM
Joined: Apr 2009
Posts: 10
B
Pikka bird
Offline
Pikka bird
B
Joined: Apr 2009
Posts: 10
It already does teh 5day 4hours etc. just remove the $2 portion of the followin gline if you don't want it to show the date.

Code:
.msg $chan Welcome Back $nick $+ . Last time you joined $chan was on $2 $+ , $duration($calc($ctime - $3)) ago $+ . (Your total visits: %t $+ )

Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
nice script...works really well for me however i cant use it . Would have been perfect if you could select what channels for it to be active it. It greets to all and got me banned lol

ToRmEnTeD #214552 08/08/09 01:22 AM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
Here's one way to have it active on channels of your choice.

replace:
Code:
on !*:JOIN:#: {

with:
Code:
on !*:JOIN:#channel,#channel,#channel: {

Replace 'channel' with the channel names you wish it be active on.


Link Copied to Clipboard