KVIP - 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

KVIP

Started by plop, 02 July, 2004, 16:45:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Seiya

ptokax 0.3.3.0 build 15.25 is a beta version of ptokax and have many bugs.

I use this script in TD4 in my hub and it works perfectly :
No syntax errors in script file F:\Dragon\Scripts\Packages\PtokaX-0[1].326.TestDrive4\scripts\K-VIP.lua
No syntax errors in script file F:\Dragon\Scripts\Packages\PtokaX-0[1].326.TestDrive4\scripts\RoboCopv7.0.lua


EDIT 1 : If fix the problem when you degrade to Reg a kVip user : I've added this condition :

if supervip[user.sName] ~= 0 and user.iProfile == 2 then
kik autoris?

and I've retired the right command if the user is not a VIP and not KVIP (if you degrade an KVIP to Reg for example)

EDIT 2 : I've done it on my hub but I use my own scripts; Robocop 7 is a compiled version, so I can't in this way change the code to give the autorisation to use the !userinfo and the Op-Chat = one solution : create a new !userinfo for the KVIP in the script KVIP itself and creat an new chat channel for OP, Master, Admin and KVIP

Just tell me if you want it

I Post the new version

-- K-VIP by Seiya
-- Version 1.2
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command


sBot = "@Dohko"

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
supervip = {}

function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if (victim.iProfile == 2) and (supervip[victim.sName] == nil) then
	supervip[victim.sName] = 0
	end
	if cmd == "!vipkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")	
		end
	return 1
	elseif cmd == "!vipunkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
				victim:SendPM(sBot,"You've been revoked from K-VIP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!kik" then
		if supervip[user.sName] ~= 0 and user.iProfile == 2 then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
			victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			victim:TempBan()
			victim:Disconnect()
			else
			user:SendData(sBot,"You can't kick an OP or VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
	if user.iProfile == 2 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
	end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
end
end

Respectfully

blackwings

#26
QuoteOriginally posted by Seiya

EDIT 2 : I've done it on my hub but I use my own scripts; Robocop 7 is a compiled version, so I can't in this way change the code to give the autorisation to use the !userinfo and the Op-Chat = one solution : create a new !userinfo for the KVIP in the script KVIP itself and creat an new chat channel for OP, Master, Admin and KVIP

Just tell me if you want it

Sure, I want it, please :)

EDIT: I noticed a bug with version 1.2, the K-VIP/kick doesn't appear in the right click menu, even if the user has it nick added to svip.txt and has the status VIP(profile 2). But the KVIP can use it if he/she types the command instead.


Seiya

To have the command in right click, ths k-vip must reconnect (the command is sent in the NuwUserConnected function)

But i've noticed another buf before doing your commands (don't laugh please) : I forgot to launch the svip.txt at the beginning , so when you restart your hub or script, you loss all your k-vip users, instead they are in the svip.txt file.

I'll do it tonight I think

Respectfully

Seiya

Ok
everybody is laughing

But i'Ve load the kvip list when starting the hub (!!!!!!!!!)

-- K-VIP by Seiya
-- Version 1.3
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command
-- fix bug : load (don't laugh) the svip.txt file when starting the script

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
supervip = {}

function Main()
	loadfile(savevipkick)
end

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end


function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if (victim.iProfile == 2) and (supervip[victim.sName] == nil) then
	supervip[victim.sName] = 0
	end
	if cmd == "!vipkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")	
		end
	return 1
	elseif cmd == "!vipunkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
				victim:SendPM(sBot,"You've been revoked from K-VIP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	elseif cmd == "!inf" then
		if (user.iProfile == 2) and (supervip[user.sName] ~= 0) then
			UserInfo(user,data)
		end
	return 1
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!kik" then
		if (supervip[user.sName] == 1) and (user.iProfile == 2) then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
			victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			victim:TempBan()
			victim:Disconnect()
			else
			user:SendData(sBot,"You can't kick an OP or VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
	if user.iProfile == 2 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
	end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
end
end

function loadfile (savevipkick)
	assert(readfrom(savevipkick))
	dostring(read("*all"))
	readfrom()
end

I'll have a look for your commands Blackwings

blackwings

#29
When you type anything in main chat, you get this error message =
Syntax error: attempt to index global `victim' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 36 [file `C:\ptokax\scripts\aKVIP.lua']
This error message can be related to why the kicked person doesn't get a message about why he/she got kicked.


And when a KVIP use the !inf command, I get this error message =
Syntax error: attempt to call global `UserInfo' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 70 [file `C:\ptokax\scripts\aKVIP.lua']

So nothing happens when I try to use the !inf command


Seiya

Hi

Error 1 : sorry, I'haven't done it when post it but you must delete the  line 36 37 and 38
It works like this in my hub and its'ok

Error 2 : hihihihihi, It was the beginning of what I'm going to do.... The UserInfo command isn't existing yet, the beginning of what you're looking for

Respectfully

blackwings

#31
If it's ok by you Seiya, I have fixed the bug and made some small changes. If you want me to remove this, just PM me about it, ok?

The script seems to be working perfectly now (except for the !inf command that Seiya hasn't finished yet)
-- K-VIP by Seiya
-- Version 1.4b
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command
-- fix bug : load (don't laugh) the svip.txt file when starting the script
-- fixed bug : kicked user doesn't get a reason message - by blackwings
-- Made some changes in the messages that the bot sends - by blackwings
-- Changed the names of the commands - by blackwings
-- line 36,37 and 38 from v1.3 is removed. The error message about line 36 is gone - by blackwings
-- Messages about users that gets kicked, goes to Ops only, not in main chat - by blackwings

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file in the ptokax\scripts\logs directory
supervip = {}

function Main()
	loadfile(savevipkick)
end

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end


function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if cmd == "!addkvip" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The OP "..user.sName.." gave K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"Congratulations, you've been upgraded to K-VIP. Just have a look at your right click menu for the kick command or use !vkick when you find a rule breaker. Just remeber that to read the rules carefully and kick only when you're sure that it's needed. If it's a heavy rule break that needs banning, then report the user to a OP")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The OP "..user.sName.." gave K-VIP status to "..victim.sName)
				victim:SendPM(sBot,"Congratulations, you've been upgraded to K-VIP. Just have a look at your right click menu for the kick command or use !vkick when you find a rule breaker. Just remeber that to read the rules carefully and kick only when you're sure that it's needed. If it's a heavy rule break that needs banning, then report the user to a OP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet, so this user can't be upgraded to K-VIP")	
		end
	return 1
	elseif cmd == "!delkvip" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The OP "..user.sName.." has just revoked "..victim.sName.." K-VIP status")
				victim:SendPM(sBot,"You've been revoked from the K-VIP status")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	elseif cmd == "!inf" then
		if (user.iProfile == 2) and (supervip[user.sName] ~= 0) then
			UserInfo(user,data)
		end
	return 1
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!vkick" then
		if (supervip[user.sName] == 1) and (user.iProfile == 2) then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendPmToOps(sBot,"The "..user.sName.." kicked "..victim.sName.." - reason : "..reason)
			victim:SendData(sBot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			victim:TempBan()
			victim:Disconnect()
			else
			user:SendData(sBot,"You can't kick an OP or a VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
	if user.iProfile == 2 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !vkick %[nick] %[line:Reason for the kick]||")
	end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Add K-VIP$<%[mynick]> !addkvip %[nick]||")
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Del K-VIP$<%[mynick]> !delkvip %[nick]||")
end
end

function loadfile (savevipkick)
	assert(readfrom(savevipkick))
	dostring(read("*all"))
	readfrom()
end


Seiya

Thanks,  well done Blackwings
 
For the name's commands  changes........ you do as you want. I'm a french man and the script run in french mode in my hub.

I'm out of home tonight...I will finish your special commands tomorrow

Thanks.

Respectfully

blackwings

QuoteOriginally posted by Seiya
Thanks,  well done Blackwings
 
For the name's commands  changes........ you do as you want. I'm a french man and the script run in french mode in my hub.

I'm out of home tonight...I will finish your special commands tomorrow

Thanks.

Respectfully

When the !inf command is complete, then the script will be prefect :)


Seiya

As wanted :

-- K-VIP by Seiya
-- Version 1.5
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command
-- fix bug : load (don't laugh) the svip.txt file when starting the script
-- add the userinfo command	

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
supervip = {}

function Main()
	loadfile(savevipkick)
end

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end


function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if cmd == "!vipkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")	
		end
	return 1
	elseif cmd == "!vipunkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
				victim:SendPM(sBot,"You've been revoked from K-VIP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	elseif cmd == "!inf" then
		if (user.iProfile == 2) and (supervip[user.sName] ~= 0) then
			UserInfo(user,data)
		end
	return 1
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!kik" then
		if (supervip[user.sName] == 1) and (user.iProfile == 2) then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
			victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			victim:TempBan()
			victim:Disconnect()
			else
			user:SendData(sBot,"You can't kick an OP or VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
	if user.iProfile == 2 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
	user:SendData("$UserCommand 1 2 K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||")
	end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
end
end

function loadfile (savevipkick)
	assert(readfrom(savevipkick))
	dostring(read("*all"))
	readfrom()
end

function UserInfo(user, data)
s,e,cmd,who = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*")
local usr = GetItemByName(who)
if usr == nil then
return 1
end
if usr.iProfile == 4 then
profile = "Admin"
elseif usr.iProfile == -1 then
profile = "User"
elseif usr.iProfile == 0 then
profile = "Master"
elseif usr.iProfile == 1 then
profile = "Operator"
elseif usr.iProfile == 2 and supervip[usr.sName] == 0 then
profile = "VIP"
elseif usr.iProfile == 2 and supervip[usr.sName] == 1 then
profile = "K-VIP"
elseif usr.iProfile == 3 then
profile = "Reg"
else
profile = "Unknown"
end


user:SendPM(sBot, "? Name: "..who.." |")
user:SendPM(sBot, "? Profile: "..profile.." |")
user:SendPM(sBot, "? IP: "..usr.sIP.." |")

_,b, dcver = strfind(usr.sMyInfoString,"V:(%x+.%x+)")
if (strfind(usr.sMyInfoString,"

Respectfully

jiten

Seiya, your script really works well except for the fact that VIPs wihout the K-VIP status can assign or revoke that status to/from anyone they want.
can you check it, please?

Seiya

thanks Jiten
Check :

-- K-VIP by Seiya
-- Version 1.6
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command
-- fix bug : load (don't laugh) the svip.txt file when starting the script
-- fix bug : VIP can't add/revoke VIP to/from K-VIP anymore
-- add the userinfo command	

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
supervip = {}

function Main()
	loadfile(savevipkick)
end

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end


function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if cmd == "!vipkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")	
		end
	return 1
	elseif cmd == "!vipunkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
				victim:SendPM(sBot,"You've been revoked from K-VIP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	elseif cmd == "!inf" then
		if ((user.iProfile == 2) and (supervip[user.sName] == 1)) or (user.iProfile == 0) or (user.iProfile == 4) then
			UserInfo(user,data)
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	else
		user:SendData(sBot,"You're not allowed to use this command")
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!kik" then
		if (supervip[user.sName] == 1) and (user.iProfile == 2) then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
			victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			victim:TempBan()
			victim:Disconnect()
			else
			user:SendData(sBot,"You can't kick an OP or VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
	if user.iProfile == 2 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
	user:SendData("$UserCommand 1 2 K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||")
	end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||")
end
end

function loadfile (savevipkick)
	assert(readfrom(savevipkick))
	dostring(read("*all"))
	readfrom()
end

function UserInfo(user, data)
s,e,cmd,who = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*")
local usr = GetItemByName(who)
if usr == nil then
return 1
end
if usr.iProfile == 4 then
profile = "Admin"
elseif usr.iProfile == -1 then
profile = "User"
elseif usr.iProfile == 0 then
profile = "Master"
elseif usr.iProfile == 1 then
profile = "Operator"
elseif usr.iProfile == 2 and supervip[usr.sName] == 0 then
profile = "VIP"
elseif usr.iProfile == 2 and supervip[usr.sName] == 1 then
profile = "K-VIP"
elseif usr.iProfile == 3 then
profile = "Reg"
else
profile = "Unknown"
end


user:SendPM(sBot, "? Name: "..who.." |")
user:SendPM(sBot, "? Profile: "..profile.." |")
user:SendPM(sBot, "? IP: "..usr.sIP.." |")

_,b, dcver = strfind(usr.sMyInfoString,"V:(%x+.%x+)")
if (strfind(usr.sMyInfoString,"

Respectfully

jiten

hi there.
well, now the VIPs without that status can't assign or revoke it to anyone but, when i type something in main i get this (the bot's message and mine):

[09:07:04] You're not allowed to use this command
[09:07:04] test

Seiya

Yep
it works well but you've got the message
sorry
fixed :

[code]
-- K-VIP by Seiya
-- Version 1.6
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the command
-- fix bug : Kvip which is degrated can't use anymore the kik command
-- fix bug : load (don't laugh) the svip.txt file when starting the script
-- fix bug : VIP can't add/revoke VIP to/from K-VIP anymore
-- add the userinfo command   

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
supervip = {}

function Main()
   loadfile(savevipkick)
end

function dosavesupervip(user,data)
   writeto(savevipkick) ;
   write("supervip = {");
   for a,b in supervip do
      if b then
         write(format("[%q]=",a)..b..",");
      end
   end
   write("}" );
   writeto();
end


function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
   data=strsub(data,1,strlen(data)-1)
   s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
   victim = GetItemByName(Name)
   if cmd == "!vipkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then
      if victim.iProfile == 2 then
         if supervip[victim.sName] == nil then
            supervip[victim.sName] = 1
            dosavesupervip()
            SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
            victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
         else
            supervip[victim.sName] = supervip[victim.sName] + 1
            dosavesupervip()
            SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName)
            victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click")
         end
      else
         user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")   
      end
   return 1
   elseif cmd == "!vipunkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then
      if victim.iProfile == 2 then
         if supervip[victim.sName] ~= 0 then
            supervip[victim.sName] = 0
            dosavesupervip()
            SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
            victim:SendPM(sBot,"You've been revoked from K-VIP")
         end
      else
         user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
      end
   return 1
   elseif cmd == "!inf" then
      if ((user.iProfile == 2) and (supervip[user.sName] == 1)) or (user.iProfile == 0) or (user.iProfile == 4) then
         UserInfo(user,data)
      else
         user:SendData(sBot,"You're not allowed to use this command")
      end
   return 1
   end
   s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
   victim = GetItemByName(Name)
   if cmd == "!kik" then
      if (supervip[user.sName] == 1) and (user.iProfile == 2) then
         if victim.iProfile == -1 or victim.iProfile == 3 then
         SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
         victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
         victim:TempBan()
         victim:Disconnect()
         else
         user:SendData(sBot,"You can't kick an OP or VIP")
         end
      else
         user:SendData(sBot,"You're not allowed to use this command")
      end
   return 1
   end
end
end

function NewUserConnected(user,data)
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then
else
   if user.iProfile == 2 then
   user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
   user:SendData("$UserCommand 1 2 K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||")
   end
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
   user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
   user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
   user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||")
end
end

function loadfile (savevipkick)
   assert(readfrom(savevipkick))
   dostring(read("*all"))
   readfrom()
end

function UserInfo(user, data)
s,e,cmd,who = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*")
local usr = GetItemByName(who)
if usr == nil then
return 1
end
if usr.iProfile == 4 then
profile = "Admin"
elseif usr.iProfile == -1 then
profile = "User"
elseif usr.iProfile == 0 then
profile = "Master"
elseif usr.iProfile == 1 then
profile = "Operator"
elseif usr.iProfile == 2 and supervip[usr.sName] == 0 then
profile = "VIP"
elseif usr.iProfile == 2 and supervip[usr.sName] == 1 then
profile = "K-VIP"
elseif usr.iProfile == 3 then
profile = "Reg"
else
profile = "Unknown"
end


user:SendPM(sBot, "? Name: "..who.." |")
user:SendPM(sBot, "? Profile: "..profile.." |")
user:SendPM(sBot, "? IP: "..usr.sIP.." |")

_,b, dcver = strfind(usr.sMyInfoString,"V:(%x+.%x+)")
if (strfind(usr.sMyInfoString,"_,b, dcgui = strfind(usr.sMyInfoString,"V:(%x+.%x+.%x+)")
clienttype = "DCGUI"
version = dcgui      
elseif (strfind(usr.sMyInfoString,"_,b, nm201 = strfind(usr.sMyInfoString,"V:(%x+.%x+)")
clienttype = "Neo-Modus"
version = nm201
elseif (strfind(usr.sMyInfoString,"<+")) then
if strfind(usr.sMyInfoString,"clienttype = "oDC"
version = dcver
elseif strfind(usr.sMyInfoString,"V:0.%x+%a") then
clienttype = "czDC++"
version = dcver
elseif strfind(usr.sMyInfoString,"L:") or strfind(usr.sMyInfoString,"B:") then
clienttype = "BCDC++"
version = dcver
elseif (strfind(usr.sMyInfoString,"<++")) then
clienttype = "DC++"
version = dcver
end
else
user:SendPM(sBot, "? NMDC1 or BlackDC")
return 1
end

if version == nil then user:SendPM(sBot, "? NMDC1 or BlackDC") return 1 end

user:SendPM(sBot, "? Client: "..clienttype.." v"..version)
-- active or pasive
if strfind(usr.sMyInfoString,"M:A") then
mode = "active"
user:SendPM(sBot, "? Mode: "..mode)
elseif strfind(usr.sMyInfoString,"M:P") then
mode = "pasive"
user:SendPM(sBot, "? Mode: "..mode)
end
-- slot info
_,b, slots = strfind(usr.sMyInfoString,"S:(%x+)")
if slots ~= nil then
user:SendPM(sBot, "? "..slots.." - Slot(s) |")
end
-- hub info
_,b, guest = strfind(usr.sMyInfoString,"H:(%x+)/")
if guest == nil then
_,b, hubs = strfind(usr.sMyInfoString,"H:(%x+)")
if hubs ~= nil then
user:SendPM(sBot, "? "..hubs.." - Hub(s) |")
end
else
_,b, opped = strfind(usr.sMyInfoString,"H:%x+/%x+/(%x+)")
_,b, regged = strfind(usr.sMyInfoString,"H:%x+/(%x+)/")
if regged ~= nil then
user:SendPM(sBot, "? "..guest.." - Hub(s) as user |")
user:SendPM(sBot, "? "..regged.." - Hub(s) as VIP |")
user:SendPM(sBot, "? "..opped.." - Hub(s) as Op |")
end
end

end
(/CODE]

Respectfully

jiten

thanks Seiya. now it is working well.

Seiya

Thanks Jiten for testing

I've done it with you and Blackwings

jiten

-- K-VIP by Seiya 
-- Version 1.6 
-- add kick to the VIP you want 
-- without creating a new profile 
-- fix bug : all vip have the command 
-- fix bug : Kvip which is degrated can't use anymore the kik command 
-- fix bug : load (don't laugh) the svip.txt file when starting the script 
-- fix bug : VIP can't add/revoke VIP to/from K-VIP anymore 
-- add the userinfo command 
-- Added by request a kick log and its command !vkicklog (made by nErBoS)
-- Added by request a Ban to a x amout of Kicks (made by nErBoS)


sBot = "@Dohko" 

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory 
supervip = {} 
fVipLog = "viplog.dat"
arrVipLog = {}
iBan = 4 -- Times of Kick equal to a ban

function Main() 
loadfile(savevipkick) 
LoadFromFile(fVipLog)
end 

function dosavesupervip(user,data) 
writeto(savevipkick) ; 
write("supervip = {"); 
for a,b in supervip do 
if b then 
write(format("[%q]=",a)..b..","); 
end 
end 
write("}" ); 
writeto(); 
end 


function DataArrival (user,data) 
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" ) 
		victim = GetItemByName(Name) 
		if cmd == "!vipkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then 
			if victim.iProfile == 2 then 
				if supervip[victim.sName] == nil then 
					supervip[victim.sName] = 1 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName) 
					victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command") 
				else 
					supervip[victim.sName] = supervip[victim.sName] + 1 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName) 
					victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click") 
				end 
			else 
				user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP") 
			end 
			return 1 
		elseif cmd == "!vipunkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then 
			if victim.iProfile == 2 then 
				if supervip[victim.sName] ~= 0 then 
					supervip[victim.sName] = 0 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP") 
					victim:SendPM(sBot,"You've been revoked from K-VIP") 
				end 
			else 
				user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.") 
			end 
			return 1 
		elseif cmd == "!inf" then 
			if ((user.iProfile == 2) and (supervip[user.sName] == 1)) or (user.iProfile == 0) or (user.iProfile == 4) then 
				UserInfo(user,data) 
			else 
				user:SendData(sBot,"You're not allowed to use this command") 
			end 
			return 1 
		end 
		s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" ) 
		victim = GetItemByName(Name) 
		if cmd == "!kik" then 
			if (supervip[user.sName] == 1) and (user.iProfile == 2) then 
				if victim.iProfile == -1 or victim.iProfile == 3 then 
					SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason) 
					victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason) 
					if (arrVipLog[victim.sName] == nil) then
						arrVipLog[victim.sName] = {}
						arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
						arrVipLog[victim.sName]["TIMES"] = 1
					else
						arrVipLog[victim.sName]["TIMES"] = arrVipLog[victim.sName]["TIMES"] + 1
						arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
					end
					if (arrVipLog[victim.sName]["TIMES"] > iBan) then
						victim:SendPM(Sbot,"You have been kicked "..iBan.." times. You are being banned.")
						arrVipLog[victim.sName]["TIMES"] = 0
						victim:Ban()
					else
						victim:TempBan()
						victim:Disconnect()
					end
					SaveToFile(fVipLog , arrVipLog , "arrVipLog")
				else
					user:SendData(sBot,"You can't kick an OP or VIP")
				end
			else 
				user:SendData(sBot,"You're not allowed to use this command") 
			end 
			return 1 
		end
		s,e,cmd = strfind( data, "%b<>%s+(%S+)")
		if (cmd == "!vkicklog" and user.bOperator) then
			local sTmp,victim,table = "The Kicks Log made by Vips:\r\n\r\n"
			for victim, table in arrVipLog do
				sTmp = sTmp.."Victim: "..victim.." ## Kick: "..table["KICK"].." ## Kicked: "..table["TIMES"].."\r\n"
			end
			user:SendPM(sBot, sTmp)
			return 1
		end
	end 
end 

function NewUserConnected(user,data) 
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then 
else 
if user.iProfile == 2 then 
user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||") 
user:SendData("$UserCommand 1 2 K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||") 
end 
end 
end 

function OpConnected(user,data) 
if user.iProfile == 0 or user.iProfile == 4 then 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||") 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||") 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||") 
end 
end 

function loadfile (savevipkick) 
assert(readfrom(savevipkick)) 
dostring(read("*all")) 
readfrom() 
end 

function UserInfo(user, data) 
s,e,cmd,who = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*") 
local usr = GetItemByName(who) 
if usr == nil then 
return 1 
end 
if usr.iProfile == 4 then 
profile = "Admin" 
elseif usr.iProfile == -1 then 
profile = "User" 
elseif usr.iProfile == 0 then 
profile = "Master" 
elseif usr.iProfile == 1 then 
profile = "Operator" 
elseif usr.iProfile == 2 and supervip[usr.sName] == 0 then 
profile = "VIP" 
elseif usr.iProfile == 2 and supervip[usr.sName] == 1 then 
profile = "K-VIP" 
elseif usr.iProfile == 3 then 
profile = "Reg" 
else 
profile = "Unknown" 
end 


user:SendPM(sBot, "? Name: "..who.." |") 
user:SendPM(sBot, "? Profile: "..profile.." |") 
user:SendPM(sBot, "? IP: "..usr.sIP.." |") 

_,b, dcver = strfind(usr.sMyInfoString,"V:(%x+.%x+)") 
if (strfind(usr.sMyInfoString,"

hac

Syntax error: assertion failed!  No such file or directory

stack traceback:
   1:  function `assert' [C]
   2:  function `loadfile' at line 145 [file `..._0.330_15.25\PtokaX_0.330_15.25\scripts\vip.lua']
   3:  function `Main' at line 23 [file `..._0.330_15.25\PtokaX_0.330_15.25\scripts\vip.lua']

jiten

Hi there hac.

You have to create a file named svip.txt in the scripts\logs directory to solve that error.

Best regards,

jiten

hac

QuoteOriginally posted by jiten
Hi there hac.

You have to create a file named svip.txt in the scripts\logs directory to solve that error.

Best regards,

jiten
tnx ;)

jadehenry04

I got this ??
Syntax ...of ?????.? M?'?? ?V?] H?l?.?.?? ??\scripts\K-VIP.lua:132: attempt to call global `readfrom' (a nil value)

jiten

You get that error because the script u are using isn't fully converted in Lua 5 (file handling issue).

jadehenry04

so does it matter? if so how i fix it? lol i aint no script writer lol!!

jiten

Yes, it does matter because with the script u got, u won't be able to use it perfectly  :D
I will have a look at it and fix/convert it to Lua 5 asap.

Best regards.

jadehenry04

#49
Cheers m8 :) xx really appreciated!!

wat does the script actually do?
i add a KVIP and they get the command to kick sumone dont they? does it notify me that they r gunna kick? do i have to verify the kick so they can?? just wandering never used this script b4!!

SMF spam blocked by CleanTalk