Author Topic: [PING] i got a ping script but i need...  (Read 1154 times)

0 Members and 1 Guest are viewing this topic.

Offline mandix

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
[PING] i got a ping script but i need...
« on: 28 June, 2004, 03:04:57 »
hela all.
i found a ping script (lua) somewhere on the net.. dunno where anymore but... my operating system is dutch  :D, but i need it in english can anyone help me ?
i got the ping.exe and ping6.exe in english from a frend...

PingComm "!ping" 


function DataArrival(curUsersData)
      
sData=strsub(sData,1,-2
      
s,e,cmd,who strfindsData"%b<>%s+(%S+)%s*(%S*)" )
	
	
if (
cmd==PingComm) and curUser.bOperator then
	
   
	
local nick GetItemByName(who)
	
	
	
if 
nick == nil then
	
	
	
SendToNick(curUser.sName,"<-=Hubgods=-> The user "..who.." is not online. Try again.") return 1 end
	
	
	
	
local compIp FetchIP(nick.sIP)
	
	
	
	
SendToNick(curUser.sName,"\r\n\t---<>-----------------------------------------------------------------------------<>---\r\n\t\tPinging ->> [ "..who.." ]   Please wait...\r\n\t---<>-----------------------------------------------------------------------------<>---")
	
	
	
	
execute("ping "..addy.." > pinger.lst")
	
	
	
	
local pingtime "" 
	
	
	
	
	
if 
readfrom("pinger.lst"then 
	
	
	
	
	
readfrom("pinger.lst"
	
	
	
	
	
pingtime read("*a"
	
	
	
	
	
pingtime gsub(pingtime,"|",strchar(166)) 
	
	
	
	
	
pingtime gsub(pingtime,"\n","\r\n\t"
	
	
	
	
	
writeto() 
	
	
	
	
	
remove("pinger.lst"
	
	
	
	
	
end
	
	
	
	
SendToNick(curUser.sName,"\t\t\t.:: Results ::.\r\n\t---<>-----------------------------------------------------------------------------<>---\r\n\t"..pingtime.."\r\n\t---<>-----------------------------------------------------------------------------<>---")
	
	
	
	
return 

	
	
end
end

function FetchIP(IP)
	
local _,_,a,b,c,strfind(IP"(%d+)%.(%d+)%.(%d+)%.(%d+)")
	
if 
and and and d then
	
	
addy=a.."."..b.."."..c.."."..d
	
	
return 
addy
	
end
end
« Last Edit: 28 June, 2004, 03:05:52 by mandix »

PtokaX forum

[PING] i got a ping script but i need...
« on: 28 June, 2004, 03:04:57 »