Register command for OPs

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Scoffer
Posts: 15
Joined: 2003-02-18 09:51

Register command for OPs

Post by Scoffer » 2003-03-08 19:00

Is there a script for user registering for OPs ?
stimorol has register user pass command, but I don't want to use stim...
it kicked half of my users away...hundread user lost...well...no problem, but still I don't want to use it, but I need register command for my OPs
-Sd

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-03-08 19:39

To add a non-op registered user, you should use something like :

Code: Select all

set oRegUser = frmhub.lstOps.listItems.Add(,,cstr(Username))
oRegUser.SubItems(1)=cstr(Password)
oRegUser.SubItems(2)="False"


Where oRegUser is an object created by the code following the "=" sign, Username is a string containing the name of the new user, Password the password the client will ask to that user to validate connection.

This should be put in the code that deals with your op commands.

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-03-08 19:57

To prevent the same nick to be registered several times, here is a little function :

Code: Select all

Function bIsReg (sUserName)    ' checks if sUserName is registered
  bIsReg = False
  For Each oElement In frmHub.lstOps.listItems
    If Lcase(oElement.Text) =  Lcase(sUserName) Then
      bIsReg=True
      Exit For
    End If
  Next
End Function


bIsReg is a boolean function, returning true if sUserName is registered.

You can use it before adding or removing a registered user (or an Op).

Scoffer
Posts: 15
Joined: 2003-02-18 09:51

Post by Scoffer » 2003-03-08 20:23

thnx...these are just what I was looking for...
could you also show me where to add them for example in gadgets generalbot ?
I just am not so familiar with scripting...
but anyway...big thanx for you =)

-Sc

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-03-08 20:51

Well, I hope this will work (I've never read generalbot before)

Code: Select all

Case sCmdPrefix+"adduser"
  if not bIsReg(sUser) then
    set oRegUser = frmhub.lstOps.listItems.Add(,,cstr(sUser))
    oRegUser.SubItems(1)=cstr(sInfo)
    oRegUser.SubItems(2)="False"
    sA=sUser&" registered with the pass: "&sInfo
  else
    sA=sUser&" is already registered"
  end if


This should be placed in the sub DataArival, after the line

Code: Select all

    Select Case sCmd


You should also put the function bIsReg somewhere in the script, before the last line should be ok

You should add a check of the sUser and sInfo strings if you want users to have an error message when they use the command inproperly.

Command usage will be adduser username password, typed wherever you type op's commands for this bot.

Scoffer
Posts: 15
Joined: 2003-02-18 09:51

Post by Scoffer » 2003-03-09 00:48

I really had to think for a while about where to add all and stuff, but It really works...very very biiig thanks for you =)

It's great when there are people willing to help when urgently needed..
you should write a separate script from that...I know many admins who are in need of that command =)
(ofcoz' I give this generalbot add instruction to them also)
-Sc

Who is online

Users browsing this forum: Google [Bot] and 0 guests