Can anyone help with this piece of code ?
Why it is not allocating any resource ?
GLOBAL timer, ntimer
GLOBAL elapsed = 10
GLOBAL a$
AUTOPAUSE FALSE
GLOBAL scy=600
ok=NETHOSTGAME(0,0, "127.0.0.1","")
IF ok=TRUE
a$= "Network on. Last check at"
myplayer$ = NETCREATEPLAYER$("Admin")
ELSE
a$= "Network off. Last check at"
ok=NETHOSTGAME(0,0, "","")
ENDIF
ips$ = NETGETIP$()
num = SPLITSTR(ips$, ip$[], "|")
WHILE TRUE
FOR i=0 TO num-1
PRINT "IP: "+ ip$[i], 0, scy-((i+1)*20)
NEXT
timer = INTEGER((GETTIMERALL())/1000)
PRINT "Elapsed time " + timer,0,20
IF elapsed - timer = 0
elapsed =(INTEGER((GETTIMERALL())/1000))+10
TestNet()
ELSE
PRINT a$ +" "+ ntimer,0,0
ENDIF
PRINT "Network"+ok,0,40
PRINT "Admin= "+myplayer$,0,60
SHOWSCREEN
WEND
FUNCTION TestNet:
ntimer=INTEGER((GETTIMERALL())/1000)
IF ok=TRUE
a$="Network on. Last check at"
ELSE
a$="Network off. Last check at"
ENDIF
ENDFUNCTION