redirect 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

redirect bot

Started by BeeR, 31 December, 2004, 17:10:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BeeR

I have an ide on a bot !!

A rd-bot that redirects users if they not get regged in the hub within time set by hubrunner (value = min)

a redirect reason like " you are now redirected because: U did not reg yourself in this hub !!
A cold BeeR is stunning !!

b_w_johan

i even have an better idea,

if youre not regged youre redirected,
(this part is for my network then)

so when a users is found which is not regged
we redirect him to a hub in this small database like thing

1GB{
jan.no-ip.
piet.no-ip.
}

5GB{
jeroen.no-ip
pietersen.no-ip
}

so if the user is not registerd hes redirected, but first share check to see which hub fits him

if you have an idea how to make this work please reply

if you have a part of this idea like checking in a file for minshare that also good now i have nothing so i get started
checkout http://wwhublist.com/index.php for my World Wide HubList project!

[UK]Madman

Slight ammendment on an old bot .. it would redirect randomly to a hub in the hubs table after a set period of time and several warnings.

Good idea about working on share size, will add that wen im not at work!

-- By [UK]Madman
-- References - Lua Language Board

var = {["bot"] = "RegToStayBot", ["time"] = 10, ["command"] = "?notreg"}, --time is in mins before redirect
times = {},
hubs =  { hubaddress1, hubaddress2} -- list of possible hubs
	

function Main()
frmHub:RegBot(var.bot)
SetTimer(60000*(tonumber(var.time)/4))
StartTimer()
end

function NewUserConnected(Curuser)

	if Curuser.iProfile == -1 then
	times[Curuser.sName] = var.time
	Curuser:SendData (var.bot, "You have to register to stay in this hub, you currently have: "..var.time.." mins to register!")
	end
end

function UserDisconnected (Curuser)
times[Curuser.sName] = Nil
end

function OnTimer()
	for key, value in times do
	value = value - (var.time/4)
	times[key] = value

		if value == 0 then tokick = GetItemByName(key)
			times[tokick] = nil
			tokick:SendData (var.bot, "You did not register, so are now being redirected!")
			tohub = random(getn(hubs))
			tokick:SendData("$ForceMove "..hubs[tohub])


	elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
	towarn:SendData (var.bot, "You have not registered, you will be redirected in: "..value.." mins unless you register!")
	end
end

function DataArrival(Curuser,data)
data = strsub(data, 1, strlen(data)-1)
	if strsub(data, 1, 1) == "<" then 
	s,e,cmd = strfind(data, "%b<>%s+(%S+)")

		if cmd == var.command and Curuser.bOperator then
		Curuser:SendPM (var.bot, "The following users are currently not regged:")
			for key, value in times do 
			Curuser:SendPM (var.bot, key.." Has approx "..value.." mins till being redirected!")
			end
		return 1
		end
	end
end

Sorry if theres any errors, cant test it at work :o(

b_w_johan

thx [UK]Madman
im gonna test the script inmediatly
ill try to figure out that checking for share
and then redirect

Greetings Johan
checkout http://wwhublist.com/index.php for my World Wide HubList project!

BeeR

QuoteOriginally posted by b_w_johan
i even have an better idea,

if youre not regged youre redirected,
(this part is for my network then)

so when a users is found which is not regged
we redirect him to a hub in this small database like thing

1GB{
jan.no-ip.
piet.no-ip.
}

5GB{
jeroen.no-ip
pietersen.no-ip
}

so if the user is not registerd hes redirected, but first share check to see which hub fits him

if you have an idea how to make this work please reply

if you have a part of this idea like checking in a file for minshare that also good now i have nothing so i get started

i run now a private reghub and want to run it in my networks rd as a publichub - but still be a reghub,,
thats why i dont need more than my request
A cold BeeR is stunning !!

b_w_johan

well thats the script wich madman posted... that say register or youre redirected within x min...
but theres a problem ...
it didn't worked by my ... :'(
so i try to strip it down to redirect without registering so everyone who connects check for being registred not so by .. not that time period and register period... but script origionally didn't worked and i mest it up so now its still not working...

madman did it work by you before ???
you said can't test it cause im at work ..
so i guess you maded one before and based this to it ?

so now im trying to get it working like its now and strip away the time period madman if you got something like this wich does work please post it =-)


here are some errors
var = {["bot"] = "RegToStayBot", ["time"] = 10, ["command"] = "?notreg"}, --time is in mins before redirect
times = {},
hubs =  { hubaddress1, hubaddress2} -- list of possible hubs


like last read = on line 5 ...and if you want an adres like johan-hub.no-ip.info:666 it gives an error because of the port number ... :'(
checkout http://wwhublist.com/index.php for my World Wide HubList project!

[UK]Madman

#6
Tested now and working ok

-- By [UK]Madman
-- References - Lua Language Board

var = {["bot"] = "RegToStayBot", ["time"] = 10, ["command"] = "?notreg"} --time is in mins before redirect
times = {}
hubs =  { "hub1.no-ip.com:500", "hub2.no-ip.com:500"} -- list of possible hubs

function Main()
frmHub:RegBot(var.bot)
SetTimer(60000*(tonumber(var.time)/4))
StartTimer()
end

function NewUserConnected(Curuser)
	if Curuser.iProfile == -1 then
	times[Curuser.sName] = var.time
	Curuser:SendData (var.bot, "You have to register to stay in this hub, you currently have: "..var.time.." mins to register!")
	end
end

function UserDisconnected (Curuser)
times[Curuser.sName] = Nil
end

function OnTimer()
	for key, value in times do
	value = value - (var.time/4)
	times[key] = value

		if value == 0 then tokick = GetItemByName(key)
			times[tokick] = nil
			tokick:SendData (var.bot, "You did not register, so are now being redirected!")
			tohub = random(getn(hubs))
			tokick:SendData("$ForceMove "..hubs[tohub])

	elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
	towarn:SendData (var.bot, "You have not registered, you will be redirected in: "..value.." mins unless you register!")
	end
end
end


function DataArrival(Curuser,data)
data = strsub(data, 1, strlen(data)-1)
	if strsub(data, 1, 1) == "<" then 
	s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if cmd == var.command and Curuser.bOperator then
		Curuser:SendPM (var.bot, "The following users are currently not regged:")
			for key, value in times do 
			Curuser:SendPM (var.bot, key.." Has approx "..value.." mins till being redirected!")
			end
		return 1
		end
	end
end

At home now :oP and yes its based on an old bot that just disconnected after a set time, not re-directed.

b_w_johan

thx its working now =-')
now im gona make it look for sharesize dont now how but ill try to figure it out=-)
checkout http://wwhublist.com/index.php for my World Wide HubList project!

BeeR

Yes i can see that this bot do the thing i asked for ,,
 what i not want is the 2 hub addys to be typed - just
 a "get from hub rd" command ,, then i dont need to
 manually change the rd in bot when networks rd            is changed
A cold BeeR is stunning !!

[UK]Madman

To get the redirect address from the address set in the hub .. replace

tohub = random(getn(hubs))
			tokick:SendData("$ForceMove "..hubs[tohub])

With....

tokick:SendData("$ForceMove "..frmHub:GetRedirectAddress())

you will also be able to remove the table

hubs =  { "hub1.no-ip.com:500", "hub2.no-ip.com:500"} -- list of possible hubs

b_w_johan

i liked this part:
hubs =  { "hub1.no-ip.com:500", "hub2.no-ip.com:500"} -- list of possible hubs

but now there's one thing i like to now is there a way to make that part in another file.

cause with guestbook you can add adresses to a txt file
and if that txt file is the random part then its easyer to add and remove hubs ...
cause some of he hubs in network where redirect is placed to some go offline at night and come online in the morning.

so if you can make it read from another file i can make an read remove thing...

thx Johan
checkout http://wwhublist.com/index.php for my World Wide HubList project!

SMF spam blocked by CleanTalk