!ping bot
 

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

!ping bot

Started by Ubikk, 19 June, 2005, 17:46:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ubikk

hey guys...
Is it possible to make a script that enables a command wich allows registered users to ping the hub? :)
Example:

!ping
Ping reply: 2 seconds


Btw.. it will be a nice thing to also have a trigger wich enables/disables the command to work only for registered users

Thank you in advance

P.S: and a trigger that allows the bot to send the ping reply message to all users in mainchat or only to the user that used the command :)

Ubikk

Isn't it possible to ping the hub's server using the windows utility ,gather the necessary information from it and then displaying it on the hub?

Dessamator

Well, if the server pings itself, the result will always be irrelevant, so in other words impossible,  what could be done is the inverse, the user uses the ping cmd, and the server pings him,then u can gather the info and send to the user .
Ignorance is Bliss.

Ubikk

Sure.. that would do just fine... so, who can help me with the necessary script?  :D

Star

This soundes great. Maybe a request to implant in PtocaX?

Dessamator

-- By Dessamator
-- "Hub Pinger" 

function ChatArrival(user, data)
	data = string.sub(data,1,-2)
	s,e,cmd = string.find(data, "%b<>%s+(%S+)")
	if cmd=="!ping" then
		local temp,n="\r\n\t\Ping Results :\r\n"..string.rep("??",12).."\r\n",0
		os.execute("ping "..user.sIP.." >pingresults.txt")
		for line in io.lines("pingresults.txt") do
			n=n+1
			if n>10 then 
			temp=temp..line.."\r\n"
			end
		end
	os.remove("pingresults.txt")
	user:SendData(frmHub:GetHubBotName(),temp)
	return 1
	end
end


Done !

P.S :
QuoteLastly the one being pinged must allow ping from WAN side in their firewall or router.
Ignorance is Bliss.

Dessamator

QuoteOriginally posted by Star
This soundes great. Maybe a request to implant in PtocaX?

well this is the wrong thread to ask for it, but anyways, maybe if ur lucky PPK, will grant ur request .
Ignorance is Bliss.

Dessamator

If it has no arguments, its hard to find what it does, either way, the result of that "$Ping" seems to be invisible to us .

im sure ptokax uses some way of finding how fast a client is, otherwise we wouldnt have the option "keep slow clients online", unless it serves a different purpose, which is unknown to me !
Ignorance is Bliss.

SMF spam blocked by CleanTalk