--Pinger 1.01 - need help
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

--Pinger 1.01 - need help

Started by Marco52, 04 July, 2005, 16:09:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marco52

I want use --Pinger 1.01 script.

But this script is in LUA4.
I convert the script with  convertor into LUA5.
But I don't know, how can I convert file handlings (readfrom)  
skript write file: pinger.lst , but not read this file.
Can somebody help me with this, please?
Here is the script in Lua4:

--Pinger 1.01 
--by Mutor The Ugly 
--
-- 
--Check users ping time to hub with Windoze 'ping.exe'
--Note: Some users may block ping from WAN side
--
--Usage = !ping 
--

PingComm = "!ping" -- Command name
--
rightclick = 1 -- if anything else than 1 rightclick menu won't appear

function DataArrival(curUser, sData)
      sData=strsub(sData,1,-2) 
      s,e,cmd,who = strfind( sData, "%b<>%s+(%S+)%s*(%S*)" )
		if (cmd==PingComm) and curUser.bOperator then
	   	local nick = GetItemByName(who)
			if nick == nil then
			SendToNick(curUser.sName,"**** User ->> "..who.." is not online. Try again.") return 1 end
				local addy = 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 1 
		end
end

function OpConnected(curUser)
	if rightclick == 1 then
		curUser:SendData("$UserCommand 255 7") 
		curUser:SendData("$UserCommand 0 3") 
		curUser:SendData("$UserCommand 1 2 +ping$<%[mynick]> !ping %[nick]||")  
	end
end

Dessamator

u have to convert the filehandling!, search the lua5 section for info on how to do this !
Ignorance is Bliss.

Markitos

Have a close look here


Cheers...

Marco52

#3
I reading manual to convert the filehandling many time.
I making change in script but no efect.
Myself can not make conwerting this script.
Please help me with this.
sorry for my bad language/
========================================
That's wonderfull, extraordinary! - i'm writing this ^^^ txt
and YOU in same time finish convert script !
Mutor - Thank You for your help, very, very much.
Script now work very well !!!
Sincere thanks.

Dessamator

i made a pinger?, hmm i just dont remember what bug it had :)
Ignorance is Bliss.

SMF spam blocked by CleanTalk