mIRC Home    About    Download    Register    News    Help

Print Thread
#125652 20/07/05 09:15 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
Is it possible that i make a bot that ppl send message to the bot to login to the bot will invite the sender to join a channel?
like /msg bot login <username> <password>

like each user have it's own username and password
admin have the power to add in ppl's name in the bot

Thx

#125653 20/07/05 02:25 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Here's something to start off with:

on invitedppl:TEXT:!invite & &:?:{
if ($hget(invitedppl,$2) === $3) {
if ($me isop #channel) invite $nick #channel
else msg $nick Sorry, I cannot invite you...
}
}
on *:START: {
hmake invitedppl 10
hload invitedppl invites.txt
}
menu nicklist {
invite:invitenick $1
}
alias -l invitenick {
hadd -m invitedppl $1 $$?="Password?"
hsave invitedppl invites.txt
guser -a invitedppl $1 5
}


It uses a hash table to store the username/password combinations and the user list to allow only nick!user@address masks that you specify to login. Just select a nickname in the nicklist and click invite, then give a password.

People should use:
/msg botname !invite nickname password
or even
//msg botname !invite $me password
if their nickname hasn't changed

If you can understand this script, you can adapt it to better suit your own needs...

(ps: wrote it in this box, so there might be some typo's or something)

#125654 20/07/05 02:48 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
I can understand certain part of it only
hehe
I'm still a noob in irc

Can i make like i let someone have access to the bot to create an account for them?
like user lvl 4 is the admin which have full control, lvl 3 have other access etc..?

So after their account is created, they can login to the channel by just messageing /msg bot login user pass
and automatic, the bot will invite them.

Thx

#125655 20/07/05 02:53 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ok here's an attempt at 8 in the morning hehe..

Code:
On *:Start: {
  hmake ulist
  if ($isfile(ulist.hsh)) hload -i ulist ulist.hsh
}

menu menu,nicklist,status,channel,query {
  $iif($dialog(ulist),$style(3)) User List: { 
    dialog -dm ulist ulist
  }
}

dialog ulist {
  title "User List"
  size -1 -1 109 143
  option dbu
  combo 1, 4 4 102 107, size
  button "Add", 2, 24 113 27 9
  button "Rem", 3, 56 113 27 9
  button "Close", 4, 37 127 37 12, ok
}


on *:dialog:ulist:sclick:2: {
  if ($numtok($did($dname,1),32) &gt; 1) {
    if ($gettok($did($dname,1),1,32) == $gettok($did($dname,1),2,32)) { 
      echo -a Username and Password cannot be the same.
    }
    else {
      if (!$hget(ulist,$gettok($did($dname,1),1,32))) {
        hadd -m ulist $gettok($did($dname,1),1,32) $gettok($did($dname,1),2,32)
        did -a ulist 1 $gettok($did($dname,1),1,32) $gettok($did($dname,1),2,32)
        echo -a Success! - Added $+($chr(2),$gettok($did($dname,1),1,32),$chr(2)) with password $+($chr(2),$gettok($did($dname,1),2,32),$chr(2)) to User List.
        halt
      }
      if ($hget(ulist,$gettok($did($dname,1),1,32))) {
        echo -a $gettok($did($dname,1),1,32) already exists..
        halt
      }
    }  
  }
  else {
    echo -a Add Users to list in the style of &lt;User&gt; &lt;Password&gt;
    echo -a Example: Andy testpass123
  }
}

On *:Dialog:ulist:sclick:3: {
  if ($did($dname,1).sel) {
    echo -a Success! - Deleted $gettok($did($dname,1).seltext,1,32)
    hdel ulist $gettok($did($dname,1).seltext,1,32)
    did -d ulist 1 $didwm(ulist,1,$did($dname,1).seltext,1)
  }
}

On *:Dialog:ulist:init:0: {
  var %x = 1
  while (%x &lt;= $hget(ulist,0).item) {
    did -a ulist 1 $hget(ulist,%x).item $hget(ulist,%x).data
    inc %x
  }
}

On *:Dialog:ulist:close:0: {
  hsave -i ulist ulist.hsh 
}

On *:Text:login *:?: {
  if ($hfind(ulist,$2) &amp;&amp; $3 == $hget(ulist,$2)) { 
    msg $nick Username and password correct..
    if ($me ison #ChannelHere) invite $nick $2
  }
  else {
    msg $nick You need to specify your username and password to be invited..
  }
}


To add a username and password right click in the channel, in the combo box type in <username> <password>. If you do it wrong it should guide you through it.

-Andy

#125656 21/07/05 02:08 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
I got it smile

Just 1 little minor problem
It doesn't invite the user into the room.
How do i do it?


I have change the #channelhere already, still not inviting smirk

if ($me ison #ChannelHere) invite $nick $2

SladeKraven
can u help me add 1 more thing?
How can i set auto close PM when they login?
If i have 10 ppl login, i'll have 10 pm untill i close it myself

Thx

Last edited by KidSol; 21/07/05 02:22 PM.
#125657 21/07/05 03:19 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That's a mistake on my part.

Try..

Code:
On *:Text:login *:?: {
  if ($hfind(ulist,$2) &amp;&amp; $3 == $hget(ulist,$2)) { 
    msg $nick Username and password correct..
    if ($me ison #ChannelHere) invite $nick $v2
    close -m $nick
  }
  else {
    msg $nick You need to specify your username and password to be invited..
  }
}


-Andy

Last edited by SladeKraven; 21/07/05 03:22 PM.

Link Copied to Clipboard