Network hub pinger redirect Manager --> to LUA5
 

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

Network hub pinger redirect Manager --> to LUA5

Started by SilentHunterKiller, 05 August, 2005, 09:30:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SilentHunterKiller

--============================================================

--========= Network hub pinger redirect Manager ==============

--============= By ??????Hawk?????? 25-05-04 =================

--============================================================

--=====This Script is designed to be run on its own hub ======

--======= Use another Ptokax hub on a different port =========

--============================================================

--========== +rdon = enable / +rdoff = disable ===============



--================== Editable settings =======================



sBot = "Network-Redirector-"			--// Bot name

DefaultHub = "DefaultHub.no-ip.org:411"	--// Default redirect hub Addy:Port

RedirectsEnabled = "true"			--// true/false Auto start

mins = 1						--// Ping Next Hub after # mins

Hub_Adress = { 

"Hub1.no-ip.com",

"411",

"Hub2.no-ip.org", 	--// Hubs In network

"415", 			--// you can add / remove as many as you want

"Hub3.servemp3.com", 	--// but keep the same layout

"412", 			--// hub  then port

"Hub4.no-ip.org", 

"417", 

"Hub5.servemp3.com", 

"411", 

"Hub6.no-ip.com", 

"414", 

"Hub7.no-ip.com", 

"412", 

 }



--=========  Mess With The Below at your own Peril ===========

Onlinehubs = {}

HubCounter = 1

curenthub = 1

curentport = 2

function Main()

	hubcount = getn(Hub_Adress)

	SetTimer(1000 * 60 * mins)

		if RedirectsEnabled == "true" then

			StartTimer()

		end

end



function NewUserConnected(curUser) 

		if (RedirectsEnabled == "false") then

			frmHub:SetRedirectAddress(DefaultHub)

		end

	SendToNick(curUser.sName, "<" ..sBot .."> Redirecting... |$ForceMove "..frmHub:GetRedirectAddress().."|")

end 



function DataArrival(user, data)

 	local data=strsub(data,1,strlen(data)-1)

		local s,e,cmd = strfind(data,"%b<>%s+(%S+)")

			if cmd=="+rdon" then

				SendToOps(sBot," Redirects enabled ")

				StartTimer()

				RedirectsEnabled = "true"

			elseif cmd=="+rdoff" then

				SendToOps(sBot," redirects disabled ")

		  		StopTimer()

		  		RedirectsEnabled = "false"

			end

end



function OnTimer()

	if curentport == hubcount + 2 then

		curenthub = 1

		curentport = 2

	end

	displayhub(curenthub,curentport)

	curenthub = curenthub + 2

	curentport = curenthub + 1



		frmHub:SetRedirectAddress(Onlinehubs[HubCounter])

		if (getn(Onlinehubs) == 0)  then

			frmHub:SetRedirectAddress(DefaultHub)

		end

		if HubCounter == getn(Onlinehubs) then

			HubCounter = 1

		else

			HubCounter = HubCounter + 1

		end

	CurrentOnlineHubs()

end



--============================================================

--===================! ! !  PING ! ! ! =======================



function displayhub(curenthub,curentport)

	local a = connect(Hub_Adress[curenthub],Hub_Adress[curentport])

	CurrentChecking = Hub_Adress[curenthub]..":"..Hub_Adress[curentport]

	Active = "false"

	ActiveHubCount = getn(Onlinehubs) + 1

		for index, value in Onlinehubs do

			if Onlinehubs[index] == CurrentChecking then

			    	Active = "true"

			    	Position = index

			end

		end

		if a == nil then

			if Active == "false" then

				SendToOps(sBot,CurrentChecking.."   Hub is still Offline")

			elseif Active == "true" then

				SendToOps(sBot,CurrentChecking.."   Hub Has Gone Offline")

				Onlinehubs[Position] = nil

			end



		else

			if Active == "false" then

				SendToOps(sBot,CurrentChecking.."   Has Come Online")

						Onlinehubs[ActiveHubCount] = CurrentChecking

			elseif Active == "true" then

				SendToOps(sBot,CurrentChecking.."   Hub is still online")

			end



			a:close() 

		end

end



--============================================================

--===================! ! !  PONG ! ! ! =======================



function CurrentOnlineHubs()

	local names = "\r\n\r\n-------------Curent Online Hubs----------------\r\n\r\n\t"

		for index, value in Onlinehubs do

			local line = index

			names = names.." "..Onlinehubs[line].."\r\n\t"

		end

	names = names.."\r\n\r\nCurently Redirecting to "..frmHub:GetRedirectAddress().."\r\n\r\n"

	SendToOps(sBot,names)

end



--===================== End Of Script ========================


Hy all, is there anyone so gentile that can translate this lus4 script into lua5, it's what i was searching for since june... :))

P.S: this script was created by  ??????HAWK??????  :D

??????Hawk??????

hi m8  ..  it  cant be  done  at the moment ...

SilentHunterKiller

:( got an alternative solution like this one... or can i try to make it to lua5 myself ( it will take a year )

Dessamator

it cant be done as in , its not possible with the current ptokax
Ignorance is Bliss.

??????Hawk??????

QuoteOriginally posted by SilentHunterKiller
:( got an alternative solution like this one... or can i try to make it to lua5 myself ( it will take a year )

you could try terminator  as the GUI has it built in.   :))

SilentHunterKiller

tryed... but it doesn't work... :'(  i only need that script...

SilentHunterKiller

couldn't i just use an old version of the ptokax insted ???

Markitos

QuoteOriginally posted by SilentHunterKiller
couldn't i just use an old version of the ptokax insted ???
i would think 2 times be4 do that...

SilentHunterKiller

u say... i don't need it as a hubserver just a redirect hub... but does it have lots of bugs ??? or what...

Madman

I got a simple redirect script...
i just choose addys random from an table.. no check if the is online and shit...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SilentHunterKiller

it coulf help...nut that was the part that interested me... the online check

Madman

-- Network redirecter
-- Made by Madman

Bot = "NetworkRedirector"

Addys = {
	"Addy1.no-ip.org",
	"Addy2.myftp.com",
}

function NewUserConnected(curUser, data)
	if Redirect == 1 then
		curUser:SendData(Bot, "Redirecting..")
		curUser:Redirect(Addys[math.random(table.getn(Addys))])
	end
end

function ChatArrival(curUser, data)
	local data =  string.sub(data, 1, -2)
	local s,e,cmd = string.find(data, "%b<>%s+[%!%+%#%?](%S+)")
	if cmd then
		local tCmds = {
		["rdon"] = function(curUser, data)
			SendToOps(Bot, "Redirects enabled by " ..curUser.sName)
			Redirect = 1
			return 1
		end,
		["rdoff"] = function(curUser, data)
			SendToOps(Bot, "Redicrects disabled by " ..curUser.sName)
			Redirect = 0
			return 1
		end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](curUser, data)
		end
	end
end

There you go... =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SilentHunterKiller

#12
tnx... mad

but in the end i installed an old ptokax 15.30 and run the old script... i ha ve a little problem... :(
it just blocks it always redirects to the " DefaultHub "
how come ???

Rick

I'd be interested in something that would network 5 hub locations!
We tried terminator but too much was going wrong and the networking wasn't working

Hawk - when Terminator is installed we have to name a bot - that bot has a 20+GB share, apparantly your email address - what is going on with that? Advertising is great but it looks like you are an OP in our hub

Thanks
Rick

HillyBilly

QuoteOriginally posted by Rick
I'd be interested in something that would network 5 hub locations!
We tried terminator but too much was going wrong and the networking wasn't working

Hawk - when Terminator is installed we have to name a bot - that bot has a 20+GB share, apparantly your email address - what is going on with that? Advertising is great but it looks like you are an OP in our hub

Thanks
Rick

Maybe this would help.

CLICK HERE

Cheers HB

Rick

That's a link to Hawks site - how does that help?
Or answer the question?

Thanks
Rick

HillyBilly

QuoteOriginally posted by Rick
That's a link to Hawks site - how does that help?
Or answer the question?

Thanks
Rick

Maybe when you post the question there, it's easier to see that it is a question abouth Terminator and you get prob. a faster reply.

Cheers HB

SMF spam blocked by CleanTalk