mIRC Home    About    Download    Register    News    Help

Print Thread
#178105 05/06/07 10:23 AM
Joined: May 2005
Posts: 74
D
Dracoz Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: May 2005
Posts: 74
Code:
on *:TEXT:!invite*:#corleone: {
  if ($address($nick,1) isin %userlist) {
    /invite $nick #hidden.corleone
    msg $chan 3 $+ Invite Geslaagd. 
    notice $nick Dubbelklik op #hidden.corleone
  }
  else {
    msg $chan 4Error! Je staat niet in de database!
  }
}
on *:TEXT:!allow*:#corleone: {
  if ($nick isop $chan) {
    if ($2 ison $chan) {
      if ($address($2,1) isin %userlist) {
        msg $chan 4Error! $2 staat al in de database!
      }
      else {
        /set %userlist %userlist $address($2,1)
        msg $chan 3 $+ $2 is toegevoegd aan de database!
      }
    }
    else {
      msg $chan 4Error! Deze gebruiker bestaat niet!
    }
  }
}
on *:TEXT:!remove*:#corleone: {
  if ($nick isop $chan) {
    if ($address($2,1) isin %userlist) {
      /set %userlist $remove(%userlist, $address($2,1))
      /kick #lucchese.fam $2 4Error! Je bent verwijderd uit de database!
      msg $chan 3 $+ $2 is verwijderd uit de database!
    }
    else {
      msg $chan 4Error! $2 staat niet in de database!
    }
  }
}


When i add couple of 30? users....
I can't add more...

How can i script this better?

Plz help !

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That's because your variable is gonna look like:

%userlist *!*user@host *!*user@host *!*user@host *!*user@host *!*user@host *!*user@host *!*user@host *!*user@host *!*user@host (Obviously your's is going to have longer addresses)

There's only so many characters a variable can have. I think you should store your addresses in a hash table, or in mIRC's internal User List.

/help Access Levels

Code:
on *:start: { 
  hmake allowed 100 
  if ($exists(allowednicks.hsh)) { 
    hload -i allowed allowednicks.hsh
  }
}

on *:TEXT:!invite*:#corleone: {
  if ($hget(allowed,$address($nick,1))) {
    invite $nick #hidden.corleone
    msg $chan 3 $+ Invite Geslaagd. 
    notice $nick Dubbelklik op #hidden.corleone
  }
  else {
    msg $chan 4Error! Je staat niet in de database!
  }
}

On @*:Text:!allow*:#corleone: {
  if ($2 ison $chan) { 
    if (!$hget(allowed)) hmake allowed 100
    if ($hget(allowed,$address($2,1))) msg $chan 4Error! $2 staat al in de database!
    else { 
      hadd allowed $address($2,1) $address($2,1)
      msg $chan 3 $+ $2 is toegevoegd aan de database!
    }
  }
  else { msg 4Error! Deze gebruiker bestaat niet! }
}

on @*:TEXT:!remove*:#corleone: {
  if ($2 ison $chan) {
    if ($hget(allowed,$address($2,1))) {
      hdel allowed $address($2,1)
      kick #lucchese.fam $2 4Error! Je bent verwijderd uit de database!
      msg $chan 3 $+ $2 is verwijderd uit de database!
    }
  }
}


Try this.

Last edited by SladeKraven; 05/06/07 11:15 AM.
Joined: May 2005
Posts: 74
D
Dracoz Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: May 2005
Posts: 74
I get this error:

*/hadd: insufficient paramaters (line 24, script.ini)

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
The script relies on the IAL (/help Internal Address List) containing the address of the user you specify with !allow and !remove. You can quickly fill the IAL for a channel with /who [color:green]#channel[/color].

The following code will automatically /who a channel when you join it:
Code:
on me:*:JOIN:#:who #



Link Copied to Clipboard