mIRC Home    About    Download    Register    News    Help

Print Thread
#194630 08/02/08 06:52 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
if ($1 == !remo) && ($nick isop #) {
  hdel -sw list $ial($2,1).user
  msg # $2 is removed from my list. :-)
}


When I typed !remo, I got a /hdel insufficient parameters error. Anything I could have overlooked or done wrong?

Last edited by Tomao; 08/02/08 06:59 AM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
/help IAL

Read about how and WHAT the IAL stores, especially what it doesn't.. a common oversight is for people to overlook the fact that doing a lookup in the IAL does *not* guarantee that you will get a result for the nickname in question. A user is only added to the ial when:

1. they are involved in an IRC action that lists their hostname along with their username (PRIVMSG, MODE, CTCP, WHOIS REPLIES, WHO REPLIES)

2. they are *still* on a common channel with you

Pay close attention to #1, because when you join a channel, 99% of the users have not yet been involved in actions that list their usernames unless you explicitly /who the channel.

Long story short: it's your responsibility to keep your IAL up to date and realize when it is feasible to use it... if your script uses $2 as nicknames you don't share channels with, it will never work. If $2 can be any user in the channel, you have to make sure you keep your IAL up to date by looking at every user's hostname when you join a channel. This can be done with /who, and there are other methods too.

Think of the IAL as a cache, not a database. It will only return results for nicknames you've already seen, so it is not a good way to do lookups.

PS. Your hdel command is failing because $ial returns $null, since it had no info on $2 (if you didn't get that part yet)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You are right. $ial works only when the nickname I wish to remove is inside the channel with me. I can't remove it when he or she is not present. Is there a solution for this matter?

* Deleted 1 'Mark87' item(s) from hash table 'list'

Last edited by Tomao; 08/02/08 07:31 AM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
One solution is to do the lookup manually, but its ugly and requires relatively more complex code to monitor the RAW replies and such.

The best solution would be to redesign the way you store usernames to never have to do lookups on the user input ($2). This would mean if your user input is an address mask, that is the mask you put in your hash table, exactly as given. It makes the system less flexible (the user has to remove the user with the exact same mask they added them as) but its a lot simpler to deal with. It's also how most eggdrop bots work, as well as mIRC's userlevel system. It's a proven system, and there are other more technical reasons the design is as such, but I'll leave that as a thinking exercise for you.



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Feb 2008
Posts: 1
J
Mostly harmless
Offline
Mostly harmless
J
Joined: Feb 2008
Posts: 1
well this is about regular mirc
can anyone tell me why /botserv help isnt a command
instead of /msg botserv help
same with hostserv

Joined: Aug 2006
Posts: 19
R
Pikka bird
Offline
Pikka bird
R
Joined: Aug 2006
Posts: 19
i use txt files to store usernames or nicks and passwords. i use $Read(txtfile,s,username or nick ) then i do write -dl$readn txtfile. or you can set variables to help with this. i dont use hash tables because i find it harder to find data from hash tables than txt files. but id setup a txt file for your users then remove the users by using the write -dl$readn txtfilename.


ReaperIRC
Killgore Computers
Joined: Aug 2006
Posts: 19
R
Pikka bird
Offline
Pikka bird
R
Joined: Aug 2006
Posts: 19
@josh you would have to write a aliase for that purpose since it is not a mirc command. like /botserv /msg botserv $1-


ReaperIRC
Killgore Computers
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I have successfully worked this matter out. I use the /timer command in relation to $ial and delete a nickname stored in my hash tables, even after the person has parted the channel I am on! Thanks for the pointer, argv0...you definitely helped me think very hard. :>


Link Copied to Clipboard