Hi! Some days ago i had an idea of making a script that would act like a small server in which the "users" using an other simple script to act as a client would connect, sent me their OS name and then get disconnected by me. So.. following this tutorial
http://www.mirc.org/mishbox/tutorials/sockets.htmi wrote this script for server side
on *:socklisten:HumStats: {
var %sockaccept $+(Hum,$rand(1,100))
sockaccept %sockaccept
sockwrite -n %sockaccept Connection Accepted.
}
on *:sockread:Hum*: {
if ($sockerr) { sockclose $sockname | echo -at Error Occured Closed Connection }
var %hum
sockread %hum
if (*OS* iswm %hum) {
write HumStats.txt $gettok(%hum,2,32)
sockwrite -n $sockname Thanks for contributing! Bye!
.timer 1 2 sockclose $sockname
}
}
And this for client side
on *:SOCKOPEN:HumStatsClient: {
window @HumStats
aline @HumStats Connecting To HumStats Server
}
on *:sockread:HumStatsClient: {
if ($sockerr) { sockclose $sockname | echo -at Error Occured Canceled Connection }
var %HumStats
sockread %HumStats
if (*Accept* iswm %HumStats) {
sockwrite -n |OS| <bla bla>
.timer 1 5 sockclose $sockname
}
}
on *:sockclose:HumStatsClient: {
aline @HumStats Connection Closed By HumStats!
}
But it doesn't trigger..
I tried to do port forwarding for the port 90 because i did /socklist Hum 90 and then i disabled my firewall but no luck again..
What am i doing wrong?