mIRC Home    About    Download    Register    News    Help

Print Thread
#94278 15/08/04 08:26 AM
Joined: Sep 2003
Posts: 29
S
sopia Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 29
on *:text:!ping:#:{ ctcp $nick ping }
on *:ctcpreply:*ping*:{
if ($2 == $null) { halt }
var %pt = $ctime - $2
if (%pt < 0) { %pt = 0 }
msg $chan $nick 4Your Ping reply is: [12 $+ $duration(%pt) $+ 4] I'm your ping servant.
}
The msg $chan doesn't work.( I want the msg to shoot in the channel where the user type in the word !ping) What could be wrong?
Help please.


Keep learning everyday, you'll be a genius.
#94279 15/08/04 09:09 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
The ctcp reply is not in the channel so you cant use $chan
use #channelname
and you should put some extra brackets in
_____________________________________________________
on *:text:!pingme:#:{ ctcp $nick ping } }
on *:ctcpreply:*ping*:{
if ($2 == $null) { halt }
var %pt = $ctime - $2
if (%pt < 0) { %pt = 0 }
.msg
#channel $nick 4Your Ping reply is: [12 $+ $duration(%pt) $+ 4] I'm your ping servant.
}

}
__________________________________________________
____
parts in red are the changes

#94280 15/08/04 10:10 AM
Joined: Sep 2003
Posts: 29
S
sopia Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 29
The ctcp reply is not in the channel so you cant use $chan
use #channelname <-- this is my problem, If i'm in another channel then the user who type in the word !ping, the reply would not shoot in that other channel , instead it will shoot in the #channelname. Is there a way around to do this? I dont want to add many #channelname , just one $chan will do. Is it possible.


Keep learning everyday, you'll be a genius.
#94281 15/08/04 10:36 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You would need to set a variable with the persons channel.


on *:text:!ping:#:{ ctcp $nick ping | hadd -m pings $nick $chan }

Then,

on *:ctcpreply:*ping*:{
if (($2) && ($hget(pings,$nick))) {
var %pt = $ctime - $2
if (%pt < 0) { %pt = 0 }
msg $hget(pings,$nick) $nick 4Your Ping reply is: [12 $+ $duration(%pt) $+ 4] I'm your ping servant.
.hdel pings $nick
}
}

Try something like that.

Eamonn.

#94282 15/08/04 10:39 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
code:
_____________________________________________________________
[color:blue:]on *:text:!ping:#:{ set[/color] %channel $chan | .ctcp $nick ping } }
on *:ctcpreply:*ping*:{
if ($2 == $null) {
unset %channel | halt }
var %pt = $ctime - $2
if (%pt < 0) { %pt = 0 }
.msg
%channel $nick 4Your Ping reply is: [12 $+ $duration(%pt) $+ 4] I'm your ping servant.
}
}

____________________________________________________________
Hope That Works Ok
laugh
oops
some1 beat me to it lol
use his it prolly works better

Last edited by whatsthedillio; 15/08/04 10:44 AM.
#94283 15/08/04 10:48 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Yours would work to a degree, if only one person at a time used the script, if person1 typed !ping in #chan1, and person2 typed it in #chan2 at the same time, both replies would goto #chan2.


Eamonn.

#94284 15/08/04 11:28 AM
Joined: Sep 2003
Posts: 29
S
sopia Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 29
hehe you guys, it doesn't matter whose work better, the point is that you guys are willing to help. Thank you both for the help...


Keep learning everyday, you'll be a genius.

Link Copied to Clipboard