mIRC Home    About    Download    Register    News    Help

Print Thread
using a trigger #155878 10/08/06 03:30 AM
Joined: May 2006
Posts: 87
S
Sableye2 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Let's say I have this script:

Code:
on *:TEXT:!hi*:#:{
msg $chan Hi you all!
}


Is it possible for me to say !hi in one channel but have the "Hi you all!" part come out of another channel?

Re: using a trigger #155879 10/08/06 03:35 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
How about something like this:

Code:
on *:TEXT:*:#:{
  if ((#channel1 == #) && (hi == $1)) { msg $chan Hi you all! }
  if ((#channel2 == #) && (hi you all == $1-3)) { msg $chan Hi you all! }
}


or you could simply do:
on *:TEXT:!hi:#channel1:/msg $chan Hi you all!
on *:TEXT:!hi you all:#channel2:/msg $chan Hi you all!

those help?


Those who fail history are doomed to repeat it
Re: using a trigger #155880 10/08/06 03:42 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Actually I think he's looking for something like
Code:
 on *:text:!hi:#channel1:{
.msg #channel2 Hi you all
}
 

The bot/client that runs this code will probably have to be in both channels

Re: using a trigger #155881 10/08/06 03:56 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
ah, wouldnt be the first time I misunderstood something on here laugh


Those who fail history are doomed to repeat it
Re: using a trigger #155882 10/08/06 02:18 PM
Joined: May 2006
Posts: 87
S
Sableye2 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Yes that is what I'm looking for. Thank you. Now I tried using the same format with my script, but when I type in the trigger, the message doesn't pop up in the other channel. The bot is in both channels.

Code:
on *:text:!es:#pn-staff:{
  if $istok(Sableye , $nick , 32) {
    .msg #pn-fun 1,8 $2, you were chosen to play Exploding Snorlax!  Your water Pokemon is 12!wartortle  
    /set %esplay $2
    /set %esnick $2
  }
  else {
    .msg #pn-fun $2 Not allowed!
  }
}


Am I missing something here?

Re: using a trigger #155883 10/08/06 03:05 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
your on text is triggering for !es, but you need !es & or !es *. This is due to you looking for a $2 parameter, but mirc doesn't trigger because all it's looking for is a one-word parameter (!es).

try this:

Code:
on *:text:[color:blue]!es &[/color]:#pn-staff:{
  if $istok(Sableye , $nick , 32) {
    .msg #pn-fun 1,8 $2, you were chosen to play Exploding Snorlax!  Your water Pokemon is 12!wartortle  
    /set %esplay $2
    /set %esnick $2
  }
  else {
    .msg #pn-fun $2 Not allowed!
  }
}


-KingTomato
Re: using a trigger #155884 10/08/06 04:43 PM
Joined: May 2006
Posts: 87
S
Sableye2 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: May 2006
Posts: 87
Thank you KingTomato, that works perfectly. Now I have this second script that is connected to the first one (!es). This script below should only work for the person with the %esnick and %esplay. For some reason, it works for anyone who types in !wartortle. I've looked it over, but I don't see anything wrong with it. What is the mistake?

Code:
on *:TEXT:!wartortle*:#:{
  if (%esplay == null) {
    .msg $chan This game is currently for %esnick only!
    halt
  }
  if ($1 == %c $+ !wartortle) {
    /timer73 1 2 msg $chan 1,8Shoot water into Snorlax's mouth to make him explode.  You must use !shootwater 10 times in 25 seconds or you lose!  4Cheating the system will get you banned.
    /timer74 1 3 msg $chan 1,8Ready?
    /timer75 1 4 msg $chan 1,8Go!
    /set %wartortle $nick
  }
}

Re: using a trigger #155885 11/08/06 12:27 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
change null to $null

Re: using a trigger #155886 11/08/06 12:58 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Code:
on *:TEXT:!wartortle*:#:{
  if (%esplay != $nick) {
    .msg $chan This game is currently for %esnick only!
    return
  }

  if ($1 == %c $+ !wartortle) {
    .timerready 1 2 msg $chan 1,8Shoot water into Snorlax's mouth to make him explode.  You must use !shootwater 10 times in 25 seconds or you lose!  4Cheating the system will get you banned.
    .timerset 1 3 msg $chan 1,8Ready?
    .timergo 1 4 msg $chan 1,8Go!
     set %wartortle $nick
  }
}