mIRC Home    About    Download    Register    News    Help

Print Thread
#64599 20/12/03 05:22 AM
Joined: Aug 2003
Posts: 3
D
Dae Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2003
Posts: 3
Hey all, I was wondering about a script that would listen to a UDP port, and when a message was recieved, it would output it in @echo -> THis is to work with a PHP script, and although I know PHP, I am new to mIRC scripting... Please help smile

#64600 21/12/03 03:34 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
on *:UDPREAD:udplisten:{
  sockread %t
  echo @echo %t
}

/sockudp -k udplisten 50785
/sockudp -n udptemp 127.0.0.1 50785 Hello

#64601 21/12/03 01:38 PM
Joined: Aug 2003
Posts: 3
D
Dae Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2003
Posts: 3
Thanks for the reply - That works great, except it echo's @echo Hello and not in a seperate window, is there anyway to fix this?

Last edited by Dae; 21/12/03 02:06 PM.
#64602 21/12/03 04:14 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Do you have a window open called @echo?

/window @echo

Code:
on *:UDPREAD:udplisten:{
  sockread %t
  window @echo
  echo @echo %t
}

Will open a window automatically when data is recieved.

#64603 26/12/03 07:48 PM
Joined: Aug 2003
Posts: 3
D
Dae Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2003
Posts: 3
And how can I close a UDP socket?

#64604 27/12/03 03:27 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/sockclose udplisten


Link Copied to Clipboard