mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
if i wanted to do something similar to

if ($read(file.txt, s,text)) { commands }

with a hash table how would i do it, im not the best with them i tried

if ($hget(TableName,Text)) with no luck

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
/help $hfind

you should take a minute to read the hash table section of the help file

Last edited by NeUtRoN_StaR; 27/01/06 06:05 AM.
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
yes i did see that, and i had tried a

/timer 1 1 if ($hfind(123456,#bla)) { echo -a A } | else { echo -a B }

and it returns B...and i know it says N'th item, but i need it to search the whole thing so i tried with ,0 as well with no luck

and yes i had done a hmake 123456 10 then hadd 123456 #bla #bla

Last edited by onesikgypo; 27/01/06 06:16 AM.
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
it returns the Nth match it does search the whole thing
what it returns is the item name of whatever number match you request

Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
then i dont see why it wouldnt be echoing A instead of B

like i said basically i wanted to make sure the #channel was in the hash table before continuing

Last edited by onesikgypo; 27/01/06 06:18 AM.
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Post deleted by NeUtRoN_StaR

Last edited by NeUtRoN_StaR; 27/01/06 06:21 AM.
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
still echoing B, and i didnt want to use a wildmatch because maybe the channel #bla is in their but not #bla-2 but it should be exact like i said i had done a /hadd 123456 #bla #bla

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try this
/timer 1 1 echo -a $iif($hfind(123456,#bla,1).data,A,B)

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
if it is the way you say it is then
$hfind(table,text,N).data should work just fine
as long as text matches the data entry exactly

further if you made the item and data the same then it should work without the .data suffix

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
that will work for him
and its prettier
the funny bit is he had it like 3 posts ago he just refused to specify N for some reason


Last edited by NeUtRoN_StaR; 27/01/06 06:40 AM.

Link Copied to Clipboard