Hi ppl
I need one script.
The script blok to talk unreg users But user can?t use comands !help / !slots ....
ex: User try to talk -? hi and bot sey "you can?t talk in this hub, you ned registery to talk, type !regme pass and wayt to Ops reg you.
Sory about my inglish
Something like this?
ChatArrival = function(user, data)
if not user.bRegistered then return user:SendData(frmHub:GetHubBotName(),"You need to be a registered user to talk in this hub. Type: !regme and wait till the Operators reg you."),1 end
end
Cheers
Hi Again
Sory i don?t speak correct.
No Main chat and PMs and apen a exception for send comands for Hub.
I Have this script but is for Lua 4, But is not very good. Don?t work very god.
[code] -- GagScript v1.1
-- Description: loOol
-- Made by guibs, 22/08/2003
-- Bugfix and optimizations by bonki 22/08/2003
-- Idea and newbie block change from Homem_do_Leme,, :)
BotName = "***Empregado-=P2P=-***"
UserLevel = {}
tSpecialChars = {
["!help"] = 1,
["!regme"] = 1,
["!rules"] = 1,
};
tLevels = { -- Guibs, what is this? CB related conversions? ;-)
- = 8,
[1] = 5,
[2] = 4,
[3] = 3,
[4] = 2,
[5] = 6,
[6] = 7,
[7] = 9,
};
function DataArrival(user, data)
local _, _, cmd = strfind(data, "%b<>%s+(%S+)");
if ((cmd and not tSpecialChars[strsub(cmd, 1, 1)]) and strsub(data, 1, 1) == "<" and CheckUserLevel(user) <= 2) then
user:SendData(BotName, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe.")
return 1;
elseif (strsub(data,1, 4) == "$To:") then
if (CheckUserLevel(user) <= 2) then
_, _, whoTo = strfind(data, "$To:%s+(%S+)")
user:SendPM(whoTo, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe")
return 1;
end
end
return 0
end
--------- Check User Level ---------
function CheckUserLevel(user)
local userlevel = nil
local allprofiles = GetProfiles()
local index, profile, index2, nick
for index, profile in allprofiles do
local users = GetUsersByProfile(profile)
for index2, nick in users do
if nick == user.sName then
userlevel = index
end
end
end
if (userlevel) then
return tLevels[userlevel];
else
return 1;
end
end
[code]
First e have a simples profiles, script creat a error for this, and user write !help / !slots and bot sey all time, user can?t talk :(
Dimmi in italiano che io ti capisco^_^
Try this one then:
ChatArrival = function(user, data)
local data = string.sub(data,1,-2)
local s,e,cmd = string.find(data,"%b<>%s+[%!%?%+%#](%S+)")
local tCmds = {
["help"] = 1,
["regme"] = 1,
["rules"] = 1,
}
if not tCmds[cmd] and not user.bRegistered then
return user:SendData(frmHub:GetHubBotName(),"You need to be a registered user to talk in this hub."),1
end
end
ToArrival = ChatArrival
Cheers
Or this one (not tested, bed is watin me)
-- GagScript v1.1
-- Description: loOol
-- Made by guibs, 22/08/2003
-- Bugfix and optimizations by bonki 22/08/2003
-- Idea and newbie block change from Homem_do_Leme,, :)
-- Lua 5 version by Markitos
BotName = "***Empregado-=P2P=-***"
UserLevel = {}
tSpecialChars = {
["!help"] = 1,
["!regme"] = 1,
["!rules"] = 1,
};
tLevels = { -- Guibs, what is this? CB related conversions? ;-)
[0] = 8,
[1] = 5,
[2] = 4,
[3] = 3,
[4] = 2,
[5] = 6,
[6] = 7,
[7] = 9,
};
function ChatArrival(user, data)
local _, _, cmd = string.find(data, "%b<>%s+(%S+)");
if ((cmd and not tSpecialChars[string.sub(cmd, 1, 1)]) and string.sub(data, 1, 1) == "<" and CheckUserLevel(user) <= 2) then
user:SendData(BotName, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe.")
return 1;
elseif (string.sub(data,1, 4) == "$To:") then
if (CheckUserLevel(user) <= 2) then
_, _, whoTo = string.find(data, "$To:%s+(%S+)")
user:SendPM(whoTo, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe")
return 1;
end
end
return 0
end
--------- Check User Level ---------
function CheckUserLevel(user)
local userlevel = nil
local allprofiles = GetProfiles()
local index, profile, index2, nick
for index, profile in allprofiles do
local users = GetUsersByProfile(profile)
for index2, nick in users do
if nick == user.sName then
userlevel = index
end
end
end
if (userlevel) then
return tLevels[userlevel];
else
return 1;
end
end
Best regards
jiten
Tank You [][][][]s
Markitos
The problem is this
tLevels = { -- Guibs, what is this? CB related conversions? ;-)
- = 8,
[1] = 5,
[2] = 4,
[3] = 3,
[4] = 2,
[5] = 6,
[6] = 7,
[7] = 9,
};
I have the ptokax profiles
Hi Again
Sory its a new request
Can?t open a exception for the unreg user, can?t send Pm?s for profile Admin????
QuoteOriginally posted by ?[-?Genius?-]?
Hi Again
Sory its a new request
Can?t open a exception for the unreg user, can?t send Pm?s for profile Admin????
What is the profile of Admin or just all operators?
Hi
Only Admin :)
Here you go:
ChatArrival = function(user, data)
local data = string.sub(data,1,-2)
local s,e,cmd = string.find(data,"%b<>%s+[%!%?%+%#](%S+)")
local tCmds = {
["help"] = 1,
["regme"] = 1,
["rules"] = 1,
}
local s,e,whoTo = string.find(data,"$To:%s+(%S+)")
if GetItemByName(whoTo) then
if GetItemByName(whoTo).iProfile == [COLOR=red]0[/COLOR] then return 0 end
end
if not tCmds[cmd] and not user.bRegistered then
return user:SendData(frmHub:GetHubBotName(),"You need to be a registered user to talk in this hub."),1
end
end
ToArrival = ChatArrival
Btw, if Admin's profile number isn't "0" then replace the red value with it.
Cheers
Hi again
The script its Working 5 *
Very nice Work :) Tank You
Now i have one problem, i can?t make one right click, wahts is the number 1.03 .....
Waths tha secrect for creat one right click?
Tanks Again
QuoteOriginally posted by ?[-?Genius?-]?
Hi again
The script its Working 5 *
Very nice Work :) Tank You
Now i have one problem, i can?t make one right click, wahts is the number 1.03 .....
Waths tha secrect for creat one right click?
Tanks Again
Search the Lua 5 How-To Section for the RightClick one. It will help you with that.
Best regards
Tanks You :)
[][][][]s