GrandCentralStation

By Tamaki on Dec 11, 2011

This is a fun little script that I threw together. It makes a post-office like message center where all the messages on ever channel you're on go to a single channel; and from that single channel, you can message any other channel you're on. Just type: say #channel what you want to say
or: act #channel anything you would normally put after the /me command

To install, just load into your remotes (in a new file preferably) and allow initialization. Anytime you close the window that pops-up, just type /gcs to reopen it.

You can set a timestamp option in the pop-up and change the channel which the station is on. Feel free to play around with it and let me know what you think. ^_^


Posted a little update where I fixed the part where when other people joined/part/talked/acted on the GCS Channel, it would repeat it. Now it doesn't.

Also fixed the timestamp a little.

on *:LOAD: {
  set %gcs.channel #grandcentralstation
  set %gcs.timestamp off
  gcs
}
on *:CONNECT: {
  gcs
}
on *:TEXT:*:#: {
  If ($chan == %gcs.channel) { halt }
  If (%gcs.timestamp == on) {
    msg %gcs.channel < $+ $asctime(ddmmmyyyy hh:nn:ss TT) $+ >< $+ # $+ >< $+ $nick $+ > $1-
  }
  Else {
    msg %gcs.channel < $+ # $+ >< $+ $nick $+ > $1-
  }
}
on *:ACTION:*:#: {
  If ($chan == %gcs.channel) { halt }
  If (%gcs.timestamp == on) {
    msg %gcs.channel < $+ $asctime(ddmmmyyyy hh:nn:ss TT) $+ >< $+ # $+ >6 $nick $1-
  }
  Else {
    msg %gcs.channel < $+ # $+ >6 $nick $1-
  }
}
on *:JOIN:#: {
  If ($chan == %gcs.channel) { halt }
  If ($nick == $me) {
    If ($chan != %gcs.channel) { halt }
    setgcstopic
  }
  If (%gcs.timestamp == on) {
    msg %gcs.channel 3 $+ $nick ( $+ $address $+ ) has joined $chan ( $+ $asctime(ddmmmyyyy hh:nn:ss TT) $+ )
  }
  Else {
    msg %gcs.channel 3 $+ $nick ( $+ $address $+ ) has joined $chan
  }
  If ($dialog(gcsusers)) {
    reinitializeusers
  }
}
on *:PART:#: {
  If ($chan == %gcs.channel) { halt }
  If ($nick == $me) { halt }
  If (%gcs.timestamp == on) {
    msg %gcs.channel 3 $+ $nick ( $+ $address $+ ) has left $chan ( $+ $asctime(ddmmmyyyy hh:nn:ss TT) $+ )
  }
  Else {
    msg %gcs.channel 3 $+ $nick ( $+ $address $+ ) has left $chan
  }
  If ($dialog(gcsusers)) {
    reinitializeusers
  }
}
on *:QUIT: {
  If ($nick == $me) { halt }
  If (%gcs.timestamp == on) {
    msg %gcs.channel 2 $+ $nick ( $+ $address $+ ) Quit (Quit: $1- $+ ) ( $+ $asctime(ddmmmyyyy hh:nn:ss TT) $+ )
  }
  Else {
    msg %gcs.channel 2 $+ $nick ( $+ $address $+ ) Quit (Quit: $1- $+ )
  }
  If ($dialog(gcsusers)) {
    reinitializeusers
  }
}
on *:INPUT:%gcs.channel: {
  If (say == $1) {
    msg $2 $3-
  }
  If (act == $1) {
    describe $2 $3-
  }
}
alias gcs {
  If ($me !ison %gcs.channel) { join %gcs.channel }
  dialog $iif($dialog(gcsusers),-v,-m gcsusers) gcsusers
  reinitializeusers
}
dialog gcsusers {
  title Users
  option dbu
  size 975 104 101 108
  list 1, 1 1 100 110
  menu "Settings", 2
  item "Time Stamp", 3
  item "Set GCS Channel", 4
}
on *:DIALOG:gcsusers:*:*: {
  If ($devent == init) {
    var %temp.1 1
    While (%temp.1 <= $chan(0)) {
      did -a $dname 1 --- $chan(%temp.1) ---
      var %temp.2 1
      While (%temp.2 <= $nick($chan(%temp.1),0)) {
        did -a $dname 1 $nick($chan(%temp.1),%temp.2)
        inc %temp.2
      }
      inc %temp.1
    }
    If (%gcs.timestamp == on) {
      did -c $dname 3
    }
  }
  If ($devent == menu) {
    If ($did == 3) {
      If (%gcs.timestamp == on) {
        did -u $dname 3
        set %gcs.timestamp off
        msg %gcs.channel [GLOBAL] Turning time stamp: 4Off
      }
      Else {
        did -c $dname 3
        set %gcs.timestamp on
        msg %gcs.channel [GLOBAL] Turning time stamp: 3On
      }
    }
    If ($did == 4) {
      var %temp.1 $$?="Please enter the new GrandCentralStation channel."
      set %gcs.channel %temp.1
      join %gcs.channel
    }
  }
}
alias reinitializeusers {
  did -r gcsusers 1
  var %temp.1 1
  While (%temp.1 <= $chan(0)) {
    did -a gcsusers 1 --- $chan(%temp.1) ---
    var %temp.2 1
    While (%temp.2 <= $nick($chan(%temp.1),0)) {
      did -a gcsusers 1 $nick($chan(%temp.1),%temp.2)
      inc %temp.2
    }
    inc %temp.1
  }
}
alias setgcstopic {
  var %temp.1 1
  While (%temp.1 < $chan(0)) {
    write -al1 temp.txt  $+ $rand(1,7) $chan(%temp.1) $+ ,
    inc %temp.1
  }
  write -al1 temp.txt  $+ $rand(1,7) $chan(%temp.1)
  topic %gcs.channel Channels I'm currently watching: $read(temp.txt, 1)
  .remove temp.txt
}

Comments

Sign in to comment.
dma   -  Mar 31, 2016

WHAT?

Tamaki  -  Apr 01, 2016

what do you mean what?

Tamaki  -  Apr 01, 2016

what do you mean what?

Sign in to comment

Tamaki   -  Dec 12, 2011

Thanks ^_^

 Respond  
IllogicTC   -  Dec 11, 2011

Wait what!? OMG! This is the script.... This is the one.

I tried building something pretty much like this about a year ago. Failed horribly, and gave up. And now it sits here, in front of me. Me likey :D

 Respond  
Tamaki   -  Dec 11, 2011

if you get flooded, it's probably not a good idea to use this script in the first place :P
and i hate windows, they're so annoying....and boring. IMO

 Respond  
SReject   -  Dec 11, 2011

Instead of using a channel as the output, you could/should use a custom window(See /help /window). That way if all your channels get a lot of messages all at the same time you won't get flooded

 Respond  
Tamaki   -  Dec 11, 2011

Finally, I think I'm done editing it. :P

 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.