mIRC Homepage
Posted By: Turbo_boy udpread - 23/08/05 08:55 AM
Hi all,

I was wondering how to trigger the IP from the sended info on the udpread becuse $sock(name).ip does't work.

How could I trigger the information? It most be possible becuse games use it to.

greetz,
Turbo_boy
Posted By: stefys99 Re: udpread - 24/08/05 12:46 AM
Quote:
Hi all,

I was wondering how to trigger the IP from the sended info on the udpread becuse $sock(name).ip does't work.

How could I trigger the information? It most be possible becuse games use it to.

greetz,
Turbo_boy


Well, the $sock(sockname).ip should work, it doesn't work only if u didn't use it properly. I didn't use an udp socket before, but I tried this:
Code:
on 1:udpread:abc:{
  var %data
  sockread %data
  echo -a got: %data --- $sock($sockname).ip
}

then I typed as commands:
Code:
/sockudp -k abc 6667
/sockudp send_data 127.0.0.1 6667 Just a little test.

got: Just a little test --- *.*.*.*
My ip appeared, so the $sock(sockname).ip works fine. Remember that $sockname returns something only inside a socket event (sockopen,sockread,udpread...).
I didn't show my ip because in this forum might be some people who like to DDoS people, but It shown my ip.

So, there's not a $sock() problem, give us more details and show us parts of your code.
© mIRC Discussion Forums