script needed :)
 

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

script needed :)

Started by D-J Valhala, 20 July, 2004, 15:33:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

D-J Valhala

+connect                   -       Show Whan User Connacting To Hub Untill The OP remove the user from the list(All OP's Can Use This CMD And Each OP have diffrent Connect list)

+connectoff               -       Stop Connecting MSG

+connectlist - Show the users that are in connect log

+mypass - Show The User Password to the hub

+myclass  - Show To User the class (No Regged Vip op and so on )  :P

+passwordlist - Will Show Me All REG's/ViP's/SuperViP's/OP's/SuperOp's/Masters Nick ==>password (Only Masters can use this command!)

+repass - Change User PassWord (All Users Can Use This)

+repass - Master Can Change user Password (Only Masters can use this command!)

thenks  :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Didn?t understand the commands...

+connect - Show Whan User Connacting To Hub Untill The OP remove the user from the list(All OP's Can Use This CMD And Each OP have diffrent Connect list)

+connectoff - Stop Connecting MSG

Can you give us examples, and about the +passwordlist i need the number of all of your profiles.

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

#2
ok here we go
========================================
+connect DJ-Valhala
<-PsYiBot-> User DJ-Valhala is beed wached by DJ-Valhala

now if i disconnect and reconnect to the hub the bot will send to me in PM

<-PsYiBot-> User DJ-Valhala Connected To The Hub In 11:30 AM

+connectoff DJ-Valhala
<-PsYiBot-> User DJ-Valhala is beed removed from wach!

now to each OP there is a connect list

+connect DJ-Valhala
<-PsYiBot-> User DJ-Valhala is beed wached by GuY

and ONLY GuY will see whan i'm connecting  :D
========================================
Profiles Are
========================================
0|Master
1|Operator
2|VIP
3|Reg
4|Super OP
5|Super VIP
========================================
thanks alot mate  :D  :D  :D  :D  :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

Hi,

Hope it helps...

--## Multi-Function Bot
--## Made by nErBoS
--## Requested by D-J Valhala
--## Commands:
--##	+connect  - Show Whan User Connacting To Hub Untill The OP remove the user from the list
--##	+connectoff  - Stop Connecting MSG 
--##	+connectlist - Show the users that are in connect log 
--##	+mypass - Show The User Password 
--##	+myclass - Show To User the class 
--##	+passwordlist - Will Show All REG's/ViP's/SuperViP's/OP's/SuperOp's/Masters password 
--##	+repass  - Change User PassWord
--##	+changepass   - Master Can Change user Password 


sBot = "Multi-Func"

fRegDat = "../RegisteredUsers.dat"
arrWatch = {}
fWatch = "watch.dat"

--## Configuration ##--

iProfiles = 6	--## The number of how many profiles do you have
verPtokax = 1	--## Choose 0 for ptokax version lower then 0.3.3.0
		--## Choose 1 for ptokax versions 0.3.3.0 or higher

--## END of Configuration ##--

function Main()
	frmHub:RegBot(sBot)
	LoadFromFile(fWatch)
end

function OnExit()
	SaveToFile(fWatch , arrWatch , "arrWatch")
end

function NewUserConnected(user)
	LogWatched(user, "Logged in  at "..GetTime())
end

function UserDisconnected(user)
	LogWatched(user, "Logged out at "..GetTime())
end

function DataArrival(user, data)
	if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
		data = strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if (cmd == "+connect") then
			local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (nick == nil) then
				user:SendPM(sBot, "Syntax Error, +connect , you must write a nick.")
			elseif (arrWatch[user.sName] == nil) then
				arrWatch[user.sName] = {}
				arrWatch[user.sName][strlower(nick)] = "Waiting for something..."
				user:SendPM(sBot, "The user "..nick.." is now been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			elseif (arrWatch[user.sName][strlower(nick)] ~= nil) then
				user:SendPM(sBot, "The user "..nick.." is already been watched.")
			else
				arrWatch[user.sName][strlower(nick)] = "Waiting for something..."
				user:SendPM(sBot, "The user "..nick.." is now been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			end
			return 1
		elseif (cmd == "+connectoff") then
			local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (nick == nil) then
				user:SendPM(sBot, "Syntax Error, +connectoff , you must write a nick.")
			elseif (arrWatch[user.sName] == nil) then
				user:SendPM(sBot, "You don't have anyone to be watched.")
			elseif (arrWatch[user.sName][strlower(nick)] == nil) then
				user:SendPM(sBot, "The user "..nick.." is not been watched by you.")
			else
				arrWatch[user.sName][strlower(nick)] = nil
				user:SendPM(sBot, "The user "..nick.." is no longer been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			end
			return 1
		elseif (cmd == "+connectlist" and user.bOperator) then
			if (arrWatch[user.sName] == nil) then
				user:SendPM(sBot, "You don't have anyone to be watched.")
			else
				ShowWatched(user)
			end
			return 1
		elseif (cmd == "+mypass") then
			if (CheckIfRegged(user.sName) == 0) then
				user:SendPM(sBot, "You aren't register in this HUB.")
			else
				user:SendPM(sBot, "Your password is: "..CheckIfRegged(user))
			end
			return 1
		elseif (cmd == "+myclass") then
			if (user.iProfile == -1) then
				user:SendPM(sBot, "Your Class is: UNREG.")
			else
				user:SendPM(sBot, "Your Class is: "..GetProfileName(user.iProfile))
			end
			return 1
		elseif (cmd == "+passwordlist" and user.iProfile == 0) then
			ShowAllPass(user)
			return 1
		elseif (cmd == "+repass") then
			local s,e,pass = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (pass == nil) then
				user:SendPM(sBot, "Syntax Error, +repass , you must write a password.")
			elseif (user.iProfile == -1) then
				user:SendPM(sBot, "You are not registered in this HUB.")
			else
				AddRegUser(user.sName, pass, user.iProfile)
				user:SendPM(sBot, "Your password as been changed to: "..pass)
			end
			return 1
		elseif (cmd == "+changepass" and user.iProfile == 0) then
			local s,e,nick,pass,profile = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")
			if (nick == nil or pass == nil) then
				user:SendPM(sBot, "Syntax Error, +changepass  , you must write a nick and a password.")
			elseif (GetItemByName(nick) == nil) then
				if (CheckIfRegged(nick) == 0) then
					user:SendPM(sBot, "The user "..nick.." is not registered in this HUB.")
				else
					nick,profile = CheckForName(nick)
					AddRegUser(nick, pass, profile)
					user:SendPM(sBot, "The password of the user "..nick.." as been changed to: "..pass)
				end
			elseif (GetItemByName(nick).iProfile == -1) then
					user:SendPM(sBot, "The user "..nick.." is not registered in this HUB.")
			else
				AddRegUser(GetItemByName(nick).sName, pass, GetItemByName(nick).iProfile)
				user:SendPM(sBot, "The password of the user "..nick.." as been changed to: "..pass)
			end
			return 1
		end
	end
end

function CheckIfRegged(usr)
	readfrom(fRegDat)
	while 1 do
		local sLine = read()
		if (sLine == nil) then
			readfrom()
			return 0
		else
			local s,e,nick,pass = strfind(sLine, "(.+)|(.+)|.+")
			if (nick ~= nil and pass ~= nil and strlower(nick) == strlower(usr)) then
				readfrom()
				return pass
			end
		end
	end
end

function CheckForName(nick)
	local profile = 0
	while profile < iProfiles do
		local usr,aux
		for aux, usr in GetUsersByProfile(GetProfileName(profile)) do
			if (strlower(usr) == strlower(nick)) then
				return usr,profile
			end
		end
		profile = profile + 1
	end
	return "ERROR"
end

function ShowWatched(user)
	local sTmp,usr,data = "List of Users watched by you:\r\n\r\n"
	for usr, data in arrWatch[user.sName] do
		sTmp = sTmp.."User: "..usr.."\tStatus: "..data.."\r\n"
	end
	user:SendPM(sBot, sTmp)
end

function LogWatched(user, data)
	local op,usr,aux,aux2
	for op, aux in arrWatch do
		for usr, aux2 in arrWatch[op] do
			if (usr == strlower(user.sName)) then
				arrWatch[op][usr] = data
				if (GetItemByName(op) ~= nil) then
					GetItemByName(op):SendPM(sBot, "The user has "..data)
				end
				return
			end
		end
	end
end

function ShowAllPass(user)
	local profile,sTmp = 0,"The List of all passwords in the HUB:\r\n\r\n"
	while profile < iProfiles do
		local usr,aux
		sTmp = sTmp.."--## "..GetProfileName(profile).." ##--\r\n\r\n"
		for aux, usr in GetUsersByProfile(GetProfileName(profile)) do
			sTmp = sTmp.."User: "..usr.."\tPassword: "..CheckIfRegged(usr).."\r\n"
		end
		sTmp = sTmp.."\r\n"
		profile = profile + 1
	end
	user:SendPM(sBot, sTmp)
end

function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Day: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end
			
function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";
	sTmp = ""

	sTmp = sTmp..sTab..sTableName.." = {\n"

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end

		sTmp = sTmp..",\n"
	end

	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(file)
	if (readfrom(file) ~= nil) then
		readfrom(file)
		dostring(read("*all"))
		readfrom()
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

#4
scripts work perfect exept +mypass  :D

can you add +getpass - Masters Get The User Password :D

and can you add a "Total: 12" in +passwordlist and in +connectlist like
=========== Super VIP ===========

User: -=Geta=-   Password: *****
User: charlie   Password: *****
User: Corayzon   Password: *****

Total: 3
==============================
and so on
password with "*****" coz i can't show my users passwords :P

and in +connectlist can you add online/offline

<-PsYiBot-> The user has Logged out at Day: 21/07/2004 Hour: 09:49:49  
where is the user name? :P

and i dont want it to show mypass in the list:)

maybe i send you my addited scripts in the hub? :)
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

#5
Hi,

Try out this one...

--## Multi-Function Bot
--## Made by nErBoS
--## Requested by D-J Valhala
--## Added a User Imune to see password and change
--## Commands:
--##	+connect  - Show Whan User Connacting To Hub Untill The OP remove the user from the list
--##	+connectoff  - Stop Connecting MSG 
--##	+connectlist - Show the users that are in connect log 
--##	+mypass - Show The User Password 
--##	+myclass - Show To User the class 
--##	+passwordlist - Will Show All REG's/ViP's/SuperViP's/OP's/SuperOp's/Masters password 
--##	+repass  - Change User PassWord
--##	+changepass   - Master Can Change user Password 
--##	+getpass  - Get The User Password  


sBot = "Multi-Func"

fRegDat = "../RegisteredUsers.dat"
arrWatch = {}
fWatch = "watch.dat"

--## Configuration ##--

iProfiles = 6		--## The number of how many profiles do you have
verPtokax = 1		--## Choose 0 for ptokax version lower then 0.3.3.0
			--## Choose 1 for ptokax versions 0.3.3.0 or higher
sImuneUser = "Nick"	--## User Imune to show the password

--## END of Configuration ##--

function Main()
	frmHub:RegBot(sBot)
	LoadFromFile(fWatch)
end

function OnExit()
	SaveToFile(fWatch , arrWatch , "arrWatch")
end

function NewUserConnected(user)
	LogWatched(user, "Logged in  at "..GetTime().." [ONLINE]")
end

function UserDisconnected(user)
	LogWatched(user, "Logged out at "..GetTime().." [OFFLINE]")
end

function DataArrival(user, data)
	if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
		data = strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if (cmd == "+connect") then
			local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (nick == nil) then
				user:SendPM(sBot, "Syntax Error, +connect , you must write a nick.")
			elseif (arrWatch[user.sName] == nil) then
				arrWatch[user.sName] = {}
				arrWatch[user.sName][strlower(nick)] = "Waiting for something..."
				user:SendPM(sBot, "The user "..nick.." is now been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			elseif (arrWatch[user.sName][strlower(nick)] ~= nil) then
				user:SendPM(sBot, "The user "..nick.." is already been watched.")
			else
				arrWatch[user.sName][strlower(nick)] = "Waiting for something... [ONLINE/OFFLINE]"
				user:SendPM(sBot, "The user "..nick.." is now been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			end
			return 1
		elseif (cmd == "+connectoff") then
			local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (nick == nil) then
				user:SendPM(sBot, "Syntax Error, +connectoff , you must write a nick.")
			elseif (arrWatch[user.sName] == nil) then
				user:SendPM(sBot, "You don't have anyone to be watched.")
			elseif (arrWatch[user.sName][strlower(nick)] == nil) then
				user:SendPM(sBot, "The user "..nick.." is not been watched by you.")
			else
				arrWatch[user.sName][strlower(nick)] = nil
				user:SendPM(sBot, "The user "..nick.." is no longer been watched by you.")
				if (verPtokax == 0) then
					OnExit()
				end
			end
			return 1
		elseif (cmd == "+connectlist" and user.bOperator) then
			if (arrWatch[user.sName] == nil) then
				user:SendPM(sBot, "You don't have anyone to be watched.")
			else
				ShowWatched(user)
			end
			return 1
		elseif (cmd == "+mypass") then
			if (CheckIfRegged(user.sName) == 0) then
				user:SendPM(sBot, "You aren't register in this HUB.")
			else
				user:SendPM(sBot, "Your password is: "..CheckIfRegged(user.sName))
			end
			return 1
		elseif (cmd == "+myclass") then
			if (user.iProfile == -1) then
				user:SendPM(sBot, "Your Class is: UNREG.")
			else
				user:SendPM(sBot, "Your Class is: "..GetProfileName(user.iProfile))
			end
			return 1
		elseif (cmd == "+passwordlist" and user.iProfile == 0) then
			ShowAllPass(user)
			return 1
		elseif (cmd == "+repass") then
			local s,e,pass = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (pass == nil) then
				user:SendPM(sBot, "Syntax Error, +repass , you must write a password.")
			elseif (user.iProfile == -1) then
				user:SendPM(sBot, "You are not registered in this HUB.")
			else
				AddRegUser(user.sName, pass, user.iProfile)
				user:SendPM(sBot, "Your password as been changed to: "..pass)
			end
			return 1
		elseif (cmd == "+changepass" and user.iProfile == 0) then
			local s,e,nick,pass,profile = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")
			if (nick == nil or pass == nil) then
				user:SendPM(sBot, "Syntax Error, +changepass  , you must write a nick and a password.")
			elseif (GetItemByName(nick) == nil) then
				if (CheckIfRegged(nick) == 0) then
					user:SendPM(sBot, "The user "..nick.." is not registered in this HUB.")
				else
					if (strlower(nick) == strlower(sImuneUser)) then
						user:SendPM(sBot, "You can't change the password of this user.")
					else
						nick,profile = CheckForName(nick)
						AddRegUser(nick, pass, profile)
						user:SendPM(sBot, "The password of the user "..nick.." as been changed to: "..pass)
					end
				end
			elseif (GetItemByName(nick).iProfile == -1) then
					user:SendPM(sBot, "The user "..nick.." is not registered in this HUB.")
			else
				if (strlower(nick) == strlower(sImuneUser)) then
					user:SendPM(sBot, "You can't change the password of this user.")
				else
					AddRegUser(GetItemByName(nick).sName, pass, GetItemByName(nick).iProfile)
					user:SendPM(sBot, "The password of the user "..nick.." as been changed to: "..pass)
				end
			end
			return 1
		elseif (cmd == "+getpass" and user.iProfile == 0) then
			local s,e,nick = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if (nick == nil) then
				user:SendPM(sBot, "Syntax Error, +getpass , you must write a nick.")
			elseif (CheckIfRegged(nick) == 0) then
				user:SendPM(sBot, "The user "..nick.." is not registered in the HUB.")
			else
				if (strlower(nick) == strlower(sImuneUser)) then
					user:SendPM(sBot, "You can't see the password of this user.")
				else
					user:SendOM(sBot, "The password of the user "..nick.." is: "..CheckIfRegged(nick))
				end
			end
			return 1
		end
	end
end

function CheckIfRegged(usr)
	readfrom(fRegDat)
	while 1 do
		local sLine = read()
		if (sLine == nil) then
			readfrom()
			return 0
		else
			local s,e,nick,pass = strfind(sLine, "(.+)|(.+)|.+")
			if (nick ~= nil and pass ~= nil and strlower(nick) == strlower(usr)) then
				readfrom()
				return pass
			end
		end
	end
end

function CheckForName(nick)
	local profile = 0
	while profile < iProfiles do
		local usr,aux
		for aux, usr in GetUsersByProfile(GetProfileName(profile)) do
			if (strlower(usr) == strlower(nick)) then
				return usr,profile
			end
		end
		profile = profile + 1
	end
	return "ERROR"
end

function ShowWatched(user)
	local sTmp,usr,data = "List of Users watched by you:\r\n\r\n"
	for usr, data in arrWatch[user.sName] do
		sTmp = sTmp.."User: "..usr.."\tStatus: "..data.."\r\n"
	end
	user:SendPM(sBot, sTmp)
end

function LogWatched(user, data)
	local op,usr,aux,aux2
	for op, aux in arrWatch do
		for usr, aux2 in arrWatch[op] do
			if (usr == strlower(user.sName)) then
				arrWatch[op][usr] = data
				if (GetItemByName(op) ~= nil) then
					GetItemByName(op):SendPM(sBot, "The user "..usr.." has "..data)
				end
				return
			end
		end
	end
end

function ShowAllPass(user)
	local profile,sTmp = 0,"The List of all passwords in the HUB:\r\n\r\n"
	while profile < iProfiles do
		local count,usr,aux = 0
		sTmp = sTmp.."--## "..GetProfileName(profile).." ##--\r\n\r\n"
		for aux, usr in GetUsersByProfile(GetProfileName(profile)) do
			if (strlower(usr) ~= strlower(sImuneUser)) then
				sTmp = sTmp.."User: "..usr.."\tPassword: "..CheckIfRegged(usr).."\r\n"
				count = count + 1
			end
		end
		sTmp = sTmp.."Total: "..count.."\r\n"
		sTmp = sTmp.."\r\n"
		profile = profile + 1
	end
	user:SendPM(sBot, sTmp)
end

function GetTime()
	s = date("%S")
	h = date("%H")
	m = date("%M")
	d = date("%d")
	mm = date("%m")
	y = date("%y")
	Date = "Day: "..d.."/"..mm.."/20"..y.." Hour: "..h..":"..m..":"..s
	return Date
end
			
function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";
	sTmp = ""

	sTmp = sTmp..sTab..sTableName.." = {\n"

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end

		sTmp = sTmp..",\n"
	end

	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(file)
	if (readfrom(file) ~= nil) then
		readfrom(file)
		dostring(read("*all"))
		readfrom()
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

D-J Valhala

hehe perfect  :D
thanks alot :P
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

SMF spam blocked by CleanTalk