1

I'm a person with zero programming skill, thus everything related to programming seems like the hardest thing.

I wanted to auto copy paste between different channels on different network using mIRC, if it matches predefined word. For example:

My predefined word is: hello

If someone in #channelA (on network1) or #channelB (on network2) or #channelC (on network3) says hello, it will appear on #channel4 (on network4) as: said "hello" without channel's name or anything and no duplicate from rest of the networks(if said hello there as well) will appear on network 4's channel, i.e only first one will appear for each keyword.

I have tried searching for a solution and found this:

But it's not helpful to me. Any guidance would be appreciated.

Community
  • 1
  • 1
AXiON
  • 11
  • 2

2 Answers2

0

Usually we never built someone a script but asks him for what he done so far and then pointing him the failures or helping him a little bit.

But because the script you mentioned sounds nice, i took the liberty of implementing it myself.

If you not familiar with mSL i suggest you to only touch the following identifiers:
FromNetwork, FromChannel, ToNetwork and ToChannel

Code

;###
;### TextPublisher v1
;### Author: Orel Eraki
;### Email: orel.eraki@gmail.com
;###
;### Usage:
;### - Pretty simple, just edit the identifier settings.
;### - For enable/disable change "TextPublisherEnable" identifier to 1 or 0

;### Settings
alias -l TextPublisherEnable return 1
alias -l TextPublisherFormat return &timestamp < &+ &nick &+ > &1-
alias -l TextPublisherMatchText return *text*
alias -l TextPublisherFromNetwork return Network1
alias -l TextPublisherFromChannel return #Channel1
alias -l TextPublisherToNetwork return Network2
alias -l TextPublisherToChannel return #Channel2

;### Functions
alias -l FindNetworkCid {
  if ($1) {
    var %i = 1, %n = $scon(0), %temp
    while (%i <= %n) {
      if ($scon(%i).status == connected && $scon(%i).network == $1) {
        return $scon(%i).cid
      }
      inc %i
    }
  }
  return
}

;### Events
on *:text:$($TextPublisherMatchText):$($TextPublisherFromChannel): {
  if ($TextPublisherEnable && $network == $TextPublisherFromNetwork) {
    var %networkId = $FindNetworkCid($TextPublisherToNetwork)
    if (%networkId) {
      scid -t1 %networkId if ($TextPublisherToChannel ischan) { msg $TextPublisherToChannel $eval($replace($TextPublisherFormat, &, $chr(36)), 2) }
    }
  }
}
Orel Eraki
  • 11,940
  • 3
  • 28
  • 36
  • As you suggested I added the codes in Remote section of the mIRC, but doesn't seems o be working on mIRC v7.32, I tried following: `alias -l TextPublisherEnable return 1 alias -l TextPublisherFormat return &timestamp < &+ &nick &+ > &1- alias -l TextPublisherMatchText return *test.text* alias -l TextPublisherFromNetwork return ABCD alias -l TextPublisherFromChannel return #EFGH alias -l TextPublisherToNetwork return IJKLM alias -l TextPublisherToChannel return #NOPQR` and left others intact, haven't tested on previous version of mIRC – AXiON Aug 22 '13 at 18:43
  • The code is 100% work. could you elaborate what exactly isn't working ? – Orel Eraki Aug 22 '13 at 21:38
  • Here's what I did: 1. I copied all the codes and changed the: `TextPublisherMatchText return *reuired.text* TextPublisherFromNetwork return ABCDE TextPublisherFromChannel return #FGH TextPublisherToNetwork return IJKLM TextPublisherToChannel return #MNO` and kept rest of the codes intact and pasted in Remote section of the mIRC and restarted mIRC. In order to test I, posted `reuired.text` in `from Channel` but it didn't appeared in `To Channel`. Seems I'm doing something wrong or unable to undersatnd. – AXiON Aug 23 '13 at 19:48
  • i.e I edited only **Settings** section and added the names of the **from** and **to Network and Channels** and keyword only, and left other things intact, and pasted in **Remote** section of the mIRC. – AXiON Aug 23 '13 at 20:02
  • @AXiON, You should copy the whole code as is and put it at a clean new file at the Remote(ALT+R). Than you should **ONLY** Change the settings values and **NOT** anything else. (I see you removed "alias" and stuff). Do what i told you and it will work perfectly. – Orel Eraki Aug 23 '13 at 22:40
  • I'm adding screenshot sir, `http://i.imgur.com/88J1fyc.jpg` , as you can see sir I have only changed values in setting section only, i.e. **Network1, Channel1, Network2 and Channel2** and tested using the word **test**, but didn't worked for me on mIRC v7.32. – AXiON Aug 24 '13 at 17:07
  • Other scripts at your Remote working well ? If not please write at the mIRC editbox */remote on* – Orel Eraki Aug 24 '13 at 21:39
  • Also try change the OnText event to

    on *:text:$($TextPublisherMatchText):$($TextPublisherFromChannel): { echo -ag Passed1: Matched text and From Channel. if ($TextPublisherEnable && $network == $TextPublisherFromNetwork) { echo -ag Passed2: Checked if enable and From Network. var %networkId = $FindNetworkCid($TextPublisherToNetwork) echo -ag Passed3: Find network cid: %networkid if (%networkId) { scid -t1 %networkId if ($TextPublisherToChannel ischan) { msg $TextPublisherToChannel $eval($replace($TextPublisherFormat, &, $chr(36)), 2) } } } }
    – Orel Eraki Aug 24 '13 at 21:46
  • i know its your way of coding, but whats the reason in doing this %n = $scon(0), and then you use this $scon(%i).status... setting a variable just to use it in a while loop – Sirius_Black Jul 12 '14 at 06:44
0

This might help, Its taken from my Nick Mention and will work with any word you want. It comes up in the room you are in highlighted and also opens a new window and records what/who and time it was said. It may lead you in the direction you are looking for if it is not exactly what you are looking for..

;; Word mention ;;

on *:START: {
  window -De @WordMention
 echo @WordMention Your word mentioned and what was said goes here
}
on *:text:*:#:{
  if (# == $active) halt
  if  (%me isin $strip($1-)) || ($me isin $strip($1-)) {
     if (%mention. [ $+ [ $nick ] ] == $true) halt
     echo -a 2,4 # $nick said : $1-
     echo @WordMention  =======================================
     echo @WordMention  0,4 $+ $timestamp  $nick said your word at $asctime(h:nn:sstt) in # 
     echo @WordMention  $nick said: $1-
     echo @WordMention  =======================================
     set -u10 %mention. [ $+ [ $nick ] ] $true
   }
}

menu channel {
  .Word mention ( $+ %mynick $+ )
  ..Set My word $iif(%me == $null,(no word set),( $+ %me $+ )):/set %me $$?="Enter word eg =     word to watch for" | echo -a %me Set
   ..$iif(%myword == on,$style(2),$style(0)) On:/set %mynick on
  ..$iif(%myword == off,$style(2),$style(0)) Off:/set %mynick off
}
Xeon
  • 1
  • 1