mIRC Home    About    Download    Register    News    Help

Print Thread
#131116 25/09/05 04:38 PM
Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
I have this script in my mIRC, but I want to cut it up into several lines so I dont have to scroll to read it.
Can anyone help me to make this code stretch over several lines instead of one long?

Code:
on *:text:$(JOINED*):#channel:{ if ($nick == Abska) { if ($window(@Abska).state) { aline -h @Abska $date - $time $1-5 } | else { window -ng2 @Abska | aline -h @Abska $date - $time $1-5 } } | write logs\@Abska.log $strip($date - $time $1-5) } 

Please tell if you see any unnecessary code in my little script - I'm open for suggestions :-)


I'm Croyfer @ the EF.net -- #nesse
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:$(JOINED*):#channel:{
 if ($nick == Abska) {
 if ($window(@Abska).state) {
 aline -h @Abska $date - $time $1-5
 }
 else {
 window -ng2 @Abska
 aline -h @Abska $date - $time $1-5
 }
 }
write logs\@Abska.log $strip($date - $time $1-5)
 } 


Please note that copying code from this forum, due to the way PHPbb works (I believe) will but that all into one line as a straight copy.

To copy it into multiple lines, as it appears, copy and paste the lines one at a time.

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
This is the same script on multiple lines:
Code:
on *:text:$(JOINED*):#channel:{
  if ($nick == Abska) {
    if ($window(@Abska).state) {
      aline -h @Abska $date - $time $1-5
    }
    else {
      window -ng2 @Abska
      aline -h @Abska $date - $time $1-5
    }
  }
  write logs\@Abska.log $strip($date - $time $1-5)
}

This is something similar that I find better:
Code:
on *:TEXT:JOINED *:#channel:{
  if ($nick == Abska) {
    if (!$window(@Abska)) { window -ng2 @Abska }
    aline -h @Abska $date - $time $1-5
    write logs\@Abska.log $strip($date - $time $1-5)
  }
}

And maybe even this, but then you need to add a line
Abska:Abska!*@*
in your Users window (alt-r alt-u). You can then simply add new nicknames or address masks to have the same action for multiple users.
Code:
on Abska:TEXT:JOINED *:#channel:{
  if (!$window(@Abska)) { window -ng2 @Abska }
  aline -h @Abska $date - $time $1-5
  write logs\@Abska.log $strip($date - $time $1-5)
}

Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
Thank you both! Very much appreciated! =)


I'm Croyfer @ the EF.net -- #nesse
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Lol, RusselB... this is UBB, not phpBB. phpBB actually copies code tags just fine.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
blush

Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
I have another question about the script.
Is it possible to check if the line $1- already is stored in a .log, and if it is not print the result in the @WINDOW ?

This is the code I have so far.
Code:
on *:TEXT:$(JOINED*):#channel:{
  if ($nick == Botname) {
    if (!$window(@Abska)) { window -ng2 @Abska }
    aline -h @Abska $date - $time $1-
    write logs\@Abska.log $strip($date - $time $1-)
  }
}


I'm Croyfer @ the EF.net -- #nesse
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can search files like this:
Code:
if ($read(something.log,w,$1-) != $null) { [color:green]do commands for when it is in the log[/color] }
else { [color:green]do commands when it is not in the log[/color] }


That would search for exact matches.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard