mIRC Home    About    Download    Register    News    Help

Print Thread
#249065 12/11/14 11:19 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
This code is used to measure my lag, I would have to be modified to work for everyone?
Try changing $me for $2 or the nick and not work.
.lag fulanito

Code:
ON 1:INPUT:*:{ 
  if ($1 == .lag) { .ctcp $me sping $ticks $chan } 
}
#lagmeter on
ctcp *:sping:*:{ 
msg $3  2[4Lag2] 2[ $+ $calc($calc($ticks - $2) / 1000) $+ 2] }
#lagmeter end

Last edited by JuanAm; 12/11/14 11:48 PM.
JuanAm #249079 13/11/14 10:53 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
191 views and no answers frown
It is so difficult to modify this code?

JuanAm #249080 13/11/14 11:12 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try use this code:

Code:
ON *:INPUT:*:{ 
  if ($1 == .lag) { .enable #lagmeter | .ctcp $me sping $ticks $chan } 
}

ON *:TEXT:.*:#: {
  tokenize 32 $strip($1-,burci)
  if ($1 == .lag) {
    if (!$2) { .msg $chan [ $+ $nick $+ ]: Error, Not enough parameters, try again and enter an nickname! | return }
    if ($2 !ison $chan) { .msg $chan [ $+ $nick $+ ]: Error, Cannot find, the $qt($2) nickname is NOT on the channel! | return }
    if (%ctcp_nick) { .msg $chan [ $+ $nick $+ ]: Error, Already in use, try again later! | return }
    set -eu10 %ctcp_nick $2
    set -eu10 %ctcp_user $nick
    set -eu10 %ctcp_chan $chan
    .enable #lagmeter
    .ctcp $2 PING
  }
}
#lagmeter off
ctcp *:sping:*: { 
  msg $3  2[4Lag2] 2[ $+ $calc($calc($ticks - $2) / 1000) $+ 2]
  .disable #lagmeter
}
ON *:CTCPREPLY:PING*: {
  if (%ctcp_nick) && (%ctcp_nick == %ctcp_user) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: Your Ping is  $+ $calc($ctime - $2) $+  second(s). | goto end | return }
  if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). }
  :end
  unset %ctcp_*
  .disable #lagmeter
}
#lagmeter end


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #249088 14/11/14 01:04 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Originally Posted By: westor
Try use this code:

Code:
ON *:INPUT:*:{ 
  if ($1 == .lag) { .enable #lagmeter | .ctcp $me sping $ticks $chan } 
}

ON *:TEXT:.*:#: {
  tokenize 32 $strip($1-,burci)
  if ($1 == .lag) {
    if (!$2) { .msg $chan [ $+ $nick $+ ]: Error, Not enough parameters, try again and enter an nickname! | return }
    if ($2 !ison $chan) { .msg $chan [ $+ $nick $+ ]: Error, Cannot find, the $qt($2) nickname is NOT on the channel! | return }
    if (%ctcp_nick) { .msg $chan [ $+ $nick $+ ]: Error, Already in use, try again later! | return }
    set -eu10 %ctcp_nick $2
    set -eu10 %ctcp_user $nick
    set -eu10 %ctcp_chan $chan
    .enable #lagmeter
    .ctcp $2 PING
  }
}
#lagmeter off
ctcp *:sping:*: { 
  msg $3  2[4Lag2] 2[ $+ $calc($calc($ticks - $2) / 1000) $+ 2]
  .disable #lagmeter
}
ON *:CTCPREPLY:PING*: {
  if (%ctcp_nick) && (%ctcp_nick == %ctcp_user) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: Your Ping is  $+ $calc($ctime - $2) $+  second(s). | goto end | return }
  if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). }
  :end
  unset %ctcp_*
  .disable #lagmeter
}
#lagmeter end


the line "if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). }

returns:
[peter] The james Ping is 1408357463 second(s).

JuanAm #249089 14/11/14 02:33 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try replace that line with this:

Code:
  if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $2 $+  second(s). }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #249102 14/11/14 04:35 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Originally Posted By: westor
Try replace that line with this:

Code:
  if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). | halt }


It did not work.
I solved it by adding the halt command at the end of the line.

Code:
 The correct line is:

[code]if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). | halt }
[/code]

Thank westor for your contribution.


Last edited by JuanAm; 14/11/14 05:00 PM. Reason: Error
JuanAm #249103 14/11/14 04:54 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Yes, i fix the bug try use this code:

Code:
ON *:INPUT:*:{ 
  if ($1 == .lag) { .enable #lagmeter | .ctcp $me sping $ticks $chan } 
}

ON *:TEXT:.*:#: {
  tokenize 32 $strip($1-,burci)
  if ($1 == .lag) {
    if (!$2) { set -eu10 %ctcp_nick $nick | goto start | return }
    if ($2 !ison $chan) { .msg $chan [ $+ $nick $+ ]: Error, Cannot find, the $qt($2) nickname is NOT on the channel! | return }
    if (%ctcp_nick) { .msg $chan [ $+ $nick $+ ]: Error, Already in use, try again later! | return }
    set -eu10 %ctcp_nick $2
    :start
    set -eu10 %ctcp_user $nick
    set -eu10 %ctcp_chan $chan
    .enable #lagmeter
    .ctcp %ctcp_nick PING
  }
}
#lagmeter off
CTCP *:sping:*: { 
  haltdef
  msg $3  2[4Lag2] 2[ $+ $calc($calc($ticks - $2) / 1000) $+ 2]
  .disable #lagmeter
}
ON *:CTCPREPLY:PING*: {
  haltdef
  if (%ctcp_nick) && (%ctcp_nick == %ctcp_user) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: Your Ping is  $+ $calc($calc($ctime - $2) / 1000) $+  second(s). | goto end | return }
  if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($calc($ctime - $2) / 1000) $+  second(s). }
  :end
  unset %ctcp_*
  .disable #lagmeter
}
#lagmeter end


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #249105 14/11/14 04:56 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
I edited previous post and solved.
The correct line is:

Code:
if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). | halt }

Last edited by JuanAm; 14/11/14 04:59 PM.
JuanAm #249106 14/11/14 04:58 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Oh i didn't refresh it :P anyway try the new one.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #249107 14/11/14 05:00 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
The correct line is:

Code:
if (%ctcp_nick) { .msg %ctcp_chan [ $+ %ctcp_user $+ ]: The  $+ %ctcp_nick $+  Ping is  $+ $calc($ctime - $2) $+  second(s). | halt }

JuanAm #249108 14/11/14 05:19 PM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Sorry for previous editing and double post.

Your first code was fine, just needed to add the halt command at the end of that line.

Thank you !! smile

Last edited by JuanAm; 14/11/14 05:27 PM. Reason: My bad english :p

Link Copied to Clipboard