Auto Join dialog

By xdesoto on Dec 16, 2011

Just an auto Join for a server.

dialog Ajoin {
  title "Auto Join"
  size -1 -1 87 52
  option dbu
  button "Add", 2, 64 2 22 9
  button "Rem", 3, 64 11 22 9
  check "Enable", 4, 64 29 22 9, push
  button "Clear", 5, 64 20 22 9
  list 1, 1 1 62 50, size
  button "Done", 6, 64 42 22 9, ok cancel
}
on *:dialog:Ajoin:sclick:2: {
  var %a = $input(Enter Channel,1,Auto Join)
  var %b = $input(Enter Key (No if there isn't one),9,Auto Join)
  did -a $dname 1 %a %b
  write $c.dir(System,Ajoin.txt) %a %b
}
on *:dialog:Ajoin:sclick:3: {
  did -d $dname 1 $did(1).sel
  write -dl $+ $did(1).sel $c.dir(System,Ajoin.txt)
}
on *:dialog:ajoin:sclick:5: {
  write -c $c.dir(System,Ajoin.txt)
  did -r $dname 1
}
on *:dialog:ajoin:sclick:4: {
  if ($did(4).state == 1) {
    hadd Settings Ajoin on
    did -e $dname 1,2,3,5
  }
  else {
    hadd Settings Ajoin off
    did -rb $dname 1
    did -b $dname 2,3,5
    write -c $c.dir(System,ajoin.txt)
  }
  hsave -o Settings $c.dir(System,remotes,hashtable.txt)
}
on *:dialog:ajoin:init:0: {
  if ($hget(Settings,Ajoin) == on) && ($isfile($c.dir(System,ajoin.txt))) { loadbuf -ro $dname 1 $c.dir(System,ajoin.txt) | did -c $dname 4 }
  else {
    did -b $dname 1,2,3,5
  }
}

Comments

Sign in to comment.
xdesoto   -  Dec 17, 2011

My bad ;/ As I said previously I do not mess with dialogs anymore, that was in one of my first scripts. I just copied and pasted. Geez don't chastise me :(

 Respond  
Jethro   -  Dec 17, 2011

The $cdir() may result an error without being removed. It's the author's responsibility to mention it in the description.

 Respond  
Spoof   -  Dec 17, 2011

Doesn't mirc already have an auto chan join option?
This is like my away system, for mirc and it already comes with one... lol

 Respond  
pball   -  Dec 16, 2011

Two things, one where is the part that auto joins and two you should probably remove parts if they aren't included. Like the $cdir you should either include that custom identifier or remove it and edit the script so people can use it without editing it themselves. I personally feel scripts should work out of the box, especially if they are being publicly posted.

 Respond  
xdesoto   -  Dec 16, 2011

That can be edited, it's just where I have my System Ajoin.txt at

 Respond  
_Dean_   -  Dec 16, 2011

what is $c.dir?

 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.