mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 7
L
lakitu Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jan 2006
Posts: 7
here's the idea: make it so IRC servers have trimmed logs of channels, so that when you join a channel, the server either automatically or on command sends your channel window a decent amount of chat that was posted BEFORE you joined, so you are filled-in on the most recent discussion, & can then instantly participate, while being on-topic.

i am in undernet #philosophy quite a bit, & people often ask for the topic upon joining; this would help. also, if you could make it so there is a command to get 'backlogged' (i.e. get what was posted before you joined upon joining) MORE, so that the curious who have just joined can do some more reading, that would be excellent.

the downsides to this idea are that 1) servers would have to keep logs, even if just trimmed ones, for all channels (maybe even just for a certain duration, i.e. expiring logs), & 2) you'd have to code it. i cannot think of any more drawbacks to this idea.

it seems like a good idea to me, what do you think?

lakitu

Joined: Mar 2004
Posts: 526
Fjord artisan
Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
While this might be a good idea, it should be brought up in a forum for IRC servers, not an IRC client. Not sure if there is one, but most of the major networks do have a channel for the IRC Server area.


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
It would do two things:

1. Compromise privacy - whilst it could be said that priv/+s rooms are the place for private chats I don't think it is fair for two people having a conversation thinking that no-one else can see it only to have people join and be able to view what was said.
2. It would place an un-necessary load on the server, especially on large networks where hundreds can join rooms every single second.

The idea has some merit but not enough to counteract the above issues, and possibly others. Also, this is a feature that would be better suggested to IRCd coders, rather than client coders as the primary function would have to be on the server first.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You could easily do this using a simple mIRC script. It would be much more difficult to implement on a IRC-network-wide scale. Every IRCd and IRC client would have to be modified to handle this feature.

-genius_at_work

Joined: Oct 2004
Posts: 73
M
Babel fish
Offline
Babel fish
M
Joined: Oct 2004
Posts: 73
I've seen this implemented on old telnet talkers, and recently on jabber servers, so either they didn't consider those issues or have a different view on whether the merit of it counters the issues.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
You could easily do this using a simple mIRC script.


Please define the outline of this "simple" mirc script, as i doubt simple it would be, since you cant have the log already, you going to have to make a request for it, which means its a p2p responce system dependent on either a sleeper bot in the channel replying or other chatters also having the script and the server section running also to hand channel back chat to you.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I was thinking a bot that sits in the channel and records the last 'x' lines/minutes of chat. Then people who join could request the record using a !command. The bot could send the messages as PRIVMSG or as a file over DCC (possibly the user could choose). Obviously there would be code to prevent the command from being abused.

If the command is widely used in a channel, then there could be a script for users to download and install. The script could take the information provided by the bot (msgs or file) and actually echo it into the channel window so everything flows smoothly.

-genius_at_work

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
so "a simple mIRC script" it is then! (/me rolls eyes)

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I'm not sure how it would need to be difficult.

In the bot:
Code:
on *:TEXT:!backlog:#channel:{
  if (%last. [ $+ [ $nick] ]) {
    msg $nick You must wait before requesting another log
    return
  }
  .play $nick logfile.txt 100
  set -u300 %last. $+ $nick 1
}
on *:TEXT:*:#channel:{
  write logfile.txt @ < $+ $nick $+ > $1-
  if ($lines(logfile.txt) > 25) write -dl1 logfile.txt
}


For users:
Code:
on ^*:TEXT:@ *:?:{
  if ($nick != botnick) return
  echo #channel $2-
  halt
}


I just made that code up in 5 mins.. so there are probably some bugs to tweak.

-genius_at_work

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
You have just started colapsing your script down, Now it only deals with one channel, and that can be flooded off, the bot well not respond quick enough with the 25 lines if a single/multiple requests made, you may have the /WRITE Delete line mirc bug after 65000 or so delete writes, you not capturing actions to the channel, and people should have to see others going !backlog either. And of course the fact that there has to be a client script to make it work correctly.

Now im not expecting you to correct all that, im just trying to point out that, it would never be just a "simple mirc script"

Another aproach might be to simply write a client/server script, where say your running it, your in a channel called #backlogs (all the time), you enter the channel you want to be in lets say #BLAH, you right click and select the added menu option for #BLAH called "backlog", in #backlogs your client says "!backlog #BLAH", any one in there whos in #BLAH, can/does now PM your client with a message such as "~~~ BACKLOG HERE ~~~" this is never seen by you as the script processes it, first person to PM it is sent a reply "~~~ BACKLOG REQUEST ~~~", and his script PM's or better yet DCC's you the backlog. Protections can be arranged to ignore bulk requests and or requests after someone is already in the channel for some time or not in the channel at all of a !backlog <channel> request.

This would leave the channels transparent to backloging script. And mean that no one is relyiong on any one bot for there backlog, as long as one other user of the script was in the channel, you can still get a backlog.

Last edited by DaveC; 07/01/06 10:59 PM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The sample I made doesn't require that the client have the second portion installed.. the backlog would just be displayed in the bot's query window, where it could still be read easily.

I only made the on TEXT event, but the on ACTION/JOIN/MODE/PART/QUIT/KICK/etc events would be basically identical.

I wasn't aware of the 16bit /write -d bug, so there some sort of preventative measures might need to be taken, such as keeping track of how many lines have been deleted, and when a certain number has been reached, store the log in a temp file, delete the log file, and then rename the temp file to the log file name.

I made the script to specifically handle one channel. The same bot could handle multiple channels just by adding the $chan name to the variable and logfile names, %last. [ $+ [ $nick ] $+ . $+ [ $chan ] ] and logfile. $+ $chan .

The bot should never get flooded off as long as the bot has its flood protection enabled, since /play goes through it. The delay on the /play command could be adjusted to get the data transferred in the minimum length of time, although as it is, it sends 25 lines in 2.5 seconds with a 100ms delay. 2.5s is significantly shorter than having to ask the other chatters what you missed.

-genius_at_work

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I was bored, so I made the full script.. and yes, I would still consider this simple..:

For the bot:
Code:
alias log.chans return #chan1,#chan2,#chan3
;
on *:CONNECT:{
  unset %last.*
  var %chan, %c = 0, %cc = $numtok($log.chans,44)
  while (%c &lt; %cc) {
    inc %c
    %chan = $gettok($log.chans,%c,44)
    if ($exists($+(backlog.,%chan,.txt))) .remove $+(backlog.,%chan,.txt)
    join %chan
  }

}
on *:TEXT:!backlog:$($log.chans):{
  var %bfile = $+(backlog.,$chan,.txt)
  if (!$exists(%bfile)) {
    msg $nick No log exists for $chan
    return
  }
  if ($($+(%,last.,$nick,.,$chan),2)) {
    msg $nick You must wait before requesting another log for $chan
    return
  }
  if (!$window(@backlog)) window -n @backlog
  aline -hpi @backlog  $+ $color(other) $timestamp Backlog request by $nick in $chan 
  .msg $nick @ $chan 14 $ctime ### Backlog ###
  .play $nick %bfile 100
  set -u300 $+(%,last.,$nick,.,$chan) 1
}
;
on *:ACTION:*:$($log.chans):log.write $chan 1 * $nick $1-
on *:JOIN:$($log.chans):log.write $chan 7 * $nick has joined $chan
on *:KICK:$($log.chans):log.write $chan 8 * $knick was kicked by $nick ( $+ $1- $+ )
on *:MODE:$($log.chans):log.write $chan 9 * $nick set mode: $1-
on *:NICK:log.mwrite $newnick 10 * $nick is now known as $newnick
on *:NOTICE:*:$($log.chans):log.write $chan 12 $+(-,$nick,:,$chan,-) $1-
on *:PART:$($log.chans):log.write $chan 16 * $nick has left $chan $iif($1,$chr(40) $+ $1- $+ $chr(41))
on *:QUIT:log.mwrite $nick 17 * $nick has quit IRC ( $+ $1- $+ )
on *:TEXT:*:$($log.chans):log.write $chan 11 &lt; $+ $nick $+ &gt; $1-
on *:TOPIC:$($log.chans):log.write $chan 18 * $nick changes topic to ' $+ $1- $+ '
;
alias log.color return  $+ $color($1)
alias log.mwrite {
  ; 1 = nick, 2- = msg
  var %c = 0, %cc = $comchan($1,0)
  while (%c &lt; %cc) {
    inc %c
    log.write $comchan($1,%c) $2-
  }
}
alias log.write {
  ; 1 = chan, 2 = color, 3- = msg
  var %bfile = $+(backlog.,$1,.txt)
  var %tfile = $+(temp.,$1,.txt)
  write %bfile @ $1 $2 $ctime $3-
  if ($lines(%bfile) &gt; 25) write -dl1 %bfile
  inc $+(%,logbug.,$1)
  if (%logbug. [ $+ [ $1 ] ] &gt; 10000) {
    copy -o %bfile %tfile
    remove %bfile
    copy -o %tfile %bfile
    unset $+(%,logbug.,$1)
  }
}


When the bot connects to the IRC server, it removes all existing log files and then joins the given channels. The events record everything that happens in the channel (except text/actions done by the bot) to individual logfiles for each channel. I don't know much about that /write -d bug, so I tried to prevent it in the /log.write alias. When a user types !backlog in a channel, the bot will /play the logfile for that channel to the user. Each line in the logfiles is formatted like this:
@ <#chan> <color> <ctime> <message here>

(<color> is a number that matches to a token in the user script)


For the user:
Code:
on ^*:TEXT:@ *:?:{
  if ($nick != [color:red]BOTNICK[/color]) return
  var %colors = act,ctcp,high,info,info2,inv,join,kick, $&amp;
    mode,nick,nor,notice,notify,oth,own,part,quit,top,wall,whois
  echo $color($gettok(%colors,$3,44)) $2 $asctime($4,$timestampfmt) $5-
  window -c $nick
  halt
}


The user script receives the messages from the bot and echos it to the appropriate channel window. The color finds a token in the list and retrieves the appropriate color using $color. The timestamp is shown using the users current $timestampfmt. The bot's nick must be specified in place of the red text. The default text is halted and the bot's PM window is closed.

The messages would look a bit strange if the user doesn't have the script installed. Although, if you think about it, the same would be true if you were reading raw server messages instead of letting the IRC client software interpret them. The message is still quite easily readable, just like a raw PRIVMSG.

-genius_at_work

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

A few small things, i couldnt see a ALIAS log.chans { }, was i missing something?

And as to the flooding off, I was more meaning in the "msg $nick You must wait before requesting another log for $chan", some one brings 20 bots in and gets them to each request the backlog 5 times each all at once, your likely to flood out (maybe if mircs anti flood things going your just lagged to heck), Im of the opion if your not ment to be doing the command dont reply to there attempt at all.

Joined: Feb 2003
Posts: 23
M
Mog Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 23
What you could always do also ... get an eggdrop bot, run the eggdrop bot out of a webhosting account (if you can swing it with the company), and make it so the bot runs at www.domain.com/eggdropbot/ ... then what you could do is create a simple script to simply read the log file the eggdrop bot creates (as you can set the options for the eggdrop bot to trim the files automatically).

This will be the most feasable way to do this, or I think it would be. Creating a bot to do this and type !backlog would be a little much, especially considering you'd have to run that bot all the time. It would be much easier to do it this way, plus it's much less to put together ... just a few lines for a script.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
log.chans is the very first line so that the channel list can be altered more easily.

I altered that wait notification so that it won't allow users to flood it off as easily:
Code:
  if ($($+(%,last.,$nick,.,$chan),2)) {
    if ($v1 == 1) msg $nick You must wait before requesting another log for $chan
    set $+(%,last.,$nick,.,$chan) 2
    return
  }


-genius_at_work

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
log.chans is the very first line so that the channel list can be altered more easily.


Doh!, for some reason I just didnt see it, even tho its sitting there as plain as day!


Link Copied to Clipboard