mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2021
Posts: 22
saner Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2021
Posts: 22
mad sick cool



Hello everyone, I have a problem with my new script, I always get an error!
The old script for msg channel copie is this!


I couldn't find anything here in the old thread unfortunately
OLD THREAD FOR COPY TEXT CHANNEL



Code
OLD_SCRIPT CODE COPY MSG CHANNEL

on *:TEXT:*:#irc-channel:{
  if $network == irc-server { scid -at1 relay $unsafe($chan $1-) }
}

alias -l relay {
  if $network == irc-server && $me ison #irc-channel {
    msg #irc-channel $2-
  }
}



Code
NEW SCRIPT COED COPY MSG CHANNEL BY TRIGGER WORD

on *:TEXT:*:#irc-channel:{
  if ($network == irc-server) {
     if (trigger-word,strip($1-),32) {
      .scid -at1 relay $nick $1-
     }
  }
 }

on *:TEXT:*:#irc-channel:{
   if ($network == irc-server) {
     if ($istok(trigger-word,strip($1-),32)) {
       .scid -at1 relay $nick $1-
     }
   }
 }




So the new script should only make the ANNOUNCED MESSAGE COPY from an irc network channel with a TRIGGER WORD
but only get error and so on displayed unfortunately




greets to all wink
mad sick cool

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Try starting with the code from this thread. And also, be sure to read the link about msl injection, to prevent shenanigans by people creating a message that would be evaluated in your timer. It looks like your code is relaying from/to the same channel, and then you modified it to remove the usage of $unsafe, when it was put there for a good reason

https://forums.mirc.com/ubbthreads....chat-from-1-server-to-another#Post263256

Joined: Jan 2012
Posts: 307
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 307
Try to use this script:
Code
alias -l copymsg_set {
  %network = EpicNet.Ru
  %triggers = saner,Hello,How are you,Bye,some words
}
on *:TEXT:*:#test:{
  copymsg_set | if ($network == %network) {
    if ($wfind($strip($1-))) { .scid -at1 copymsg $unsafe($nick $1-) }
  }
}
alias -l wfind { var %i 1 | while (%i <= $numtok(%triggers,44)) { if ($gettok(%triggers,%i,44) isin $1-) return 1 | inc %i } }
alias -l copymsg { msg #test2 $1 $2- }


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Mar 2021
Posts: 22
saner Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2021
Posts: 22
Thanks Epic it works but need a modification please !!
the nickname and the trigger word will be posted!
can you do that in the post without a nickname and trigger word?

Joined: Jan 2012
Posts: 307
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 307
Originally Posted by saner
the nickname and the trigger word will be posted!
can you do that in the post without a nickname and trigger word?

Ok. Try to use this script modification:
Code
on *:TEXT:*:#test:{
  if ($network == EpicNet.Ru) {
    %triggers = saner,Hello,How are you,Bye,some words
    if ($wfind($strip($1-))) { .scid -at1 copymsg $unsafe($rtrig($strip($1-))) }
  }
}
alias -l wfind { var %i 1 | while (%i <= $numtok(%triggers,44)) { if ($gettok(%triggers,%i,44) isin $1-) return 1 | inc %i } }
alias -l rtrig { var %i 1, %str $1- | while (%i <= $numtok(%triggers,44)) { var %str $remove(%str,$gettok(%triggers,%i,44)) | inc %i } | if ($len(%str)) return %str | else return $1- }
alias -l copymsg { msg #test2 $1- }


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Mar 2021
Posts: 22
saner Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2021
Posts: 22
Thank you Epic
goes 1a as always with things from you ;-)

Thanks very much
smirk laugh

Joined: Mar 2021
Posts: 22
saner Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2021
Posts: 22
But I still have something with the script. Can you also set a new word instead of the trigger word when posting???

Joined: Jan 2012
Posts: 307
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 307
Originally Posted by saner
But I still have something with the script. Can you also set a new word instead of the trigger word when posting???
As far as I understand, this is a similar issue that was discussed in personal correspondence. I will also post the answer here.


To set the first word before the copied message text change this line:
Code
alias -l copymsg { msg #test2 $1- }

To another line:
Code
alias -l copymsg { msg #test2 Your_Word $1- }


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Mar 2021
Posts: 22
saner Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2021
Posts: 22
Very nice

big thanks Epic


smirk


Link Copied to Clipboard