mIRC Homepage
Posted By: EviL_SmUrF Attempting to get back into sockets... - 01/01/05 09:53 PM
Well, I am attempting to get back into mirc scripting cause I had a pretty good idea with something I wanted to create, but am having some problems with the scripting. I am running this code on 2 machines on my LAN. one is used to send the data, another to recieve it. For some reason, the receiving one sends the "handshake", but the other one never recieves it and does what it is supposed to do, IE it never echoes out "handshake recieved from %name $+ !" like it is supposed to do when it reads in the "handshake"

What am I doing wrong with this code?

Thanks for your help!!

Here is an example of what is happening:

Machine 1, I type /imlisten
Machine 2: I type /imsend to get the ball rolling.

Machine 1:

Socket open... waiting for connection.
Connection being established.
Sending handshake...
Handshake sent.. awaiting response.

Machine 2:

Attempting to send...
Connection established

That is how far it gets.


Code:
alias imsend { 
  /sockopen imsend 192.168.1.103 22486
  echo Attempting to send...
}

on *:sockopen:imsend: {
  echo Connection established
}


alias imlisten { 
  /socklisten imlisten 22486
  echo Socket open... waiting for connection.
}

on *:socklisten:imlisten: {
  /sockaccept handshake
  echo Connection being established.
  echo Sending handshake...
  /sockwrite handshake handshake %name %password $ip
}

on *:sockwrite:handshake: {
  echo Handshake sent.. awaiting response.
}

on *:sockread:handshake: {
  /sockread -f %handshake
  set %name $gettok(%handshake,2,32)
  echo Handshake recieved from %name $+ !
}
Posted By: Online Re: Attempting to get back into sockets... - 01/01/05 10:18 PM
Code:
on *:sockread:[color:red]imsend[/color]: {
  /sockread -f %handshake
  set %name $gettok(%handshake,2,32)
  echo Handshake recieved from %name $+ !
}
aha! that worked!

thanks =D
© mIRC Discussion Forums