Hash Sandwhich — File Browser

HashSandwhichv3.04 / HashSandwhichv3.04 / mrf_ht.mrc

mrf_ht.mrc — 53.94 KB — Download this file

;#################### Hash Sandwhich v3.03 ####################
;### concept by: mr_foot
;### date created: January 10 2003
;### dialog design: mr_foot using Dialog Studio
;### code writing: mr_foot using mIRC v6.03
;### last updated: Oct 5 2004 using mIRC v6.13 by mr_foot
;#################### please do not modify and distribute ###################
;########## DIALOG DEFINITIONS ##########
;### DIALOG - dialog definitions.
dialog mrf_hashtable {
title %critical.hsh.progname %critical.hsh.progversion - by %critical.hsh.author
size -1 -1 353 243
option dbu
list 1, 134 148 104 62, sort size vsbar
list 2, 7 45 116 155, sort size vsbar
button "LOAD", 11, 185 213 22 10
button "SAVE", 12, 160 213 22 10
button "FREE", 13, 134 213 23 10
box "Resident Hash Tables", 14, 130 140 112 100
box "Values in Selected Hash Table", 15, 3 37 124 203
button "E&XIT", 18, 325 97 25 41, multi cancel
edit "", 30, 7 216 116 11
check "Filter &Values Using This Mask", 31, 7 228 84 10, disable
button "CREATE", 33, 210 213 28 10
text "[N/A]", 36, 164 102 24 8
text "Name:", 37, 135 111 18 8
text "[N/A]", 38, 153 111 164 8
button "ADD", 40, 7 203 21 10
button "REMOVE", 41, 91 203 32 10
button "RENAME", 43, 31 203 29 10
button "RENAME", 44, 134 226 33 10
button "CHANGE SIZE", 45, 198 226 40 10
text "", 83, 245 143 105 29
button "COPY", 84, 170 226 25 10
button "COPY", 85, 63 203 25 10
icon 86, 245 174 104 64, $scriptdir\logo.jpg, 0, noborder
box "Data in Selected Value", 16, 130 37 220 56
edit "", 3, 134 45 187 44, multi autovs vsbar limit 5000
button "&UNDO", 87, 325 46 21 19, disable
button "&APPLY", 88, 325 69 21 19, disable
box "Selected Hash Table Information", 103, 130 94 192 44
text "Table Size:", 104, 135 102 29 8
text "Values:", 105, 135 120 21 8
text "Recommended Size:", 106, 135 129 52 8
text "[N/A]", 107, 156 120 24 8
text "[N/A]", 108, 187 129 24 8
box "Search Values", 111, 3 13 124 23
box "Search Data", 112, 130 13 220 23
edit "", 125, 7 21 93 11
edit "", 126, 134 21 188 11
button "FIND", 115, 103 21 20 11, disable
button "FIND", 116, 325 21 21 11, disable
text "*Search/Filter Parameters: Use wildcards: mist*, *sterfoot, *sterf*, mis*ot, mis?erfoot, ???terfoo?, mister foot, the apple, etc etc.", 117, 3 3 347 8
check "BINARY HASH TABLE", 200, 256 126 62 10, hide disable left
button "HIDDEN BUTTON", 121, 302 3 48 12, hide result default
menu "HOTKEYS", 97
item "UNDO -> ALT-U", 98, 97
item "APPLY -> ALT-A", 99, 97
item "FILTER -> ALT-V", 102, 97
item break, 100, 97
item "EXIT -> ALT-X", 101, 97
menu "Help", 109
item "mIRC Hash Tables Help File...", 110, 109
item break, 120, 109
item "About...", 500, 109
item "Register...", 122, 109
menu "Update", 299
item "Check For Updates", 300, 299
}
;##########
dialog mrf_upgrade {
title Upgrading
size -1 -1 274 155
option dbu
box Upgrading Hash Sandwhich from $mrf_r(progversion) to v $+ $mrf_r(ud.cver), 1, 3 2 268 119
text "Current Operation:", 2, 8 12 62 8
edit "", 10, 8 23 258 92, read multi autovs vsbar
button CLICK HERE TO START MAKING A HASH SANDWHICH v $+ $mrf_r(ud.cver) STYLE!, 55, 3 124 268 27, hide result ok
}
dialog mrf_updater {
title %critical.hsh.progname %critical.hsh.progversion
size -1 -1 324 249
option dbu
box "Update Information / News", 1, 3 4 317 227
button "REFRESH INFO", 100, 96 234 48 12, default
button "UPGRADE NOW", 3, 3 234 47 12, disable
text "Most Recent Version:", 4, 8 14 53 8
text "Last Package Date:", 5, 8 36 49 8
text "Author's Current Email Address:", 6, 8 47 79 8
edit "", 7, 62 13 40 10, read autohs
edit "", 8, 57 35 107 10, read autohs
edit "", 9, 87 46 228 10, read autohs
text "Your Current Version:", 10, 8 25 54 8
edit "", 11, 62 24 40 10, read autohs
icon 12, 104 13 209 19, $scriptdir\ud-needrefresh.jpg, 0, noborder
button "CLOSE", 13, 293 234 27 12, ok
text "Revision History:", 14, 121 61 62 8, center
edit "", 15, 8 71 307 154, read multi return autovs vsbar
text "Size of Upgrade:", 16, 180 36 42 8
edit "", 17, 223 35 92 10, read autohs
text "Last Refreshed:", 18, 151 236 41 8
edit "", 19, 192 235 95 10, read autohs
check "FORCE", 20, 52 235 29 10, disable
}
dialog mrf_about {
title %critical.hsh.progname %critical.hsh.progversion
size -1 -1 114 174
option dbu
icon 1, 5 4 104 64, $scriptdir\logo.jpg, 0
text %critical.hsh.progname %critical.hsh.progversion, 2, 4 71 106 8, center
text Created: %critical.hsh.datecreated, 3, 4 78 106 8, center
text Author: %critical.hsh.author, 4, 4 85 106 8, center
text "Dialog Design: DStudio v1.0 beta 8", 5, 4 99 106 8, center
text "Designed For: mIRC v6.03", 6, 4 106 106 8, center
text %mrf_ttt, 7, 4 92 106 8, center
text "Registered To:", 8, 4 113 106 8, center
text %critical.hsh.regname, 9, 4 120 106 8, center
text "Updates At: http://www.mircscripts.org", 10, 4 132 106 8, center
text "This Program is Freeware", 11, 4 139 106 8, center
text "Please only distribute original package!", 12, 4 146 106 8, center
button "CLOSE", 13, 4 158 106 12, default ok
}
dialog mrf_file3 {
title SAVE Hash Table to a File - %critical.hsh.progname
size -1 -1 260 42
option dbu
box %hsh.id17.text, 17, 3 1 254 22
text "Name:", 8, 7 10 18 8, right
edit %hsh.id9.text, 9, 27 9 224 10, disable
button SAVE, 1, 3 26 37 12, result default ok
button "Cancel", 2, 220 26 37 12, cancel
button SAVE as Binary, 3, 106 26 48 12, hide disable result ok
}
dialog mrf_file {
title LOAD Hash Table From a File - %critical.hsh.progname
size -1 -1 260 60
option dbu
box %hsh.id17.text, 17, 3 1 254 41
button "CLEAR", 39, 7 10 25 19, multi
text "Name:", 8, 34 10 18 8, right
text "Size:", 6, 34 21 18 8, right
edit %hsh.id9.text, 9, 54 9 199 10
edit %hsh.id10.text, 10, 54 20 36 10
check "Load as a Binary File", 32, 195 20 58 10, hide disable left
text %hsh.id29.text, 29, 7 32 246 7
button %hsh.id1.text, 1, 3 45 37 12, result default ok
button "Cancel", 2, 220 45 37 12, cancel
}
dialog mrf_file2 {
title CREATE a New Hash Table - %critical.hsh.progname
size -1 -1 260 60
option dbu
box %hsh.id17.text, 17, 3 1 254 41
button "CLEAR", 39, 7 10 25 19, multi
text "Name:", 8, 34 10 18 8, right
text "Size:", 6, 34 21 18 8, right
edit %hsh.id9.text, 9, 54 9 199 10
edit %hsh.id10.text, 10, 54 20 36 10
text %hsh.id29.text, 29, 7 32 244 7
button %hsh.id1.text, 1, 3 45 37 12, result default ok
button "Cancel", 2, 220 45 37 12, cancel
}
;########## ALIASES ##########
;## ALIAS - initialize the mrf_file2 table dialog for CREATING
alias -l mrf_init.createhash {
%hsh.id17.text = CREATE a new Hash Table using these settings
%hsh.id29.text = * If these fields are left blank, DEFAULTS will be ' $+ $me $+ - $+ $time(h-nn-ss) $+ ' for table name, and size 100.
%hsh.id9.text = $me $+ - $+ $time(h-nn-ss)
%hsh.id10.text = 100
%hsh.id1.text = CREATE
%hsh.dialog = $dialog(mrf_createfile,mrf_file2,-4)
}
;## ALIAS - initialize the mrf_file3 table dialog for SAVING
alias -l mrf_init.savetable {
%hsh.id17.text = SAVE ' $+ $did(mrf_hashtable,1).seltext $+ ' Hash Table to FILE
%hsh.id9.text = %hsh.tmp
%hsh.dialog = $dialog(mrf_savefile,mrf_file3,-4)
}
;## ALIAS - initialize the mrf_file table dialog for LOADING
alias -l mrf_init.loadfile {
%hsh.tmp = $sfile($mircdir\*.hsh,Choose File to Load,LOAD)
if (%hsh.tmp == $null) halt
%hsh.id17.text = LOAD file: ' $+ $nopath(%hsh.tmp) $+ ' into a Hash Table
%hsh.id29.text = * If these fields are left blank, DEFAULTS will be ' $+ $gettok($nopath(%hsh.tmp),1,46) $+ ' for table name, and size 100.
%hsh.id9.text = $gettok($nopath(%hsh.tmp),1,46)
%hsh.id10.text = 100
%hsh.id1.text = LOAD
%hsh.dialog = $dialog(mrf_loadfile,mrf_file,-4)
}
;### ALIAS - brings up Load File Dialog with *.hsh as a file mask.
alias -l mrf_load.file {
%hsh.dialog = $null
mrf_init.loadfile
if (%hsh.dialog == $null) { unset %hsh.* | halt }
if (%hsh.id9.text == $null && $hget($gettok($nopath(%hsh.tmp),1,46)) != $null) { mrf_err A Hash Table with the name ' $+ $gettok($nopath(%hsh.tmp),1,46) $+ ' is already resident. You must first FREE this Hash Table. | unset %hsh.* | halt }
if ($remove(%hsh.id9.text,-,_,.) !isalnum && %hsh.id9.text) {
mrf_err In order to avoid conflicts, you cannot use the following characters in a Hash Table name: {}[]\;:'"/?><,~`!@#$%^&*+= $crlf $+ Please choose another name. | unset %hsh.* | halt }
if (%hsh.id9.text != $null && $hget(%hsh.id9.text) != $null) { mrf_err A Hash Table with the name ' $+ %hsh.id9.text $+ ' is already resident. You must first FREE this Hash Table. | unset %hsh.* | halt }
if (%hsh.id10.text !isnum && %hsh.id10.text != $null) { mrf_err The SIZE of the Hash Table to be Loaded must be a positive integer... | unset %hsh.* | halt }
if (%hsh.id9.text == $null && %hsh.id10.text != $null) hmake $gettok($nopath(%hsh.tmp),1,46) $int(%hsh.id10.text)
elseif (%hsh.id9.text != $null && %hsh.id10.text == $null) hmake %hsh.id9.text 100
elseif (%hsh.id9.text != $null && %hsh.id10.text != $null) hmake %hsh.id9.text $int(%hsh.id10.text)
else hmake $gettok($nopath(%hsh.tmp),1,46) 100
hload $iif(%hsh.binary,-b) $iif(%hsh.id9.text == $null,$gettok($nopath(%hsh.tmp),1,46),%hsh.id9.text) " $+ %hsh.tmp $+ "
if (%hsh.binary) %critical.hsh.binarylist = $addtok(%critical.hsh.binarylist,$iif(%hsh.id9.text == $null,$gettok($nopath(%hsh.tmp),1,46),%hsh.id9.text),777)
mrf_pop.tables
unset %hsh.*
}
;### ALIAS - creates a new hash table using settings specified beforehand on main dialog
alias -l mrf_create.hash {
%hsh.dialog = $null
mrf_init.createhash
if (%hsh.dialog == $null) { unset %hsh.* | halt }
if (%hsh.id10.text !isnum && %hsh.id10.text != $null) { mrf_err You are CREATING A NEW HASH TABLE. You must specify an positive INTEGER in for the SIZE of the new Hash Table. ' $+ %hsh.id10.text $+ ' is NOT a positive integer. | unset %hsh.* | halt }
if ($remove(%hsh.id9.text,-,_,.) !isalnum && %hsh.id9.text) {
mrf_err In order to avoid conflicts, you cannot use the following characters in a Hash Table name: {}[]\;:'"/?><,~`!@#$%^&*+= $crlf $+ Please choose another name. | unset %hsh.* | halt }
if ($hget(%hsh.id9.text) != $null && %hsh.id9.text != $null) { mrf_err A Hash Table with the name ' $+ %hsh.id9.text $+ ' is already resident. You must first FREE this Hash Table. | unset %hsh.* | halt }
hmake $iif(%hsh.id9.text != $null,%hsh.id9.text,$me $+ - $+ $time(h-nn-ss)) $iif(%hsh.id10.text != $null,%hsh.id10.text,100)
mrf_pop.tables
}
;### ALIAS - adds a new value to selected hash table
alias -l mrf_add.value {
if ($did($dname,1).seltext == $null) halt
%hsh.newvalue = $input(Enter $+ $chr(44) in ONE WORD $+ $chr(44) the name of the value to be added. If your entry contains a space $+ $chr(44) any data AFTER the space will be used for DATA in your new value:,eoq,Add A Value to the Current Hash Table,$me $+ - $+ $time(h-nn-ss))
if ($istok($didtok($dname, 2, 44), $gettok(%hsh.newvalue,1,32),44) != $true && %hsh.newvalue != $null) { hadd $iif($did($dname,31).state,-b) $did($dname,1).seltext %hsh.newvalue }
unset %hsh.newvalue
mrf_pop.values
}
;### ALIAS - removes the selected value from the selected hash table
alias -l mrf_rem.value {
if ($did($dname,2).seltext == $null) halt
hdel $did($dname,1).seltext $did(mrf_hashtable,2).seltext
mrf_pop.values
}
;### ALIAS - renames the selected value, utilizing a temporary value
alias -l mrf_rnm.value {
if ($did($dname,2).seltext == $null) halt
%hsh.newvalue = $input(Enter $+ $chr(44) in ONE WORD $+ $chr(44) the NEW name of the value ' $+ $did($dname,2).seltext $+ '.,eoq,Rename a Value,$me $+ - $+ $time(h-nn-ss))
if ($istok($didtok($dname, 2, 44), $gettok(%hsh.newvalue,1,32),44) != $true && %hsh.newvalue != $null) {
hadd $iif($did($dname,31).state,-b) $did($dname,1).seltext $gettok(%hsh.newvalue,1,32) $hget($did($dname,1).seltext,$did($dname,2).seltext)
hdel $did($dname,1).seltext $did($dname,2).seltext
}
unset %hsh.newvalue
mrf_pop.values
}
;### ALIAS - copies the selected value, utilizing a temporary value
alias -l mrf_copy.value {
if ($did($dname,2).seltext == $null) halt
%hsh.newvalue = $input(Enter $+ $chr(44) in ONE WORD $+ $chr(44) the name of the COPY of the value ' $+ $did($dname,2).seltext $+ ' that you are creating:,eoq,Rename a Value,$me $+ - $+ $time(h-nn-ss))
if ($istok($didtok($dname, 2, 44), $gettok(%hsh.newvalue,1,32),44) != $true && %hsh.newvalue != $null) {
hadd $iif($did($dname,31).state,-b) $did($dname,1).seltext $gettok(%hsh.newvalue,1,32) $hget($did($dname,1).seltext,$did($dname,2).seltext)
}
unset %hsh.newvalue
mrf_pop.values
}
;### ALIAS - renames the selected hash table, utilizing a temporary file
alias -l mrf_rnm.table {
if ($did($dname,1).seltext == $null) halt
unset %hsh.tmp %hsh.tmp.size
if ($did($dname,1).seltext != $null) { %hsh.tmp = $mircdir\ $+ misterfootistheshit $+ .mrf | %hsh.tmp.size = $hget($did($dname,1).seltext).size }
if (%hsh.tmp == $null) halt
hsave $iif($did($dname,31).state,-ob,-o) $did($dname,1).seltext " $+ %hsh.tmp $+ "
%hsh.newvalue = $input(Enter $+ $chr(44) in ONE WORD $+ $chr(44) the NEW name of the Hash Table ' $+ $did($dname,1).seltext $+ '.,eoq,Rename a Hash Table,$me $+ - $+ $time(h-nn-ss))
if ($remove(%hsh.newvalue,-,_,.) !isalnum && %hsh.newvalue) {
mrf_err In order to avoid conflicts, you cannot use the following characters in a Hash Table name: {}[]\;:'"/?><,~`!@#$%^&*+= $crlf $+ Please choose another name. | unset %hsh.* | halt }
if ($hget(%hsh.newvalue) != $null && %hsh.newvalue != $null) { mrf_err A Hash Table with the name ' $+ %hsh.newvalue $+ ' is already resident. You must first FREE this Hash Table. | unset %hsh.* | halt }
if ($istok($didtok($dname, 1, 44), $gettok(%hsh.newvalue,1,32),44) != $true && %hsh.newvalue != $null) {
hmake %hsh.newvalue %hsh.tmp.size
hload $iif($did($dname,31).state,-b) %hsh.newvalue " $+ %hsh.tmp $+ "
.remove %hsh.tmp
hfree $did($dname,1).seltext
}
unset %hsh.newvalue %hsh.tmp %hsh.tmp.size
mrf_pop.tables
}
;### ALIAS - copies the selected hash table, utilizing a temporary file
alias -l mrf_copy.table {
if ($did($dname,1).seltext == $null) halt
unset %hsh.tmp %hsh.tmp.size
if ($did($dname,1).seltext != $null) { %hsh.tmp = $mircdir\ $+ misterfootistheshit $+ .mrf | %hsh.tmp.size = $hget($did($dname,1).seltext).size }
if (%hsh.tmp == $null) halt
$iif($did($dname,31).state,-ob,-o) " $+ $did($dname,1).seltext $+ " %hsh.tmp
%hsh.newvalue = $input(Enter $+ $chr(44) in ONE WORD $+ $chr(44) the name of the COPY of the Hash Table ' $+ $did($dname,1).seltext $+ ' that you are creating:,eoq,Rename a Hash Table,$me $+ - $+ $time(h-nn-ss))
if ($remove(%hsh.newvalue,-,_,.) !isalnum && %hsh.newvalue) {
mrf_err In order to avoid conflicts, you cannot use the following characters in a Hash Table name: {}[]\;:'"/?><,~`!@#$%^&*+= $crlf $+ Please choose another name. | unset %hsh.* | halt }
if ($hget(%hsh.newvalue) != $null && %hsh.newvalue != $null) { mrf_err A Hash Table with the name ' $+ %hsh.newvalue $+ ' is already resident. You must first FREE this Hash Table. | unset %hsh.* | halt }
if ($istok($didtok($dname, 1, 44), $gettok(%hsh.newvalue,1,32),44) != $true && %hsh.newvalue != $null) {
hmake %hsh.newvalue %hsh.tmp.size
hload %hsh.newvalue " $+ %hsh.tmp $+ "
.remove %hsh.tmp
}
unset %hsh.newvalue %hsh.tmp %hsh.tmp.size
mrf_pop.tables
}
;### ALIAS - changes the size of the current hash table, utilizing a temporary file
alias -l mrf_change.size {
if ($did($dname,1).seltext == $null) halt
unset %hsh.tmp %hsh.tmp.size
if ($did($dname,1).seltext != $null) { %hsh.tmp = $mircdir\ $+ misterfootistheshit $+ .mrf | %hsh.tmp.size = $did($dname,1).seltext }
if (%hsh.tmp == $null) halt
hsave $iif($did($dname,31).state,-ob,-o) $did($dname,1).seltext " $+ %hsh.tmp $+ "
%hsh.newvalue = $input(Enter $+ $chr(44) using only positive Integers $+ $chr(44) the NEW size of the Hash Table ' $+ $did($dname,1).seltext $+ ' $+ $chr(44) whose current size is ' $+ $hget($did($dname,1).seltext).size $+ '.,eoq,Change SIZE of a Hash Table,100)
if ($remove($did($dname,1).seltext,-,_,.) !isalnum && $did($dname,1).seltext) {
mrf_err In order to avoid conflicts, you cannot use the following characters in a Hash Table name: {}[]\;:'"/?><,~`!@#$%^&*+= $crlf $+ Please choose another name. | unset %hsh.* | halt }
if (%hsh.newvalue isnum && %hsh.newvalue != $null) {
hfree $did($dname,1).seltext
hmake %hsh.tmp.size %hsh.newvalue
hload $iif($did($dname,31).state,-b) %hsh.tmp.size " $+ %hsh.tmp $+ "
.remove %hsh.tmp
}
unset %hsh.newvalue %hsh.tmp %hsh.tmp.size
mrf_pop.tables
}
;### ALIAS - pops up an error dialog with a custom message (Usage: mrf_err <custom error msg>)
alias -l mrf_err var %hsh.tmp = $input($$1-,ow,You screwed up yo...)
;### ALIAS - populates the data combobox
alias -l mrf_pop.data { did -ar $dname 3 $hget($did(mrf_hashtable,1).seltext,$did(mrf_hashtable,2).seltext) }
;### ALIAS - populates the values combobox
alias -l mrf_pop.values {
%hhh = 1
did -r $dname 2,3
while (%hhh <= $hget($did(mrf_hashtable,1).seltext,0).item) {
%hhh.i = $hget($did(mrf_hashtable,1).seltext,%hhh).item
if ($did($dname,31).state) {
var %hhh.2 = $did($dname,30)
if (%hhh.2 iswm %hhh.i) did -a $dname 2 %hhh.i
}
else {
did -a $dname 2 %hhh.i
}
inc %hhh }
unset %hhh*
}
;### ALIAS - populates the hash tables combo box
alias -l mrf_pop.tables {
did -r $dname 1,2,3
if ($hget(0) <= 0) { halt }
%hhh = 1
while (%hhh <= $hget(0)) {
did -a $dname 1 $hget(%hhh)
inc %hhh }
unset %hhh
}
;### ALIAS - necessary process in order to allow saving a multi-line editbox as a single hash table entry
alias -l mrf_wholeeditbox {
if ($1 != $null && $2 != $null) {
set %ad.temp 1
set %ad.tempvalue $null
while (%ad.temp <= $did($1,$2).lines) {
%ad.tempvalue = %ad.tempvalue $did($1,$2,%ad.temp).text
inc %ad.temp
}
unset %ad.temp
return %ad.tempvalue
}
else return $null
}
;### ALIAS - updates the textbox info of the current hash table
alias -l mrf_update.info {
if ($did(mrf_hashtable,1).seltext != $null && $did(mrf_hashtable,2).seltext == $null) {
;XBINARY- did -e $dname 200
;XBINARY- if ($istok(%critical.hsh.binarylist,$did($dname,1).seltext,777)) did -c $dname 200
;XBINARY- else did -u $dname 200
%hsh.tmp2 = $did(mrf_hashtable,1).seltext
%hsh.poop = $hget($did($dname,1).seltext,0).item
%hsh.pooey = $round($calc(%hsh.poop / 10),0)
did -a $dname 16 Data in Selected Values $chr(91) $+ no value selected $+ $chr(93)
did -a $dname 15 $hget($did($dname,1).seltext,0).item Values in Selected Hash Table
did -a $dname 36 $chr(91) $+ $hget(%hsh.tmp2).size $+ $chr(93)
did -a $dname 38 $chr(91) $+ %hsh.tmp2 $+ $chr(93)
did -a $dname 107 $chr(91) $+ $hget($did($dname,1).seltext,0).item $+ $chr(93)
did -a $dname 108 $chr(91) $+ $iif(%hsh.pooey < 5,5,%hsh.pooey) $+ $chr(93)
}
elseif ($did(mrf_hashtable,1).seltext == $null) {
;XBINARY- did -ub $dname 200
%hsh.tmp2 = N/A
did -a $dname 16 Data in Selected Values $chr(91) $+ no hash table selected $+ $chr(93)
did -a $dname 15 Values in Selected Hash Table
did -a $dname 36,38,107,108 $chr(91) $+ %hsh.tmp2 $+ $chr(93)
}
if ($did(mrf_hashtable,1).seltext != $null && $did(mrf_hashtable,2).seltext != $null) {
did -a $dname 16 Data in Selected Values $chr(91) $+ $len($mrf_wholeeditbox($dname,3).text) characters $+ $chr(93)
}
did -a $dname 14 $hget(0) Resident Hash Tables
mrf_update.buttons r
did -a $dname 111 Search Values $iif(%hshsearch.values,[ $+ $iif(%hshsearch.total,%hshsearch.total matches - showing $chr(35) $+ %hshh.session.count $+ ],no matches $+ ]))
did -a $dname 112 Search Data $iif(%hshsearch.data,[ $+ $iif(%hshsearch.total,%hshsearch.total matches - showing $chr(35) $+ %hshh.session.count $+ ],no matches $+ ]))
unset %hsh.*
}
;### ALIAS - saves the current table, this alias is not used in the RENAMING and CHANGE SIZE functions
alias -l mrf_save.table {
unset %hsh.*
if ($did($dname,1).seltext != $null) { %hsh.tmp = $sfile($mircdir\ $+ $did($dname,1).seltext $+ .hsh,Choose File to Save To,SAVE) }
if (%hsh.tmp == $null) halt
mrf_init.savetable
if (%hsh.binary == cancel) halt
hsave $iif(%hsh.binary == $true,-ob,-o) $did($dname,1).seltext " $+ %hsh.tmp $+ "
unset %hsh.*
mrf_pop.tables
}
;### ALIAS - formatted echo -a cmd, uses $! for prefix (choose from E = error, S = status, N = note, P = passed, F = failed, PRE = prefix, SUF = suffix)
alias mrf_echo {
if (($1 != E && $1 != S && $1 != N && $1 != P && $1 != F && $1 != PRE && $1 != SUF && $1 != CUS) || ($2 == $null && $1 != PRE && $1 != SUF)) { echo -a 00,01[SCRIPT ERROR] 15SYNTAX: mrf_echo <E,S,N,P,PRE,SUF> <msg> | halt }
if ($1 == E) echo -a 09,01-03-14-04 [ERROR]15 $2-
if ($1 == S) echo -a 09,01-03-14-15 $2-
if ($1 == N) echo -a 09,01-03-14-14 [00*14]15 $2-
if ($1 == P) echo -a 09,01-03-14-12 [PASSED]15 $2-
if ($1 == F) echo -a 09,01-03-14-04 [FAILED]15 $2-
if ($1 == PRE) echo -a 09,01-03-14- 00Initialization 14---- -03-09- --- ----03--- -09- - 03-----14-- -09--03-----14---- --03--09-03-- 14--------03-14- ----- -03-14-- -- ---- - - -- -
if ($1 == SUF) echo -a 09,01-03-14- -09- --- ----03--- -09- - 03-----14-- -09--03-----14---- --03--09-03-- 14--------03-14- ----- -03-14-- -- ---- - - -- -
if ($1 == CUS) echo -a 09,01-03-14-00 $2- 09-- --- ----03--- -09- - 03-----14-- -09--03-----14---- --03--09-03-- 14--------03-14- ----- -03-14-- -- ---- - - -- -
}
;### ALIAS - update UNDO and apply buttons
alias -l mrf_update.buttons {
if ($1 == r) { did -b $dname 87,88 | did -j $dname 3 }
if ($did($dname,3).edited == $true && $did($dname,87).enabled == $false) { did -e $dname 87 }
if ($did($dname,3).edited == $true && $did($dname,88).enabled == $false) { did -e $dname 88 }
}
;### ALIAS - applies changes to DATA box
alias -l mrf_apply {
hadd $did($dname,1).seltext $did($dname,2).seltext $mrf_wholeeditbox($dname,3)
mrf_update.buttons r
}
;### ALIAS - UNDO's changes to data box
alias -l mrf_undo {
%hsh.tmp = $did($dname,1).seltext
%hsh.tmp2 = $did($dname,2).seltext
did -ra $dname 3 $hget(%hsh.tmp,%hsh.tmp2)
mrf_update.buttons r
unset %hsh.*
}
;### ALIAS - updates binary variables
alias -l mrf_binary.update {
if ($did($dname,200).state == 1) {
if ($istok(%critical.hsh.binarylist,$did($dname,1).seltext,777) == $false) { %critical.hsh.binarylist = $addtok(%critical.hsh.binarylist,$did($dname,1).seltext,777) }
}
if ($did($dname,200).state == 0) {
%critical.hsh.binarylist = $remtok(%critical.hsh.binarylist,$did($dname,1).seltext,1,777)
}
mrf_update.info
}
;## ALIAS - finds data
alias -l mrf_find.data {
if ($did($dname,31).state) { did -u $dname 31 | mrf_pop.values }
if ($did($dname,126).text != %hshsearch.wildtext) {
%hshh.session.count = 0
}
%hshsearch.wildtext = $did($dname,126).text
%hshsearch.total = $mrf_search.hash(n,d,%hshsearch.wildtext)
if (%hshsearch.total < 1) { mrf_err NO MATCHES FOUND | halt }
%hshsearch.tmp = 1
%hsh.current.hash = $did($dname,1).seltext
inc %hshh.session.count
if (%hshh.session.count > %hshsearch.total) { %hshh.session.count = 1 }
did -c mrf_hashtable 1 $didwm($dname,1,$gettok($mrf_search.hash(%hshh.session.count,d,%hshsearch.wildtext),1,777))
$iif(%hsh.current.hash != $did($dname,1).seltext,mrf_pop.values)
did -c mrf_hashtable 2 $didwm($dname,2,$gettok($mrf_search.hash(%hshh.session.count,d,%hshsearch.wildtext),2,777))
mrf_pop.data
mrf_update.info
}
;## ALIAS - finds values
alias -l mrf_find.values {
if ($did($dname,31).state) { did -u $dname 31 | mrf_pop.values }
if ($did($dname,125).text != %hshsearch.wildtext) {
%hshh.session.count = 0
}
%hshsearch.wildtext = $did($dname,125).text
%hshsearch.total = $mrf_search.hash(n,i,%hshsearch.wildtext)
if (%hshsearch.total < 1) { mrf_err NO MATCHES FOUND | halt }
%hshsearch.tmp = 1
%hsh.current.hash = $did($dname,1).seltext
inc %hshh.session.count
if (%hshh.session.count > %hshsearch.total) { %hshh.session.count = 1 }
did -c mrf_hashtable 1 $didwm($dname,1,$gettok($mrf_search.hash(%hshh.session.count,i,%hshsearch.wildtext),1,777))
$iif(%hsh.current.hash != $did($dname,1).seltext,mrf_pop.values)
did -c mrf_hashtable 2 $didwm($dname,2,$gettok($mrf_search.hash(%hshh.session.count,i,%hshsearch.wildtext),2,777))
mrf_pop.data
mrf_update.info
}
;### ALIAS - updates version information from hash file.
alias -l mrf_update.info.ver {
if ($mrf_r(ud.last)) { did -ra mrf_updater 19 $mrf_r(ud.last) } | else { did -ra mrf_updater 19 never }
did -ra mrf_updater 17 $bytes($mrf_r(ud.size),k).suf
did -ra mrf_updater 7 $mrf_r(ud.cver)
did -ra mrf_updater 8 $mrf_r(ud.cdate)
did -ra mrf_updater 9 $mrf_r(ud.aemail)
did -ra mrf_updater 11 $remove($mrf_r(progversion),v)
if (!$isfile(" $+ $scriptdir $+ ht_history.txt $+ ")) { mrf_Echo e !exist | goto 1.updater.end }
if (!$read(" $+ $scriptdir $+ ht_history.txt $+ ",n,1)) { mrf_echo e !read | goto 1.updater.end }
var %hsh.ud.d.temp = 1
did -r mrf_updater 15
%hsh.ud.d.file = " $+ $scriptdir $+ ht_history.txt $+ "
while ($read(%hsh.ud.d.file,n,%hsh.ud.d.temp) != END OF UPDATES && %hsh.ud.d.temp <= 500) {
did -a mrf_updater 15 $read(%hsh.ud.d.file,n,%hsh.ud.d.temp) $+ $crlf
inc %hsh.ud.d.temp
}
goto 1.realend
:1.updater.end
did -ra mrf_updater 15 HISTORY COULD NOT BE RETRIEVED
:1.realend
$iif($did(mrf_updater,7) > $did(mrf_updater,11),did -g mrf_updater 12 " $+ $scriptdir $+ ud-yesupdate.jpg $+ ",did -g mrf_updater 12 " $+ $scriptdir $+ ud-noupdate.jpg $+ ")
$iif($did(mrf_updater,7) > $did(mrf_updater,11),did -e mrf_updater 3,did -b mrf_updater 3)
$iif($did(mrf_updater,7) > $did(mrf_updater,11),did -b mrf_updater 20,did -e mrf_updater 20)
did -c mrf_updater 15 1
}
;### ALIAS - checks for new version information and saves data to hash file.
alias mrf_check.ver {
did -ra $dname 7,8,9,15,17 Retrieving Info...
if ($isfile(" $+ $scriptdir $+ ht_history.txt $+ ")) { .remove " $+ $scriptdir $+ ht_history.txt $+ " }
if ($sock(mrf.sopen.hsandwhich.ver)) {
sockclose mrf.sopen.hsandwhich.ver
}
sockopen mrf.sopen.hsandwhich.ver www.shuswapjanitorial.com 80
}
on *:sockopen:mrf.sopen.hsandwhich.ver:{
sockwrite -n $sockname GET http://www.shuswapjanitorial.com/hash/ht_ver.txt
}
;############################################################################# -> upgrade
alias -l mrf_upgrade.script {
if ($isfile(" $+ $scriptdir $+ mrf_ht.new $+ ")) .remove " $+ $scriptdir $+ mrf_ht.new $+ "
dialog -m mrf_upgrade mrf_upgrade
if $sock(mrf.sopen.hsandwhich.upgrade) { sockclose mrf.sopen.hsandwhich.upgrade }
sockopen mrf.sopen.hsandwhich.upgrade www.shuswapjanitorial.com 80
}
alias mrf_pr { did - $+ $$1 mrf_upgrade 10 $$2- $crlf }
on *:dialog:mrf_upgrade:init:0:{
mrf_pr ra Connecting to http://www.shuswapjanitorial.com...
}
alias -l mrf_upgrade.script.2 {
mrf_pr a Installing Script...
dialog -x mrf_updater
.timer -m 1 100 dialog -x mrf_hashtable
mrf_pr a Saving NEW file as mrf_ht.new...
mrf_pr a Copying mrf_ht.mrc to mrf_ht.old...
.copy -o " $+ $scriptdir $+ mrf_ht.mrc $+ " " $+ $scriptdir $+ mrf_ht.old $+ "
mrf_pr a Copying mrf_ht.new to mrf_ht.mrc...
.copy -o " $+ $scriptdir $+ mrf_ht.new $+ " " $+ $scriptdir $+ mrf_ht.mrc $+ "
mrf_pr a When this window is closed, you will see the text: "UPGRADE SUCCESSFULL"
mrf_pr a At this time, you may run Hash Sandwhich and use the new version..
mrf_pr a --- This widow will close in 10 seconds. Please wait ---
mrf_pr a Preparing to Reload...
did -a mrf_upgrade 10 10... $chr(32)
.timer 1 1 did -a mrf_upgrade 10 9... $chr(32)
.timer 1 2 did -a mrf_upgrade 10 8... $chr(32)
.timer 1 3 did -a mrf_upgrade 10 7... $chr(32)
.timer 1 4 did -a mrf_upgrade 10 6... $chr(32)
.timer 1 5 did -a mrf_upgrade 10 5... $chr(32)
.timer 1 6 did -a mrf_upgrade 10 4... $chr(32)
.timer 1 7 did -a mrf_upgrade 10 3... $chr(32)
.timer 1 8 did -a mrf_upgrade 10 2... $chr(32)
.timer 1 9 did -a mrf_upgrade 10 1... $chr(32)
.timer 1 10 did -a mrf_upgrade 10 GO!
mrf_echo n Working... Please wait...
.timer 1 10 mrf_ug.finalize
.timer 1 10 did -v mrf_upgrade 55
}
on *:dialog:mrf_upgrade:sclick:*:{
if ($did == 55) {
dialog -x mrf_upgrade
.reload -rs " $+ $script $+ "
}
}
alias -l mrf_ug.finalize {
mrf_Echo cus Upgrade Status
mrf_echo n Now writing new version information to SETTINGS
mrf_w progversion v $+ $mrf_r(ud.cver)
mrf_echo s Writing Program Version:11 $mrf_r(progversion)
mrf_w datecreated $mrf_r(ud.cdate)
mrf_echo s Writing Creation Date:11 $mrf_r(datecreated)
mrf_echo p UPGRADE SUCCESSFULL
mrf_echo n You may now run Hash Sandwhich $mrf_r(progversion) by typing /mrf_ht or right clicking in most windows...
mrf_echo suf
}
;### UPDATE ON EVENTS ##########################################################3333
;### TOKEN SEPARATOR is $chr(94) or ^
on *:sockopen:mrf.sopen.hsandwhich.upgrade:{
mrf_pr a Initiating Download of mrf_ht.new...
sockwrite -n $sockname GET http://www.shuswapjanitorial.com/hash/mrf_ht.mrc
sockwrite -n $sockname Host: www.shuswapjanitorial.com
sockwrite -n $sockname $str($crlf,2)
}
on *:sockread:mrf.sopen.hsandwhich.upgrade:{
if ($sockerr) { echo -a *** Socket read error: $sock($sockname).wsmsg | return }
%mrf_ug.t2 = $mrf_r(ud.size)
:nextread
sockread %mrf_ug.temp
if ($sockbr == 0) { unset %mrf_ug.temp %mrf_ug.t* %mrf_ug.byte | return }
%mrf_ug.byte = $sock($sockname).rcvd
did -ra mrf_upgrade 10 Downloading mrf_ht.mrc... Received %mrf_ug.byte bytes... $crlf
did -a mrf_upgrade 10 Percent Complete $chr(91) $+ $round($calc(%mrf_ug.byte / %mrf_ug.t2 * 100),0) $+ % $+ $chr(93) $crlf
write " $+ $scriptdir $+ mrf_ht.new $+ " %mrf_ug.temp
goto nextread
}
on *:sockread:mrf.sopen.hsandwhich.logo:{
if ($sockerr) { echo -a *** Socket read error: $sock($sockname).wsmsg | return }
:nnnextread
sockread &mrf_ug.temp
if ($sockbr == 0) {
unset %mrf_ug.temp %mrf_ug.t* %mrf_ug.byte
did -ra mrf_upgrade 10 Downloading logo.jpg... Received %mrf_ug.byte bytes... $crlf
did -a mrf_upgrade 10 Percent Complete $chr(91) $+ 100 $+ % $+ $chr(93) $crlf
return }
%mrf_ug.byte = $sock($sockname).rcvd
did -ra mrf_upgrade 10 Downloading logo.jpg... Received %mrf_ug.byte bytes... $crlf
did -a mrf_upgrade 10 Percent Complete $chr(91) $+ $round($calc(%mrf_ug.byte / 26000 * 100),0) $+ % $+ $chr(93) $crlf
bwrite " $+ $scriptdir $+ logo.jpg $+ " -1 4096 &mrf_ug.temp
/bunset &mrf_ug.temp
goto nnnextread
}
on *:sockclose:mrf.sopen.hsandwhich.upgrade:{
mrf_pr a Finished Downloading mrf_ht.new
if ($isfile(" $+ $scriptdir $+ logo.jpg $+ ")) .remove " $+ $scriptdir $+ logo.jpg $+ "
sockopen mrf.sopen.hsandwhich.logo www.shuswapjanitorial.com 80
}
on *:sockclose:mrf.sopen.hsandwhich.logo:{
mrf_upgrade.script.2
}
on *:sockopen:mrf.sopen.hsandwhich.logo:{
mrf_pr a Initiating Download of mrf_ht.new...
sockwrite -n $sockname GET http://www.shuswapjanitorial.com/hash/logo.jpg
sockwrite -n $sockname Host: www.shuswapjanitorial.com
sockwrite -n $sockname $str($crlf,2)
}
on *:sockread:mrf.sopen.hsandwhich.ver:{
if ($sockerr) { echo -a *** Socket read error: $sock($sockname).wsmsg | return }
:nextver
sockread %mrf_ud.temp
if ($sockbr == 0) { unset %mrf_ud.* | return }
if ($gettok(%mrf_ud.temp,1,94) == CURRENT VER) { %hsh.ud.cver = $gettok(%mrf_ud.temp,2,94) | mrf_w ud.cver %hsh.ud.cver }
elseif ($gettok(%mrf_ud.temp,1,94) == DATE UPDATED) { %hsh.ud.cdate = $gettok(%mrf_ud.temp,2,94) | mrf_w ud.cdate %hsh.ud.cdate }
elseif ($gettok(%mrf_ud.temp,1,94) == AUTHOR'S EMAIL) { %hsh.ud.aemail = $gettok(%mrf_ud.temp,2,94) | mrf_w ud.aemail %hsh.ud.aemail }
elseif ($gettok(%mrf_ud.temp,1,94) == SIZE) { %hsh.ud.size = $gettok(%mrf_ud.temp,2,94) | mrf_w ud.size %hsh.ud.size }
elseif (%mrf_ud.temp == $null) { }
goto nextver
}
on *:sockclose:mrf.sopen.hsandwhich.ver:{
unset %mrf_ud.* %hsh.ud.*
if ($sock(mrf.sopen.hsandwhich.history)) {
sockclose mrf.sopen.hsandwhich.history
}
sockopen mrf.sopen.hsandwhich.history www.shuswapjanitorial.com 80
}
on *:sockclose:mrf.sopen.hsandwhich.history:{
unset %mrf_hs.* %hsh.hs.*
mrf_update.info.ver
}
on *:sockopen:mrf.sopen.hsandwhich.history:{
sockwrite -n $sockname GET http://www.shuswapjanitorial.com/hash/ht_history.txt
}
;### TOKEN SEPARATOR is $chr(94) or ^
on *:sockread:mrf.sopen.hsandwhich.history:{
if ($sockerr) { mrf_Echo e socket error $sock($sockname).wserr | return }
sockread %mrf_hs.temp
if ($sockbr) {
write " $+ $scriptdir $+ ht_history.txt $+ " %mrf_hs.temp
if (%mrf_hs.temp == $null || %mrf_hs.temp == $crlf) { write " $+ $scriptdir $+ ht_history.txt $+ " $crlf }
}
}
;#########################################################################333
;########## ON EVENTS ##########
;### ON EVENT - runs every time the dialog is initialized (every time it is run)
on *:dialog:mrf_updater:init:0:{
if ($mrf_r(ud.last)) { did -ra mrf_updater 19 $mrf_r(ud.last) } | else { did -ra mrf_updater 19 never }
if ($mrf_r(ud.size)) { did -ra mrf_updater 17 $bytes($mrf_r(ud.size),k).suf }
if ($mrf_r(ud.cver)) { did -ra $dname 7 $mrf_r(ud.cver) }
if ($mrf_r(ud.cdate)) { did -ra $dname 8 $mrf_r(ud.cdate) }
if ($mrf_r(ud.aemail)) { did -ra $dname 9 $mrf_r(ud.aemail) }
did -ra $dname 11 $remove($mrf_r(progversion),v)
if (!$isfile(" $+ $scriptdir $+ ht_history.txt $+ ")) { goto init.updater.end }
if (!$read(" $+ $scriptdir $+ ht_history.txt $+ ",n,1)) { goto init.updater.end }
var %hsh.ud.temp = 1
while ($read(" $+ $scriptdir $+ ht_history.txt $+ ",n,%hsh.ud.temp) != END OF UPDATES && %hsh.ud.temp <= 500) {
did -a $dname 15 $read(" $+ $scriptdir $+ ht_history.txt $+ ",n,%hsh.ud.temp) $+ $crlf
inc %hsh.ud.temp
}
:init.updater.end
$iif($did(mrf_updater,7) > $did(mrf_updater,11),did -g mrf_updater 12 " $+ $scriptdir $+ ud-yesupdate.jpg $+ ",did -g mrf_updater 12 " $+ $scriptdir $+ ud-noupdate.jpg $+ ")
$iif($did(mrf_updater,7) > $did(mrf_updater,11),did -e mrf_updater 3,did -b mrf_updater 3)
}
on *:dialog:mrf_hashtable:init:0:{
;## CHECKING FOR DATA FILE hsandwhich.hash
if (!$isfile(" $+ $scriptdir $+ hsandwhich.hash $+ ")) {
mrf_echo e SETTINGS FILE NOT FOUND
mrf_defaults
}
;mrf_echo cus Loading $mrf_r(progname) $mrf_r(progversion)
%critical.hsh.progname = $mrf_r(progname)
%critical.hsh.progversion = $mrf_r(progversion)
%critical.hsh.datecreated = $mrf_r(datecreated)
%critical.hsh.author = $mrf_r(author)
%critical.hsh.regname = $mrf_r(reg.name)
dialog -t $dname %critical.hsh.progname %critical.hsh.progversion - by %critical.hsh.author
mrf_pop.tables
mrf_update.info
$iif($version < 6.03,did -a $dname 83 *UPGRADE YOUR mIRC to v6.03+ to ensure complete functionality!,did -a $dname 83 *You are using mIRC v $+ $version $+ ! Enjoy the program $+ $chr(44) and thank you!)
var %critical.hsh.binarylist
}
on *:dialog:mrf_hashtable:close:*:{
unset %hsh*
unset %critical.hsh.*
if ($dialog(mrf_updater)) dialog -x mrf_updater
if ($dialog(mrf_createfilefile)) dialog -x mrf_file
if ($dialog(mrf_savefile)) dialog -x mrf_savefile
if ($dialog(mrf_loadfile)) dialog -x mrf_loadfile
if ($dialog(mrf_about)) dialog -x mrf_about
}
;### ON EVENT - runs once when the script is first loaded, checks for version conflicts, nothing more.
on *:load:{
mrf_echo pre
mrf_echo s Installing Hash Sandwhich...
mrf_echo s Now Checking For Compatibility...
mrf_echo s mIRC Version Check: 09mIRC v $+ $version $+ ...
if ($version < 5.91) {
mrf_echo f Version Check
mrf_echo e You're a DINOSAUR UPGRADE FOR GOD's SAKE! This script is not compatible with mIRC versions under 00v5.91
mrf_echo e You can download the latest version of mIRC at00 http://www.mirc.com
mrf_echo suf
unset %hsh.*
unload -rs " $+ $script $+ "
}
else {
mrf_echo p Version Check
$iif($version < 6.03,mrf_echo n However $+ $chr(44) this script was 15designed to run with 00mIRC v6.03 $+ 15 $+ $chr(44) and unless you use this same version $+ $chr(44) unexpected effects could occur one of which is that the error pop-ups may display incorrectly due to a change in the $ $+ input function... Please upgrade at this time.,mrf_echo n Since this script was designed using 00mIRC v6.0315 $+ $chr(44) and you are using 00v $+ $version $+ 15 $+ $chr(44) we should not have ANY problems...)
}
var %hsh.duplicate = $?!="Do you wish to SCAN your local Hard Disk for copies of this script in order to avoid version conflicts? No action will be taken on any files found..."
if (%hsh.duplicate == $true) {
mrf_echo s Duplicate script check (scanning your Hard Drive for copies of ' $+ 09mrf_HT.mrc $+ 00')...
set %hsh.others $findfile(\,mrf_HT.mrc,0)
var %hsh.tmp = 1
if (%hsh.others > 1) {
mrf_echo s Found 09 $+ $calc(%hsh.others - 1) 15other $iif(%hsh.others == 2,copy,copies) of this script on your Hard Drive. For your reference, the path and filename of each file will be displayed so you can delete all old versions. This will help avoid future conflict...
while (%hsh.tmp <= %hsh.others) {
set %hsh.other. [ $+ [ %hsh.tmp ] ] $findfile(\,mrf_HT.mrc,%hsh.tmp)
if (%hsh.other. [ $+ [ %hsh.tmp ] ] != $script) { mrf_echo s '00 $+ $replace(%hsh.other. [ $+ [ %hsh.tmp ] ],mrf_HT.mrc,09mrf_HT.mrc) $+ 15' }
inc %hsh.tmp }
mrf_Echo s For your reference, this script's full path and filename is: '00 $+ $script $+ 15'
}
else {
mrf_echo s Found 09 $+ 0 15other copies of this script on your Hard Drive. For your reference, this script's full path and filename is: '00 $+ $script $+ 15'
}
}
if (%hsh.duplicate == $false) { mrf_echo s You elected NOT to scan for other copies of this script on your Hard Drive. For your reference, this script's full path and filename is: '00 $+ $script $+ 15' }
mrf_Echo s Successfully loaded 09Hash Sandwhich15!!!!!
mrf_defaults
mrf_Echo s Your computer, your life, and your mind are now being controlled by an alien life force.
mrf_echo n It is recommended that you check for a newer version the first time you run Hash Sandwhich and every couple of years thereafter.
mrf_echo n You may now run Hash Sandwhich $mrf_r(progversion) by typing /mrf_ht or right clicking in most windows...
unset %hsh.*
mrf_echo suf
}
;### ON EVENT - contains all the events of single clicking any control in the dialog, including menu items, which are defined under the ;####
on *:dialog:mrf_hashtable:dclick:2:{
;## ID 2 - items listbox
did -f $dname 3
did -c $dname 3 1 1 $calc($len($mrf_wholeeditbox($dname,3).text) + 5)
}
on *:dialog:mrf_loadfile:sclick:*:{
;## ID 1 - LOAD button
if ($did == 1) { %hsh.id9.text = $did($dname,9) | %hsh.id10.text = $did($dname,10) | %hsh.binary = $did($dname,32).state }
if ($did == 39) { did -r $dname 9,10 }
}
;ZZZ
on *:dialog:mrf_updater:sclick:*:{
if ($did == 100) {
%hsh.sure = $input(You must be connected to the internet in order to grab new information for Hash Sandwhich. Click YES if you are sure you are connected and that your firewall will not intercept any socket connections originating from mIRC. The website the information will be downloaded from is: http://www.shuswapjanitorial.com ... Click NO if you'd like to try again later.,yvq,Are You Connected to the Internet?)
if (%hsh.sure == $yes) {
%critical.hsh.hasrefreshed = $true | mrf_w ud.last $date(mmmm dd yyyy) @ $time(h:nn TT) | did -ub $dname 20 | mrf_check.ver
}
if (%hsh.sure == $no) {
mrf_err At your request, no connection attempts have been made.
}
}
if ($did == 3) {
%hsh.sure = $input(You must be connected to the internet in order to auto-upgrade Hash Sandwhich. Click YES if you are sure you are connected and that your firewall will not intercept any socket connections originating from mIRC. The website the new script will be downloaded from is: http://www.shuswapjanitorial.com ... Click NO if you'd like to try again later.,yvq,Are You Connected to the Internet?)
if (%hsh.sure == $yes) {
$iif(!%critical.hsh.hasrefreshed,mrf_err You must first click REFRESH INFO to gather the current upgrade information,mrf_upgrade.script)
}
if (%hsh.sure == $no) {
mrf_err At your request, no connection attempts have been made.
}
}
if ($did == 20) { if ($did($dname,20).state) { did -e $dname 3 } | else { did -b $dname 3 } }
}
on *:dialog:mrf_createfile:sclick:*:{
;## ID 1 - CREATE button
if ($did == 1) { %hsh.id9.text = $did($dname,9) | %hsh.id10.text = $did($dname,10) }
if ($did == 39) { did -r $dname 9,10 }
}
on *:dialog:mrf_savefile:sclick:*:{
if ($did == 1) { %hsh.binary = $null | dialog -x mrf_savefile }
if ($did == 3) { %hsh.binary = $true | dialog -x mrf_savefile }
if ($did == 2) { %hsh.binary = cancel | dialog -x mrf_savefile }
}
on *:dialog:mrf_hashtable:sclick:*:{
;#### CONTROLS
;## ID 116 - FIND data string button
if ($did == 116) { %hshsearch.data = 1 | %hshsearch.values = 0 | mrf_find.data }
;## ID 115 - FIND item button
if ($did == 115) { %hshsearch.data = 0 | %hshsearch.values = 1 | mrf_find.values }
;## ID 200 -- BINARY HASH TABLE checkbox
if ($did == 200) { mrf_binary.update }
;## ID 1 -- Hash Tables Combo Box
if ($did == 1) { mrf_pop.values | mrf_update.info }
;## ID 2 -- Values Combo Box
if ($did == 2) { mrf_pop.data | mrf_update.info | did -f $dname 3 }
;## ID 11 -- LOAD button
if ($did == 11) { mrf_load.file | mrf_update.info }
;## ID 13 - FREE button
if ($did == 13) {
if ($did($dname,1).seltext != $null) { hfree $did($dname,1).seltext }
mrf_pop.tables | mrf_update.info
}
;## ID 12 -- SAVE button
if ($did == 12) { mrf_save.table | mrf_update.info }
;## ID 31 -- FILTER VALUES checkbox
if ($did == 31) { mrf_pop.values | mrf_update.info }
;## ID 39 -- CLEAR button (clears NAME & SIZE editboxes)
if ($did == 39) { did -r $dname 9,10 | mrf_update.info }
;## ID 33 - CREATE new hash table button
if ($did == 33) { mrf_create.hash | mrf_update.info }
;## ID 40 -- ADD value button
if ($did == 40) { mrf_add.value | mrf_update.info }
;## ID 41 -- REMOVE value button
if ($did == 41) { mrf_rem.value | mrf_update.info }
;## ID 43 -- RENAME value button
if ($did == 43) { mrf_rnm.value | mrf_update.info }
;## ID 44 -- RENAME Hash Table button
if ($did == 44) { mrf_rnm.table | mrf_update.info }
;## ID 45 -- CHANGE SIZE of Hash Table button
if ($did == 45) { mrf_change.size | mrf_update.info }
;## ID 18 -- EXIT button
if ($did == 18) { unset %ad.tempvalue }
;## ID 84 - COPY table button
if ($did == 84) { mrf_copy.table }
;## ID 85 - COPY value button
if ($did == 85) { mrf_copy.value }
;## ID 87 - UNDO button
if ($did == 87) { mrf_undo }
;## ID 88 - APPLY button
if ($did == 88) { mrf_apply }
}
on *:dialog:mrf_hashtable:menu:*:{
;#### MENU ITEMS
;## NO MENU SCLICK EVENTS - TOO LAZY TO BUILD A MENU
;## ID 110 - HASH FILE HELP
if ($did == 110) { help $ $+ hget }
if ($did == 500) { %mrf_ttt = Author's Email: $iif($mrf_r(ud.aemail),$mrf_r(ud.aemail),mr_foot@theduckhouse.tk) | %hsh.aboutbox = $dialog(mrf_about,mrf_about,-4) | unset %hsh.aboutbox %mrf_ttt }
if ($did == 122) {
var %hsh.newregname = $?="Enter Your Name Here:"
if (%hsh.newregname == $null) { mrf_err Registration NOT CHANGED. This script remains registered to < $+ $mrf_r(reg.name) $+ > | halt }
mrf_w reg.name %hsh.newregname
%critical.hsh.regname = $mrf_r(reg.name)
mrf_err This Script is now registered to: < $+ $mrf_r(reg.name) $+ >
}
if ($did == 300) { %hsh.t.update = $dialog(mrf_updater,mrf_updater,-4) }
}
;### ON EVENT - runs every time the data is edited in both the DATA editbox and the FILTER editbox, and SEARCH editboxes, but not the other editbox
on *:dialog:mrf_hashtable:edit:*:{
;##ID 126 - FIND data string editbox
if ($did == 126) { if ($did($dname,126).text != $null) { did -e $dname 116 } | else did -b $dname 116 | $iif(%hshh.session.count > 0,did -a $dname 112 Search Data) | $iif(%hshh.session.count > 0,did -a $dname 111 Search Values) | %hshh.session.count = 0 }
;## ID 125 - FIND item editbox
if ($did == 125) { if ($did($dname,125).text != $null) { did -e $dname 115 } | else did -b $dname 115 | $iif(%hshh.session.count > 0,did -a $dname 112 Search Data) | $iif(%hshh.session.count > 0,did -a $dname 111 Search Values) | %hshh.session.count = 0 }
;## ID 3 -- Data combo box, every time a character changes, it is saved to the hash file.
if ($did == 3) {
mrf_update.buttons
}
;## ID 30 -- Update values list if the FILTER checkbox is checked, when editing the FILTER editbox.
if ($did == 30) {
if ($did($dname,31).state == 1) { mrf_pop.values }
if ($did($dname,30).text != $null) {
did -e $dname 31
}
else {
did -bu $dname 31
mrf_pop.values
}
}
}
;########## MENU DEFINITIONS ##########
;### MENU - contains the text 'Hash Sandwhich' and when clicked in any pop up menu the dialog is displayed
menu menubar,channel,nicklist,query,status {
$chr(45) $+ $chr(60) $+ $chr(60) $+ $chr(58) $+ $chr(93) Hash Sandwhich $chr(91) $+ $chr(58) $+ $chr(62) $+ $chr(62) $+ $chr(45)
.Run Hash Sandwhich!!!:dialog -m mrf_hashtable mrf_hashtable
.Unload It
..Unload this Script Right Now
...Seriously, Do It!
....Click Here to Unload the Script:{
echo -a Script successfully unloaded... Enjoy your mundane world...
echo -a signed, mr_foot the sad.
unload -rs " $+ $script $+ "
}
}
;### HASH TABLE ACCESS ALIASES
;### ALIAS - runs the hash tabler
alias mrf_ht { dialog -m mrf_hashtable mrf_hashtable }
alias -l mrf_w.hash {
if ($isfile(" $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ ") != $true) {
mrf_echo cus $$1 $+ .hash does not exist
mrf_echo n Creating hash file $$1 [ $+ [ .hash ] ] for information storage
if ($hget($$1) != $null) { hfree $$1 }
hmake $$1
hadd $$1 AUTHOR mr_foot
hsave -o $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
hfree $1
mrf_echo n Succesfully created hash file
mrf_echo suf
}
if ($hget($$1) != $null) { hfree $$1 }
hmake $$1
hload $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
hadd $$1 $$2 $$3-
hsave -o $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
hfree $1
}
alias -l mrf_r.hash {
if ($isfile(" $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ ") != $true) {
mrf_Echo e Hash file $$1 [ $+ [ .hash ] ] does not exist!
halt
}
if ($hget($$1) != $null) { hfree $$1 }
hmake $$1
hload $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
set %hsh.hash.tmp $hget($$1,$$2)
hfree $1
return %hsh.hash.tmp
}
alias -l mrf_d.hash {
if ($isfile(" $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ ") != $true) {
mrf_echo e Hash file $$1 [ $+ [ .hash ] ] does not exist!
halt
}
if ($hget($$1) != $null) { hfree $$1 }
hmake $$1
hload $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
hdel $$1 $$2
hsave -o $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
hfree $1
}
alias -l mrf_l.hash {
if ($isfile(" $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ ") != $true) {
mrf_echo e Hash file $$1 [ $+ [ .hash ] ] does not exist!
halt
}
if ($hget($$1) != $null) { hfree $$1 }
hmake $$1
hload $$1 " $+ $scriptdir $+ $$1 [ $+ [ .hash ] ] $+ "
set %hash.tmp 1
//echo -a 04,1:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
//echo -a 04,1:: 12HASH LIST FOR11 $$1 [ $+ [ .hash ] ] 04,1::
//echo -a 04,1:: 03KEY 12------------------- 15VALUE 04,1::
while (%hash.tmp <= $hget($$1,0).item) {
//echo -a 04,1:: 03 $+ $hget($$1,%hash.tmp).item 12-----15 $hget($$1,%hash.tmp).data 04::
inc %hash.tmp
}
//echo -a 04,1:: 12END HASH LIST (11 $+ $calc(%hash.tmp - 1) item displayed12) 04,1::
//echo -a 04,1:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
hfree $$1
}
;### DEFAULT SETUP
alias mrf_defaults {
;XXXDEFAULT
mrf_echo cus Writing Information to Data File
mrf_w progname Hash Sandwhich
mrf_echo s Writing Program Name:11 $mrf_r(progname)
mrf_w progversion v3.04
mrf_w ud.cver $remove($mrf_r(progversion),v)
mrf_echo s Writing Program Version:11 $mrf_r(progversion)
mrf_w datecreated October 5 2004
mrf_w ud.cdate $mrf_r(datecreated)
mrf_echo s Writing Creation Date:11 $mrf_r(datecreated)
mrf_w AUTHOR mr_Foot
mrf_echo s Writing Author Name:11 $mrf_r(author)
mrf_w ud.aemail mr_foot@bigfoot.com
if (!$mrf_r(reg.name)) {
mrf_w REG.name not registered
mrf_echo s Writing Registration Information:11 $mrf_r(REG.name)
goto over.defaults
}
if ($mrf_r(reg.name)) {
var %hsh.result = $?!="Setup has found registration info under the name of: < $+ $mrf_r(reg.name) $+ >. Do you wish to overwrite it with default information?"
if (%hsh.result == $true) {
mrf_echo n REMOVING REGISTRATION
mrf_w REG.name not registered
mrf_echo s Writing Registration Information:11 $mrf_r(REG.name)
} }
:over.defaults
mrf_echo n Finished Writing Information to Data File
mrf_echo suf
unset %hsh.result
}
;#####
;### ALIASES - to streamline data from the hash sandwhich
alias mrf_w { mrf_w.hash hsandwhich $$1 $$2- }
alias mrf_r { return $mrf_r.hash(hsandwhich,$$1) }
alias mrf_d { mrf_d.hash hsandwhich $$1 }
alias mrf_l { mrf_l.hash hsandwhich }
;### ALIAS - searches all hash files for a wildcard string of text in either data or items
;### USAGE: $mrf_search.hash(<N,n>,<i,d>,<wildtext*>)
;### SYNTAX DESCRIPTION: where N = the number of the match (ex: 3 will return the 3rd match)
;### SYNTAX DESCRIPTION: where n = the letter 'n', returns the total # of matches
;### SYNTAX DESCRIPTION: where i = search item names only
;### SYNTAX DESCRIPTION: where d = search data strings only
;### SYNTAX DESCRIPTION: where wildtext = a wildcard search string, (EX: cr*, word, how are you, a*whoa, holy f?ck, etc)
alias mrf_search.hash {
;$hfind(name/N, text, N, M)
;Searches table for the Nth item name which matches text. Returns item name.
;Properties: .data
;If you specify the .data property, searches for a matching data value.
;M is optional, and can be:
; n	normal text comparison (default if M isn't specified)
; w	text is wildcard text
; W	hash table item/data is wildcard text
; r	text is regular expression
; R	hash table item/data is regular expression
;### ERROR CHECKING
if (!$1 || ($2 != i && $2 != d) || !$3) { unset %hsh.s.* | mrf_echo e SYNTAX: /search.hash <hashtablename> <i,d> <wildtext> | halt }
if (($1 !isnum && $1 != n) || ($1 < 0 && $1 != n)) { unset %hsh.s.* | mrf_Echo e Invalid request: USE 00n 15for total # or a positive integer < total # for results | halt }
;### START SEARCH
var %hsh.s.token, %hsh.s.token.tmp, %hsh.s.token.tmp2
var %hsh.s.debug 0
var %hsh.s.debug2 0
var %hsh.s.debug3 0
var %hsh.s.tokencharacter $chr(777)
$iif(%hsh.s.debug || %hsh.s.debug2 || %hsh.s.debug3,clear)
$iif(%hsh.s.debug || %hsh.s.debug2,mrf_echo pre)
var %hsh.s.tmp 1, %hsh.s.tmp2, %hsh.s.tmp3, %hsh.s.tmp4, %hsh.s.tmp5
var %hsh.s.numht $hget(0)
$iif(%hsh.s.debug,mrf_Echo n % $+ hsh.s.numht =12 %hsh.s.numht)
var %hsh.s.htcount 0
var %hsh.s.itemcount 0
var %hsh.s.datacount 0
while (%hsh.s.tmp <= %hsh.s.numht) {
var %hsh.s.numitems. [ $+ [ %hsh.s.tmp ] ] $hget(%hsh.s.tmp,0).item
var %hsh.s.name. [ $+ [ %hsh.s.tmp ] ] $hget(%hsh.s.tmp)
$iif(%hsh.s.debug,mrf_Echo n % $+ hsh.s.numitems. $+ %hsh.s.tmp 10( $+ %hsh.s.name. [ $+ [ %hsh.s.tmp ] ] $+ ) 15=13 %hsh.s.numitems. [ $+ [ %hsh.s.tmp ] ])
var %hsh.s.numitems.search. [ $+ [ %hsh.s.tmp ] ] $hfind(%hsh.s.tmp,$3,0,w)
$iif(%hsh.s.numitems.search. [ $+ [ %hsh.s.tmp ] ] > 0 && $2 == i,inc %hsh.s.htcount)
$iif(%hsh.s.debug && $2 == i,mrf_Echo s --- % $+ hsh.s.numitems.search. $+ %hsh.s.tmp =12 $hfind(%hsh.s.tmp,$3,0,w) 00( $+ $3 $+ ))
var %hsh.s.numdata.search. [ $+ [ %hsh.s.tmp ] ] $hfind(%hsh.s.tmp,$3,0,w).data
$iif(%hsh.s.numdata.search. [ $+ [ %hsh.s.tmp ] ] > 0 && $2 == d,inc %hsh.s.htcount)
$iif(%hsh.s.debug && $2 == d,mrf_Echo s --- % $+ hsh.s.numdata.search. $+ %hsh.s.tmp =12 $hfind(%hsh.s.tmp,$3,0,w).data 00( $+ $3 $+ ))
inc %hsh.s.itemcount %hsh.s.numitems.search. [ $+ [ %hsh.s.tmp ] ]
inc %hsh.s.datacount %hsh.s.numdata.search. [ $+ [ %hsh.s.tmp ] ]
$iif(%hsh.s.debug,mrf_echo suf)
inc %hsh.s.tmp
}
if ($2 == d) {
$iif(%hsh.s.debug2,mrf_echo n Hash Tables with 00( $+ $3 $+ ) 15in at least one Data String:10 %hsh.s.htcount)
$iif(%hsh.s.debug2,mrf_echo n Total occurances of 00( $+ $3 $+ )15 in all Hash Table Data Strings:10 %hsh.s.datacount)
var %hsh.s.tmp 1, %hsh.s.tmp2 0, %hsh.s.tmp4 0
while (%hsh.s.tmp <= %hsh.s.numht) {
if ($hfind(%hsh.s.name. [ $+ [ %hsh.s.tmp ] ],$3,0,w).data > 0) {
inc %hsh.s.tmp2
$iif(%hsh.s.debug2,mrf_Echo s --- 13( $+ %hsh.s.tmp2 $+ )15 %hsh.s.name. [ $+ [ %hsh.s.tmp ] ] 00( $+ %hsh.s.numdata.search. [ $+ [ %hsh.s.tmp ] ] $+ ))
}
var %hsh.s.tmp3 1
while (%hsh.s.tmp3 <= %hsh.s.numdata.search. [ $+ [ %hsh.s.tmp ] ]) {
inc %hsh.s.tmp4
if ($hfind(%hsh.s.name. [ $+ [ %hsh.s.tmp ] ],$3,0,w).data > 0) {
%hsh.s.token.tmp. [ $+ [ %hsh.s.tmp4 ] ] = %hsh.s.name. [ $+ [ %hsh.s.tmp ] ]
%hsh.s.token.tmp2. [ $+ [ %hsh.s.tmp4 ] ] = $hfind(%hsh.s.tmp,$3,%hsh.s.tmp3,w).data
$iif(%hsh.s.debug2,mrf_echo s 01---15\__ 00( $+ %hsh.s.tmp4 $+ )15 %hsh.s.token.tmp2. [ $+ [ %hsh.s.tmp4 ] ])
}
;XTOKEN-%hsh.s.token = $addtok(%hsh.s.token,%hsh.s.token.tmp $+ $chr(277) $+ %hsh.s.token.tmp2,777)
inc %hsh.s.tmp3
}
inc %hsh.s.tmp
}
$iif(%hsh.s.debug3,mrf_echo cus returning search results)
if ($1 != n && $1 > %hsh.s.datacount) {
$iif(%hsh.s.debug3,mrf_echo e You have asked for a number that is too high!)
}
if ($1 > 0 && $1 != n && $1 <= %hsh.s.datacount) {
$iif(%hsh.s.debug3,mrf_echo p,return) %hsh.s.token.tmp. [ $+ [ $1 ] ] $+ $chr(777) $+ %hsh.s.token.tmp2. [ $+ [ $1 ] ]
}
if ($1 == n) { $iif(%hsh.s.debug3,mrf_echo p,return) %hsh.s.datacount }
}
;################################################
elseif ($2 == i) {
$iif(%hsh.s.debug2,mrf_echo n Hash Tables with 00( $+ $3 $+ ) 15in at least one item:10 %hsh.s.htcount)
$iif(%hsh.s.debug2,mrf_echo n Total occurances of 00( $+ $3 $+ )15 in all Hash Table Items:10 %hsh.s.itemcount)
var %hsh.s.tmp 1, %hsh.s.tmp2 0, %hsh.s.tmp4 0
while (%hsh.s.tmp <= %hsh.s.numht) {
if ($hfind(%hsh.s.name. [ $+ [ %hsh.s.tmp ] ],$3,0,w) > 0) {
inc %hsh.s.tmp2
$iif(%hsh.s.debug2,mrf_Echo s --- 13( $+ %hsh.s.tmp2 $+ )15 %hsh.s.name. [ $+ [ %hsh.s.tmp ] ] 00( $+ %hsh.s.numitems.search. [ $+ [ %hsh.s.tmp ] ] $+ ))
}
var %hsh.s.tmp3 1
while (%hsh.s.tmp3 <= %hsh.s.numitems.search. [ $+ [ %hsh.s.tmp ] ]) {
inc %hsh.s.tmp4
if ($hfind(%hsh.s.name. [ $+ [ %hsh.s.tmp ] ],$3,0,w) > 0) {
%hsh.s.token.tmp. [ $+ [ %hsh.s.tmp4 ] ] = %hsh.s.name. [ $+ [ %hsh.s.tmp ] ]
%hsh.s.token.tmp2. [ $+ [ %hsh.s.tmp4 ] ] = $hfind(%hsh.s.tmp,$3,%hsh.s.tmp3,w)
$iif(%hsh.s.debug2,mrf_echo s 01---15\__ 00( $+ %hsh.s.tmp4 $+ )15 %hsh.s.token.tmp2. [ $+ [ %hsh.s.tmp4 ] ])
}
;XTOKEN-%hsh.s.token = $addtok(%hsh.s.token,%hsh.s.token.tmp $+ $chr(277) $+ %hsh.s.token.tmp2,777)
inc %hsh.s.tmp3
}
inc %hsh.s.tmp
}
$iif(%hsh.s.debug3,mrf_echo cus returning search results)
if ($1 != n && $1 > %hsh.s.itemcount) {
$iif(%hsh.s.debug3,mrf_echo e You have asked for a number that is too high!)
}
if ($1 > 0 && $1 != n && $1 <= %hsh.s.itemcount) {
$iif(%hsh.s.debug3,mrf_echo p,return) %hsh.s.token.tmp. [ $+ [ $1 ] ] $+ $chr(777) $+ %hsh.s.token.tmp2. [ $+ [ $1 ] ]
}
if ($1 == n) { $iif(%hsh.s.debug3,mrf_echo p,return) %hsh.s.itemcount }
}
else goto hsh.s.end
:hsh.s.end
$iif(%hsh.s.debug || %hsh.s.debug2 || %hsh.s.debug3,mrf_echo suf)
unset %hsh.s.*
}