mIRC Home    About    Download    Register    News    Help

Print Thread
#221851 30/05/10 08:19 AM
Joined: May 2010
Posts: 9
P
Pnk Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: May 2010
Posts: 9
For makiing my custom balloo tips i use suck a piece of code:
Code:
on *:TEXT:*:#:{
  if (Bank isin $1-) || ($me isin $1-) {
    if $highlight(1) || $highlight(2) {
      $tip(TipName,Highlight $network,$chan : $nick messages,$null,$readini($mircini,files,trayicon),$null,window -a $chan,$null)
    }
  }
}

But i get tips even when i am active in the channel, and when i double-click the tip in status window i get message
Quote:
1 Unknown command
Plz help!
(1 and 2 in $highlight are the conditions in the list of highloghts, hightlights are ON)

Joined: Mar 2009
Posts: 74
K
Babel fish
Offline
Babel fish
K
Joined: Mar 2009
Posts: 74
Put 'noop' in front of $tip, it's attempting to execute a command from $tip, since $tip succeeded, it returned 1 (meaning $true), so noop would prevent it from trying to do that, thus getting rid of the error message. 'noop' basically means don't execute what comes after as a command, just evaluate the identifiers and/or variables after it. The identifier might execute commands, but what ever it returns won't be executed.

I'd probably do a check for $active (the active window), and match it to both $chan and $nick (if $active is equal to either, it's the active window), also $appactive to see if mIRC is the active window, so I'd include a check for that. This would prevent tips showing when you are in the window where the highlighted message appeared.
Code:
 on *:TEXT:*:#:{
  if (($active == $chan) || ($active == $nick)) { return }
  if ($appactive) { return }
  if (Bank isin $1-) || ($me isin $1-) {
    if $highlight(1) || $highlight(2) {
      noop $tip(TipName,Highlight $network,$chan : $nick messages,$null,$readini($mircini,files,trayicon),$null,window -a $chan,$null)
    }
  }
}

Joined: May 2010
Posts: 9
P
Pnk Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: May 2010
Posts: 9
This part is not really needed, because app can be active and $chan window not.
Code:
if ($appactive) { return }

Hm, also i need to check /me messges...

Last edited by Pnk; 30/05/10 09:14 AM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
It's better to use $istok than isin. If someone says, banking, banker or anything that begins or ends with it will get your script triggered:
Code:
if ($istok(bank $me,$1-,32)) {

Joined: Dec 2008
Posts: 95
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
That will only be true if the entire message is bank or $me,
should be if ($istok($1-,bank,32) || $istok($1-,$me,32)) unless tokenizing or looping through $1- and checking if $istok(bank $me,%token,32) is an option,
or $regex() with word boundaries.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You got me. I wasn't thinking.


Link Copied to Clipboard