mIRC Home    About    Download    Register    News    Help

Print Thread
O
onesikgypo
onesikgypo
O
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

N
NeUtRoN_StaR
NeUtRoN_StaR
N
/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.
O
onesikgypo
onesikgypo
O
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.
N
NeUtRoN_StaR
NeUtRoN_StaR
N
it returns the Nth match it does search the whole thing
what it returns is the item name of whatever number match you request

O
onesikgypo
onesikgypo
O
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.
N
NeUtRoN_StaR
NeUtRoN_StaR
N
Post deleted by NeUtRoN_StaR

Last edited by NeUtRoN_StaR; 27/01/06 06:21 AM.
O
onesikgypo
onesikgypo
O
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,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Try this
/timer 1 1 echo -a $iif($hfind(123456,#bla,1).data,A,B)

N
NeUtRoN_StaR
NeUtRoN_StaR
N
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

N
NeUtRoN_StaR
NeUtRoN_StaR
N
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