mIRC Home    About    Download    Register    News    Help

Print Thread
#128778 30/08/05 07:17 AM
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
Hi, I would like to create a socket BOT. I use msock.dll and after the $dll(msock.dll,ircconnect,Server Port Pseudo Identd Fullname) the server ask me:
:ircnet.choopa.net 451 * :You have not registered

What are the operations for first connection into an IRC Server? shocked

#128779 30/08/05 08:36 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I've never used a DLL to make a connection to an IRC server, but I believe you have to send the USER 3 times

Send the USER parameter first then nickname.

Might be an idea to check the DLL documentation it maybe you only need to send USER once and the DLL strings it 3 times.

Code:
alias irc { sockopen irc irc.mysticirc.co.uk 6667 }

On *:Sockopen:irc: {
  sockwrite -tn irc USER $str($+(Andy,$chr(32)),3)
  sockwrite -tn irc NICK $+(Andy,$rand(1,999))
}

on 1:sockread:irc: {
  if ($sockerr > 0) return
  :irc
  sockread %irc
  if ($sockbr == 0) return
  if (!%irc) %irc = -
  echo 2 -a  $gettok(%irc,2-,58)
  goto irc
}


There's an example.

Type: /irc

-Andy

#128780 30/08/05 10:30 AM
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
The result is always the same:
Please wait while we process your connection.
You have not registered

What can I do to join channels, send message, etc.?
The dll work fine I think, but the server show me always "You have not registered".

#128781 31/08/05 05:53 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
try

Code:
alias sockbot { sockopen sockbot $1 $iif($2 == $null,6667,$2) }
on *:sockopen:sockbot:{
  sockwrite -n $sockname USER Sockbot "" "" :Socket Bot
  sockwrite -n $sockname NICK Sockbot
}
on *:sockread:sockbot:{
  sockread %sockbot
  if (ping * iswm %sockbot) { sockwrite -n $sockname $replace(%sockbot,PING,PONG) }
}



then type /sockbot servername e.g. /sockbot irc.server.com

Last edited by JigsZilla; 31/08/05 05:55 PM.

Link Copied to Clipboard