Jump to content

Attention Mr. Travis


Silo

Recommended Posts

Ok, you asked for it, my friend! I've ben reading up on it, seems fairly straight forward. And I'm quite excited to take my knowledge to the next stop. If you can just inform me how to write a while loop to load info into a combo box I think I'll be set. :)

 

Here is my demo dialog code...

alias ht {
  dialog $iif($dialog(hash.table),-x,-mh hash.table) hash.table
}
dialog hash.table {
  title "Nicknames"
  size -1 -1 160 48
  option dbu
  combo 1, 4 3 84 82, size edit drop
  button "Add", 2, 91 2 32 12
  button "Delete", 3, 124 2 32 12
  button "Close", 4, 124 32 32 12, ok cancel
}
On *:Dialog:hash.table:sclick:2:{
  hadd -s Nicknames $did($dname,1).text
<alias for loop goes here>
}

 

Thanks heaps in advance :)

Link to comment
Share on other sites

here silo

hes not only one who can help lol

 

bit of info for you

hadd -m

-m creates a hash table if it isnt allready made

 

alias ht {
  dialog $iif($dialog(hash.table),-x,-mh hash.table) hash.table
}
dialog hash.table {
  title "Nicknames"
  size -1 -1 160 48
  option dbu
  combo 1, 4 3 84 82, size edit drop
  button "Add", 2, 91 2 32 12
  button "Delete", 3, 124 2 32 12
  button "Close", 4, 124 32 32 12, ok cancel
}
On *:Dialog:hash.table:sclick:2:{
  hadd -m Nicknames $did($dname,1).text
  get.nicks
}
alias get.nicks {
  did -r hash.table 1
  var %o 1 
  while (%o <= $hget(Nicknames, 0).item) {
    did -a hash.table 1 $hget(Nicknames, %o).item
    inc %o
  }
}

Link to comment
Share on other sites

:o That easy? Thanks, Ozzy. I asked Travis because he suggested I learn up on hash tables & invited me to post any question about them.

 

Thank you very much :)

 

PS - I'll be back soon :P

 

PPS - These things are awesome!

Edited by Silo
Link to comment
Share on other sites

Guest Travis

lol that was kind of embarassing. Yeah hash tables are real easy.

 

 

hash table management is important. Hash tables reside in your RAM so once you close mirc all the data is gone. If you want to save them you have to write them to a file. The code below is what I do to preserve my hash tables.

 

on *:start:{
  hmake
}
on *:disconnect:{
  hsave
}
on *:exit:hsave

alias h_make {
  if (!$hget(prot)) { hmake prot 100 }
  if ($file(lists\prot.txt).shortfn) { hload prot $ifmatch }
}
alias h_save {
  if ($hget(prot)) { hsave -o prot lists\prot.txt }
}

 

This saves the hash tables when I close mirc. When you turn it on it will make the tables and load them fromt he saved file.

 

This dialog is a great tool. I hope you find it as usefull as I have. nHash - click here

 

Also, I learmed token identifiers while learning hash tables. They go hand in hand I think.

 

I'm glad you are having fun with it.

 

 

Link to comment
Share on other sites

Sorry if I embarrassed you, Tavis. T'wasn't my intention to do so :P I'm glad you just made that post, because Iwas thinking about it last night, as I recalled reading once, that the data is stored in RAM, and since I couldn't actually find any file in my mirc directory pertaining to it, I did wonder where it went.

 

I shall check out that dialog you linked me to. Again, everyone here is so very friendly & helpful. I really couldn't put a price on the information & techniques I've learned since joining up. I've learned more in two months here than I have in two years looking at other people's scripts :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...