mIRC Home    About    Download    Register    News    Help

Print Thread
#127714 16/08/05 09:08 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
this text is supposed to show what people say in a channel in a custom format (basically, i take the text when somebody writes something and show it another way).
however, the following code does that for my own text, but when other people talk in a channel, the text appears to be blocked.. it doesn't show anything to me.
can anyone help me and tell me why?

Code:
  
on ^*:text:*:#:{.
   echo -t $target $+(,$nick,,>>) $1-
   halt
}
/*--------------*/
on 1:input:*:{
   if ($left($1,1) != /) || ($ctrlenter) {
      .echo -t $active $+(,$me,,>>) $1-
      .raw privmsg $active : $+ $1-
      halt
   }
}

#127715 16/08/05 09:10 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
i'm not interrested in a different version, i just need to know why this one doesn't work, so that i may fix it....

#127716 16/08/05 10:06 AM
Joined: Feb 2003
Posts: 26
M
MRN Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Feb 2003
Posts: 26
$target?

I'm not sure what it is or if it works. I would debug a little. In the line before you use $target, try "echo -s target is: $target " to see if $target does link to anything.

Either way, I would use $chan instead.

#127717 16/08/05 11:07 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
One thing you might like to do is remove that /*--------------*/ construct.

The

/*

*/

construct, to have comments inside them only works if it's on multiple lines. /*blabla*/ doesn't. In fact, mIRC now thinks that the opening comment /* has not been closed, so your entire remote after that is ignored.

So either remove that line, put a ; in front of it, or make it like:

/*
--------------
*/


Gone.
#127718 16/08/05 01:30 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
I already answered to this topic before, and the script I gave you with changing the messages format was working. Now, you edited it, and it's not working anymore. Check the old topic and look what's wrong, and don't add more topics for same problem please smile

#127719 16/08/05 02:23 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
QUOTE
i'm not interrested in a different version, i just need to know why this one doesn't work, so that i may fix it....
END QUOTE

thanks anyway stefy..
i asked why this code wasn't working. i removed the comments but still, it doesn't work. it shows what other people are saying in both the old format and my custom format.
and that is despite the fact that i wrote HALT. HALTDEF doesn't work either

anyone has a solution for this?

edit: changed $chan instead of $target. still doesn't work

Last edited by filip_xyz; 16/08/05 02:28 PM.
#127720 16/08/05 03:02 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
on ^*:text:*:#:{.

Who put that . there?
Scripting is not english, don't put a dot at the end of a sentence in mIRC scripting smile

#127721 16/08/05 05:41 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Good eyes. Hard to notice that in here. smile


Invision Support
#Invision on irc.irchighway.net
#127722 16/08/05 06:11 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Quote:
on ^*:text:*:#:{.

Who put that . there?
Scripting is not english, don't put a dot at the end of a sentence in mIRC scripting smile

Lol, I didn't see that either. But in the version I gave him there was no .

#127723 16/08/05 07:16 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
forget the spelling mistakes. those are not the cause!

i need logically to find out what's wrong. IT DOESN"T WORK!

#127724 16/08/05 08:01 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Dwonload mIRC 6.16 from here, install it into a new folder, hit alt-r twice and paste

Code:
on ^*:text:*:#:{
  echo -t $target $+(,$nick,,>>) $1-
  halt
}

on *:input:*:{
  if ($left($1,1) != /) || ($ctrlenter) {
    echo -t $active $+(,$me,,>>) $1-
    .raw privmsg $active : $+ $1-
    halt
  }
}

in that window exactly as you see it here, on 11 different lines, then hit alt-s to save it. Then close the remotes window by clicking the OK button, connect to your server and test it out. It does work correctly.


If it doesn't for you, you either have some other scripts interfering, some other typo's, commented the code out (; or /* somewhere), forgot a } in the code above, have scripts disabled (type /Remote on), disabled the group you put that code in (/help groups), or did something else wrong.

#127725 16/08/05 08:12 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
forget the spelling mistakes. those are not the cause!

i need logically to find out what's wrong. IT DOESN"T WORK!


dude chill... dont be rude man they are trying to assist you (atleast IT DOESNT WORK) looks rude

on ^*:text:*:*:{
if ($nick ison #) { echo -a $timestamp ( $+ $nick $+ >>) $1- | HALT }
}
on *:INPUT:*:{
if ($me ison #) { echo -a $timestamp ( $+ $me $+ >>) $1- | halt }
}

thats all you need... :tongue:


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#127726 16/08/05 08:13 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Quote:
forget the spelling mistakes. those are not the cause!

i need logically to find out what's wrong. IT DOESN"T WORK!

Yes, that was the cause. I tried it with . and it didn't work. Then i removed the . and it worked perfectly.

#127727 17/08/05 09:40 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
hello again. sorry if i seemed rude, text can be interpreted and that was not myy intention. i installed a brand new copy of mirc 6.16. still doesn't work but please read to the end of this post.

my text appears.
however, when someone else says something, his text doesn't appear. nowhere. not in the channel... not anywhere. it's like he didn't say anything.

if someone has tested the code and works, can it be a problem from the sever (i don't think so, because the modifications are client-side, right? ).

what else could cause this ?

i attached a small movie with me doing the things above (my desktop), please look at it and tell me if i do something wrong.
it's archived with WinRAR 3.5 beta. and has 250kb. otherwise it would have been 17MB smile

http://www.xana.ro/~filip/mircbug.rar

thanks all for help.

#127728 17/08/05 12:37 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
It's wrong and the cause of all these problems:

-> echo -a sends to the active window, not the channel window (it might sometimes if you're lucky or on only one channel, but not always)

-> if ($nick ison # ) -> 3 cases
--> it's a pm then this test fails and you get default display
--> it's a channel message then this gives the changed display (somewhere, whatever window was on top)
--> it's a channel message but from outside the channel (was not +n) then this gives default display

-> the on input event halts everything, even /commands. Sometimes it would echo something but it never sends anything to the server (/.raw, /.msg, something like that) or even let you execute commands.

#127729 17/08/05 01:14 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
@Lpfix:

Instead of doing echo -a, which will echo to the active window, whichever one that may be (could be your status window for example), you should echo to the correct window.

On thing you can do is this:

echo $iif($chan,$chan,$nick) <text>

What does this mean? In the on text event with location part * it can trigger on both channels and queries. $chan will be filled if the on text triggered on a channel, so then the $iif returns $chan, and we echo to the channel. $nick will be filled if it's in a query, so $iif returns $nick and we echo the text to the nickname's window.

on ^*:text:*:*: haltdef | echo -mbflirt $iif($chan,$chan,$nick) $+(<<,$nick,>>) $1-

@Original requester:

Your on input event could be improved some.

Code:
on *:input:*:{ 
 if (!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) &amp;&amp; $&amp;
    ($istok(channel chat query,$window($active).type,32)) &amp;&amp; $&amp;
    (!$ctrlenter) &amp;&amp; (!$inpaste) { 
    haltdef 
    .msg $active $1- 
    echo -artc own $+(&lt;&lt;,$me,&gt;&gt;) $1- 
  } 
}

  1. This will check if the window you are typing to is either a channel, query, or chat window.
  2. It will check not only for the / command char, but for the custom command char that users can specify in the mIRC options.
  3. In the on input event, using echo -a is fine, since the active window is the one where you typed the text, it will always be the correct window.
  4. Note that instead of checking for ($ctrlenter) it makes more sense to check for (!$ctrlenter). ctrl+enter is generally a means to be able to override your script and msg something directly to the server bypassing your on input script. Example if it were an acronym replacer, and you typed lol, it would go to the on input event and change it to "Laughing out Loud", though with the ctrl+enter trick, you can make it so it just sends "lol", by checking for (!$ctrlenter).
  5. I included a check for (!$inpaste), which means right now when you paste something, it will not be formatted. If you do want your pastes to go through the on input event, remove the if check for (!$inpaste).


Gone.
#127730 17/08/05 03:14 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
my work is finally complete!

i will write the code without no further explanation, as i am very tired of all this thinking. mirc has .... let's not call them bugs, because they're not.... but .. "glitches".
this solution can be complicated in a thousand different ways, but i preffer to keep it simple. anyway, here's the code that works fine, tested:

Code:
on ^*:TEXT:*:#:{
  if ($nick != $me) .echo $chan $timestamp ( $+ $nick $+ ): $1-
  haltdef
}

on *:INPUT:*:{
  if (($server) &amp;&amp; (!$ctrlenter) &amp;&amp; ($left($1,1) != /)) {
    echo $timestamp 4( $+ $me $+ 4): $1- 
    .msg $active $1-
    halt
  }
}
  


problem bbefore was that on input i had to add .msg otherwise my message desn't get sent.
bye and thanks very much to all

#127731 17/08/05 04:47 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I will think twice next time before giving you code, since you're not going to listen to it anyway.

The code I gave you was all that you need, but suit yourself.

Two more things:
- You cannot trigger your own text events, so the check for if ($nick != $me) is obsolete.
- The check for if ($server) in the on input event also is useless, since you could still be typing in a status window. I already gave you a way how to determine if the active window is a window which you can send messages to...

Btw, this sort of thing IS very simple, it's one of the most basic things in mIRC scripting.

Btw2, this Xscript2005 of yours is breaking the mIRC license agreement, which states you may not redistribute the mIRC executable with your scripts.


Gone.
#127732 17/08/05 07:01 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
thanks for the comments, they were useful.
true.. i didn't read the licence agreement.. who does? smile
however i'm not advertising it anywhere. it's for me only (although i made a local website) but i will remove the mirc executable from the archive now that i found out.

btw, that website is private. i don't understand why did you look at it and how you found it.

#127733 18/08/05 03:14 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Quote:

btw, that website is private. i don't understand why did you look at it and how you found it.


Well, you said the site earlier: http://www.xana.ro/~filip/mircbug.rar

P.S. You're Romanian, like me laugh


Link Copied to Clipboard