Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:EXIT: { save_servers_and_channels }
- ON *:START: {
- var %f = last_session.txt
- if (!$file(%f)) { return }
- var %t = $lines(%f)
- var %i = 1
- while (%i <= %t) {
- var %r = $read(%f,n,%i)
- if (%r) { %r }
- inc %i
- }
- .remove $qt(%f)
- }
- alias save_servers_and_channels {
- var %t = $scon(0)
- var %i = 1
- while (%i <= %t) {
- var %server = $scon(%i).servertarget
- var %port = $scon(%i).port
- var %all_chans = $scon(%i).channels
- if (%server) && (%port) && (%all_chans) { write last_session.txt /server $iif(%i !== 1,-m) %server $+ : $+ %port -j %all_chans }
- inc %i
- }
- }
- alias -l channels {
- var %i = 1
- while (%i <= $chan(0)) {
- var %c = $chan(%i)
- if (%c) { var %tot = $addtok(%tot,%c,44) }
- inc %i
- }
- return $iif(%tot,$v1,0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement