Hi, been messing around with TSockets a bit and can't seem to get it to work. Iv'e even tried copying methods used in
cbk1994's Grattpd.
Here is what I have in a DBNPC.
PHP Code:
function onCreated(){
temp.url = "http://automation.whatismyip.com/n09230945.asp";
temp.req = requesturl(url);
waitfor(req, "onReceiveData", 5);
this.ip = req.data[0];
if(!this.ip){
echo("Failed to get server IP.");
}
this.ls = new TSocket();
this.ls.bind(0, false);
thiso.catchevent(this.ls, "onBind", "onBound");
thiso.catchevent(this.ls, "onBindFailed", "onBoundFailed");
}
function onBound(){
echo("Bound!");
}
function onBoundFailed(){
echo("Not bound!");
}