Skip to content
General IRCd

Attention Mr. Travis

A TG007 community discussion started by Silo.

Discussion 20 posts
Page 1 of 1
Open
Topic #11340 · 20 published posts · 5,120 views

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 :)

Sure np. Have to wait till I get home from work.

 

Till then, read up on $hget, /hadd and /hdel.

OK, shall do. Thanks heaps, mate :)

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
  }
}

My code does NOT have bugs. It just develops random features.

: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 Oct 6, 2008 2:47 PM by Silo

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.

 

 

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 :)

Needs more rainbows :)

Will this suffice? :)

Edited Oct 13, 2008 11:57 PM by Silo

Perfect :D

What's rainbow gotta do with this post anyway?

 

What hasnt it got to do with the post? :)

well in all reality nothing has to do with rainbows personally i think your on LSD but hey whatever man lol

Hey! This topic has MY NAME on it and I happen to like rainbows! I grew up in hawai'i so there you go. Ya know, before it was the gay pride symbol IT WAS AN F'ING RAINBOW!!!!!!! >_<

 

 

Thanks! :D

Edited Oct 16, 2008 12:11 AM by Travis

lol but what does hawii have to do with rainbows?

Im glad you asked. Hawaii is where all rainbows come from. It has been known as the rainbow state and the college team's mascot was even the rainbow. (Until some guy with a little *flower* who wasn't comfortable with his sexuality thought it sounded gay and renamed them 'The Rainbow Warrior's". I dunno about you but what sounds more gay? Rainbow? Or a rainbow warrior?

Wasn't the Rainbow Warrior a Greenpeace ship that was sunk in the mid 80's by the French Secret Service?

Yes it was!

wow you learn something new everyday i guess then i take back my previous statement about rainbows lol

i figured he was on something with all that rainbow shit

Edited Oct 18, 2008 1:39 AM by morph3us

 

Operating System: Microsoft Windows 7 Ultimate 6.1.7600 (Ultimate)

CPU: AMD RX™ 8120 Eight Core, 3.10 GHz

Maximum Clock: 2200 MHz

RAM: DDR3 1333 16 gb Ram

Video Adapter: ATI Radeon HD 3200 Graphics (512 MB)

3D Accelerator: ATI Radeon HD 3200 (RS780)

Monitor: DELL ST2420 (Digital) [24 "LCD]

Monitor: HP 2159 Series Widle LCD monitor [23" LCD]

 

Your better off to have a friend than to be all alone.. If you fail, Your friend can help you up.