mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#222110 06/06/10 08:37 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
Hello Dears

i want a Script in Which BOT asks for Password to Give access to specific users of kick ban and aop.please if anybody help me.
also i want that Nick SHould be added by IP like if nick is ABC then it also CHecks IP nick@119.119.199.*
Waiting for response

maSeeha #222115 06/06/10 03:33 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
When should the bot ask for the password?
Is it the same password for everyone, or does each person have their own password?
If each person can have their own password, who sets the password, and who can change it?
Is the password case sensitive?

Those are the questions that I can think of right now. If I think of others, I'll post.

maSeeha #222120 06/06/10 05:53 PM
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
something like this?

Code:
on *:text:*:?:{
  if $wildsite == *!*@host {
    if $istok(kick.ban.aop,$1,46) && $2-3 {
      if $1 != aop && $2 ison $3 { $1 $3 $2 }
      else cmd for aop
    }
  }
}


in PM u send

kick nick #chan
ban nick #chan
cmd for aop knowing that $1 = aop, $2 = nick & $3 = #chan


WorldDMT
RusselB #222131 07/06/10 03:53 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
Like if Nick RusselB is added in Bot lIst then with Soem password and Nick Comes in Bots private and give command like !identify Paswarod then bot will recognize it as Special Member and will OP that nick. and will also match that .. person is with same ip which is added in Bot Database like there is file Ip.txt in wichi i have save the ip like Russel!Ident@172.172.172

and bot will check the both and id Ip is not matched both will say YO are wrong person. or if pass not matched bot will say your pass is wrong.

waiting for ur reply

maSeeha #222132 07/06/10 09:36 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I understood most (if not all) of that from your original request.

I still need to know if you want the same password for everyone, or do you want each person to have their own password?
Also, is the password to be case sensitive?

If you want a different password for each person, do you want them to start with a custom generated password and/or do you want them to be able to change the password to something of their choice?

RusselB #222144 08/06/10 11:17 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
Each person will have own pass which and should be Case Sensitive.
also i want them to have/change pass of own choice.

maSeeha #222167 09/06/10 12:53 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
I am still waiting for your answer. please if you can give my issue priority :S

maSeeha #222191 10/06/10 05:23 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You have to be patient. One day is not much time for a code, especially when I have other things to do.

In fact, it states in the New to the forums sticky

Quote:
d) Be patient . This is all volunteer. Ask/State your question and check back for answers. Not everyone knows how to solve your specific problem. If you don't get a 'fast' response here, try your networks #mIRC channel. Folks might be present and active to help you faster than you can get help here.

e) Realize YOU have to do work to solve the problem you are having. People here can offer ideas/suggestions/input and maybe even solve things entirely, but it's up to YOU to do the work.


RusselB #222225 11/06/10 11:11 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on @*:text:!register*:#:{
  if ($nick !isop $chan) {    .msg $nick Sorry, but only ops can use this command  }
  elseif ($$2 isop $chan) {    .msg $nick $$2 is already opped  }
  elseif ($$2 !ison $chan) {    .msg $nick $$2 isn't on $chan  }
  elseif (op isin $level($address($$2,8))) {    .msg $nick $$2 is already registered  }
  else {
    var %pass
    while $len(%pass) < 8 {
      var %c = $r(1,3)
      if %c == 1 {        %c = $r(0,9)      }
      elseif (%c == 2) {        %c  = $r(a,z)      }
      else {        %c = $r(A,Z)      }
      %pass = $addtok(%pass,%c,32)
      inc %a
    }
    %pass = $remove(%pass,$chr(32))
    .mode # +o $$2
    .msg $nick You have been granted Ops access by $nick $+ . Your temporary password is %pass $+ .
    .msg $nick We recommend that you change this soon by typing /msg $me !pass <old pass> <new pass>
    .guser -a op $$2 8 $md5(%pass)
  }
}
on op:text:!pass & &:?:{
  if ($md5($$2) === $ulist($address($nick,8)).info) {
    .guser -a op $nick 8 $md5($$3)
    .msg $nick Your password has been changed.
  }
  else {    .msg $nick Sorry, but the password you entered doesn't match my records  }
}
on @op:join:#:{
  .msg $nick Please enter your password to obtain ops status
}
on op:text:*:?:{
  if ($md5($$1) !=== $ulist($address($nick,8)).info) {    .msg $nick Sorry, but the password you entered doesn't match my records  }
  var %a = 1, %b = $comchan($nick,0)
  while %a <= %b {
    if ($me isop $comchan($nick,%a)) && ($nick !isop $v2) {      .mode $v2 +o $nick    }
    inc %a
  }
}


RusselB #222230 12/06/10 01:01 PM
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
That was a rather odd way to do it...
and you should note that there is a possible clash there between the on *:text:*: event and the other text events.
I am uncertain whether or not this issue was fixed already, since I always avoid it, but you could just do on op:text:!login &:?:

Also, there is this:
Code:
    var %pass
    while $len(%pass) < 8 {
      var %c = $r(1,3)
      if %c == 1 {        %c = $r(0,9)      }
      elseif (%c == 2) {        %c  = $r(a,z)      }
      else {        %c = $r(A,Z)      }
      %pass = $addtok(%pass,%c,32)
      inc %a
    }
    %pass = $remove(%pass,$chr(32))


How about:

Code:
  var %pass
  while $len(%pass) <= 8 {
    %r = $rand(1,3)
    %pass = %pass $+ $rand($replace(%r,1,0,2,a,3,A),$replace(%r,1,9,2,z,3,Z))
  }


Also, maSeeha, tell me if you'd like a system that doesn't depend on the host, since if you use such a system, users will have to have the same host as the one saved to login to their account.

Also, the code for the kick and ban commands has been forgotten...

ziv.

ziv #222239 12/06/10 08:00 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The clash possibility that you refer to, only exists if the ON TEXT events are not structured correctly.

Only the first matching ON TEXT event will be triggered.

As the first ON TEXT event is restricted to channel messages only, it will never be triggered via a pm/query message.

The second and third ON TEXT events are restricted to pm/query messages, thus they will never be triggered via a channel message.

The second event, while having the same location restriction as the third event, also has a specific static reply format, thus differentiating that event from the third via the matchtext section of the event.

You're right I could've used on
Code:
op:text:!login &:?:
in the third ON TEXT event. I opted not to, as that would require the person to type !login <password> rather than just <password>

You're suggestion for the initial random generation of the password didn't occur to me, but now that I see it, I applaud the idea.

As to the coding for the ban and kick commands, the original request, as I read it, didn't ask for them, and they don't need to be coded as any op can use /ban or /kick

RusselB #222271 15/06/10 11:16 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
you pppl are not getting what i am trying to say. :S

or i am unable to convey my msg to you.

Russel Brother please tell me will this script will work like if i have a file in my Database with ip.txt and in this i have nick russel!irc@172.172.72
will this script will match the person from that file? and then will accept the !pass command ? and will make a pass.txt.?

maSeeha #222273 15/06/10 11:30 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What RusselB gave you will store both the user's host/IP information and password in your Users tab (Alt-R > Users). The password is stored using $md5() to mask it so it can't be easily read. It will do what you want, but won't store them in files. There really isn't any reason to use files. If you really need them in files, it can be updated to reflect that.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #222283 15/06/10 06:11 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
Thanks for reply my Dear.

but i want specific users like just 2 or 4 special users having nick like RusselB, Home, etc. and where i have to specify those users.?
bcz simple addition of this script in Remotes is not working. even user type !register nothing happen. waiting for reply

maSeeha #222288 15/06/10 07:55 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It's never a good idea to rely on nicks for restricted access, as the nick is the easiest item to change, and even if the network has services and those are configured to a quick kill if the password doesn't match, there's still a delay of (about) 30 seconds in which a person could use someone else's nick and get access.

I don't know why the code I provided isn't working for you.

Is the script on a bot, or your own client? If your client, move it to a bot, as that is what it is designed to work from.
Is the client opped in the channel? If not, op it.

Was a nick provided after the !register command? If not, provide one.
Was the nick that used the command opped? If not, they need to be.

I thought I had included messages to handle situations like above, however, limitations of this site prevent me from confirming this while I'm writing here.

RusselB #222315 16/06/10 01:25 PM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
RusselB your given script is not working i checked it as you just said but it still not working.
i am pasting here a Script . will give u a General Idea that how script on our server works. its a script which checks the user IP on connection and if IP matchd from ip of our database file ip.txt. it auto kline the IP. so i want like that script that if user (which is already added at lever 299 in remote userlist) give command !identify password Bot will match the IP from IP.txt and then will match the password from password file of that person like i have mase a file of pass.txt in which i have written Russelb:password. and if pas is ok then will op him/her else will not op him
Example: NIck = kamran its added as 299:Kamran in file ip.txt ip is 72.110.255 and in pass kamran:123456 where 123456 is pass.

you can make changes in pass.txt like if u say this is not rite format of pass saving. then you tell me please the way.

here i am pasting the format of script
=============================================
on *:snotice:*client connecting*:{
if ($level($9) >= 50) return
set %host $remove($10,$chr(40),$chr(64),$chr(64),$chr(41))
if ($read(ip.txt, w, %host $+ *)) {
.kline %host 11,12Join our Chat Server 2

unset %host
}
}


waiting for your reply

maSeeha #222348 17/06/10 05:58 PM
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
I recommend you change this:
Code:
on op:text:*:?:{
  if ($md5($$1) !=== $ulist($address($nick,8)).info) {    .msg $nick Sorry, but the password you entered doesn't match my records  }
  var %a = 1, %b = $comchan($nick,0)
  while %a <= %b {
    if ($me isop $comchan($nick,%a)) && ($nick !isop $v2) {      .mode $v2 +o $nick    }
    inc %a
  }
}


To this:
Code:
on op:text:!identify &:?:{
  if ($md5($$1) !=== $ulist($address($nick,8)).info) {    .msg $nick Sorry, but the password you entered doesn't match my records  }
  var %a = 1, %b = $comchan($nick,0)
  while %a <= %b {
    if ($me isop $comchan($nick,%a)) && ($nick !isop $v2) {      .mode $v2 +o $nick    }
    inc %a
  }
}


Also, make sure your users are using the !register command in the channel where the bot is, NOT in a pm to it.
The commands to change password and to identify will work only in PM, but the command to register a new user will only work in the channel.

Let us know if it still doesn't work.

ziv.

ziv #222360 17/06/10 09:41 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Uhm, why? The code by RusselB
Code:
on @op:join:#:{
  .msg $nick Please enter your password to obtain ops status
}
will ask the user quite clearly to enter the password in query - there's neither the need for an !identify command, nor will anyone guess it.

In addition, your change
Quote:
on op:text:!identify &:?:{
obviously will only work with
Quote:
if ($md5($$2) !=== $ulist($address($nick,8)).info) {

That if-condition furthermore should either contain a return command, or be followed by an else { give ops in comchans }

Why (attempt to) "improve" code posted by someone else in a most dispensable way? No offense, I just wonder why - it's quite popular. smile

Horstl #222371 18/06/10 01:34 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
there is some confusion . please clear it my dear.

in the code you give u didnt mention where i have to give the pass bcoz as i said if i give pass in pass.txt then in ur give script you didnt use ip.txt anywhere or you want me to give pass in remotes user list if yes then tell me how and what will b e format of password?

Horstl #222372 18/06/10 01:34 AM
Joined: Mar 2008
Posts: 31
M
maSeeha Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Mar 2008
Posts: 31
there is some confusion . please clear it my dear.

in the code you give u didnt mention where i have to give the pass bcoz as i said if i give pass in pass.txt then in ur give script you didnt use ip.txt anywhere or you want me to give pass in remotes user list if yes then tell me how and what will b e format of password?

Page 1 of 2 1 2

Link Copied to Clipboard