mIRC Home    About    Download    Register    News    Help

Print Thread
#107408 09/01/05 10:08 PM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Not sure if this question belongs here or in script help but.
Is it possible to add text in a dialog edit box to a hash table using a button in the same dialog? I have never done this before so it really has me stumped... will i need mdx, because i would prefer not to use it.
Thanks

#107409 09/01/05 10:11 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on *:dialog:<name>:sclick:<button id>:{ hadd -m <hashtable name> <item> $did(<edit id>) }


New username: hixxy
#107410 09/01/05 10:19 PM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Sorry to make this difficult for you but , <item> ?

#107411 09/01/05 10:22 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Yes, from /help hash tables:

Quote:
/hadd -smbczuN <name> <item> [data | &binvar]


eg. /hadd -m test 1 2, "test" is the name, "1" is the item and "2" is the data.


New username: hixxy
#107412 09/01/05 10:28 PM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
So item would be the specific data i am actually trying to add....... the text in the editbox.... so i would have to do something like using a local variable to set the value of the text in the editbox?..... i really am sorry to put you through this tidy_trax..... and thanks for the help!

#107413 09/01/05 10:33 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
No. "name", "item" and "data" can be whatever you like.

Let's imagine:

You have a dialog called "modes", the button id is "1" and the edit id is "2".
The editbox contains a channel key for the active channel, you could use something like this:

Code:
on *:dialog:modes:sclick:1:{ 
  if ($active ischan) { hadd -m $active channelkey $did(2) }
}


New username: hixxy
#107414 09/01/05 10:48 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
The above code will create a hash table called..

#Channel for example.
#Channel will have 1 item called channelkey, with a value of whatever is in your editbox.

To get our data we use $hget(#Channel,channelkey) for example.

#107415 09/01/05 10:52 PM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
ooooh..... i got it now ....... thanks a lot!

#107416 09/01/05 11:03 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I haven't tried the following but apparently you can modify, create, rename hash tables with this addon.

Hope it helps.

#107417 10/01/05 05:59 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
ADDON???
Bad man! Im trying to avoid addons .... tired of relying on thirdparty addons to make things happen that mIRC does on its own. wink
But i did find my problem and have it all working pefectly now. Thanks for the help guys!!

#107418 10/01/05 06:21 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Quote:
... tired of relying on thirdparty addons to make things happen that mIRC does on its own.

What do you mean? That addon IS mIRC script doing things on its own. It doesn't use any dll, and is pure mIRC scripting.

I understand where you're coming from, I don't use any full script or anything.

However, I actually use such hash table viewing addon myself, since it's simply easy to get a quick view of information about your hash tables currently loaded, without having to script the whole thing yourself.

Greets


Gone.
#107419 10/01/05 08:15 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Sorry...... didnt look at it ..... blush
New question though .... i want to find or compare a variable against the hash table , but not by item, but value.......
/hadd -m <table name> <item name> <data>
So i need to locate by the data part and not the item name.
If you need to see what i have so far just ask.

#107420 10/01/05 08:29 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
If you want to match it: $hfind(table,<match>,1).data
If it's a wildcard match: $hfind(table,<*match*>,1,w).data


Link Copied to Clipboard