|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
OP
Hoopy frood
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.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
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: ; Usage: /userlist <level or * for the whole list>
alias userlist {
var %i = 1, %total = $ulist(*,$1,0)
while %i <= %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.
|
|
|
|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
OP
Hoopy frood
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
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Check whether $level returns some value: if $level($2) { notice $nick Access for $2 is $ifmatch }
else { notice $nick Sorry, $2 isn't listed. }
|
|
|
|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
OP
Hoopy frood
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.
|
|
|
|
Joined: Dec 2002
Posts: 27
Ameglian cow
|
Ameglian cow
Joined: Dec 2002
Posts: 27 |
use $level($address($2,5)) mirc userlist works by mask, not nickname
|
|
|
|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
OP
Hoopy frood
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!
|
|
|
|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
OP
Hoopy frood
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!
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
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 , anyone?
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 395
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 395 |
Yes, $address would be $null.
|
|
|
|
|