mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
I have a ton of this stuff.
on *:DIALOG:ME:sclick:*: {
set %ME104 $iif($did(104).state == 1,ON,OFF)

on *:DIALOG:ME:INIT:0: {
if (%ME104 == On) { did -c ME 104 }

I don't mean to be a bother, i was just reading a post that covered this last night and i can't remember where the post is. I would like to get rid of all those variables to either a hash or ini file. If you know where that thread is that will be more than enough info.
Thanks!

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Convert existing vars to hash...
Code:
  var %i = 1
  ; find all matching vars
  while $var(%me*,%i) {
    ; hadd them (you can remove the -m switch, it only makes sure the hash table is open.
    ; - $mid($v1,2) removes the first char from the varname (the "%") 
    ; - $($v1,2) is the vars value
    hadd -m tablename $mid($v1,2) $($v1,2)
    inc %i
  }
  unset %me*


On dialog events...
Code:
on *:DIALOG:ME:sclick:*:{
  hadd -m Tablename ME104 $iif($did(104).state == 1,ON,OFF)
 ...
}
on *:DIALOG:ME:INIT:0: {
  if $hget(tablename,ME104) == On { did -c ME 104 }
 ...
}

Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Thanks a LOT!!!!!!!!!!!!!!!!

Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
I finished the project i was working on. So now before i convert the variables, i would like a better idea of just how far i can go with them. I have a dozen or so checkboxes, a few color selection combos. So in the calling script it goes something like if (%var == on) do this ...... so now its if ($hget(tablename,name) == on) do this. Would this work pretty much the same with the color variables too?
Example of calling colors:
echo @DCC.Info $timestamp  $+ %ME322x *** DCC Send from $nick REJECTED ( $filename ) File Type REJECTED.
Would now be more like this?
echo @DCC.Info $timestamp  $+ $hget(Tablename,ME322x)*** DCC Send from $nick REJECTED ( $filename ) File Type REJECTED.

Is that right?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
yes

but watch the 3 *'s there touching the $hget

$hget(Tablename,ME322x)***

Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Thanx, yeah i know it was just a typo when i put it on here. wink Just wanted to make sure before i made all those changes.


Link Copied to Clipboard