mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
How to do this automatically send a ping to the server thought a socket?
This is a little piece of the connection info which the socket must send:

:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Looking up your hostname...
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Found your hostname, cached
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Checking Ident
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Got Ident response
PING :1784155698
:tongue:enguin.uk.eu.blitzed.org 451 Triviant join :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :If you are having difficulty connecting, try typing /QUOTE PONG 1784155698
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.

I have this in my remote:

on 1:sockread:Trivia:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
echo 4 %temp
goto nextread
}

anybody now how to help me??? confused

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
on *:sockread:trivia:{
if $sockerr { return }
var %triv
sockread %triv
tokenize 32 %triv
if $11 == /QUOTE { quote $12-13 }
}


New username: hixxy
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
it doesn't work? :S

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
change the: if $11 == /QUOTE...
to: echo -a $1

tell me what it echo's


New username: hixxy
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Looking up your hostname...
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Found your hostname, cached
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Checking Ident
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :*** Got Ident response
PING :1484238029
:tongue:enguin.uk.eu.blitzed.org 451 Triviant join :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
:tongue:enguin.uk.eu.blitzed.org NOTICE AUTH :If you are having difficulty connecting, try typing /QUOTE PONG 1484238029
:tongue:enguin.uk.eu.blitzed.org 451 Triviant privmsg :Register first.
ERROR :Closing Link: 0.0.0.0 (Connection Timed Out)

Last edited by jeffvd15; 19/01/04 03:46 PM.
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
on *:sockread:trivia:{
if $sockerr { return }
var %triv
sockread %triv
tokenize 32 %triv
if $12 == /QUOTE { sockwrite -n trivia quote $13-14 }
}


New username: hixxy
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
nope, doesn't work neither

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
no because then it would be: quote /quote $13-14


New username: hixxy
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
nope it doesn't work, it won't respone the PING

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You need to respond to this
  • PING :1484238029

tokenize 32 %triv
if $1 == PING { sockwrite -n trivia PONG $2 }

Joined: Sep 2003
Posts: 156
B
Vogon poet
Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
I hope that will help you out
Socket's user name, fullname and nick should be send to server firstly:
Code:
on *:sockopen:trivia:{
sockwrite -n $sockname USER user . . fullname
sockwrite -n $sockname NICK trivia 
}
on *:sockread:trivia:{
if ($sockerr > 0) return
var %triv
sockread %triv
tokenize 32 %triv
if ($1 == PING) sockwrite -n $sockname PONG $2 
if (/quote isin $1-) GET_NUM $1-
if ($2 == 451) sockwrite -n $sockname QUOTE PONG %tmp~
}

alias GET_NUM {
var %i = 1
while $gettok($1-,%i,32) {
if ($left($ifmatch,1) isnum) set -u15 %tmp~ $gettok($1-,%i,32)
inc %i
}
}



Last edited by bleach; 19/01/04 05:12 PM.
Joined: Jan 2004
Posts: 11
J
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 11
yes it works. thankyou very much! smile

Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
You can't connect because you don't send all info what the ircd need to accept your connection..
Use that.

Code:
on 1:sockopen:Trivia:{
  sockwrite -n $sockname NICK BotNick
  sockwrite -n $sockname USER BotIdent "" "" :Full Name Zz
}

on 1:sockread:Trivia:{
  echo -s Z $sock($sockname).ip
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  if ($sockbr == 0) return
  if (%temp == $null) %temp = -
  echo 4 %temp
  .tokenize 32 %temp
  if ($1 == PING) sockwrite -n $sockname PONG $right($2,-1)
  goto nextread
}


mIRC Chm Help 6.16.0.3 Full Anchored!
Joined: Sep 2003
Posts: 156
B
Vogon poet
Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
no probs smile

Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Ops.. My post was too late ;P Can't edit now ;P


mIRC Chm Help 6.16.0.3 Full Anchored!

Link Copied to Clipboard