mIRC Homepage
Posted By: PHMinistries another hash tabel Question - 28/12/02 08:47 PM
is there an easy way to have all of the contents in the hashtable go at once

like say

i have Autojoin1 #lobby
autojoin2 #silent
autojoin3 #train

is there a way to have all the channels open at once?
even if later added another autojoin channel?
Posted By: zac Re: another hash tabel Question - 28/12/02 10:09 PM
Code:
var %i = 1, %chans
while ($hget(whatever, %i)) {
  %chans = $addtok(%chans, $ifmatch, 44)
  inc %i
}
join %chans


or if you have other entries

Code:
var %i = 1, %chans
while ($hget(whatever, $hfind(whatever, autojoin*, %i, w))) {
  %chans = $addtok(%chans, $ifmatch, 44)
  inc %i
}
join %chans
Posted By: PHMinistries Re: another hash tabel Question - 28/12/02 10:15 PM
and this would go into the alias?

how do i get it to auto join just do an on connect?
Posted By: zac Re: another hash tabel Question - 28/12/02 10:18 PM
if all of them are autojoin*-ish

Code:
on *:connect:{
  var %i = 1, %chans
  while ($hget(whatever, %i)) {
    %chans = $addtok(%chans, $ifmatch, 44)
    inc %i
  }
  join %chans
}


or if you have autojoin* and oithers:

Code:
on *:connect:{
  var %i = 1, %chans
  while ($hget(whatever, $hfind(whatever, autojoin*, %i, w))) { 
    %chans = $addtok(%chans, $ifmatch, 44)
    inc %i
  }
  join %chans
}


you can throw in an if() checking the network, or just switch it around for an alias
© mIRC Discussion Forums