Hello
Im Searching for a LUA 5 Stand Alone Script for getting passwort from User.
Maybe is possible with a profile table where i can enable/Disable this cmd for each Profile.
Found an old Lua 4 One, but theres no Profile check. Only OPs can user +getpass nick.
I have more Profiles which should can use this.
Thx in Advance.
Greets
Give this a try:
--/---------------------------------------------
-- Get Password v1.0 by jiten (6/27/2005)
--/---------------------------------------------
sBot = frmHub:GetHubBotName()
tPrefixes = {}
AllowedProfiles = {
[-1] = 0, -- unreg
[0] = 1, -- master
[1] = 1, -- operator
[2] = 0, -- vip
[3] = 0, -- reg
[4] = 1, -- moderator
[5] = 1, -- founder
}
Main = function()
for a,b in pairs(frmHub:GetPrefixes()) do tPrefixes[b] = 1 end
end
ChatArrival = function(user,data)
local data = string.sub(data,1,-2)
local s,e,sPrefix,cmd = string.find(data,"%b<>%s*(%S)(%S+)")
if sPrefix and tPrefixes[sPrefix] then
local tCmds = {
["getpass"] =
function(user,data)
if AllowedProfiles[user.iProfile] == 1 then
local s,e,nick = string.find(data,"%b<>%s+%S+%s+(%S+)")
if nick then
if frmHub:GetUserPassword(nick) then
user:SendData(sBot,"Nick: "..nick..", Password: "..frmHub:GetUserPassword(nick))
else
user:SendData(sBot,"*** Error: "..nick.." isn't registered.")
end
else
user:SendData(sBot,"*** Syntax Error: Type !getpass ")
end
else
user:SendData(sBot,"*** Error: You are not allowed to use this command.")
end
end,
}
if tCmds[cmd] then return tCmds[cmd](user,data),1 end
end
end
*edit* Missing If Added
Best regards
Thx M8,
Looks Great. I will test it today evening at Home.
Greets
why i can change to use more prefixes?
So that i can use
!getpass nick
+getpass Nick
#getpass nick
Is it much to do? I asked, because i like to have by all my scripts this 3 Prefixes ;-)
Greets
QuoteOriginally posted by Krysalis
why i can change to use more prefixes?
So that i can use
!getpass nick
+getpass Nick
#getpass nick
Is it much to do? I asked, because i like to have by all my scripts this 3 Prefixes ;-)
Greets
Well, in the PtokaX's GUI, go to the Options tab and add them to the "Hub commands prefix" box.
Best regards
Thats all?
but i think it works only if there is no prefix specified in the script itself....or am i wrong?
Greets
yep, it depends on the script,
QuoteOriginally posted by Krysalis
Thats all?
but i think it works only if there is no prefix specified in the script itself....or am i wrong?
Greets
Indeed. That's all (just like Dessamator said) :D
Cheers
oki, understood ;-)
Thx