mIRC Home    About    Download    Register    News    Help

Print Thread
#8500 27/01/03 03:00 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
I have another question relating to a mIRC bot im creating. I have given a tester a certain access level. Ok my question is this....

how can I get the bot to message me the users access level?

I have these access levels: Chanowner, Chanmaster, Chanop Im debating whether or not to include other levels but right now i have these

so basically i wanna be able to either

/msg <botnick> !access <nick> to get the bot to return to me what type of access a particular user has

or

/msg <botnick>!access list to get the bot to return the entire userlist to me

How could i do this? Any help would be appreciated.

btw Oakland 21 Tampa Bay 48 Final

Last edited by The_Game; 27/01/03 03:24 AM.
#8501 27/01/03 03:28 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
From the help file:

$level(address)

Finds a matching address in the remote user list and returns its corresponding levels list
.

For relaying the userlist, a loop through $ulist() is needed:
Code:
; Usage: /userlist &lt;level or * for the whole list&gt;
alias userlist {
  var %i = 1, %total = $ulist(*,$1,0)
  while %i &lt;= %total {
    var %entry = $ulist(*,$1,%i)
    echo -a %i $+ . %entry ( $+ $level(%entry) $+ )
    inc %i
  }
}

And if you wanted to message the list, replace 'echo -a' by 'msg $nick' or something. see /help $ulist for more information.

#8502 27/01/03 04:11 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
ok better yet instead i wanna be able to do this:

I type !access <nickname> for example and the bot returns this

If the nickname is on the list have it send back via notice: The user level for <nickname> is <userlevel>

If the nickname is NOT on the list have it send back via notice: Sorry, <nickname> does not exist on my list.

Thats what i really want ...BTW thanks for the quick reply Online

#8503 27/01/03 05:04 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Check whether $level returns some value:
Code:
if $level($2) { notice $nick Access for $2 is $ifmatch }
else { notice $nick Sorry, $2 isn't listed. }

#8504 27/01/03 05:10 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
i tried that last syntax and changed $1 to $2 because $1 returns the command i typed and this is what i got for a reply

Access for The_Game is 1

if i change $level to $ulevel i get

Sorry, The_Game isn't listed

Somewhere i must be overlooking something...

Last edited by The_Game; 27/01/03 05:17 AM.
#8505 27/01/03 07:05 AM
Joined: Dec 2002
Posts: 27
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Dec 2002
Posts: 27
use $level($address($2,5))
mirc userlist works by mask, not nickname

#8506 27/01/03 08:04 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Ok now another question, If the default access level is 1 my question is:

How can i make it say back that if a user has a level of 1, that that user is classified as a "Regular user"

and thanks that syntax did work!

#8507 27/01/03 08:16 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Nevermind i got that part to work i just added to what i already had

if ($level($address($2,5)) == 1) /notice $nick That user is a regular chatter and has no access!

Thanks for the help yet again everyone!

#8508 30/01/03 01:09 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
This woudn't work all the time, since the user may not be online.

so if you type !access Aubs and I am online, it would use:
$level($address(Aubs,5))
giving $level(Aubs!Aubs@123.blueyonder.co.uk)

But, if I am not online, then $address wouldn't return anything? Am I right? can't remember 100% as I don't use mIRC much atm frown , anyone?


Aubs.
cool

#8509 30/01/03 04:11 PM
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
Yes, $address would be $null.


Link Copied to Clipboard