SaNCaK

miRC Auto Ping

Mar 17th, 2026
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.63 KB | None | 0 0
  1. menu menubar,channel {
  2.   • Ayar
  3.   .Auto Pinger {
  4.     aping
  5.   }
  6. }
  7. alias aping { if ($dialog(aping)) dialog -v aping | else dialog -m aping aping }
  8. alias -l _ping.dir { return $shortfn($scriptdir) }
  9. alias -l _ping.ini { return $shortfn($scriptdiraping.ini) }
  10. alias -l _ping.wini { writeini -n $_ping.ini $1 $2 $3 }
  11. alias -l _ping.rini { return $readini($_ping.ini,$1,$2) }
  12. alias -l _ping.d {
  13.   _ping.wini aping s y
  14.   _ping.wini aping u y
  15.   .enable #aping
  16.   _ping.wini aping r n
  17.   _ping.wini aping d 600
  18.   _ping.wini aping t !ping
  19.   if ($dialog(aping)) {
  20.     did -c $dname 1,7,12
  21.     did -r $dname 3,9
  22.     did -u $dname 11,13
  23.     did -a $dname 3 $_ping.rini(aping,d)
  24.     did -a $dname 9 $_ping.rini(aping,t)
  25.   }
  26. }
  27.  
  28. dialog aping {
  29.   title Auto Pinger
  30.   icon graph/sck.ico
  31.   size -1 -1 330 200
  32.  
  33.   check "Auto Ping to server",1,20 20 120 20
  34.   text "Delay :",2,150 23 50 20
  35.   edit "",3,195 20 70 20
  36.   text "Seconds",4,270 23 50 20
  37.   box "",5,10 5 310 45
  38.  
  39.   box "",6,10 43 310 110
  40.   check "Auto Ping to user",7,20 58 120 20
  41.   text "Trigger :",8,148 61 50 20
  42.   edit "",9,195 58 115 20
  43.  
  44.   text "Reply :",10,150 90 50 20
  45.   radio "Channel",11,195 88 70 20
  46.   radio "Notice",12,195 108 70 20
  47.   radio "Message",13,195 128 70 20
  48.  
  49.   box "",14,10 146 310 45
  50.   button "Default",15,20 162 70 20
  51.   button "Close",16,240 162 70 20,ok
  52. }
  53.  
  54. on *:dialog:aping:init:*:{
  55.   if ($_ping.rini(aping,s) = y) { did -c $dname 1 } | else { did -u $dname 1 }
  56.   if ($_ping.rini(aping,u) = y) && ($group(#aping) = on) { did -c $dname 7 } | else { did -u $dname 7 }
  57.  
  58.   if ($_ping.rini(aping,r) = c) { did -c $dname 11 }
  59.   if ($_ping.rini(aping,r) = n) { did -c $dname 12 }
  60.   if ($_ping.rini(aping,r) = m) { did -c $dname 13 }
  61.  
  62.   did -a $dname 3 $_ping.rini(aping,d)
  63.   did -a $dname 9 $_ping.rini(aping,t)
  64. }
  65.  
  66. on *:dialog:aping:sclick:*:{
  67.   if ($did = 1) { if ($did($dname,$did).state == 1) { _ping.wini aping s y } | else { _ping.wini aping s n } }
  68.   if ($did = 7) { if ($did($dname,$did).state == 1) { _ping.wini aping u y | .enable #aping } | else { _ping.wini aping u n | .disable #aping } }
  69.  
  70.   if ($did = 11) { if ($did($dname,$did).state == 1) { _ping.wini aping r c } }
  71.   if ($did = 12) { if ($did($dname,$did).state == 1) { _ping.wini aping r n } }
  72.   if ($did = 13) { if ($did($dname,$did).state == 1) { _ping.wini aping r m } }
  73.  
  74.   if ($did = 15) { _ping.d }
  75. }
  76.  
  77. on *:dialog:aping:edit:*:{
  78.   if ($did = 3) { if ($did($dname,$did).text isnum) { _ping.wini aping d $did($dname,$did).text } }
  79.   if ($did = 9) { _ping.wini aping t $did($dname,$did).text }
  80. }
  81.  
  82. on *:connect:{ if ($_ping.rini(aping,s) = y) { .timeraping 0 $_ping.rini(aping,d) raw -q ping $me } | else { halt } }
  83. #aping on
  84. on *:text:*:#:{
  85.   if ($_ping.rini(aping,t) isin $1-) && ($nick != $me) { _ping.wini aping tc $chan | ctcb $nick ping }
  86. }
  87. on *:ctcpreply:ping*:{
  88.   if ($nick != $me) {
  89.     var %aping_ = 0
  90.     %aping_ = $ctime - $2
  91.     if ($_ping.rini(aping,r) = c) { _xmsg.c3 $_ping.rini(aping,tc) (Auto Pinger) $nick : Your Ping reply from $remove($address($me,2),*!*@) ( $+ $whois.country($remove($address($me,2),*!*@)) $+ ) in $server $+ : $+ $port is $duration(%aping_) - %name }
  92.     if ($_ping.rini(aping,r) = n) { notice.p $nick (Auto Pinger) Your Ping reply from $remove($address($me,2),*!*@) ( $+ $whois.country($remove($address($me,2),*!*@)) $+ ) in $server $+ : $+ $port is $duration(%aping_) - %name }
  93.     if ($_ping.rini(aping,r) = m) { _xmsg.q2 $nick (Auto Pinger) Your Ping reply from $remove($address($me,2),*!*@) ( $+ $whois.country($remove($address($me,2),*!*@)) $+ ) in $server $+ : $+ $port is $duration(%aping_) - %name }
  94.     halt
  95.   }
  96. }
  97. #aping end
  98.  
Tags: #ping #mIRC
Advertisement
Add Comment
Please, Sign In to add comment