Hash Manager

By Gex on Feb 16, 2006

This script lets you create/edit your hash tables visually / easily. load to your remotes (alt + r) then choose hash manager from the menubar

dialog hsh {
  title "Hash Manager"
  size -1 -1 231 142
  option dbu
  list 1, 6 11 63 102, size
  list 2, 85 11 63 102, size
  edit "", 3, 162 11 63 102, read multi return autovs vsbar 
  box "Table", 4, 3 2 73 127
  box "Item", 5, 80 2 73 127
  box "Data", 6, 157 2 73 127
  button "New Table", 7, 6 115 30 12
  button "Delete", 8, 37 115 32 12, 
  button "Add Item", 9, 84 115 31 12, 
  button "Delete", 10, 116 115 31 12, 
  button "Edit Data", 11, 162 114 63 12, 
  edit "", 12, 1 130 230 11, read center
}

alias re.fresh {
  did -r hsh 2,3
  var %x 1
  did -r hsh 1
  while ($hget(%x)) {
    did -a hsh 1 $hget(%x)
    inc %x
  }

}
alias re.fresh2 {
  var %x 1
  did -r hsh 2
  while ($hget($did(1).seltext,%x).item) {
    did -a hsh 2 $hget($did(1).seltext,%x).item
    inc %x
  }
  did -ra hsh 12 You Are Viewing: $did(1).seltext ; (Total: $did(1).lines Table(s))

}
alias re.fresh3 {
  did -r hsh 3
  did -a hsh 3 $hget($did(1).seltext,$did(2).seltext)

}

on *:dialog:hsh:init:* {
  re.fresh
}
on *:dialog:hsh:sclick:1 {
  var %x 1
  did -r hsh 2
  while ($hget($did(1).seltext,%x).item) {
    did -a hsh 2 $hget($did(1).seltext,%x).item
    inc %x
  }

  did -ra hsh 12 You Are Viewing: $did(1).seltext ; (Total: $did(1).lines Table(s))
}
on *:dialog:hsh:sclick:2 {
  did -r hsh 3
  did -ra hsh 3 $hget($did(1).seltext,$did(2).seltext)  
  did -ra hsh 12 Table: $did(1).seltext $+ /Item: $did(2).seltext (Total: $did(1).lines Tables/ $+ $did(2).lines Items)
}
on *:dialog:hsh:sclick:7 { 
  .hmake $input(Enter the hash table name you want to create,qe,Hash Table Name) 10
  re.fresh

}
on *:dialog:hsh:sclick:9 { 
  if ($did(1).sel) {
    .hadd $did(1).seltext $input(Enter item name,qe,Item Name) $input(Enter Data,qe,Date?)
  }
  re.fresh2
}
on *:dialog:hsh:sclick:10 {
  if ($did(2).sel) {
    .hdel $did(1).seltext $did(2).seltext
    did -r hsh 3
    re.fresh2
  }
}
on *:dialog:hsh:sclick:8 {
  if ($did(1).sel) {
    if ($input(Are you sure that you want to delete $did(1).seltext,qy,Confirmation)) {
      .hfree $did(1).seltext
      re.fresh
    }
  }
}

on *:dialog:hsh:sclick:11 {
  var %x $input(Enter Data,qe,Data?,$hget($did(1).seltext,$did(2).seltext))
  if (%x) {
    .hdel $did(1).seltext $did(2).seltext
    .hadd $did(1).seltext $did(2).seltext %x
    re.fresh3
  }
}
alias hshviewer {
  if (!$dialog(hsh)) { dialog -m hsh hsh }
}

menu menubar {
  Hash Manager:/hshviewer
}

Comments

Sign in to comment.
Gex   -  Nov 18, 2011

haha it does :P

 Respond  
Cheiron   -  Apr 28, 2010

gives you something to do doesnt it lol

 Respond  
Gex   -  Apr 28, 2010

Oh god, I was 16 when I wrote this. :D...I even forgot how to code in mIRC lol. I bet i can't fix the bug now Cheiron.

 Respond  
Cheiron   -  Sep 23, 2009

bug found ... dialogue box will not X out sometimes after viewing data or editing. have to shut down my client totally and restart it

 Respond  
Firstmate   -  May 18, 2009

Nais 3 year bump!

 Respond  
Cheiron   -  May 18, 2009

very nice script and has saved me alot of headaches editing and deleting hashtables for channels. gets an 8 and a like :D

 Respond  
eqrunner   -  May 18, 2009

love it. great for us n00bs still trying to get the kinks out!

 Respond  
Gex   -  Feb 21, 2006

thanks guys

 Respond  
sean   -  Feb 21, 2006

very usefull, excellent work (as always) Gex

 Respond  
elya elina   -  Feb 17, 2006

Yeah.. pretty useful snippet...good work Gex

 Respond  
Gex   -  Feb 16, 2006

Thanks `Kazuma i hope evryone finds it useful

 Respond  
`Kazuma   -  Feb 16, 2006

Nice dialog job. Good work too. :P

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.