mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
So basically I am trying to make it to where if the streamer leaves to go do something he or she types in !away and then when new viewers arrive if they type something in the chat it will notify them that the streamer is away. The current script works great, however I am not sure how to make it to where if they type in the chat it will notify them that the streamer is away. Also, if I type in !awayoff it doesn't stop the script all together. Last question. Is it possible to have 1 command activate multiple on texts? So for instance if I enter !hello it allows you to use the commands below and then is it possible to turn it off if you no longer want those commands to be in use anymore, but be able to enable them again if you need them? For example on *!text:#: !Hello {

on *!text:#:heelo
on *!text:#:bye

etc....

Code:

on *:TEXT:!away:#: {
  if ($nick isop #) {
    msg $chan Away mode activated, new users will be alerted that the streamer is away
  }
}
on !*:JOIN:#: {
  if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  set -u10 %floodjoin On
  set -u30 %floodjoin. $+ $nick 
  msg $chan $nick # is away, he or she will be back shortly $+ 
}
on *:TEXT:!awayoff:#: {
  if ($nick !isop #) {
    msg $chan The streamer is back! Enjoy the show. :) { return } 

  }
}


Last edited by powerade661; 06/02/15 05:32 AM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
You need a switch to do that. Faster to edit your code than explain ;P

Code:

on *:TEXT:!away:#: {
  if ($nick isop #) {
set %away.mode On    
msg $chan Away mode activated, new users will be alerted that the streamer is away
  }
}
on !*:JOIN:#: {
  if (!%away.mode) return
  if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  set -u10 %floodjoin On
  set -u30 %floodjoin. $+ $nick 
  msg $chan $nick $remove(#,$chr(35)) is away, he or she will be back shortly  
}
on *:TEXT:!awayoff:#: {
  if ($nick isop #) {
unset %away.mode    
msg $chan The streamer is back! Enjoy the show. :) 

  }
}


Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok that works, thanks so much! Another question, is there anyway to have one command enable multiple commands? So for instance !speak activates

on*text:hello:#:
msg $chan hello how are you?

etc...

But when I need to disable it say for instance a command !stop speak it stops but if I type speak it reactivates the commands again

Last edited by powerade661; 06/02/15 12:51 PM.
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Sure, you just need to understand the principles used in the code and you can do whatever you want. Where's the confusion? :]

If you want the same command for on/off it could be something like
Code:
on *:TEXT:!away:#: {
  if ($nick !isop #) return
  if (%away.mode == On) {
  unset %away.mode
  msg # Streamer is no longer away
}
  elseif (!%away.mode) {
  set %away.mode On
  msg # Streamer is away

  }  
}

Last edited by Sakana; 06/02/15 04:54 PM.
Joined: Nov 2014
Posts: 79
N
Babel fish
Offline
Babel fish
N
Joined: Nov 2014
Posts: 79
To make several texts use one command you can do two things. Make an alias that will be used throughout.

EX.

Code:
alias Greetings {
if ((%floodgreetings) || ($($+(%,floodgreetings.,$nick),2))) { return } 
set -u10 %floodgreetings On
set -u30 %floodgreetings. $+ $nick 
msg # Hello, how are you?
}

on *:TEXT:Hello:#: {
Greetings
}

on *:TEXT:Hi:#: {
Greetings
}

..etc.


You can also use regex, although I've personally have had problems, where the message would pop up even though they haven't said the word

Again the example:

Code:
on $*:TEXT:/(hi/hello)$/i:#: {
msg # Hello, how are you?
}

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Ok thank you so much for your help guys. smile

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
This script only tells them the streamer is away if they type in the chat, right? Only types that in that channel who typed !away?


Code:
on *:TEXT:!away:#: {
  if ($nick isop #) {
    set %away.mode On    
    msg $chan Away mode activated, new users will be alerted that the streamer is away
  }
}
on !*:JOIN:#: {
  if (!%away.mode) return
  if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  set -u10 %floodjoin On
  set -u30 %floodjoin. $+ $nick 
  msg $chan $nick $remove(#,$chr(35)) is away, he or she will be back shortly  
}
on *:TEXT:!awayoff:#: {
  if ($nick isop #) {
    unset %away.mode    
    msg $chan The streamer is back! Enjoy the show. :) 

  }
}


Last edited by powerade661; 07/02/15 06:20 PM.
Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
on !*:JOIN:#: {
msg $chan $nick $remove(#,$chr(35)) is away, he or she will be back shortly
}

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
But it only activates in that channel, right? Or would I need to specify the channel such as on !*:JOIN:#channelname: { Right now it says the message regardless if the streamer types in the chat or not. If they join it says the streamer is away. I want it to only activate if they type something in the chat.

Last edited by powerade661; 07/02/15 07:30 PM.

Link Copied to Clipboard