It's a litle and fine Bot :D
Is a Bot that you can use to all user livel. Is not limitate. But you haven't problem, because the user change only his password. :D
--********************************************************--
--********************************************************--
--** **--
--** In this Bot the users livels are settings: **--
--** **--
--** Newbie = lvl 0 **--
--** Reg = lvl 1 **--
--** Vip = lvl 2 **--
--** **--
--** **--
--********************************************************--
--********************************************************--
BotName = "Change-Pass"
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<") then
data = strsub(data,1,strlen(data)-1)
local s,e,cmd = nil
s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
--//Command ChangePass
if (cmd=="!changepass" or cmd=="!chpass" or cmd=="!Changepass") then
if (user.iProfile == nil) then
user:SendPM(BotName, "You are not registered, so you are not allow to use this command")
elseif (user.iProfile == 0 or user.iProfile == 1 or user.iProfile == 2) then --//Here you can change the users livel
s,e,cmd,pwd = strfind(data, "%b<>%s(%S+)%s(%S+)")
local usr = user.sName
local lvl = user.iProfile
SendToOps(BotName, "The user "..usr.." have change the password in: " ..pwd)
AddRegUser(usr, pwd, lvl)
user:SendPM(BotName, "The registration of the new password has stayed effected with success, now your new password is: " ..pwd)
elseif (user.bOperator) then
s,e,cmd,pwd = strfind(data, "%b<>%s(%S+)%s(%S+)")
local usr = user.sName
local lvl = user.iProfile
AddRegUser(usr, pwd, lvl)
user:SendPM(BotName, "The registration of the new password has stayed effected with success, now your new password is: " ..pwd)
end
end
end
end
if (user.iProfile == nil) then
this never happens, unregistered users have the profile number -1.
not a bug or anything bad but master = 0, operator = 1, vip = 2, reg = 3.
some hubowners might be offended if you call them newbies. lol
plop
ehehhe.. Sorry Owners or Masters.. ehehe.. I didn't want to offend you. Is only an exaple. You can set the user livel here:
elseif (user.iProfile == 0 or user.iProfile == 1 or user.iProfile == 2) then
:D
Thanks plop. You have save me from a lynching :D
QuoteOriginally posted by DorianG
ehehhe.. Sorry Owners or Masters.. ehehe.. I didn't want to offend you. Is only an exaple. You can set the user livel here:
elseif (user.iProfile == 0 or user.iProfile == 1 or user.iProfile == 2) then
:D
Thanks plop. You have save me from a lynching :D
yw.
plop
hi @all
nice script
can some 1 change it a littlebit 4me?
1. I don?t want to see the bot in my hub
i did it with
function Main()
-- frmHub:RegBot(BotName)
end
ok and
2.
if i wrote !chpass
in mainchat
everyone could see the cmd and passwd ...
could some one change it that the cmd is not visible in mainchat?
thx
;-) HaL
no only u still see it, but change the user:SendPM to user:SendData
QuoteOriginally posted by (uk-kingdom)pH?tt?
no only u still see it, but change the user:SendPM to user:SendData
the return 1's were missing so indeed every1 could see it.
fixed and optimized it a little bit.
give it a try.
--********************************************************--
--********************************************************--
--** **--
--** In this Bot the users livels are settings: **--
--** **--
--** Newbie = lvl 5 **--
--** Reg = lvl 3 **--
--** Vip = lvl 2 **--
--** **--
--** **--
--********************************************************--
--********************************************************--
BotName = "Change-Pass"
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<") then
data = strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind( data, "%b<>%s+(%S+)" )
--//Command ChangePass
if (cmd=="!changepass" or cmd=="!chpass" or cmd=="!Changepass") then
if (user.iProfile == -1) then
user:SendPM(BotName, "You are not registered, so you are not allow to use this command|")
else
local s,e,pwd = strfind(data, "%b<>%s%S+%s*(%S*)")
if pwd == "" then
user:SendPM(BotName, "Pls give me your new password, i can't fill in blancs|")
return 1
elseif (user.bOperator) then
AddRegUser(user.sName, pwd, user.iProfile)
user:SendPM(BotName, "The registration of the new password has stayed effected with success, now your new password is: " ..pwd.."|")
return 1
elseif (user.iProfile == 3 or user.iProfile == 2) then --//Here you can change the users livel
SendToOps(BotName, "The user "..user.sName.." have change the password in: " ..pwd.."|")
AddRegUser(user.sName, pwd, user.iProfile)
user:SendPM(BotName, "The registration of the new password has stayed effected with success, now your new password is: " ..pwd.."|")
return 1
end
end
end
end
end
plop
hey @all
i tested it on a test drive 4 hub
with one op and one user
!chpass
is visible 4everyone not only 4me, not only 4ops!
and now the last version doesn?t work anymore
Syntax Error: `)' expected (to close `(' at line 61);
last token read: `return' at line 63 in file `...instellungen\hal\Desktop\PtokaX-0.326.TestDrive4\scripts\chpass.lua'
???
QuoteOriginally posted by plop
QuoteOriginally posted by (uk-kingdom)pH?tt?
no only u still see it, but change the user:SendPM to user:SendData
the return 1's were missing so indeed every1 could see it.
eheh shows how much attention i payed, its because its not [code]ed
QuoteOriginally posted by plop
if pwd == "" then
user:SendPM(BotName, "Pls give me your new password, i can't fill in blancs|"
return 1
here is the error ;-)
you have to close the
user:SendPM(BotName............ with a )
gretz HaL
QuoteOriginally posted by HaL
QuoteOriginally posted by plop
if pwd == "" then
user:SendPM(BotName, "Pls give me your new password, i can't fill in blancs|"
return 1
here is the error ;-)
you have to close the
user:SendPM(BotName............ with a )
gretz HaL
thats what happens if i start coding after only 1 mug of coffee. lol
i've fixed the code above.
plop