mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 19
F
fast68 Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Sep 2003
Posts: 19
once someone on a network i used to go to showed me how to make a real basic multiple on text event line and it was something very similar to this:

on *!:text:*in a row!!*:#:/msg $chan wD! | on :text:*grr*:/msg $chan grrrrr laugh |


the separate events/text triggers were separated by the |

but i know i have something incorrect about the # part and i remember that the only # in the whole script line was only at the beginnign of the script line so that all the events only happened either all of the channels im on, or in the one i specify- at the beginning of the script line

also theres something i need to add to the beginning of the second and sequential on text events which increases by one for every event i add to the entire line overall

but i forgot what it is too

anyone know ?


thanks





Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
First, putting all of the script onto a single line can cause problems and is really a pain to read. If you want to, then you can use the pipe (|) to do it, but it's really not the nicest way to write any script.

If you want it all in a single event, like it seems that you're wanting, then why not:

Code:
on *:text:*:#: {
  if (*in a row!!* iswm $1-) { msg $chan wD! }
  elseif (*grr* iswm $1-) { msg $chan grrrrr :D }
}


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 19
F
fast68 Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Sep 2003
Posts: 19
hi there ok thanks i will try that and see if it does what im trying to explain here laugh

im just wanting to have more than three on text events because if you have more than about three separate ones in mirc then they wont work

so thats hwy im trying to remember how to put them all in a single line but i just forgot how to write them but i remember they were separated by the |

i do however remember that i didnt have to use any of the elseif stuff though

so..

thanks laugh
R

Last edited by fast68; 17/01/07 10:27 PM.


Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can have as many on TEXT events as you want to as long as you pay attention to how you have them set up so they don't cancel each other out.

What happens is that in a single script file, mIRC will only do the first matching event and will ignore any other events of the same type that are beneath that. That isn't quite the best way to put it, but I can't think of another way, so here are a few quick examples:
Code:
on *:text:*:#channel: {
  do this
}

on *:text:hello:#channel: {
  do that
}


If someone says hello in #channel, the first event will trigger because it triggers on ALL text (*). Because that one triggered, the second one will not trigger. If you put the second event above the first event, then the hello one will trigger and the ALL (*) one will not trigger.

Or:
Code:
on *:text:*hi*:#channel: {
  do this
}

on *:text:*this*:#channel: {
  do that
}


With this one, the *hi* will trigger when someone says "this", so the second one will not trigger.

As long as you put them in the correct order, you won't have problems and you can have as many events as you want. The better way, imo, is to use the method I showed above. The reason I think it's better is because (1) it's shorter, and (2) it's much less likely to fail you because of an incorrect order. You can easily see the order it will follow. It will first check the first IF. If that's true, it will do that and then stop. If not, it will check the ELSEIF that follows it. If it is a match, then it does that and if not, it continues down the list. As long as you use ELSEIF, only the first match in the list of triggers will happen. If you want to have them all trigger if it matches all of them, use IF instead of ELSEIF. So, in the *hi*/*this* example above, you could have both happen if someone said "this" by having both be IF in the combined version that I gave you originally.

If any of that is confusing, let me know.

Basically, all events of the same type that are in the same script file are treated as ELSEIF events. IF the first match is true, do that but don't do any others. ELSEIF the second match is true, do that one but don't do any others, etc.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 19
F
fast68 Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Sep 2003
Posts: 19
ok should anything go in place of the $1-

how does that work?


thanks!
R



Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
In place of which $1-? $1- is the text that you receive from others. Unless you're looking at just part of that text, you'll use $1-.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 19
F
fast68 Offline OP
Pikka bird
OP Offline
Pikka bird
F
Joined: Sep 2003
Posts: 19
recieve from others ? what ?
now i am really super lost lol


my status window shows this all the time:

* /if: 'iswn' unknown operator (line 14, script.ini)



thanks

Last edited by fast68; 16/02/07 03:51 PM.


Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
An on TEXT event works with text that *other* people say. $1- is what they said. It may help to read the help file.

As for your error, it's because you have a typo. iswn should be iswm (see the code above).


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard