A different sort of redirect
 

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

A different sort of redirect

Started by lazyj189, 09 November, 2003, 00:59:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lazyj189

Is it possible to make a small script that changes the redirect address of the hub to other addresses that it like pulls from either inside the script or from a text file every amount of time that is specified by the hub owner?

So one minute it is set to hub a's address
another minute it chagnes to hub b's adress, and hub c's address , or even it can change hub address randomly.  The amount of time that it takes to change address can be defined from 1 second to whatever in minutes.
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

kbeh273300

i have such a script

Bot = "-=T-G-T_REDIRBOT=-"
hubs = {"hub one,hubtwo,hub three"}

sec = 1000
min = 60 * sec
hour = 60 * min

index = nil

function Main()
frmHub:RegBot(Bot)
SetTimer(30*sec)
StartTimer()
end

function OnTimer()
index = next(hubs, index)
if not index then
index = next(hubs, index)
end
if hubs[index] then
frmHub:SetRedirectAddress(hubs[index])
else
frmHub:SetRedirectAll(0)
frmHub:SetRedirectFull(0)
end
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) and user.bOperator then
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
--extract command
_,_,cmd=strfind(data, "%b<>%s+(%S+)")
--check if cmd exist
if not cmd then cmd = "0" end

if (strsub(cmd, 1, 1) ~= "!" ) then
return 0
else
cmd = strlower(cmd)
if cmd == "!addred" then
_,_,arg = strfind(data, "%b<>%s+%S+%s+(%S+)")
tinsert ( hubs, arg)
frmHub:SetRedirectFull(1)
user:SendData(Bot, arg.." has been added to the redirect list")
hubs["n"]=nil
elseif cmd == "!removered" then
local _,_,arg = strfind(data, "%b<>%s+%S+%s+(%S+)")
for i,v in hubs do
if v == arg then
tremove(hubs, i)
hubs["n"]=nil
user:SendData(Bot, v.." has been removed from the redirect list")
break
end
end
elseif cmd == "!clearred" then
frmHub:SetRedirectAll(0)
frmHub:SetRedirectFull(0)
hubs = {}
user:SendData(Bot, "All redirects has been removed")
elseif cmd == "!chredtimer" then
_,_,arg,time = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")
timer = strlower(time)
if timer == "sec" then
SetTimer(tonumber(arg)*sec)
elseif timer == "min" then
SetTimer(tonumber(arg)*min)
elseif timer == "hour" then
SetTimer(tonumber(arg)*hour)
end
user:SendData(Bot, "The interval between changing redaddress has been changed to once every "..arg.." "..time)
elseif cmd == "!getredhubs" then
local j = 0
for i,v in hubs do
j = j + 1
user:SendData(Bot, "Redirect address"..j.." is "..v.." "..i)
end
if j == 0 then
user:SendData(Bot, "There is no redirect hubs")
end
end
end
end
end
------------------------------------------------------------------
saveing lua

-=T-G-T=- network
Network Webpage: //www.t-g-t.nl
Network forum http://tgt.shows.it
Hub address: houseofkings.no-ip.org
hub webpage: http://houseofkings.no-ip.org
my lua forum http://lua.uknnet.com/
-=United Kings network=-
Network Webpage?
Hub address: houseofkings.no-ip.org:420
hub webpage
hub forum

lazyj189

Dude, that is just awesome.  Thanks alot for your help
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

SMF spam blocked by CleanTalk