PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: plop on 02 July, 2004, 16:45:36

Title: KVIP
Post by: plop on 02 July, 2004, 16:45:36
made on request.
tested and working.
-- KVIP script.
-- gives some VIPs the right to kick without adding a new profile.
-- only masters can add/remove them.
-- script requested by: (MM)(nl)rjsconn/rick
-- by plop

-- name of the bot (doesn't resgister in the userlist).
Bot = "sneaky_kick"
-- folder where the files are saved (you can't do without it).
folder = "vipkick"
-- log file name for the kicks.
file = "vipkick.log"

-- place the name of the opchat for scripted opchat or
--frmHub:GetOpChatName() for the ptokax built-in opchat
opchat = nil

------------------------------------------

function Main()
   if readfrom(folder.."/KVIP.lua") then
      dofile(folder.."/KVIP.lua")
      readfrom()
   else
      tKickingVIPs = {}
   end
end

function WriteLog(kicker, victum, reason)
   appendto(folder.."/"..file)
   local msg = kicker.." kicked: "..victum.." because of: "..reason
   if opchat then
      SendPmToOps(opchat, msg.."|")
   else
      SendPmToOps(Bot, msg.."|")
   end
   write(msg.."\n")
   writeto()
end

function SaveKvip()
   writeto(folder.."/KVIP.lua")
   write("tKickingVIPs = {")
   local t = nil
   for a,b in tKickingVIPs do
      write( (t or "").."\n".."\t[\""..a.."\"] = 1" )
      if t == nil then
         t = ","
      end
   end
   write("\n}")
   writeto()
end

function DoKick(user, data)
   local s,e,victum, reason = strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
   if victum == "" then
      return "I need a name to know who to kick!!"
   elseif reason == "" then
      return "I need a reason to kick the user!"
   else
      local victem = GetItemByName(victum)
      if victem ~= nil then
         if victem.iProfile == 3 or victem.iProfile == -1 then
            WriteLog(user.sName, victum, reason)
            victem:SendData(Bot, "You have been kicked by: "..user.sName.." because of: "..reason.."|")
            victem:Kick()
            return victum.." has been kicked!"
         else
            return "We don't kick Operators or VIP's!!"
         end
      else
         return victum.." Isn't in the hub!!"
      end
   end
end

function AddKick(user, data)
   local s,e,kvip = strfind(data, "%b<>%s+%S+%s*(%S*)")
   if kvip ~= "" then
      local KVIP = GetItemByName(kvip)
      if KVIP ~= nil then
         if KVIP.iProfile == 2 then
            tKickingVIPs[KVIP.sName]=1
            SaveKvip()
            return kvip.." can now kick users!"
         elseif KVIP.iProfile ~= 2 then
            return kvip.." isn't a VIP!"
         end
      else
         return "Unknown user!"
      end
   else
      return "I need the name of the VIP to be able to add him!"
   end
end

function DelKick(user, data)
   local s,e,kvip = strfind(data, "%b<>%s+%S+%s*(%S*)")
   if kvip ~= "" then
      if tKickingVIPs[kvip] then
         tKickingVIPs[kvip]=nil
         SaveKvip()
         return kvip.." can't kick anymore!"
      else
         return kvip.." was no KVIP!"
      end
   else
      return "I need the name of the VIP to be able to remove him!"
   end
end

function DataArrival(user, data)
   if tKickingVIPs[user.sName] then
      if(strsub(data, 1, 4) == "$To:") then
         local s,e,whoTo = strfind(data,"$To:%s+(%S+)")
         if whoTo == Bot then
            data=strsub(data,1,strlen(data)-1)
            local s,e,cmd = strfind(data, "%$%b<>%s+(%S+)")
            if cmd == "!kick" then
               data = strfind(data, "(%$%b<>.*)")
               user:SendData(Bot, DoKick(user, data).."|")
               return 1
            end
         end
      elseif( strsub(data, 1, 1) == "<" ) then
         data=strsub(data,1,strlen(data)-1)
         local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
         if cmd == "!kick" then
            user:SendData(Bot, DoKick(user, data).."|")
            return 1
         end
      end
   elseif user.iProfile == 0 then
      if(strsub(data, 1, 4) == "$To:") then
         local s,e,whoTo = strfind(data,"$To:%s+(%S+)")
         if whoTo == Bot then
            data=strsub(data,1,strlen(data)-1)
            local s,e,cmd = strfind(data, "%$%b<>%s+(%S+)")
            data = strfind(data, "(%$%b<>.*)")
            if cmd == "!addvipkick" then
               user:SendData(Bot, AddKick(user, data).."|")
               return 1
            elseif cmd =="!delvipkick" then
               user:SendData(Bot, DelKick(user, data).."|")
               return 1
            end
         end
      elseif( strsub(data, 1, 1) == "<" ) then
         data=strsub(data,1,strlen(data)-1)
         local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
         if cmd == "!addvipkick" then
            user:SendData(Bot, AddKick(user, data).."|")
            return 1
         elseif cmd =="!delvipkick" then
            user:SendData(Bot, DelKick(user, data).."|")
            return 1
         end
      end
   end
end

plop
Title:
Post by: Troubadour on 02 July, 2004, 23:31:46
Awesome script m8.

Regards,
Troubadour
Title:
Post by: plop on 03 July, 2004, 00:02:10
QuoteOriginally posted by Troubadour
Awesome script m8.

Regards,
Troubadour
thx.

plop
Title:
Post by: Seiya on 29 July, 2004, 22:07:46
Testing and working fine, thanks plop
I like very much all your scripts

Another way, perhaps less in memory :

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"
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 cmd == "!vipkick" then
if victim.iProfile == 2 then
if supervip[victim.sName] == nil then
supervip[victim.sName] = 1
else
supervip[victim.sName] = supervip[victim.sName] + 1
dosavesupervip()
SendPmToOps(sBot,"L'op "..user.sName.." vient d'attribuer le statut de SuperVIP ? "..victim.sName)
victim:SendPM(sBot,"F?licitations, tu viens d'obtenir le statut de SuperVIP. Reconnecte toi pour obtenir ta commande de kick")
end
else
user:SendData(sBot,"L'user "..victim.sName.." n'?tant pas VIP, ne peut b?n?ficier du statut Super 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,"L'Op "..user.sName.." a retir? le statut de Super-VIP ? "..victim.sName)
victim:SendPM(sBot,"Tu viens d'?tre d?chu de tes droits de Super-VIP")
end
else
user:SendData(sBot,"L'user "..victim.sName.." n'est pas un Super 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 then
if victim.iProfile == -1 or victim.iProfile == 3 then
SendToAll(sBot,"Le Super-VIP "..user.sName.." a kick? "..victim.sName.." pour la raison suivante : "..reason)
victim:SendPM(Sbot,"Le Super-VIP "..user.sName.." t'a kick? pour la raison suivante : "..reason)
victim:TempBan()
victim:Disconnect()
else
user:SendData(sBot,"Tu ne peux pas kick? un Op ou VIP")
end
else
user:SendData(sBot,"Tu n'es pas habilit? ? utiliser cette commande")
end
return 1
end
end
end


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

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

with a file named "svip.txt" in the log's directory

Sorry I haven't translated it in english  ;)

Respectfully

Seiya
Title:
Post by: blackwings on 05 August, 2004, 01:10:35
hmm, can someone add so that a VIP can't kick to many times under period? If they do that, they will be temporary disabled from useing kick, until a OP removes them from the "abuse" list.

EDIT:
Quite some time ago, there was a thread in one of the two LUA forums in the request section a thread, which had several version of K-VIP, but I can't find it and I don't know it one of them has the function I reqesting:P
Title:
Post by: plop on 05 August, 2004, 01:25:49
QuoteOriginally posted by blackwings
hmm, can someone add so that a VIP can't kick to many times under period? If they do that, they will be temporary disabled from useing kick, until a OP removes them from the "abuse" list.
take a look @ my VIPvote kick.
with that the vip's can kick but not alone, this makes it a lot harder 2 abuse it.

plop
Title:
Post by: blackwings on 05 August, 2004, 02:44:39
QuoteOriginally posted by plop
QuoteOriginally posted by blackwings
hmm, can someone add so that a VIP can't kick to many times under period? If they do that, they will be temporary disabled from useing kick, until a OP removes them from the "abuse" list.
take a look @ my VIPvote kick.
with that the vip's can kick but not alone, this makes it a lot harder 2 abuse it.

plop

well, I will only have 1 or 2 K-VIP's, so vote doesn't work to good for me :P
Title:
Post by: Seiya on 05 August, 2004, 05:26:00
hummmm plop's solution seems to be the best way I  think

But :
iyou give the right to kick to the vip (kvip) so you know him and have a certain confidence. If he abuse, you can revoqk the right

In an other way : you can limit (as plo and I do) the kick to users and reg, or users unreg only
Title:
Post by: blackwings on 05 August, 2004, 12:29:40
QuoteOriginally posted by Seiya
hummmm plop's solution seems to be the best way I  think

But :
iyou give the right to kick to the vip (kvip) so you know him and have a certain confidence. If he abuse, you can revoqk the right

In an other way : you can limit (as plo and I do) the kick to users and reg, or users unreg only

and how do I limit it so they can just kick reg and unreg users?
Title:
Post by: blackwings on 05 August, 2004, 18:02:37
QuoteOriginally posted by blackwings
QuoteOriginally posted by Seiya
hummmm plop's solution seems to be the best way I  think

But :
iyou give the right to kick to the vip (kvip) so you know him and have a certain confidence. If he abuse, you can revoqk the right

In an other way : you can limit (as plo and I do) the kick to users and reg, or users unreg only

and how do I limit it so they can just kick reg and unreg users?

hmm, ok, decided I wanted plop script KVIP script, but could anyone add so that only VIP's with a username from a certain list, like kvip.dat, can use kick? For example:

In the kvip.dat, the username [K-VIP]Username is saved, so that makes him able to use !kick, but for those VIP that hasnt' there username saved in that file, they won't be able to use !kick.
Title:
Post by: Seiya on 05 August, 2004, 18:53:41
in my script = the k-VIP is registered in a txt file
and only these vip can kick
and only reg and unreg (lower profile)
i send the raw command in the right click too


in plop's too as far as i can see, but registered in the script itself
and you can only kick lower profile too
i've tested plop and it works fine

Seiya
Title:
Post by: blackwings on 05 August, 2004, 19:14:08
QuoteOriginally posted by Seiya
in my script = the k-VIP is registered in a txt file
and only these vip can kick
and only reg and unreg (lower profile)
i send the raw command in the right click too


in plop's too as far as i can see, but registered in the script itself
and you can only kick lower profile too
i've tested plop and it works fine

Seiya

could you translate your script, I don't understand France
Title:
Post by: Seiya on 05 August, 2004, 21:45:03
oki

-- K-VIP by Seiya
-- Version 1.0
-- add kick to the VIP you want
-- without creating a new profile

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 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 have a look at your right click for kick command")
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 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 then
user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
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


I hope it help you and reply to what you're searching about
Title:
Post by: blackwings on 06 August, 2004, 11:30:39
you're script works, except from when you use it with RoboCop 7.0a. It says that you're not allowed to use the command. But if say that VIP's are able to kick in RoboCop, then you can kick. But when you do that, all VIP's can kick, even those that haven't been given the K-VIP status

Is there a way to get around this? Or is it impossible?
Title:
Post by: Seiya on 06 August, 2004, 19:08:46
Hum
could you explain more?
I can't understand why it won't work with robocop : i've done a new command for the K-VIP witch is : !kik in my script and not !kick
Except if this command exist in Robocop 7.0, it could'nt interfer with Robocop.

and you don't have to say in Robovop that vip can kick (if you do that, it'sn normal that all the vip can kick)
In the Robocop config, vip can't kick

use the !kik command fot the K-VIP

For more security, i'm going to test it with Robocop 7.0... and reply

+++
Title:
Post by: blackwings on 06 August, 2004, 22:58:51
QuoteOriginally posted by Seiya
Hum
could you explain more?
I can't understand why it won't work with robocop : i've done a new command for the K-VIP witch is : !kik in my script and not !kick
Except if this command exist in Robocop 7.0, it could'nt interfer with Robocop.

and you don't have to say in Robovop that vip can kick (if you do that, it'sn normal that all the vip can kick)
In the Robocop config, vip can't kick

use the !kik command fot the K-VIP

For more security, i'm going to test it with Robocop 7.0... and reply

+++

I think that Optimus have made a function that checks for the raw command that is sent, so even if you're command is different, you're raw command send to the hub is the same
Title:
Post by: plop on 07 August, 2004, 02:04:17
QuoteOriginally posted by Seiya in plop's too as far as i can see, but registered in the script itself
i'm using a table which is saved into the folder.
check the function SaveKvip() for how i do this.

the trouble with RC can be solved in 2 way's.
1) rename the kick cmd.
2) rename the script so it runs before RC (a name like aKvip.lua should solve that).

plop
Title:
Post by: Seiya on 07 August, 2004, 03:14:25
Thanks plop
because mine is named betasvip.lua in my test
and with robocop 7.0, it works
but i can't find the 7.0a
so.........
Title:
Post by: Seiya on 07 August, 2004, 03:19:58
Quotei'm using a table which is saved into the folder.
check the function SaveKvip() for how i do this.

Yep plop, I haven't look, well, saved in KVP.lua
Respectfully
Title:
Post by: blackwings on 07 August, 2004, 14:13:38
The kick work now in Seiya's script, but everyone gets the KVIP kick in their right click menu and everyone can use the kick command.

Could you fix this Seiya
Title:
Post by: Seiya on 07 August, 2004, 14:25:48
Hum... i have a look at that

and if you disable the vip (!vipunkick) = is it really disable when it reconnect the hub?
Title:
Post by: Seiya on 07 August, 2004, 14:59:31
bug fix

-- K-VIP by Seiya
-- Version 1.1
-- add kick to the VIP you want
-- without creating a new profile
-- fix bug : all vip have the 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 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
user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
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
Title:
Post by: blackwings on 08 August, 2004, 01:18:24
it works a little bit better, but all VIP's can kick, both with !kik and that RoboCop for some strange reason sends the normal !kick command to the right click menu.

So now all VIP's can use both !kick and !kik.
Title:
Post by: Seiya on 08 August, 2004, 10:39:48
hummm no.
I've tested it with robocop 7 and it wotks perfectly

if vip can user the !kick command, it's due to the fact that in your robocop config, you've allowed vip to kick

for the kvip script, delete the svip.txt you've got
and create an empty one, and restart your hub
Title:
Post by: blackwings on 08 August, 2004, 15:37:36
ya, I had forgot the thing that I allowed VIP to kick in RC 7. I disabled the kick for VIP in RC 7.

Anyway, whats not working is that the one that gets kicked doesn't get a message about it.


I get this error message(btw, I use ptokax 0.3.3.0 build 15.25) =

Syntax error: attempt to index global `victim' (a nil value)
stack traceback:
   1:  function `DataArrival' at line 30 [file `C:ptokax\scripts\aKVIP.lua']

hmm, it says that victim is a global, doesn't that mean that you need a declaration of it before the code with the functions start?

EDIT: Hmm, another thing I noticed. If you make someone a KVIP, then after their nickname is added, you degrade them to Reg, they can still kick, because their username is in the svip.txt

EDIT2: Oh, after the bugs is fixed, could you make so that the K-VIP can use the !userinfo command? And if it's possible (this is just a nice thing if it was possible), make KVIP able to chat in the OP-Chat
Title:
Post by: Seiya on 08 August, 2004, 16:13:41
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
Title:
Post by: blackwings on 08 August, 2004, 16:25:23
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.
Title:
Post by: Seiya on 10 August, 2004, 07:45:32
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
Title:
Post by: Seiya on 10 August, 2004, 19:28:55
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
Title:
Post by: blackwings on 11 August, 2004, 13:23:08
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
Title:
Post by: Seiya on 11 August, 2004, 19:30:14
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
Title:
Post by: blackwings on 12 August, 2004, 11:43:45
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
Title:
Post by: Seiya on 12 August, 2004, 19:12:35
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
Title:
Post by: blackwings on 14 August, 2004, 01:48:01
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 :)
Title:
Post by: Seiya on 15 August, 2004, 11:36:38
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,"_,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


Respectfully
Title:
Post by: jiten on 19 August, 2004, 19:22:20
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?
Title:
Post by: Seiya on 20 August, 2004, 03:15:53
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,"_,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

Respectfully
Title:
Post by: jiten on 20 August, 2004, 09:08:06
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
Title:
Post by: Seiya on 20 August, 2004, 19:27:35
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
Title:
Post by: jiten on 20 August, 2004, 21:13:52
thanks Seiya. now it is working well.
Title:
Post by: Seiya on 20 August, 2004, 21:52:06
Thanks Jiten for testing

I've done it with you and Blackwings
Title:
Post by: jiten on 08 November, 2004, 09:43:55
-- 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,"_,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

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
Title:
Post by: hac on 29 November, 2004, 19:51:44
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']
Title:
Post by: jiten on 29 November, 2004, 21:54:47
Hi there hac.

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

Best regards,

jiten
Title:
Post by: hac on 29 November, 2004, 22:18:55
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 ;)
Title:
Post by: jadehenry04 on 23 March, 2005, 07:58:39
I got this ??
Syntax ...of ?????.? M?'?? ?V?] H?l?.?.?? ??\scripts\K-VIP.lua:132: attempt to call global `readfrom' (a nil value)
Title:
Post by: jiten on 23 March, 2005, 08:14:31
You get that error because the script u are using isn't fully converted in Lua 5 (file handling issue).
Title:
Post by: jadehenry04 on 23 March, 2005, 08:17:40
so does it matter? if so how i fix it? lol i aint no script writer lol!!
Title:
Post by: jiten on 23 March, 2005, 08:23:41
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.
Title:
Post by: jadehenry04 on 23 March, 2005, 08:26:21
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!!
Title:
Post by: jiten on 23 March, 2005, 09:27:37
QuoteOriginally posted by jadehenry04
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!!

With this script u can give certain VIPs the ability to kick (so they become KVIPs).

It doesnt include the kick report to the ops, but, i'll check it, and u don't need to verify the kicks eheh

Cheers.
Title:
Post by: jadehenry04 on 23 March, 2005, 09:33:29
ok cheers m8 any idea on how long it will take to check the script? oh wat eva u gunna do lol xx
Title:
Post by: jiten on 23 March, 2005, 09:36:54
I guess I'll have it ready tomorrow because today I don't have much time.
Title:
Post by: jadehenry04 on 23 March, 2005, 09:45:06
kool cheers any way m8 :)
Title:
Post by: jiten on 24 March, 2005, 15:06:56
QuoteOriginally posted by jadehenry04
kool cheers any way m8 :)

Check this (http://board.univ-angers.fr/thread.php?threadid=4033&boardid=26&styleid=1&sid=48553798db6a1b6a2f890e576637f939&page=1#1) .

Best regards,

jiten