Bot Change-Password
 

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

Bot Change-Password

Started by DorianG, 23 January, 2004, 02:51:06

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DorianG

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

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

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

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

HaL

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

pHaTTy

no only u still see it, but change the user:SendPM to user:SendData
Resistance is futile!

plop

#6
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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

HaL

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'


???

pHaTTy

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
Resistance is futile!

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

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk