Snakey commented on a Page, Weather script for mIRC  -  Sep 06, 2013

EQ.. Could just be me but registering a location doesnt "stay" in the script after a reboot.

Is hadd -m meant to write the variables to a file or table someplace? I'm presuming a hashtable but for some reason any times I had to reboot script, re-registering is required.

eqrunner  -  Sep 06, 2013

hadd is a hash table. That is what keeps track of the registration. (a lot faster than reading/writing to a txt file).
The on:connect and on:disconnect actions occur so that when you disconnect from a server, it will write the hashtable to a wu_reg.dat file in your local directory. When you start up your mIRC client, the on:connect will first create a hash table (hmake) unless one already exisits. Then will read the wu_reg.dat file and put that info into the hash table.

As to why it is not working on yours could be a bunch of issues. First. The action occurs when you Connect and Disconnect from a server. Not when you close and open the program. Second. The file saved goes in the local directory folder of mIRC. Maybe there is a computer OS administration based issue not allowing mIRC to write the file.

I use http://www.hawkee.com/snippet/1738/ to manage my scripts in mIRC. You might want to try it, to see if it is correctly recording the registration. Then disconnect and see if it writes the file wu_reg.dat

The registration part has not changed since v 3.2. Only change was around line 117. Where the script now will allow other users to !weather [Friendsnick] and bring up their forecast. Aka, anyone can use the registered users nick's to find their weather. (it use to be only the $nick that registered their own location could, and anyone else would get a 'location not found)

mike_12212012  -  Apr 06, 2016

Same issue here, it does save when you close mIRC but when you relaunch mIRC it does not access the wu_reg.dat to recreate the hash file.

miRC v7.44

http://prntscr.com/aovoyc

eqrunner  -  Dec 17, 2016

You need this:

;Instructions

;if the hash table is needed to be made and loaded first
;You will see a dialog appearing asking you to locate directory containing hash table
;you want to make and load

;if you want to make and load hash table first, then add "-z" to end
;if you don't want to free hash table at end, then add a "-x" after the z
;space in between the -z and -x , see usage below

;if you previouslly saved the hash table as a binary file, data only or ini format
;you will need to apply the respective switches for this, hense what the is for
;-b = binary file , -n = data read only , -i = hash table treated like a ini file

;USAGE: /get.hash -z -x

;Now its very important you have 3 items after the hash table name, even if you don't want to
;use a certain part. so any part you don't want to use, replace with a "no", see below
;USAGE; /get.hash no no -x

alias get_hash {
window -ak(0) @hash
aline @hash Item $chr(9) $chr(9) Data
aline @hash ~~~~~~~~~~~~
var %hash.name = $1
var %switches = $2
if ( $3 == -z ) {
var %hashtable = $+(",$sfile($mircdir),")
hmake %hash.name
if ( %switches == no ) { hload %hash.name %hashtable }
else { hload %switches %hash.name %hashtable }
}
var %i = 1
while ( $hget(%hash.name,%i).item ) {
var %item = $ifmatch , %data = $hget(%hash.name,%i).data
aline @hash %item $chr(9) $chr(9) %data
inc %i
}
if ( $4 == -x ) { hfree %hash.name }
}

Sign in to comment

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.