Nonstandard account checker bot - Page 2
 

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

Nonstandard account checker bot

Started by Requiem, 19 December, 2004, 03:25:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

#25
damn i should have slept in the last few days :)

altho strange i thought i fixed it

maybe i forgot something, even my black box is flushed now

-- share check & reg by profiles
-- by bastya_elvtars
-- for Requiem
-- use !command  
-- feel free to include any profile index (not name!) - see profiles.dat


levels_height={ -- profile_index=strength_of_level
			-- determines the power of levels. why? see below
			-- you can also exclude ppl you dont want to be able to allow to reg
--master:

[0]=4, 

-- op: 

[1]=3,

-- moderator:

[4]=5,

-- netfounder:

[5]=6,

}

allowed_to_reg=3 -- minimum profile power (see above) for the ppl alowed to reg these folks - if you set Ops as 2, VIPs as 1,
				-- and this value is 2, Ops can reg ppl, vips cannot.

profiles_share={ -- [profileindex]=minshareingigabytes

[6]=10,

[7]=20,

[8]=30,

}

profiles_cmd={ -- ["command"]=profile_index,

["!regls1"]=6,

["!regls2"]=7,

["regls3"]=8,
}



maxShare=2 -- in terabytes, to keep out some idiot fakeeeeeeeeeeeeers

todoforlowshare=1 -- 1 to disconnect, 2 to redirect

redir_addy="redirect.address.here"

-- do not edit below

profiles={}

function NewUserConnected(user)
	checkshare(user)
end

function DataArrival(user,data)
	if strsub(data, 1, 7) == "$MyINFO" then
		if user.sMyInfoString and strlen (user.sMyInfoString) > (strlen(user.sName)+13) then
			checkshare(user)
		end
	elseif strsub(data,1,1)=="<" then
		data=strsub(data,1,strlen(data)-1)
		local _,_,cmd = strfind(data,"%b<>%s+[%!%+%#](%S+)")
		if cmd then
			if profiles_cmd[cmd] then
				regprof(user,data,profiles_cmd[cmd])
				return 1
			end
		end
	end
end

checkshare=function(user)
	if profiles_share[user.iProfile] then
		local _,_,temp = strfind(user.sMyInfoString, "%$(%d+)%$")
		if not temp then user:SendData("ShareCheck","Your client is idiot."); user:Disconnect() return 1 end
		local minshare=profiles_share[user.iProfile]*1024*1024*1024
		local maxshare=maxShare*1024*1024*1024*1024
		if tonumber(temp) < minshare then
			if todoforlowshare == 2 then
				user:SendData("ShareCheck","You do not meet the share minimum ("..minShare.." GB)!")
				user:SendData("RedirectBot","You are being redirected ... ")
				user:SendData("$ForceMove "..redir_addy.."|")
			elseif todoforlowshare==1 then
				user:SendData("ShareCheck","You do not meet the share minimum, and are being disconnected ...")
				user:Disconnect()
			end
		elseif tonumber(temp) > maxshare then
			user:SendData("ShareCheck","Do you really think that i believe that you are sharing "..format("%0.2f", tonumber(temp)/(gb*1024)).." TBytes of data??? |")
			user:Disconnect() return "shit"
		end
	end
end

function loadusers()
	local regusers={}
	readfrom("../RegisteredUsers.dat")
	while 1 do
		local line = read()
		if line == nil then 
				readfrom()
				break 
		end
		local _,_,name,levl = strfind(line,"(.+)|.+|(%d+)")
		regusers[name]=tonumber(levl)
		
	end
	readfrom()
	return regusers
end


function regprof(user,data,idx)
	if levels_height[user.iProfile] and levels_height[user.iProfile]>=allowed_to_reg then
		local regppl=loadusers()
		local _,_,cmd,toreg,pw=strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(%S+)")
		if toreg and pw then
			if regppl[toreg] then
				user:SendData("Reggabot","User is already regged as "..GetProfileName(regppl[toreg]).." !!! Do not waste my time!")
			else
				AddRegUser(toreg,pw,idx)
				SendToNick(toreg," "..user.sName.." has regged you as "..GetProfileName(idx).." with password "..pw" . Edit your settings in Favourite Hubs and reconnect!")
				SendToOps(" "..user.sName.." has regged "..toreg.." as "..GetProfileName(idx)".")
			end
		else
			user:SendData("Reggabot","Bad usage! Correct usage: "..cmd.."  ")
		end
	else
		user:SendData("Reggabot","Not allowed to reg!")
	end
end
Everything could have been anything else and it would have just as much meaning.

Requiem

havent been able to test it for days. thank you. works fine now.

bastya_elvtars

QuoteOriginally posted by Requiem
havent been able to test it for days. thank you. works fine now.

yw this was my xmas present 4 you  8)
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk