mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2006
Posts: 20
R
r0uJe Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 20
hey all,

i'm trying to write a script where everytime a user says something in the main channel (a bot, actually), the script will automatically copy what that person (or bot) said and open a new window and paste it there.

kinda like:

[9:00a] (JohnDoe) New Announcement: <New Forum Post> Title: 'How to write IRC scripts' posted by 'JaneDoe' - [In this tutorial, JaneDoe will try to help r0uJe with his IRC script.] - To read more about this post, visit - http://www.pleasehelpmemakemyscriptwork.com

...and then the script will automatically open a new window (named JohnDoe for example) and it'll basically copy all that JohnDoe said.

here's my non-working script so far:

Code:
on *:TEXT:*:#TestChannel:{
  if ($nick == JohnDoe) &amp;&amp; (New isin $1-) &amp;&amp; (Announcement isin $1-) {
    window -b @JohnDoe
    aline @JohnDoe 7[ $+ $time(hh:nn:ss) $+ 7] 4 $+ $1- 
  }
}


what happens when i use my script is that it only copies the first line or sentence which is:

[9:00a] (JohnDoe) New Announcement: <New Forum Post> Title: 'How to write IRC

...and it stops there. it does not copy the rest of the announcement (meaning, the next line(s) or sentence(s)).


thanks in advance!

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
If that's where it stops, is it because 'JohnDoe' is sending the announcement in multiple parts? I can't see why (if sent ias one line) it would stop short.


-KingTomato
Joined: May 2006
Posts: 20
R
r0uJe Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 20
Quote:
If that's where it stops, is it because 'JohnDoe' is sending the announcement in multiple parts? I can't see why (if sent ias one line) it would stop short.


JohnDoe is saying the announcement in one long sentence. sometimes, that one sentence breaks up in 4-5 lines (in my IRC client).

i have no clue why the script copies only the first line or sentence and stops there.


frown


EDIT: the announcement is EXACTLY the same as the example announcement in my original post (and sometimes, longer than that).

Last edited by r0uJe; 15/07/06 05:19 PM.
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I think I understand now. It's not the message received, it's the window itself. The -b isn't updating the horizontal scrollbar, and the text continues off-screen with no way or viewing it. I'm not really farmiliar with how it should work, all I can recommend is perhaps using /echo so the line wraps instead of continuing on the same line. Perhaps this is a bug in the way -b is treated?


-KingTomato
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
aline -hpi @JohnDoe 7[ $+ $time(hh:nn:ss) $+ 7] 4 $+ $1-

Using -hpi with /aline makes the line wrap if it is too long, the wrapped line is indented, and the window button is highlighted.

-genius_at_work

Joined: May 2006
Posts: 20
R
r0uJe Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 20
Quote:
aline -hpi @JohnDoe 7[ $+ $time(hh:nn:ss) $+ 7] 4 $+ $1-

Using -hpi with /aline makes the line wrap if it is too long, the wrapped line is indented, and the window button is highlighted.

-genius_at_work


thank you SO much for the help!!! adding -hpi worked perfectly!

may i ask what -hpi means? i'm guessing h = highlight and i = indent?

thanks again!


P.S. KingTomato, thanks for the quick responses as well! smile

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Commands
The following commands allow you to manipulate the lines in a custom window.

/help /aline



Quote:

/aline [-ahilmnprs] [c] <@name> <text> add line to list
/cline [-ahilmnprs] [c] <@name> <N> changes the color of the Nth line to color C
/dline [-ahilmnprs] [c] <@name> <N[-N2]> delete Nth line through N2th line
/iline [-ahilmnprs] [c] <@name> <N> <text> insert line at Nth line
/rline [-ahilmnprs] [c] <@name> <N> <text> replace Nth line
/sline [-ahilmnprs] [c] <@name> <N> select Nth line

The c parameter specifies a color number for the line.
The -s switch selects the line that was just added and clears the current selections.
The -a switch selects a line without clearing the current selections.
The -h switch highlights the window's button if it's currently minimized.
The -p switch forces the line of text to be wrapped if it's too long to fit on one line.
The -r switch is used with /cline to reset a nickname color in a channel listbox to the default color.

The -i switch is used with /aline and /iline to indent a newly added line.
The -n switch is used with /aline and /iline to prevent a line from being added if it exists.
The -m switch is used with /cline when coloring nicknames in a channel nicklist, and makes mIRC also color the nick in channel messages.

If you are referencing a window which uses a side-listbox, you can specify the -l switch in the above commands to act on the side-listbox.


-genius_at_work

Joined: Jul 2006
Posts: 2
M
Bowl of petunias
Offline
Bowl of petunias
M
Joined: Jul 2006
Posts: 2
hey! sorry for rudeness and etc.. i`m new in this site and new in forums at all... welll .. i have a problem .. maybe, some1 could help? anyway .. here`s my script:
on ^*:text:*:#: {
if (%highlightsoundstatus == on) {
if (%highlightsound != $null) {
if (%highlightsound == beeeep) { beep }
if (%highlightsound != beeeep) { splay " $+ %highlightsound $+ " }
}
}
if ($me isin $strip($1-)) {
if ($away == $true) { notice $nick as away su priezastim: 4-= %awaymsg =- . Manes nera jau 4-= $duration($awaytime,1) =- | write -a awaylog.txt $timestamp < $+ $nick $+ > $1- }
if ($nick isop #) { flash $chan | window -g2 $chan | echo # 4 $+ $timestamp 10 $+ $chr(171) 4 $+ $chr(64) $+ $+ $nick $+ $+ 10 $chr(187) 8 $1- | halt }
if ($nick isvoice #) { flash $chan | window -g2 $chan | echo # 4 $+ $timestamp 10 $+ $chr(171) 4 $+ $chr(134) $+ $+ $nick $+ $+ 10 $chr(187) 8 $1- | halt }
if (($nick !isop #) && ($nick !isvoice #)) { flash $chan | window -g2 $chan | echo # 4 $+ $timestamp 10 $+ $chr(171) 4 $+ $+ $nick $+ $+ 10 $chr(187) 8 $1- | halt }
}
else {
if ($nick isop #) { window -g1 $chan | echo # $timestamp $+ 10 $chr(171) $+ 4 $+ $chr(64) $+ $+ $nick $+ 10 $+ $chr(187) 0 $1- | halt }
if ($nick isvoice #) { window -g1 $chan | echo # $timestamp $+ 10 $chr(171) $+ 4 $+ $chr(134) $+ $+ $nick $+ 10 $+ $chr(187) 0 $1- | halt }
if (($nick !isop #) && ($nick !isvoice #)) { window -g1 $chan | echo # $timestamp $+ 10 $chr(171) $+ 4 $+ $+ $+ $nick $+ 10 $+ $chr(187) 0 $1- | halt }
}
} and the problem with it is very simple... everything works as i wanted, except one thing... when some1 draws a ASCI pic, i can`t see it properly.. i meen, i can`t see all the "spaces" between symbols... any ideas, what should i do
thnx

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
You're altering the text output. It's just mIRC's temper with consecutive spacing, that's all.You may try $rawtext, but even then I think you're not going to have the desired output. I'm not exactly positive though, i don't go in to too much depth of 'theming' mIRC.


-KingTomato
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
First off, this should've been put as a New Post, not as a reply to a post/topic already started.
Secondly, it's a lot easier to read and work with code when the Code Tags are used.
I regret that I can't offer you a solution to your problem, however, I would like to offer you the following code, which is a re-write of your current code, condensing common elements, re-writing for a 'better' script (ie: proper usage of the if/elseif/else format and removal of the halt statements)

Code:
 on ^*:text:*:#: {
  if (%highlightsoundstatus == on) {
    if (%highlightsound) {
      $iif(%highlightsound == beeeep,beep,splay " $+ %highlightsound $+ ")
    }
  }
  if ($me isin $strip($1-)) {
    if $away {
      notice $nick as away su priezastim: 4-= %awaymsg =- . Manes nera jau 4-= $duration($awaytime,1) =- 
      write -a awaylog.txt $timestamp &lt; $+ $nick $+ &gt; $1-
    }
    flash $chan
    window -g2 $chan
    echo # 4 $+  $timestamp $+ 10 $chr(171) $+ 4 $+ $iif($nick isop #,$chr(64),$iif($nick isvoice #,$chr(134))) $+ $nick $+ 10 $+ $chr(187) 0 $1-
  }
  else {
    window -g1 $chan
    echo # $timestamp $+ 10 $chr(171) $+ 4 $+ $iif($nick isop #,$chr(64),$iif($nick isvoice #,$chr(134))) $+ $nick $+ 10 $+ $chr(187) 0 $1-
  }
}
 

Joined: Jul 2006
Posts: 2
M
Bowl of petunias
Offline
Bowl of petunias
M
Joined: Jul 2006
Posts: 2
emmm ... thnx for script, but.. it`s not what i wanted.. in mine everything`s exactly as i wanted.. only problem is those "spaces" smirk and you script would do tha same sh..... sorry smile `fcourse, some adjujstments should be done in "ifs" but... just can`t figgure it out about spaces...:/ that`s all i`m after here...

Last edited by Mr_Chaoss; 20/07/06 06:42 PM.

Link Copied to Clipboard